@privy-io/react-auth 1.87.0 → 1.88.0-beta-20240926133016
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/cjs/index.js +38 -38
- package/dist/cjs/useWallets.js +1 -1
- package/dist/dts/index.d.mts +5 -5
- package/dist/dts/index.d.ts +5 -5
- package/dist/dts/types.d.mts +2 -2
- package/dist/dts/types.d.ts +2 -2
- package/dist/esm/index.mjs +60 -60
- package/dist/esm/useWallets.mjs +1 -1
- package/package.json +3 -3
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddress as n}from"@ethersproject/address";import{Web3Provider as i}from"@ethersproject/providers";import{createStore as a}from"mipd";import o,{useRef as l,useState as s,useMemo as d,useContext as h,createContext as p,useEffect as m,useCallback as f,useReducer as y,forwardRef as w}from"react";import*as v from"react-device-detect";import{isMobile as C,isIOS as b,isSafari as E,isAndroid as $}from"react-device-detect";import{P as x,f as k,a as A,b as T,c as _,d as S,e as N,g as I,n as P,u as O,h as R,i as M,j as L,k as D,I as F}from"./internal-context.mjs";import*as U from"jose";import{base64url as W}from"jose";import{g as B,C as G,H,O as z,S as j,D as q,a as V,b as K,c as Y,d as Z,V as X,T as Q,R as J,F as ee,e as te,f as re,h as ne,i as ie,j as ae,I as oe,k as le,l as se,m as de,n as ce,u as ue,o as he,p as pe,q as me,W as fe,r as ge,s as ye,t as we,v as ve,w as Ce,x as be,y as Ee,z as $e,A as xe,B as ke,E as Ae,G as Te,M as _e,J as Se,K as Ne,L as Ie,P as Pe,N as Oe,Q as Re,U as Me,X as Le,Y as De,Z as Fe,_ as Ue,$ as We,a0 as Be}from"./useWallets.mjs";export{a1 as SUPPORTED_CHAINS}from"./useWallets.mjs";import{t as Ge,r as He,i as ze,e as je,a as qe,g as Ve,b as Ke,c as Ye,f as Ze,d as Xe,B as Qe,s as Je,h as et,j as tt,k as rt,l as nt,p as it,u as at,A as ot,m as lt,n as st,M as dt,o as ct,q as ut,C as ht,v as pt,T as mt,w as ft,x as gt,y as yt,W as wt,z as vt,D as Ct,E as bt,F as Et,G as $t,L as xt,H as kt,I as At,J as Tt,K as _t,N as St,O as Nt,P as It,Q as Pt,R as Ot,S as Rt,U as Mt,V as Lt,X as Dt,Y as Ft,Z as Ut,_ as Wt,$ as Bt,a0 as Gt,a1 as Ht,a2 as zt}from"./useFundWallet.mjs";export{a4 as useConnectWallet,a5 as useFundWallet,a3 as useLogin}from"./useFundWallet.mjs";import{v4 as jt}from"uuid";import{isHexString as qt}from"@ethersproject/bytes";import Vt from"eventemitter3";import{CoinbaseWalletSDK as Kt}from"@coinbase/wallet-sdk";import{l as Yt,f as Zt,W as Xt,a as Qt,U as Jt,i as er,C as tr,P as rr,b as nr,E as ir,c as ar}from"./useSolanaWallets.mjs";export{u as useSolanaWallets}from"./useSolanaWallets.mjs";import{EthereumProvider as or,OPTIONAL_EVENTS as lr,OPTIONAL_METHODS as sr}from"@walletconnect/ethereum-provider";import{u as dr,M as cr,a as ur,e as hr,b as pr}from"./getEmbeddedConnectedWallet.mjs";export{c as addRpcUrlOverrideToChain,g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet.mjs";import{ofetch as mr}from"ofetch";import fr from"js-cookie";import{Turnstile as gr}from"@marsidev/react-turnstile";import{styled as yr,css as wr,keyframes as vr,createGlobalStyle as Cr}from"styled-components";import br from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Er from"@heroicons/react/24/outline/ArrowLeftIcon";import $r from"@heroicons/react/24/outline/ArrowRightIcon";import xr from"@heroicons/react/24/outline/XMarkIcon";import kr from"@heroicons/react/24/outline/ExclamationTriangleIcon";import Ar from"@heroicons/react/24/outline/WalletIcon";import{ExclamationCircleIcon as Tr,Square2StackIcon as _r,WalletIcon as Sr,ExclamationTriangleIcon as Nr,ChevronDownIcon as Ir}from"@heroicons/react/24/outline";import Pr from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Or from"@heroicons/react/24/solid/DocumentCheckIcon";import Rr from"@heroicons/react/20/solid/CheckIcon";import Mr from"@heroicons/react/24/outline/EnvelopeIcon";import Lr from"@heroicons/react/24/outline/PhoneIcon";import Dr from"@heroicons/react/24/solid/CheckCircleIcon";import Fr from"@heroicons/react/24/solid/XCircleIcon";import Ur from"fast-password-entropy";import*as Wr from"secure-password-utilities";import{DEFAULT_WORDLIST as Br}from"secure-password-utilities/wordlists";import Gr from"@heroicons/react/24/outline/ArrowPathIcon";import Hr from"@heroicons/react/24/outline/EyeIcon";import zr from"@heroicons/react/24/outline/EyeSlashIcon";import jr from"@heroicons/react/24/outline/KeyIcon";import qr from"@heroicons/react/24/outline/ArrowDownTrayIcon";import Vr from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import Kr from"@heroicons/react/24/outline/DocumentDuplicateIcon";import Yr from"@heroicons/react/24/outline/UserCircleIcon";import Zr from"@heroicons/react/24/solid/LockClosedIcon";import Xr from"qrcode";import Qr from"@heroicons/react/24/outline/CheckCircleIcon";import{createPublicClient as Jr,http as en,parseEther as tn,createWalletClient as rn,custom as nn,publicActions as an,encodeFunctionData as on,decodeFunctionData as ln}from"viem";import sn from"@heroicons/react/24/outline/GlobeAltIcon";import{Menu as dn,Transition as cn,Dialog as un}from"@headlessui/react";import hn from"@heroicons/react/24/outline/ClockIcon";import pn from"@heroicons/react/24/outline/TrashIcon";import mn from"@heroicons/react/24/solid/CheckBadgeIcon";import fn from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import gn from"@heroicons/react/24/outline/PencilIcon";import{parseUnits as yn,formatUnits as wn}from"@ethersproject/units";import vn from"@heroicons/react/24/outline/InformationCircleIcon";import Cn from"@heroicons/react/24/outline/QrCodeIcon";import bn from"@heroicons/react/24/outline/LinkIcon";import En from"@heroicons/react/24/outline/ChevronRightIcon";import $n from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import xn from"@heroicons/react/24/solid/IdentificationIcon";import kn from"@heroicons/react/24/solid/PhoneIcon";import An from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import Tn from"@heroicons/react/24/solid/ShieldCheckIcon";import _n from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import Sn from"@heroicons/react/24/outline/FingerPrintIcon";import Nn from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import In from"@heroicons/react/24/outline/ShieldCheckIcon";import{VoidSigner as Pn}from"@ethersproject/abstract-signer";import{BigNumber as On}from"@ethersproject/bignumber";import{Contract as Rn}from"@ethersproject/contracts";import{serialize as Mn}from"@ethersproject/transactions";import Ln from"fetch-retry";import Dn from"@heroicons/react/24/outline/ChevronDownIcon";import Fn from"@heroicons/react/24/outline/CalendarIcon";import Un from"@heroicons/react/24/outline/LockClosedIcon";import Wn from"@heroicons/react/24/outline/PencilSquareIcon";import{isVersionedTransaction as Bn}from"@solana/wallet-adapter-base";import Gn from"@heroicons/react/24/outline/ClipboardDocumentIcon";import Hn from"@heroicons/react/24/outline/ExclamationCircleIcon";import{ErrorCode as zn}from"@ethersproject/logger";import{toUtf8String as jn}from"@ethersproject/strings";import"tinycolor2";import"@heroicons/react/24/outline/Square2StackIcon";let qn={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"}}},Vn={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0},Kn={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},Yn={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"}}},Zn={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0},Xn={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},Qn={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"}}},Jn={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0},ei={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},ti={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"}}},ri={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0},ni={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"}}},ii={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},ai={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},oi=e=>[qn.id,Vn.id,Kn.id].includes(e),li=e=>[56,97].includes(e),si="0x420000000000000000000000000000000000000F",di=["function getL1Fee(bytes memory _data) external view returns (uint256)"],ci=e=>[Yn.id,Zn.id,Xn.id,Qn.id,Jn.id,ei.id,ni.id,ai.id,ii.id,81457,168587773].includes(e);let ui={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},hi=Ln(fetch,{retries:3,retryDelay:500}),pi=e=>[ti.id,ri.id,ui.id].includes(e),mi=e=>({maxPriorityFee:yn(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:yn(e.maxFee.toFixed(9),"gwei").toHexString()}),fi=async e=>{let t="";switch(e){case ti.id:t="https://gasstation.polygon.technology/v2";break;case ri.id:t="https://gasstation-testnet.polygon.technology/v2";break;case ui.id:t="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}let r=await hi(t),n=await r.json();if(r.status>399)throw n;return{safeLow:mi(n.safeLow),standard:mi(n.standard),fast:mi(n.fast)}};async function gi(e,t){if(!e.gasLimit)throw new Yt("gasLimit was not successfully set for transaction.");let r=ze(e.gasLimit),n=On.from(0);if(2==e.type){if(!e.maxFeePerGas)throw new Yt("maxFeePerGas was not successfully set for transaction of type 2.");n=ze(e.maxFeePerGas)}else{if(!e.gasPrice)throw new Yt("gasPrice was not successfully set for transaction of type 0 or 1.");n=ze(e.gasPrice)}let i=r.mul(n),a=On.from(0);if(e.chainId&&ci(e.chainId))try{a=await async function(e,t){if(!e.chainId||e.chainId&&!ci(e.chainId))return On.from(0);let r=On.from(0);try{let n=new Rn(si,di,t),i=He(e),a=Mn(i);r=await n.getL1Fee(a)}catch(e){}return r}(e,t),i=i.add(a)}catch(e){}return{totalGasEstimate:i,l1ExecutionFeeEstimate:a}}function yi(e){return/^-?0x[a-f0-9]+$/i.test(e)}async function wi(e,t,r){if(t.chainId=Number(t.chainId),function(e){for(let t of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=e[t];if(void 0!==r&&!function(e){let t="number"==typeof e,r="bigint"==typeof e,n="string"==typeof e&&yi(e);return t||r||n}(r))throw Error(`Transaction request property '${t}' must be a valid number, bigint, or hex string representing a quantity`)}if("number"!=typeof e.chainId)throw Error("Transaction request property 'chainId' must be a number")}(t),t.from||(t.from=e),!t.nonce){let n=new Pn(e,r);t.nonce=await n.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await async function(e,t){try{return(await t.estimateGas(e)).toHexString()}catch(r){let n;if("message"in r&&r.message.includes("insufficient funds")&&(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'value'`),n=await async function({txRequest:e,provider:t}){try{let r={...e,value:void 0};return(await t.estimateGas(r)).toHexString()}catch(e){return console.warn(`Gas estimation failed with error: ${e} when omitting the 'value'`),null}}({txRequest:e,provider:t})),n||(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from'`),n=await async function({txRequest:e,provider:t}){try{let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}catch(e){return console.warn(`Gas estimation failed with error: ${e} when omitting the 'from' address`),null}}({txRequest:e,provider:t})),!n)throw r;return n}}(t,r)),"string"==typeof t.type&&yi(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),0===(t=pi(t.chainId)?await async function(e){if(!pi(e.chainId))throw Error("Invalid chain ID for Polygon gas estimation.");if(void 0===e.type&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{let{standard:t}=await fi(e.chainId);e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=t.maxPriorityFee),e.maxFeePerGas||(e.maxFeePerGas=t.maxFee),e.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete e.gasPrice)}catch(e){throw Error(`Failed to set gas prices from Polygon gas station with error: ${e}.`)}return e}(t):oi(t.chainId)?await(async(e,t)=>{if(!oi(e.chainId))throw Error("Invalid chain ID for Arbitrum gas estimation.");if(void 0===e.type&&(e.type=2),e.maxFeePerGas)return e;try{let{lastBaseFeePerGas:r}=await t.getFeeData();if(r){let t=r.mul(On.from(120)).div(On.from(100));e.maxFeePerGas=Ge(t),e.maxPriorityFeePerGas=Ge(On.from(0))}}catch(e){throw Error(`Failed to set gas price for Arbitrum transaction: ${e}.`)}return e})(t,r):ci(t.chainId)?await(async(e,t)=>{if(!ci(e.chainId))throw Error("Invalid chain ID for OP Stack gas estimation.");if(void 0===e.type&&(e.type=2),e.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete e.gasPrice),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{if(!e.maxPriorityFeePerGas){let r=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=r}if(e.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),e.maxPriorityFeePerGas>=e.maxFeePerGas))throw Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!e.maxFeePerGas){let{lastBaseFeePerGas:r}=await t.getFeeData();if(!r)throw Error("Unable to fetch baseFee for last block.");let n=On.from(r).mul(On.from(126)).div(On.from(100)).add(On.from(e.maxPriorityFeePerGas));e.maxFeePerGas=Ge(n)}}catch(e){throw Error(`Failed to set gas price for OP stack transaction: ${e}.`)}return e})(t,r):li(t.chainId)?await(async(e,t)=>{if(!li(e.chainId))throw Error("Invalid chain ID for BSC gas estimation.");if(void 0===e.type?e.type=0:1!=e.type&&2!=e.type||console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e})(t,r):await(async(e,t)=>{if(void 0===e.type&&(e.type=2),2===e.type){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let r=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=r.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=r.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e})(t,r)).type&&delete t.accessList,2!==t.type&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}var vi={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"470123456",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"90011234",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"32123456",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"67622901",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"12221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"},Ci={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0(4(?:[14]4|56)|[579])?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|63\\d{6}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0-79])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([3-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","9008\\d{3}|(?:[2-467]\\d\\d|510|862)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[25]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29[1289]|389)","529(?:1[1-46-9]|2[013-8]|90)|5(?:298|389)[0-46-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5293[01]\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|9[0-289])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[0189]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|2[0-2]|6[0-8]|8[0-3]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:[27]2|44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[047]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-5]))\\d{4}"],["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-27]|8[0-8]|9[0-479]))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[27]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-8]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[04]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["5056(?:[0-35-9]\\d|4[46])\\d{4}|(?:4722|505[2-57-9]|983[29])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[0-2]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","(?:0004|4)\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10,13],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","200\\d{6}|(?:33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|5[0-4]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[013-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function bi(e,t){var r=Array.prototype.slice.call(t);return r.push(Ci),e.apply(this,r)}function Ei(e){return(Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $i(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xi(e){var t="function"==typeof Map?new Map:void 0;return(xi=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ki(e,arguments,_i(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ti(r,e)})(e)}function ki(e,t,r){return(ki=Ai()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Ti(i,r.prototype),i}).apply(null,arguments)}function Ai(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Ti(e,t){return(Ti=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _i(e){return(_i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Si=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ti(e,t)}(n,xi(Error));var t,r=(t=Ai(),function(){var e=_i(n);return function(e,t){if(t&&("object"===Ei(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return $i(e)}(this,t?Reflect.construct(e,arguments,_i(this).constructor):e.apply(this,arguments))});function n(e){var t;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),Object.setPrototypeOf($i(t=r.call(this,e)),n.prototype),t.name=t.constructor.name,t}return Object.defineProperty(n,"prototype",{writable:!1}),n}(),Ni="0-90-9٠-٩۰-۹",Ii="".concat("-‐-―−ー-").concat("//").concat("..").concat(" ").concat("()()[]\\[\\]").concat("~⁓∼~");function Pi(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),i=0;i<3;i++){var a=Number(r[i]),o=Number(n[i]);if(a>o)return 1;if(o>a)return-1;if(!isNaN(a)&&isNaN(o))return 1;if(isNaN(a)&&!isNaN(o))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}function Oi(e){return(Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ri(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function Mi(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Li=" ext. ",Di=/^\d+$/,Fi=function(){function e(t){Ri(this,e),function(e){if(!e)throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!zi(e)||!zi(e.countries))throw Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(zi(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+ji(e)+": "+e,"."))}(t),this.metadata=t,Vi.call(this,t)}return Mi(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(e){return"001"!==e}))}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&Di.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw Error("Unknown country: ".concat(e));this.numberingPlan=new Ui(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw Error("Unknown calling code: ".concat(t));this.numberingPlan=new Ui(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var r=this.nonGeographic()[e];if(r)return r}else{var n=this.countryCallingCodes()[e];if(n&&1===n.length&&"001"===n[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),e}(),Ui=function(){function e(t,r){Ri(this,e),this.globalMetadataObject=r,this.metadata=t,Vi.call(this,r.metadata)}return Mi(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map((function(t){return new Wi(t,e)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return!(this.types()&&0===this.types().length||!this.types())}},{key:"type",value:function(e){if(this.hasTypes()&&Hi(this.types(),e))return new Gi(Hi(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?Li:this.metadata[13]||Li}}]),e}(),Wi=function(){function e(t,r){Ri(this,e),this._format=t,this.metadata=r}return Mi(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||Bi.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),e}(),Bi=/^\(?\$1\)?$/,Gi=function(){function e(t,r){Ri(this,e),this.type=t,this.metadata=r}return Mi(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),e}();function Hi(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}var zi=function(e){return"object"===Oi(e)},ji=function(e){return Oi(e)};function qi(e,t){if((t=new Fi(t)).hasCountry(e))return t.country(e).countryCallingCode();throw Error("Unknown country: ".concat(e))}function Vi(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===Pi(t,"1.2.0")?this.v2=!0:-1===Pi(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var Ki=function(e){return"([".concat(Ni,"]{1,").concat(e,"})")};function Yi(e){var t="[ \\t,]*",r="[:\\..]?[ \\t,-]*",n="[ \\t]*";return";ext="+Ki("20")+"|"+t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+r+Ki("20")+"#?|"+t+"(?:[xx##~~]|int|int)"+r+Ki("9")+"#?|[- ]+"+Ki("6")+"#|"+n+"(?:,{2}|;)"+r+Ki("15")+"#?|"+n+"(?:,)+"+r+Ki("9")+"#?"}var Zi=RegExp("^[++]{0,1}(?:["+Ii+"]*["+Ni+"]){1,2}$","i"),Xi="[++]{0,1}(?:["+Ii+"]*["+Ni+"]){3,}["+Ii+Ni+"]*(?:"+Yi()+")?",Qi=RegExp("^["+Ni+"]{2}$|^"+Xi+"$","i"),Ji=RegExp("(?:"+Yi()+")$","i");function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ta={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function ra(e){for(var t,r="",n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ea(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ea(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;){var i=ta[t.value];i&&(r+=i)}return r}function na(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ia(e){for(var t,r="",n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return na(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return na(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;)r+=function(e,t){if("+"===e){if(t)return;return"+"}return ta[e]}(t.value,r)||"";return r}function aa(e,t){return function(e,t,r){var n=r.type(t),i=n&&n.possibleLengths()||r.possibleLengths();if(!i)return"IS_POSSIBLE";var a=e.length,o=i[0];return o===a?"IS_POSSIBLE":o>a?"TOO_SHORT":i[i.length-1]<a?"TOO_LONG":i.indexOf(a,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(e,void 0,t)}function oa(e,t){return"IS_POSSIBLE"===aa(e,t)}function la(e,t){return e=e||"",RegExp("^(?:"+t+")$").test(e)}function sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var da=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function ca(e,t,r){if(t=t||{},e.country){(r=new Fi(r)).selectNumberingPlan(e.country,e.countryCallingCode);var n=t.v2?e.nationalNumber:e.phone;if(la(n,r.nationalNumberPattern())){if(ua(n,"FIXED_LINE",r))return r.type("MOBILE")&&""===r.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":r.type("MOBILE")?ua(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var i,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return sa(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sa(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(da);!(i=a()).done;){var o=i.value;if(ua(n,o,r))return o}}}}function ua(e,t,r){return!(!(t=r.type(t))||!t.pattern())&&!(t.possibleLengths()&&0>t.possibleLengths().indexOf(e.length))&&la(e,t.pattern())}function ha(e){return e.replace(RegExp("[".concat(Ii,"]+"),"g")," ").trim()}var pa=/(\$\d)/;function ma(e,t,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var a=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(pa,t.nationalPrefixFormattingRule()):t.format());return n?ha(a):a}var fa=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function ga(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ya(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ya(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ya(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var va={formatExtension:function(e,t,r){return"".concat(e).concat(r.ext()).concat(t)}};function Ca(e,t,r,n,i){var a=function(e,t){for(var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ga(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ga(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(r=n()).done;){var i=r.value;if(i.leadingDigitsPatterns().length>0){var a=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(0!==t.search(a))continue}if(la(t,i.pattern()))return i}}(n.formats(),e);return a?ma(e,a,{useInternationalFormat:"INTERNATIONAL"===r,withNationalPrefix:!a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix,carrierCode:t,metadata:n}):e}function ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ba(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $a=function(){var e;function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),!e)throw TypeError("`country` or `countryCallingCode` not passed");if(!r)throw TypeError("`nationalNumber` not passed");if(!n)throw TypeError("`metadata` not passed");var i,a,o,l=(o=new Fi(n),xa(e)?(i=e,o.selectNumberingPlan(i),a=o.countryCallingCode()):a=e,{country:i,countryCallingCode:a}),s=l.country,d=l.countryCallingCode;this.country=s,this.countryCallingCode=d,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return e=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){var e,t,r,n;return this.country?[this.country]:(e=this.countryCallingCode,t=this.nationalNumber,(n=new Fi(r=this.getMetadata()).getCountryCodesForCallingCode(e))?n.filter((function(e){var n;return(n=new Fi(r)).selectNumberingPlan(e),n.numberingPlan.possibleLengths().indexOf(t.length)>=0})):[])}},{key:"isPossible",value:function(){return function(e,t,r){if(void 0===t&&(t={}),r=new Fi(r),t.v2){if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return oa(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){var e,t;return e={v2:!0},t=this.getMetadata(),e=e||{},(t=new Fi(t)).selectNumberingPlan(this.country,this.countryCallingCode),t.hasTypes()?void 0!==ca(this,e,t.metadata):la(e.v2?this.nationalNumber:this.phone,t.nationalNumberPattern())}},{key:"isNonGeographic",value:function(){return new Fi(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return ca(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return function(e,t,r,n){if(r=r?wa(wa({},va),r):va,n=new Fi(n),e.country&&"001"!==e.country){if(!n.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));n.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";n.selectNumberingPlan(e.countryCallingCode)}var i,a,o,l,s,d,c,u,h,p,m,f,g,y=n.countryCallingCode(),w=r.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return w?(i=g=Ca(w,e.carrierCode,"NATIONAL",n,r),a=e.ext,o=n,l=r.formatExtension,a?l(i,a,o):i):"";case"INTERNATIONAL":return w?(g=Ca(w,null,"INTERNATIONAL",n,r),s=g="+".concat(y," ").concat(g),d=e.ext,c=n,u=r.formatExtension,d?u(s,d,c):s):"+".concat(y);case"E.164":return"+".concat(y).concat(w);case"RFC3966":return function(e){var t=e.number,r=e.ext;if(!t)return"";if("+"!==t[0])throw Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}({number:"+".concat(y).concat(w),ext:e.ext});case"IDD":if(!r.fromCountry)return;return h=function(e,t,r,n,i){if(qi(n,i.metadata)===r){var a,o=Ca(e,t,"NATIONAL",i);return"1"===r?r+" "+o:o}var l=(void 0,(a=new Fi(i.metadata)).selectNumberingPlan(n,undefined),a.defaultIDDPrefix()?a.defaultIDDPrefix():fa.test(a.IDDPrefix())?a.IDDPrefix():void 0);if(l)return"".concat(l," ").concat(r," ").concat(Ca(e,null,"INTERNATIONAL",i))}(w,e.carrierCode,y,r.fromCountry,n),p=e.ext,m=n,f=r.formatExtension,p?f(h,p,m):h;default:throw Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}(this,e,t?Ea(Ea({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),xa=function(e){return/^[A-Z]{2}$/.test(e)},ka=RegExp("(["+Ni+"])");function Aa(e,t,r,n){if(t){var i=new Fi(n);i.selectNumberingPlan(t,r);var a=new RegExp(i.IDDPrefix());if(0===e.search(a)){var o=(e=e.slice(e.match(a)[0].length)).match(ka);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return e}}}function Ta(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var i,a,o,l=n.length-1,s=l>0&&n[l];if(t.nationalPrefixTransformRule()&&s)i=e.replace(r,t.nationalPrefixTransformRule()),l>1&&(a=n[1]);else{var d=n[0];i=e.slice(d.length),s&&(a=n[1])}if(s){var c=e.indexOf(n[1]);e.slice(0,c)===t.numberingPlan.nationalPrefix()&&(o=t.numberingPlan.nationalPrefix())}else o=n[0];return{nationalNumber:i,nationalPrefix:o,carrierCode:a}}}return{nationalNumber:e}}function _a(e,t){var r=Ta(e,t),n=r.carrierCode,i=r.nationalNumber;return i!==e&&(la(e,t.nationalNumberPattern())&&!la(i,t.nationalNumberPattern())||t.possibleLengths()&&!function(e,t){switch(aa(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(i,t))?{nationalNumber:e}:{nationalNumber:i,carrierCode:n}}function Sa(e,t,r,n){var i=t?qi(t,n):r;if(0===e.indexOf(i)){(n=new Fi(n)).selectNumberingPlan(t,r);var a=e.slice(i.length),o=_a(a,n).nationalNumber,l=_a(e,n).nationalNumber;if(!la(l,n.nationalNumberPattern())&&la(o,n.nationalNumberPattern())||"TOO_LONG"===aa(l,n))return{countryCallingCode:i,number:a}}return{number:e}}function Na(e,t,r,n){if(!e)return{};if("+"!==e[0]){var i,a=Aa(e,t,r,n);if(!a||a===e){if(t||r){var o=Sa(e,t,r,n),l=o.countryCallingCode,s=o.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:s}}return{number:e}}i=!0,e="+"+a}if("0"===e[1])return{};n=new Fi(n);for(var d=2;d-1<=3&&d<=e.length;){var c=e.slice(1,d);if(n.hasCallingCode(c))return n.selectNumberingPlan(c),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:e.slice(d)};d++}return{}}function Ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Pa(e,t){var r=t.countries,n=t.defaultCountry,i=t.metadata;i=new Fi(i);for(var a,o=[],l=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ia(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ia(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(a=l()).done;){var s=a.value;if(i.country(s),i.leadingDigits()){if(e&&0===e.search(i.leadingDigits()))return s}else if(ca({phone:e,country:s},void 0,i.metadata)){if(!n||s===n)return s;o.push(s)}}if(o.length>0)return o[0]}function Oa(e,t){var r=t.nationalNumber,n=t.defaultCountry,i=t.metadata,a=i.getCountryCodesForCallingCode(e);return a?1===a.length?a[0]:Pa(r,{countries:a,defaultCountry:n,metadata:i.metadata}):void 0}var Ra="(["+Ni+"]|[\\-\\.\\(\\)]?)",Ma=RegExp("^\\+"+Ra+"*["+Ni+"]"+Ra+"*$","g"),La=RegExp("^(["+Ni+"]+((\\-)*["+Ni+"])*\\.)*[a-zA-Z]+((\\-)*["+Ni+"])*\\.?$","g"),Da="tel:",Fa=";phone-context=",Ua=RegExp("[++"+Ni+"]"),Wa=RegExp("[^"+Ni+"#]+$");function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ga(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ha(e){return(Ha="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function za(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ja(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function qa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Va(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qa(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ya(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ka(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ka(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Za(){var e=function(e){var t,r,n,i=function(e){if(Array.isArray(e))return e}(t=Array.prototype.slice.call(e))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),4!==a.length);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw i}}return a}}(t)||function(e,t){if(e){if("string"==typeof e)return ja(e,4);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ja(e,4)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],o=i[1],l=i[2],s=i[3];if("string"!=typeof a)throw TypeError("A text for parsing must be a string.");if(o&&"string"!=typeof o){if("object"!==Ha(o))throw Error("Invalid second argument: ".concat(o));l?(r=o,n=l):n=o}else s?(r=l,n=s):(r=void 0,n=l),o&&(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?za(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):za(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({defaultCountry:o},r));return{text:a,options:r,metadata:n}}(arguments),t=e.text,r=e.options,n=e.metadata,i=function(e,t,r){var n;t&&t.defaultCountry&&(n=t.defaultCountry,!r.countries.hasOwnProperty(n))&&(t=Va(Va({},t),{},{defaultCountry:void 0}));try{return function(e,t,r){if(t=t||{},r=new Fi(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry)){if(t.v2)throw new Si("INVALID_COUNTRY");throw Error("Unknown country: ".concat(t.defaultCountry))}var n,i=function(e,t,r){var n=function(e,t){var r,n=t.extractFormattedPhoneNumber,i=function(e){var t=e.indexOf(Fa);if(t<0)return null;var r=t+15;if(r>=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}(e);if(null!==i&&(0===i.length||!Ma.test(i)&&!La.test(i)))throw new Si("NOT_A_NUMBER");if(null===i)r=n(e)||"";else{r="","+"===i.charAt(0)&&(r+=i);var a,o=e.indexOf(Da);a=o>=0?o+4:0;var l=e.indexOf(Fa);r+=e.substring(a,l)}var s=r.indexOf(";isub=");if(s>0&&(r=r.substring(0,s)),""!==r)return r}(e,{extractFormattedPhoneNumber:function(e){return function(e,t,r){if(e){if(e.length>250){if(r)throw new Si("TOO_LONG");return}if(!1===t)return e;var n=e.search(Ua);if(!(n<0))return e.slice(n).replace(Wa,"")}}(e,r,t)}});if(!n)return{};if(!(n.length>=2&&Qi.test(n)))return Zi.test(n)?{error:"TOO_SHORT"}:{};var i=function(e){var t=e.search(Ji);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(Ji),i=1;i<n.length;){if(n[i])return{number:r,ext:n[i]};i++}}(n);return i.ext?i:{number:n}}(e,t.v2,t.extract),a=i.number,o=i.ext,l=i.error;if(!a){if(t.v2){if("TOO_SHORT"===l)throw new Si("TOO_SHORT");throw new Si("NOT_A_NUMBER")}return{}}var s=function(e,t,r,n){var i,a=Na(ia(e),t,r,n.metadata),o=a.countryCallingCodeSource,l=a.countryCallingCode,s=a.number;if(l)n.selectNumberingPlan(l);else{if(!s||!t&&!r)return{};n.selectNumberingPlan(t,r),t&&(i=t),l=r||qi(t,n.metadata)}if(!s)return{countryCallingCodeSource:o,countryCallingCode:l};var d=_a(ia(s),n),c=d.nationalNumber,u=d.carrierCode,h=Oa(l,{nationalNumber:c,defaultCountry:t,metadata:n});return h&&(i=h,"001"===h||n.country(i)),{country:i,countryCallingCode:l,countryCallingCodeSource:o,nationalNumber:c,carrierCode:u}}(a,t.defaultCountry,t.defaultCallingCode,r),d=s.country,c=s.nationalNumber,u=s.countryCallingCode,h=s.countryCallingCodeSource,p=s.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new Si("INVALID_COUNTRY");return{}}if(!c||c.length<2){if(t.v2)throw new Si("TOO_SHORT");return{}}if(c.length>17){if(t.v2)throw new Si("TOO_LONG");return{}}if(t.v2){var m=new $a(u,c,r.metadata);return d&&(m.country=d),p&&(m.carrierCode=p),o&&(m.ext=o),m.__countryCallingCodeSource=h,m}var f=!!(t.extended?r.hasSelectedNumberingPlan():d)&&la(c,r.nationalNumberPattern());return t.extended?{country:d,countryCallingCode:u,carrierCode:p,valid:f,possible:!!f||!(!0!==t.extended||!r.possibleLengths()||!oa(c,r)),phone:c,ext:o}:f?(n={country:d,phone:c},o&&(n.ext=o),n):{}}(e,Ga(Ga({},t),{},{v2:!0}),r)}catch(e){if(!(e instanceof Si))throw e}}(t,r=Ya(Ya({},r),{},{extract:!1}),n);return i&&i.isPossible()||!1}var Xa=function(){var e;function t(e){var r=e.onCountryChange,n=e.onCallingCodeChange;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.onCountryChange=r,this.onCallingCodeChange=n}return e=[{key:"reset",value:function(e){var t=e.country,r=e.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,r)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"update",value:function(e){for(var t=0,r=Object.keys(e);t<r.length;t++){var n=r[t];this[n]=e[n]}}},{key:"initCountryAndCallingCode",value:function(e,t){this.setCountry(e),this.setCallingCode(t)}},{key:"setCountry",value:function(e){this.country=e,this.onCountryChange(e)}},{key:"setCallingCode",value:function(e){this.callingCode=e,this.onCallingCodeChange(e,this.country)}},{key:"startInternationalNumber",value:function(e,t){this.international=!0,this.initCountryAndCallingCode(e,t)}},{key:"appendDigits",value:function(e){this.digits+=e}},{key:"appendNationalSignificantNumberDigits",value:function(e){this.nationalSignificantNumber+=e}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function Qa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ja=/x/;function eo(e,t){if(t<1)return"";for(var r="";t>1;)1&t&&(r+=e),t>>=1,e+=e;return r+e}function to(e,t){return")"===e[t]&&t++,function(e){for(var t=[],r=0;r<e.length;)"("===e[r]?t.push(r):")"===e[r]&&t.pop(),r++;var n=0,i="";t.push(e.length);for(var a=0;a<t.length;a++){var o=t[a];i+=e.slice(n,o),n=o+1}return i}(e.slice(0,t))}function ro(e,t,r){var n=r.metadata,i=r.useNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix,o=ma(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:i,metadata:n});if(i||(e.nationalPrefix?o=e.nationalPrefix+a(t)+o:e.complexPrefixBeforeNationalSignificantNumber&&(o=e.complexPrefixBeforeNationalSignificantNumber+" "+o)),ra(o)===e.getNationalDigits())return o}var no=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t)}return e=[{key:"parse",value:function(e){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(e),1!==this.context.length)throw Error("Non-finalized contexts left when pattern parse ended");var t=this.context[0],r=t.branches,n=t.instructions;if(r)return{op:"|",args:r.concat([oo(n)])};if(0===n.length)throw Error("Pattern is required");return 1===n.length?n[0]:n}},{key:"startContext",value:function(e){this.context.push(e)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(e){if(!e)throw Error("Pattern is required");var t=e.match(ao);if(t){var r=t[1],n=e.slice(0,t.index),i=e.slice(t.index+r.length);switch(r){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw Error('No instructions found after "|" operator in an "or" group');var a=this.getContext().branches;a.push(oo(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:a});break;case"|":if(!this.getContext().or)throw Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(oo(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:function(e){for(var t=[],r=0;r<e.length;){if("-"===e[r]){if(0===r||r===e.length-1)throw Error("Couldn't parse a one-of set pattern: ".concat(e));for(var n=e[r-1].charCodeAt(0)+1,i=e[r+1].charCodeAt(0)-1,a=n;a<=i;)t.push(String.fromCharCode(a)),a++}else t.push(e[r]);r++}return t}(n)});break;default:throw Error("Unknown operator: ".concat(r))}i&&this.parsePattern(i)}else{if(io.test(e))throw Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""))}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),io=/[\(\)\[\]\?\:\|]/,ao=RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function oo(e){return 1===e.length?e[0]:e}function lo(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return so(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return so(e,void 0)}}(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function so(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var co=function(){var e;function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.matchTree=(new no).parse(e)}return e=[{key:"match",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!e)throw Error("String is required");var r=function e(t,r,n){if("string"==typeof r){var i=t.join("");return 0===r.indexOf(i)?t.length===r.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===i.indexOf(r)?n&&t.length>r.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,r.length)}:void 0}if(Array.isArray(r)){for(var a=t.slice(),o=0;o<r.length;){var l=e(a,r[o],n&&o===r.length-1);if(!l)return;if(l.overflow)return l;if(!l.match){if(l.partialMatch)return{partialMatch:!0};throw Error("Unsupported match result:\n".concat(JSON.stringify(l,null,2)))}if(0===(a=a.slice(l.matchedChars.length)).length)return o===r.length-1?{match:!0,matchedChars:t}:{partialMatch:!0};o++}return n?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-a.length)}}switch(r.op){case"|":for(var s,d,c=lo(r.args);!(d=c()).done;){var u=e(t,d.value,n);if(u){if(u.overflow)return u;if(u.match)return{match:!0,matchedChars:u.matchedChars};if(!u.partialMatch)throw Error("Unsupported match result:\n".concat(JSON.stringify(u,null,2)));s=!0}}return s?{partialMatch:!0}:void 0;case"[]":for(var h,p=lo(r.args);!(h=p()).done;){var m=h.value;if(t[0]===m)return 1===t.length?{match:!0,matchedChars:t}:n?{overflow:!0}:{match:!0,matchedChars:[m]}}return;default:throw Error("Unsupported instruction tree: ".concat(r))}}(e.split(""),this.matchTree,!0);if(r&&r.match&&delete r.matchedChars,!r||!r.overflow||t)return r}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function uo(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ho(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ho(e,void 0)}}(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ho(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var po=eo("9",15),mo=/[- ]/,fo=RegExp("["+Ii+"]*\\$1["+Ii+"]*(\\$\\d["+Ii+"]*)*$"),go=function(){var e;function t(e){e.state;var r=e.metadata;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.metadata=r,this.resetFormat()}return e=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(e,t){this.resetFormat(),e?(this.isNANP="1"===e.callingCode(),this.matchingFormats=e.formats(),t.nationalSignificantNumber&&this.narrowDownMatchingFormats(t)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(e,t){var r=this;if("IS_POSSIBLE"===aa(t.nationalSignificantNumber,this.metadata))for(var n,i=uo(this.matchingFormats);!(n=i()).done;){var a=n.value,o=function(e,t,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return function(e,t,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix;if(e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode,i(t)){var o=ro(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:a,metadata:n});if(o)return o}return ro(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:a,metadata:n})}(e,t,{metadata:n,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:a})}(t,a,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(e){return r.shouldTryNationalPrefixFormattingRule(e,{international:t.international,nationalPrefix:t.nationalPrefix})},getSeparatorAfterNationalPrefix:function(e){return r.getSeparatorAfterNationalPrefix(e)}});if(o)return this.resetFormat(),this.chosenFormat=a,this.setNationalNumberTemplate(o.replace(/\d/g,"x"),t),this.populatedNationalNumberTemplate=o,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf("x"),o}return this.formatNationalNumberWithNextDigits(e,t)}},{key:"formatNationalNumberWithNextDigits",value:function(e,t){var r=this.chosenFormat,n=this.chooseFormat(t);if(n)return n===r?this.formatNextNationalNumberDigits(e):this.formatNextNationalNumberDigits(t.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(e){var t=this,r=e.nationalSignificantNumber,n=e.nationalPrefix,i=e.international,a=r.length-3;a<0&&(a=0),this.matchingFormats=this.matchingFormats.filter((function(e){return t.formatSuits(e,i,n)&&t.formatMatches(e,r,a)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(e,t,r){return!(r&&!e.usesNationalPrefix()&&!e.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!t&&!r&&e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(e,t,r){var n=e.leadingDigitsPatterns().length;if(0===n)return!0;r=Math.min(r,n-1);var i=e.leadingDigitsPatterns()[r];if(t.length<3)try{return void 0!==new co(i).match(t,{allowOverflow:!0})}catch(e){return console.error(e),!0}return new RegExp("^(".concat(i,")")).test(t)}},{key:"getFormatFormat",value:function(e,t){return t?e.internationalFormat():e.format()}},{key:"chooseFormat",value:function(e){for(var t,r,n=uo(this.matchingFormats.slice());!(r=n()).done&&"break"!=(t=r.value,this.chosenFormat===t?"break":fo.test(this.getFormatFormat(t,e.international))?this.createTemplateForFormat(t,e)?(this.chosenFormat=t,"break"):(this.matchingFormats=this.matchingFormats.filter((function(e){return e!==t})),"continue"):"continue"););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(e,t){if(!(e.pattern().indexOf("|")>=0)){var r=this.getTemplateForFormat(e,t);return r?(this.setNationalNumberTemplate(r,t),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&mo.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var r=e.IDDPrefix,n=e.missingPlus;return r?t&&!1===t.spacing?r:r+" ":n?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,r=0,n=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";r<n.length+e.getDigitsWithoutInternationalPrefix().length;)t=this.template.indexOf("x",t+1),r++;return to(this.template,t+1)}}},{key:"setNationalNumberTemplate",value:function(e,t){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,t.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g,"x")+eo("x",t.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,t){var r=t.nationalSignificantNumber,n=t.international,i=t.nationalPrefix,a=t.complexPrefixBeforeNationalSignificantNumber,o=e.pattern();o=o.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");var l=po.match(o)[0];if(!(r.length>l.length)){var s=RegExp("^"+o+"$"),d=r.replace(/\d/g,"9");s.test(d)&&(l=d);var c,u=this.getFormatFormat(e,n);if(this.shouldTryNationalPrefixFormattingRule(e,{international:n,nationalPrefix:i})){var h=u.replace(pa,e.nationalPrefixFormattingRule());if(ra(e.nationalPrefixFormattingRule())===(i||"")+ra("$1")&&(u=h,c=!0,i))for(var p=i.length;p>0;)u=u.replace(/\d/,"x"),p--}var m=l.replace(new RegExp(o),u).replace(/9/g,"x");return c||(a?m=eo("x",a.length)+" "+m:i&&(m=eo("x",i.length)+this.getSeparatorAfterNationalPrefix(e)+m)),n&&(m=ha(m)),m}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,r){for(var n,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Qa(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qa(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.split(""));!(n=i()).done;){var a=n.value;if(0>e.slice(t+1).search(Ja))return;t=e.search(Ja),e=e.replace(Ja,a)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(t)return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],to(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var r=t.international,n=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var i=e.usesNationalPrefix();if(i&&n||!i&&!r)return!0}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function yo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wo(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var vo=RegExp("^["+Ii+Ni+"]+$","i"),Co="(?:[++]["+Ii+Ni+"]*|["+Ii+Ni+"]+)",bo=RegExp("[^"+Ii+Ni+"]+.*$"),Eo=/[^\d\[\]]/,$o=function(){var e;function t(e){var r=e.defaultCountry,n=e.defaultCallingCode,i=e.metadata,a=e.onNationalSignificantNumberChange;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=i,this.onNationalSignificantNumberChange=a}return e=[{key:"input",value:function(e,t){var r,n,i,a,o,l=(i=(n=yo("+"===(r=function(e){var t,r=e.search(Co);if(!(r<0))return"+"===(e=e.slice(r))[0]&&(t=!0,e=e.slice(1)),e=e.replace(bo,""),t&&(e="+"+e),e}(e)||"")[0]?[r.slice(1),!0]:[r],2))[0],a=n[1],vo.test(i)||(i=""),[i,a]),s=yo(l,2),d=s[0],c=s[1],u=ra(d);return c&&(t.digits||(t.startInternationalNumber(),u||(o=!0))),u&&this.inputDigits(u,t),{digits:u,justLeadingPlus:o}}},{key:"inputDigits",value:function(e,t){var r=t.digits,n=r.length<3&&r.length+e.length>=3;if(t.appendDigits(e),n&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),(function(e){return t.update(e)}))}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,r=e.callingCode;return t&&!r}},{key:"extractCountryCallingCode",value:function(e){var t=Na("+"+e.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode,n=t.number;if(r)return e.setCallingCode(r),e.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&Eo.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var r=Ta(e,this.metadata),n=r.nationalPrefix,i=r.nationalNumber,a=r.carrierCode;if(i!==e)return this.onExtractedNationalNumber(n,a,i,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,r){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,r);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=Ta(e,this.metadata),i=n.nationalPrefix,a=n.nationalNumber,o=n.carrierCode;if(a!==t)return this.onExtractedNationalNumber(i,o,a,e,r),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,r,n,i){var a,o,l=n.lastIndexOf(r);if(l>=0&&l===n.length-r.length){o=!0;var s=n.slice(0,l);s!==e&&(a=s)}i({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:r,nationalSignificantNumberMatchesInput:o,complexPrefixBeforeNationalSignificantNumber:a}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,(function(t){return e.update(t)}))||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,r=e.IDDPrefix,n=e.digits;if(e.nationalSignificantNumber,!t&&!r){var i=Aa(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==i&&i!==n?(e.update({IDDPrefix:n.slice(0,n.length-i.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=Sa(e.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode;if(t.number,r)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:r}),!0}}},{key:"startInternationalNumber",value:function(e,t){var r=t.country,n=t.callingCode;e.startInternationalNumber(r,n),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),(function(t){return e.update(t)}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function xo(e){return(xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ko(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ao=function(){var e;function t(e,r){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.metadata=new Fi(r);var n,i=function(e){if(Array.isArray(e))return e}(n=this.getCountryAndCallingCode(e))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),2!==a.length);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw i}}return a}}(n)||function(e,t){if(e){if("string"==typeof e)return ko(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ko(e,2)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],o=i[1];this.defaultCountry=a,this.defaultCallingCode=o,this.reset()}return e=[{key:"getCountryAndCallingCode",value:function(e){var t,r;return e&&("object"===xo(e)?(t=e.defaultCountry,r=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),[t,r]}},{key:"input",value:function(e){var t,r=this.parser.input(e,this.state),n=r.digits;if(r.justLeadingPlus)this.formattedOutput="+";else if(n){if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(t=this.formatter.format(n,this.state)),void 0===t&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var i=this.state.getNationalDigits();i&&(t=this.formatter.format(i,this.state))}this.formattedOutput=t?this.getFullNumber(t):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var e=this;return this.state=new Xa({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,r){e.metadata.selectNumberingPlan(r,t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new go({state:this.state,metadata:this.metadata}),this.parser=new $o({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){return this.state.country}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(e){if(this.isInternational()){var t,r=this.state.callingCode;return t=r?e?"".concat(r," ").concat(e):r:"".concat(this.state.getDigitsWithoutInternationalPrefix()),this.formatter.getInternationalPrefixBeforeCountryCallingCode(this.state,{spacing:!!t})+t}return e}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.complexPrefixBeforeNationalSignificantNumber,n=e.nationalPrefix,i=t,a=r||n;return a&&(i=a+i),i}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(e?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,"x")}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(Oa(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,r=e.callingCode,n=e.country,i=e.nationalSignificantNumber;if(t)return this.isInternational()?r?"+"+r+i:"+"+t:n||r?"+"+(n?this.metadata.countryCallingCode():r)+i:void 0}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.carrierCode,n=e.callingCode,i=this._getCountry();if(t&&(i||n)){if(i&&i===this.defaultCountry){var a=new Fi(this.metadata.metadata);a.selectNumberingPlan(i);var o=a.numberingPlan.callingCode(),l=this.metadata.getCountryCodesForCallingCode(o);if(l.length>1){var s=Pa(t,{countries:l,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});s&&(i=s)}}var d=new $a(i||n,t,this.metadata.metadata);return r&&(d.carrierCode=r),d}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function To(e){return new Fi(e).getCountries()}function _o(e,t,r){if(t[e])return new $a(e,t[e],r)}function So(e){return Ao.call(this,e,Ci)}function No(){return bi(qi,arguments)}So.prototype=Object.create(Ao.prototype,{}),So.prototype.constructor=So;let Io=(e,t)=>function(){return bi(Za,arguments)}(String(e),t),Po=(e,t)=>`+${No(t)} ${e}`,Oo=e=>`*${e.replaceAll("-","").slice(-4)}`,Ro=function(){return bi(To,arguments)}().map((e=>({code:e,callCode:No(e)})));const Mo="/api/v1/sessions",Lo="/api/v1/sessions/logout",Do="/api/v1/sessions/fork/recover",Fo="/api/v1/oauth/init",Uo="/api/v1/oauth/authenticate",Wo="/api/v1/oauth/link",Bo="/api/v1/analytics_events";class Go{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/custom_jwt_account/authenticate",{token:this.meta.token});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw k(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}}class Ho{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let e=await this.api.post("/api/v1/passwordless/authenticate",{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw k(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless/link",{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw k(e)}}async sendCodeEmail(e,t){if(!this.api)throw new x("Auth flow has no API instance");if(e&&(this.meta.email=e),t&&(this.meta.captchaToken=t),!this.meta.email)throw new x("Email must be set when initialzing authentication.");try{return await this.api.post("/api/v1/passwordless/init",{email:this.meta.email,token:this.meta.captchaToken})}catch(e){throw k(e)}}constructor(e,t,r=!1){this.meta={email:e,captchaToken:t,disableSignup:r}}}class zo extends Ho{async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new x("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post("/api/v1/passwordless/update",{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw k(e)}}constructor(e,t,r){super(t,r),this.meta={email:t,captchaToken:r,oldAddress:e,disableSignup:!1}}}const jo=e=>{let t;try{t=new URL(e).hostname}catch(e){return}for(let[e,r]of Object.entries(qo))if(t.includes(r.hostname))return{walletClientType:e,entry:r}},qo={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function Vo(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}let Ko="WALLETCONNECT_DEEPLINK_CHOICE";function Yo(e){return e.startsWith("http://")||e.startsWith("https://")}function Zo(e,t){if(Yo(e))return Xo(e,t);let r=e;return r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(t)}`,href:r}}function Xo(e,t){if(!Yo(e))return Zo(e,t);let r=e;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(t)}`,href:r}}function Qo(e,t){window.open(e,t,"noreferrer noopener")}class Jo{execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}class el{get meta(){return this._meta}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.channelToken)throw new x("Auth flow must be initialized first");try{let e=await this.api.post("/api/v1/farcaster/authenticate",{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new x("No response from authentication");return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw k(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{return await this.api.post("/api/v1/farcaster/link",{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw k(e)}}async _startChannelOnce(){if(!this.api)throw new x("Auth flow has no API instance");let e=await this.api.post("/api/v1/farcaster/init",{token:this.captchaToken});C&&!b&&e.connect_uri&&Qo(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new x("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.channelToken)throw new x("Auth flow must be initialized first");let e=await this.api.get("/api/v1/farcaster/status",{headers:{"farcaster-channel-token":this.meta.channelToken}});return"completed"===e.state&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,t=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new Jo(this._startChannelOnce.bind(this)),this.pollForReady=new Jo(this._pollForReady.bind(this)),this._meta.disableSignup=t}}function tl(e){return crypto.getRandomValues(new Uint8Array(e))}class rl{getOrCreateGuestCredential(e){let t=B(e);if(je()){if(qe.get(t))return qe.get(t);{let e=W.encode(tl(32));return qe.put(t,e),e}}return W.encode(tl(32))}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/guest/authenticate",{guest_credential:this.meta.guestCredential});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw k(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}}function nl(){return W.encode(tl(36))}function il(){return nl()}async function al(e,t="S256"){if("S256"!=t)return e;{let t=await async function(e){let t=(new TextEncoder).encode(e);return new Uint8Array(await crypto.subtle.digest("SHA-256",t))}(e);return W.encode(t)}}function ol(){return!!qe.get(H)}class ll{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if("undefined"===this.meta.authorizationCode)throw new x("User denied confirmation during OAuth flow");let e=function(){let e=qe.get(G);if(!e)throw new x("Authentication error.");return e}();try{let t=await this.api.post(Uo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return qe.del(G),qe.del(H),qe.del(z),{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user,oauth_tokens:t.oauth_tokens}}catch(e){let t=k(e);if(t.privyErrorCode)throw new x(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new x("Invalid code during oauth flow.",void 0,A.OAUTH_USER_DENIED);throw new x("Invalid code during OAuth flow.",void 0,A.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if("undefined"===this.meta.authorizationCode)throw new x("User denied confirmation during OAuth flow");let e=qe.get(G);if(!e)throw new x("Authentication error.");try{let t=await this.api.post(Wo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return qe.del(G),t}catch(e){throw k(e)}}async getAuthorizationUrl(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.provider)throw new x("Provider must be set when initializing OAuth authentication.");let e=nl();qe.put(G,e);let t=il();qe.put(j,t);let r=await al(e);this.meta.headless&&qe.put(H,!0),this.meta.disableSignup&&qe.put(z,!0);try{return await this.api.post(Fo,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:t})}catch(e){throw k(e)}}constructor(e){let t="boolean"==typeof e.headless?e.headless:ol();this.meta={...e,headless:t}}}function sl(e){return e.charAt(0).toUpperCase()+e.slice(1)}const dl=({style:r,...n})=>e("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...r},...n,children:[t("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),t("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]}),cl=({style:r,...n})=>e("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...r},...n,children:[t("g",{clipPath:"url(#clip0)",children:t("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),t("defs",{children:t("clipPath",{id:"clip0",children:t("rect",{width:"71",height:"55",fill:"white"})})})]}),ul=({style:e,...r})=>t("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...r,children:t("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})}),hl=({style:e})=>t(sn,{style:{color:"var(--privy-color-error)",...e}}),pl=({style:r,...n})=>e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...r},...n,children:[t("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),t("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),t("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),t("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});function ml(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...r,children:[e("defs",{children:[e("linearGradient",{id:"b",children:[t("stop",{offset:"0",stopColor:"#3771c8"}),t("stop",{stopColor:"#3771c8",offset:".128"}),t("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),e("linearGradient",{id:"a",children:[t("stop",{offset:"0",stopColor:"#fd5"}),t("stop",{offset:".1",stopColor:"#fd5"}),t("stop",{offset:".5",stopColor:"#ff543e"}),t("stop",{offset:"1",stopColor:"#c837ab"})]}),t("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),t("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),t("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),t("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),t("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}function fl({style:e,...r}){return t("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...r,children:t("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:t("g",{transform:"scale(5.12,5.12)",children:t("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}function gl(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...r,children:[t("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),t("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}function yl(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...r,children:[t("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),t("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),t("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}const wl=({style:e,...r})=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...r,children:t("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});let vl={google:{name:"Google",component:pl},discord:{name:"Discord",component:cl},github:{name:"Github",component:ul},linkedin:{name:"LinkedIn",component:fl},twitter:{name:"Twitter",component:wl},spotify:{name:"Spotify",component:gl},instagram:{name:"Instagram",component:ml},tiktok:{name:"Tiktok",component:yl},apple:{name:"Apple",component:dl}};const Cl=e=>e in vl?vl[e]:{name:"Unknown",component:hl};function bl(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),n=e.get("privy_oauth_provider");if(!t||!r||!n)return{inProgress:!1};let i=!1;try{i=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:n,headless:ol(),popupFlow:null!==window.opener&&i,disableSignup:!!qe.get(z)}}function El(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),qe.del(j),window.history.replaceState({},"",e)}class $l{async initAuthenticationFlow(){if(!this.api)throw new x("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new x("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let e=await import("@simplewebauthn/browser");if(!this.api)throw new x("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new x("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let t=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options));this.meta.setPasskeyAuthState?.({status:"submitting-response"});let r=await this.api.post("/api/v1/passkeys/authenticate",{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(t)});return{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(e){if("NotAllowedError"===e.name)throw new x("Passkey request timed out or rejected by user.",void 0,A.PASSKEY_NOT_ALLOWED);throw k(e)}}async link(){let e=await import("@simplewebauthn/browser");if(!this.api)throw new x("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new x("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let t=this.meta.initLinkResponse.options,r=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(t));return await this.api.post("/api/v1/passkeys/link",{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(r)})}catch(e){if("NotAllowedError"===e.name)throw new x("Passkey request timed out or rejected by user.",void 0,A.PASSKEY_NOT_ALLOWED);throw k(e)}}async _initAuthenticateOnce(){if(!this.api)throw new x("Auth flow has no API instance");return await this.api.post("/api/v1/passkeys/authenticate/init",{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new x("Auth flow has no API instance");return await this.api.post("/api/v1/passkeys/link/init",{})}_transformInitLinkOptionsToCamelCase(e){return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map((e=>({type:e.type,alg:e.alg}))),timeout:e.timeout,excludeCredentials:e.exclude_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports}))),authenticatorSelection:{authenticatorAttachment:e.authenticator_selection?.authenticator_attachment,requireResidentKey:e.authenticator_selection?.require_resident_key,residentKey:e.authenticator_selection?.resident_key,userVerification:e.authenticator_selection?.user_verification},attestation:e.attestation,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props?.rk,hmacCreateSecret:e.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){return{challenge:e.challenge,allowCredentials:e.allow_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports})))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor(e,t){this.initAuthenticateOnce=new Jo(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Jo(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:t}}}const xl=({address:e,chainId:t,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account:\n${e}\n\nBy signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: ${t}\nNonce: ${r}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`;class kl{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new x("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign(),r=await this.client.authenticateWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user}}catch(e){throw k(e)}}async link(){if(!this.client)throw new x("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw k(e)}}async sign(){if(!this.client)throw new x("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new x("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new x("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new x("SiweFlow has no client instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=xl({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}constructor(e,t,r,n=!1){this._meta={disableSignup:!1},this.getNonceOnce=new Jo(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=t,this._meta.disableSignup=n}}class Al{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new x("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign(),r=await this.client.authenticateWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user}}catch(e){throw k(e)}}async link(){if(!this.client)throw new x("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw k(e)}}async sign(){if(!this.client)throw new x("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new x("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new x("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new x("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new x("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=(({address:e,nonce:t})=>`${window.location.host} wants you to sign in with your Solana account:\n${e}\n\nYou are proving you own ${e}.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: mainnet\nNonce: ${t}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`)({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,t,r,n=!1){this._meta={disableSignup:!1},this.getNonceOnce=new Jo(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=t,this._meta.disableSignup=n}}class Tl{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let e=await this.api.post("/api/v1/passwordless_sms/authenticate",{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw k(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless_sms/link",{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw k(e)}}async sendSmsCode(e,t){if(!this.api)throw new x("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),t&&(this.meta.captchaToken=t),!this.meta.phoneNumber)throw new x("phone nNumber must be set when initialzing authentication.");try{return await this.api.post("/api/v1/passwordless_sms/init",{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(e){throw k(e)}}constructor(e,t,r=!1){this.meta={phoneNumber:e,captchaToken:t,disableSignup:r}}}class _l extends Tl{async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new x("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post("/api/v1/passwordless_sms/update",{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw k(e)}}constructor(e,t,r){super(t,r),this.meta={phoneNumber:t,captchaToken:r,oldPhoneNumber:e,disableSignup:!1}}}class Sl{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/telegram/authenticate",{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw k(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{return await this.api.post("/api/v1/telegram/link",{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw k(e)}}constructor(e,t=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=t}}function Nl(e){let t={detail:"",retryable:!1};return e?.privyErrorCode===A.LINKED_TO_ANOTHER_USER&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode===A.DISALLOWED_LOGIN_METHOD&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode===A.INVALID_DATA&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===A.CANNOT_LINK_MORE_OF_TYPE&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===A.INVALID_CREDENTIALS&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===A.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===A.TOO_MANY_REQUESTS&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Il(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}const Pl=({style:r,...n})=>e("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),Ol=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"];class Rl{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new T(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((e=>{throw Zt(e)}))}constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new Xt,t=this.rpcTimeoutDuration)=>new Promise(((r,n)=>setTimeout((()=>{n(e)}),t))),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach((e=>{this.removeListener(e.eventName,e.listener)})),this.walletProvider=e,this._subscriptions.forEach((e=>{this.walletProvider?.on(e.eventName,e.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=t||q,this._subscriptions=[]}}let Ml=class extends Error{constructor(e,t,r){super(e),this.code=t,this.data=r}};class Ll extends Vt{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new Ml(`Invalid params for ${e.method}`,4200);let t=e.params[0];if(!await Tv()||!this.address)throw new Ml("Disconnected",4900);return(await Nv(t,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new Ml(`Invalid params for ${e.method}`,4200);if("string"==typeof e.params[0])t=e.params[0];else{if(!("chainId"in e.params[0])||"string"!=typeof e.params[0].chainId)throw new Ml(`Invalid params for ${e.method}`,4200);t=e.params[0].chainId}this.chainId=Number(t),this.provider=Ve(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",t)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let t=e.params[0],r=e.params[1];return await _v(t,void 0,r)}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let t=e.params[0],r="string"==typeof e.params[1]?JSON.parse(e.params[1]):e.params[1];return await Sv(Ke(r),void 0,t)}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let t={...e.params[0],chainId:Ye(this.chainId)};try{return await this.provider.send("eth_estimateGas",[t])}catch(e){console.warn(`Gas estimation failed with error: ${e}. Retrying gas estimation by omitting the 'from' address`);try{return delete t.from,await this.provider.send("eth_estimateGas",[t])}catch(t){throw console.warn(`Gas estimation failed with error: ${t} when omitting the 'from' address`),e}}}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Ye(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!(e=>Ol.includes(e))(e.method))return this.provider.send(e.method,e.params);{let t=await Tv();if(await Iv(),!t||!this.address)throw new Ml("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.rootAddress,accessToken:t,hdWalletIndex:this.walletIndex,request:{method:e.method,params:e.params}})).response.data}catch(e){throw console.error(e),new Ml("Disconnected",4900)}}}async connect(){let e=await Tv();if(!e||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:e})).address}catch(e){return console.error(e),null}}constructor({walletProxy:e,address:t,rootAddress:r,rpcConfig:n,chains:i,appId:a,chainId:o=1,walletIndex:l}){super(),this.walletProxy=e,this.address=t,this.rootAddress=r,this.chainId=o,this.rpcConfig=n,this.chains=i,this.provider=Ve(o,this.chains,n,{appId:a}),this.rpcTimeoutDuration=ls(n,"privy"),this.appId=a,this.walletIndex=l}}class Dl extends Rl{constructor(e){super(e,e.rpcTimeoutDuration)}}class Fl extends Rl{sendAsync(e,t){throw Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}constructor(e){super(e,e.rpcTimeoutDuration)}}let Ul;function Wl(e){return"ethereum"===e.chainType}function Bl(e){return"ethereum"===e.type}class Gl extends Qt{buildConnectedWallet(e,t,r,a){let o=async()=>!!this.wallets.find((t=>n(t.address)===n(e)));return{type:"ethereum",address:n(e),chainId:t,meta:r,imported:a,switchChain:async r=>{let i,a;if(!o)throw new T("Wallet is not currently connected.");let l=this.wallets.find((t=>n(t.address)===n(e)))?.chainId;if(!l)throw new T("Unable to determine current chainId.");if("number"==typeof r?(i=`0x${r.toString(16)}`,a=r):(i=r,a=Number(r)),l===Ze(i))return;let s=this.chains.find((e=>e.id===a));if(!s)throw new T(`Unsupported chainId: ${r}`);let d=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:i}]})};try{return await d()}catch(e){if(((e,t)=>"coinbase_wallet"===t?e.message.includes("addEthereumChain"):4902===e.code||e.message?.includes("4902"))(e,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:i,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[s.rpcUrls.default?.http[0]??""],blockExplorerUrls:[s.blockExplorers?.default.url??""]}]}),d();if("rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain"))throw new T(`Rainbow does not support the chainId ${t}`);throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:o,getEthereumProvider:async()=>{if(!await o())throw new T("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await o())throw new T("Wallet is not currently connected.");return new i(new Dl(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await o())throw new T("Wallet is not currently connected.");return new Fl(this.proxyProvider)},sign:async e=>{if(!await o())throw new T("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t,r=e;try{if(void 0===r){let e=await Xe((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,e),Array.isArray(e)&&(r=e)}}catch(e){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let i=r[0],a=n(i),o=[];if("privy"===this.walletClientType){let e=qe.get(V(a));this.chains.find((t=>t.id===Number(e)))||(qe.del(V(a)),e=null),t=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){console.warn(`Unable to switch embedded wallet to chain ID ${t} on initialization`)}}else try{let e=await Xe((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,e),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t=`0x${e.toString(16)}`}}catch(e){console.warn(`Failed to get chainId from provider, defaulting to ${K}`,e),t=K}let l=Ze(t);if(!o.find((e=>n(e.address)===a))){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};o.push(this.buildConnectedWallet(n(i),l,e,"embedded_imported"===this.connectorType))}ds(o,this.wallets)||(this.wallets=o,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt)).find((t=>e.find((e=>n(e)===n(t.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),new i(new Dl(this.proxyProvider)).getSigner().signMessage(e)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,r,n){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{this.wallets.forEach((t=>{t.chainId=Ze(e),"privy"===this.walletClientType&&qe.put(V(t.address),e)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=r,this.rpcConfig=n,this.rpcTimeoutDuration=ls(n,e),this.connected=!1,this.initialized=!1}}let Hl=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],zl=(e,t)=>e.makeWeb3Provider({options:t});class jl extends Gl{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Pl,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new T("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Zt(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType="smartWalletOnly"===e?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(zl(Ul,this.connectionOptions))}constructor(e,t,r,n,i,a){if(super("coinbase_wallet",e,t,r),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new Rl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=n.coinbaseWallet.connectionOptions??"all",this.walletClientType="smartWalletOnly"===this.connectionOptions?"coinbase_smart_wallet":"coinbase_wallet","coinbase_smart_wallet"===this.walletClientType&&(this.displayName="Coinbase Smart Wallet"),!Ul){let r=[t.id].concat(e.map((e=>e.id))),n="eoaOnly"!==this.connectionOptions?r.filter((e=>!Hl.includes(e))):[];n.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${n.join(", ")}`),Ul=new Kt({appName:i,appLogoUrl:a,appChainIds:r})}this.proxyProvider.setWalletProvider(zl(Ul,this.connectionOptions))}}class ql extends Gl{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Ye(e?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Qe,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:t,defaultChain:r,rpcConfig:n,imported:i,walletIndex:a}){super("privy",t,r,n),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=a,i&&(this.connectorType="embedded_imported"),this.subscribeListeners()}}const Vl=({style:e,...r})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...r,children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),Kl=({style:r,...n})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...r},...n,children:[t("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),t("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),t("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),t("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),t("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),t("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),t("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),t("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),t("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),t("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),t("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),t("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),t("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),Yl=({style:r,...n})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});function Zl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var Xl=0;class Ql extends Gl{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new T("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Zt(e)}}constructor(e,t,r,n,i){super(i||"unknown",e,t,r),this.connectorType="injected",this.proxyProvider=new Rl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=n;let a=n.provider;this.proxyProvider.setWalletProvider(a)}}var Jl="__private_"+Xl+++"__walletBranding";class es extends Gl{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Zl(this,Jl)[Jl]??{name:"Browser Extension",icon:Vl,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new T("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Zt(e)}}constructor(e,t,r,n,i){super(i??"unknown",e,t,r),Object.defineProperty(this,Jl,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new Rl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(n),"metamask"===i?Zl(this,Jl)[Jl]={name:"MetaMask",icon:Kl,id:"io.metamask"}:"phantom"===i&&(Zl(this,Jl)[Jl]={name:"Phantom",icon:Yl,id:"phantom"})}}class ts extends Ql{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{C||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new T("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Zt(e)}}}class rs extends Gl{get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${e}`)}constructor(e,t){super(e,[],t,{}),this.connectorType="null",this.proxyProvider=new Rl(void 0,q),this.connectorType=e}}class ns extends rs{get walletBranding(){return{name:"Phantom",icon:Yl,id:"phantom"}}constructor(e){super("phantom",e)}}const is=({style:r,...n})=>{let{app:i}=dr();return e("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"28",height:"28",rx:"3",fill:"dark"===i?.appearance.palette.colorScheme?"#3396ff":"#141414"}),t("g",{clipPath:"url(#clip0_1765_9946)",children:t("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),t("defs",{children:t("clipPath",{id:"clip0_1765_9946",children:t("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};class as extends Gl{async initialize(){let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){if(this.walletProvider?.session?.peer.metadata.url){let e=jo(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:t}=await import("@walletconnect/modal");this.modal=new t({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal((e=>{e.open||this.walletProvider?.session||!this.onQrModalClosed||this.onQrModalClosed()}))}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return"metamask"===this.walletClientType?{name:"MetaMask",icon:Kl,id:"io.metamask"}:{name:Je(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||is,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=qo[e],this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(Ko)}catch{}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise(((e,t)=>{this.onQrModalClosed=()=>{t(new Jt)},(async()=>{let t="",r=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(r?.length&&(t=r[0]),!t||""===t)throw new T("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let e=jo(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=ls(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(r),e()})().catch((e=>{t(e?Zt(e):new T("Unknown error during connection"))})).finally((()=>this.modal?.closeModal()))}))}disconnect(){this.walletProvider?.disconnect().then((()=>this.onDisconnect())).catch((()=>console.warn("Unable to disconnect Wallet Connect provider")))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let t of this.chains){let r=et(t.id,this.chains,this.rpcConfig,this.privyAppId);r&&(e[t.id]=r)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],r=this.chains.map((e=>e.id)),n=await or.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:r,optionalEvents:lr,optionalMethods:sr,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return n.on("display_uri",(e=>{if(n.signer.abortPairingAttempt(),C&&this.walletEntry){let{redirect:t,href:r}=function(e,t){let r=Vo(t);if(r.deepLink)return Zo(r.deepLink,e);if(r.universalLink)return Xo(r.universalLink,e);throw new x(`Unsupported wallet ${t.id}`)}(e,this.walletEntry);(function({href:e,name:t}){try{localStorage.setItem(Ko,JSON.stringify({href:e,name:t}))}catch{}})({href:r,name:this.walletEntry.displayName}),this.redirectUri=t;let n=function(e,t){let r=Vo(t);if(r.universalLink)return Xo(r.universalLink,e)}(e,this.walletEntry);n?.redirect&&(this.fallbackUniversalRedirectUri=n.redirect),Qo(t,"_self")}else this.modal?.openModal({uri:e,chains:[this.defaultChain.id]})})),n.on("connect",(()=>{if(this.modal?.closeModal(),n.session?.peer.metadata.url){let e=jo(n.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown"}})),n}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await(this.walletProvider?.enable())}constructor(e,t,r,n,i,a,o,l){super(l||"unknown",r,n,t),this.connectorType="wallet_connect_v2",this.privyAppId=a,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=t,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new Rl(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=qo[l],this.walletClientType=l)}}const os=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>qt(e))).map((e=>n(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length},ls=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||q;class ss extends Vt{get wallets(){let e=new Set,t=this.walletConnectors.flatMap((e=>e.wallets)).sort(((e,t)=>e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0)).filter((t=>{let r=`${t.address}${t.walletClientType}${t.connectorType}`;return!e.has(r)&&(e.add(r),!0)})),r=t.findIndex((e=>e.address===(this.activeWallet?this.activeWallet:"unknown")));return r>=0&&t.unshift(t.splice(r,1)[0]),t}async initialize(){if(this.initialized)return;qe.get(Y)&&(qe.getKeys().forEach((e=>{e.startsWith("walletconnect")&&qe.del(e)})),qe.del(Y));let e=tt(this.store,this.walletList,this.externalWalletConfig).then((e=>{e.forEach((({type:e,eip6963InjectedProvider:t,legacyInjectedProvider:r})=>{this.createEthereumWalletConnector("injected",e,{eip6963InjectedProvider:t,legacyInjectedProvider:r})}))}));this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector("coinbase_wallet","coinbase_wallet"),!rt()&&this.walletList.includes("phantom")&&this.createEthereumWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector("wallet_connect_v2","unknown"),this.externalWalletConfig.solana.connectors?.get().forEach(this.addSolanaWalletConnector),this.externalWalletConfig.solana.connectors?._setOnConnectorsUpdated?.((e=>{e?.forEach(this.addSolanaWalletConnector)})),await e,this.initialized=!0}findWalletConnector(e,t){return"wallet_connect_v2"===e?this.walletConnectors.filter(Wl).find((t=>t.connectorType===e))??null:this.walletConnectors.filter(Wl).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findSolanaWalletConnector(e,t){return this.walletConnectors.filter(er).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter((e=>"embedded"===e.connectorType))}onInitialized(e){e.wallets.forEach((e=>{let t=this.storedConnections.find((t=>t.address===e.address&&t.connectorType===e.connectorType&&t.walletClientType===e.walletClientType));t&&(e.connectedAt=t.connectedAt)})),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:e,rootWallet:t,embeddedWallets:r,defaultChain:n,appId:i}){for(let a of r){let r=this.findEmbeddedWalletConnectors().find((e=>e.walletIndex===a.walletIndex));if(r&&Wl(r))r.proxyProvider.walletProxy=e;else{let r=new ql({provider:new Ll({walletProxy:e,address:a.address,rootAddress:t.address,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:n.id,walletIndex:a.walletIndex}),chains:this.chains,defaultChain:n,rpcConfig:this.rpcConfig,imported:!1,walletIndex:a.walletIndex});this.addWalletConnector(r)}}}addImportedWalletConnector(e,t,r,n){let i=this.findWalletConnector("embedded_imported","privy");if(i&&Wl(i))i.proxyProvider.walletProxy=e;else{let i=new ql({provider:new Ll({walletProxy:e,rootAddress:t,address:t,walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:n,chainId:r.id}),chains:this.chains,walletIndex:0,defaultChain:r,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(i)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter((e=>"embedded"!==e.connectorType)),this.saveConnectionHistory(),this.storedConnections=cs(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1),this.saveConnectionHistory(),this.storedConnections=cs(),this.emit("walletsUpdated")}}async createEthereumWalletConnector(e,t,r){let n=this.findWalletConnector(e,t);if(n&&Wl(n))return n instanceof as&&n.resetConnection(t),n;let i=(()=>"injected"!==e?"coinbase_wallet"===e?new jl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):"phantom"===e?new ns(this.defaultChain):new as(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,t):"metamask"===t&&r?.eip6963InjectedProvider?new ts(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):"metamask"===t&&r?.legacyInjectedProvider?new es(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):"phantom"===t&&r?.legacyInjectedProvider?new es(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&"unknown_browser_extension"===t?new es(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new Ql(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,t):void 0)();return i&&this.addWalletConnector(i),i||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",(()=>this.onInitialized(e))),e.on("walletsUpdated",(()=>this.onWalletsUpdated(e))),e.initialize().catch((e=>{console.debug("Failed to initialize connector",e)}))}saveConnectionHistory(){let e=this.wallets.map((e=>({address:e.address,connectorType:e.connectorType,walletClientType:e.walletClientType,connectedAt:e.connectedAt})));qe.put(Z,e)}async activeWalletSign(e){let t=this.wallets,r=t.length>0?t[0]:null;return r&&Bl(r)?r.sign(e):null}setActiveWallet(e){this.activeWallet=n(e),this.emit("walletsUpdated")}constructor(e,t,r,n,i,a,o,l,s,d,c){super(),this.addSolanaWalletConnector=async e=>{this.findWalletConnector("solana_adapter",e.walletClientType)||this.addWalletConnector(e)},this.getEthereumProvider=()=>{let e=this.wallets[0],t=this.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new Rl},this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=r,this.chains=n,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=a,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=l,this.externalWalletConfig=s,this.privyAppName=d,this.privyAppLogo=c,this.storedConnections=cs()}}function ds(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(n?.address!==i?.address||n&&i&&Bl(n)&&Bl(i)&&n?.chainId!==i?.chainId||n?.connectorType!==i?.connectorType||n?.connectedAt!==i?.connectedAt||n?.walletClientType!==i?.walletClientType||n?.isConnected!==i?.isConnected||n?.linked!==i?.linked)return!1}return!0}const cs=()=>{let e=qe.get(Z);return e&&Array.isArray(e)&&e.map((e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e))).every(Boolean)?e:[]};let us=[Mo,Do,Lo,Bo];class hs{async get(e,t){try{return await this.baseFetch(e,t)}catch(e){throw k(e)}}async post(e,t,r){try{return await this.baseFetch(e,{method:"POST",...t?{body:t}:{},...r})}catch(e){throw k(e)}}async delete(e,t){try{return await this.baseFetch(e,{method:"DELETE",...t})}catch(e){throw k(e)}}constructor({appId:e,appClientId:t,client:r,defaults:n}){this.appId=e,this.appClientId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=X,this.client=r,this.defaults=n,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=mr.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:e,options:t})=>{let r=new Headers(t.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client",`react-auth:${this.sdkVersion}`);let n=us.includes(e.toString());if(!r.has("authorization")){let e=await this.client.getAccessToken({disableAutoRefresh:n});null!==e&&r.set("authorization",`Bearer ${e}`)}t.headers=r,t.retryDelay&&(t.retryDelay=3*t.retryDelay)},onRequestError:({error:e})=>{if(e instanceof DOMException&&"AbortError"===e.name)throw new _}})}}function ps(){return!(E&&window.location.origin.startsWith("http://localhost"))}class ms{static parse(e){try{return new ms(e)}catch(e){return null}}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=U.decodeJwt(e)}}class fs{get token(){try{let e=qe.get(Q);return"string"==typeof e?new ms(e).value:null}catch(e){return console.error(e),this.destroyLocalState(),null}}get refreshToken(){try{let e=qe.get(J);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}get forkedToken(){try{let e=qe.get(ee);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let t=qe.get(te(e));if("string"!=typeof t)return null;{let r=new ms(t);return r.isExpired()?(qe.del(te(e)),null):r.value}}catch(e){return console.error(e),null}}get mightHaveServerCookies(){try{let e=fr.get(re);return void 0!==e&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||"string"==typeof this.token&&"string"==typeof this.refreshToken&&this.refreshToken!==ne}hasRecoveryCredentials(){return"string"==typeof this.forkedToken}hasActiveToken(){let e=ms.parse(this.token);return null!==e&&!e.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,t){"string"==typeof t?qe.put(te(e),t):qe.del(te(e))}async _authenticate(e){try{let t=await e.authenticate(),{user:r,is_new_user:n,oauth_tokens:i}=t;this.handleTokenResponse(t);let a=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0,o=function(e){return e instanceof Ho?"email":e instanceof Tl?"sms":e instanceof kl?"siwe":e instanceof rl?"guest":e instanceof Go?"custom_auth":e instanceof ll?e.meta.provider:null}(e);return o&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:o,isNewUser:n}}),"siwe"===o&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}}),{user:nt(r),isNewUser:n,oAuthTokens:a}}catch(e){throw console.warn("Error authenticating session"),S(e)}}async _link(e){try{let t=await e.link(),r=t.oauth_tokens,n=r?{provider:r.provider,accessToken:r.access_token,accessTokenExpiresInSeconds:r.access_token_expires_in_seconds,refreshToken:r.refresh_token,refreshTokenExpiresInSeconds:r.refresh_token_expires_in_seconds,scopes:r.scopes}:void 0;return{user:nt(t),oAuthTokens:n}}catch(e){throw console.warn("Error linking account"),S(e)}}async _refresh(){if(!this.api)throw new x("Session has no API instance");if(!this.client)throw new x("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,t=this.refreshToken,r=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(e&&t||this.mightHaveServerCookies){let i={};e&&(i.authorization=`Bearer ${e}`),n=await this.api.post(Mo,t?{refresh_token:t}:{},{headers:i}),r&&this.clearForkedToken()}else{if(!r)return null;n=await this.api.post(Do,{refresh_token:r}),this.clearForkedToken()}return this.handleTokenResponse(n),nt(n.user)}catch(e){if(e instanceof N&&e.privyErrorCode===A.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw S(e)}}handleTokenResponse(e){e.session_update_action?"set"===e.session_update_action?(this.storeRefreshToken(e.refresh_token),this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token)):"clear"===e.session_update_action?this.destroyLocalState():"ignore"===e.session_update_action&&e.token&&(this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token)):(this.storeRefreshToken(e.refresh_token),this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token))}async _destroy(){try{await(this.api?.post(Lo,{refresh_token:this.refreshToken}))}catch(e){console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new x("Session has no API instance");let e=this.refreshToken;try{let t=await this.api.post("/api/v1/sessions/fork",{refresh_token:e});return this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.new_session_refresh_token}catch(e){throw S(e)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(e){if("string"==typeof e){let t=qe.get(Q);if(qe.put(Q,e),!this.client?.useServerCookies){let t=ms.parse(e)?.expiration;fr.set(ie,e,{sameSite:"Strict",secure:ps(),expires:t?new Date(1e3*t):void 0})}t!==e&&this.client?.onStoreToken?.(e)}else qe.del(Q),fr.remove(ie),this.client?.onDeleteToken?.()}storeRefreshToken(e){"string"==typeof e?(qe.put(J,e),this.client?.useServerCookies||fr.set(re,"t",{sameSite:"Strict",secure:ps(),expires:30})):(qe.del(J),fr.remove(ae),fr.remove(re))}storeIdentityToken(e){if(this.client?.useServerCookies)return;qe.put(oe,e);let t=ms.parse(e)?.expiration;fr.set(le,e,{sameSite:"Strict",secure:ps(),expires:t?new Date(1e3*t):void 0})}clearIdentityToken(){qe.del(oe),fr.remove(le)}clearForkedToken(){qe.del(ee)}constructor(){this.authenticateOnce=new Jo((async e=>this._authenticate(e))),this.linkOnce=new Jo((async e=>this._link(e))),this.refreshOnce=new Jo(this._refresh.bind(this)),this.destroyOnce=new Jo(this._destroy.bind(this)),this.forkSessionOnce=new Jo(this._forkSession.bind(this))}}let gs;var ys=0,ws="__private_"+ys+++"__getOrGenerateClientAnalyticsId";class vs{initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:l,appName:s}){this.connectors||(this.connectors=new ss(this.appId,e,t,r,n,i,a,o,l,s))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let e=new hs({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new x("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new x("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter((e=>"cross_app"===e.type)).forEach((e=>{this.storeProviderAccessToken(e.providerApp.id,null)}))}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post("/api/v1/mfa/passwordless_sms/init",{action:"verify"})}catch(e){throw k(e)}}async initMfaPasskeyVerification(){try{return(e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports})))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}))((await this.api.post("/api/v1/mfa/passkeys/init",{})).options)}catch(e){throw k(e)}}async acceptTerms(){try{let e=await this.api.post("/api/v1/users/me/accept_terms",{});return nt(e)}catch(e){throw S(e)}}async unlinkEmail(e){try{let t=await this.api.post("/api/v1/passwordless/unlink",{address:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkPhone(e){try{let t=await this.api.post("/api/v1/passwordless_sms/unlink",{phoneNumber:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkEthereumWallet(e){try{let t=await this.api.post("/api/v1/siwe/unlink",{address:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkSolanaWallet(e){try{let t=await this.api.post("/api/v1/siws/unlink",{address:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkOAuth(e,t){try{let r=await this.api.post("/api/v1/oauth/unlink",{provider:e,subject:t});return await this.getAuthenticatedUser()??nt(r)}catch(e){throw S(e)}}async unlinkFarcaster(e){try{let t=await this.api.post("/api/v1/farcaster/unlink",{fid:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkTelegram(e){try{let t=await this.api.post("/api/v1/telegram/unlink",{telegram_user_id:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkPasskey(e){try{let t=await this.api.post("/api/v1/passkeys/unlink",{credential_id:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async createAnalyticsEvent({eventName:e,payload:t,timestamp:r,options:n}){if("undefined"!=typeof window)try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(Bo,{event_name:e,client_id:this.clientAnalyticsId,payload:{...t||{},clientTimestamp:r?r.toISOString():(new Date).toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch(e){}}async signMoonpayOnRampUrl(e){try{return this.api.post("/api/v1/plugins/moonpay_on_ramp/sign",e)}catch(e){throw S(e)}}async initCoinbaseOnRamp(e){try{return this.api.post("/api/v1/funding/coinbase_on_ramp/init",e)}catch(e){throw S(e)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`/api/v1/funding/coinbase_on_ramp/status?partnerUserId=${e}`)}catch(e){throw S(e)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(e){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?ms.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!e?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getSmartWalletsConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:e});return r.enabled?{enabled:r.enabled,smartWalletType:r.smart_wallet_type,configuredNetworks:r.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url})))}:{enabled:r.enabled}}catch(e){throw S(e)}}async getServerConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:e}),n=r.telegram_auth_config?{botId:r.telegram_auth_config.bot_id,botName:r.telegram_auth_config.bot_name,linkEnabled:r.telegram_auth_config.link_enabled,seamlessAuthEnabled:r.telegram_auth_config.seamless_auth_enabled}:void 0,i=r.funding_config?{methods:r.funding_config.methods,defaultRecommendedAmount:r.funding_config.default_recommended_amount,defaultRecommendedCurrency:r.funding_config.default_recommended_currency,promptFundingOnWalletCreation:r.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,spotifyOAuth:r.spotify_oauth,instagramOAuth:r.instagram_oauth,tiktokOAuth:r.tiktok_oauth,linkedinOAuth:r.linkedin_oauth,appleOAuth:r.apple_oauth,farcasterAuth:r.farcaster_auth,passkeyAuth:r.passkey_auth,telegramAuth:r.telegram_auth,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:r.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:r.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:r.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:r.privacy_policy_url,requireUsersAcceptTerms:r.require_users_accept_terms,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,fiatOnRampEnabled:r.fiat_on_ramp_enabled,captchaEnabled:r.captcha_enabled,captchaSiteKey:r.captcha_site_key,createdAt:new Date(1e3*r.created_at),updatedAt:new Date(1e3*r.updated_at),mfaMethods:r.mfa_methods,enforceWalletUis:r.enforce_wallet_uis,legacyWalletUiConfig:r.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(e){throw S(e)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch(t){return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch(e){return void console.error("Unable to fetch token price for SOL")}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:e,captchaToken:t}){try{return(await this.api.post("/api/v1/siwe/init",{address:e,token:t})).nonce}catch(e){throw S(e)}}async authenticateWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i,mode:a}){return await this.api.post("/api/v1/siwe/authenticate",{message:e,signature:t,chainId:r,walletClientType:n,connectorType:i,mode:a})}async linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){return await this.api.post("/api/v1/siwe/link",{message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})}async linkSmartWallet({message:e,signature:t,smartWalletType:r}){try{let n=await this.api.post("/api/v1/siwe/link_smart_wallet",{message:e,signature:t,smart_wallet_type:r});return nt(n)}catch(e){throw S(e)}}async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i});return nt(a)}catch(e){throw S(e)}}async generateSiwsNonce({address:e,captchaToken:t}){try{return(await this.api.post("/api/v1/siws/init",{address:e,token:t})).nonce}catch(e){throw S(e)}}async authenticateWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n,mode:i}){return await this.api.post("/api/v1/siws/authenticate",{message:e,signature:t,walletClientType:r,connectorType:n,mode:i})}async sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,farcasterEmbeddedAddress:a,oAuthUserInfo:o}){try{let l,s;switch(r){case"email":l="/api/v1/passwordless/transfer",s={nonce:e,email:t};break;case"sms":l="/api/v1/passwordless_sms/transfer",s={nonce:e,phoneNumber:t};break;case"siwe":if(l="/api/v1/siwe/transfer",!n)throw Error("Wallet parameters must be defined");s={nonce:e,address:t,...n};break;case"farcaster":l="/api/v1/farcaster/transfer",s={nonce:e,farcaster_id:t,farcaster_embedded_address:a};break;case"telegram":l="/api/v1/telegram/transfer",s={nonce:e,telegram_auth_result:i};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:l="/api/v1/oauth/transfer",s={nonce:e,userInfo:o}}let d=await this.api.post(l,s);return await this.getAuthenticatedUser()??nt(d)}catch(e){throw S(e)}}async linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n}){return await this.api.post("/api/v1/siws/link",{message:e,signature:t,walletClientType:r,connectorType:n})}async linkWithSiws({message:e,signature:t,walletClientType:r,connectorType:n}){try{let i=await this.linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n});return nt(i)}catch(e){throw S(e)}}constructor(e){Object.defineProperty(this,ws,{value:Cs}),this.apiUrl=e.apiUrl||se,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!e.apiUrl&&e.apiUrl.startsWith("https://privy."),this.timeout=e.timeout||de,this.appId=e.appId,this.appClientId=e.appClientId,this.clientAnalyticsId=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}(this,ws)[ws](),gs||(gs=new fs),this.session=gs,this.api=this.generateApi(),this.session.client=this}}function Cs(){if("undefined"==typeof window)return null;try{let e=qe.get(ce);if("string"==typeof e&&e.length>0)return e}catch(e){}let e=jt();try{return qe.put(ce,e),e}catch(t){return e}}const bs=p({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:P,setError:P,setExecuting:P,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:P,reset:P,execute:P});class Es extends I{constructor(e,t,r){super(e||"Captcha failed"),this.type="Captcha",t instanceof Error&&(this.cause=t),this.privyErrorCode=r}}const $s=({children:e,id:r,captchaSiteKey:n,captchaEnabled:i})=>{let a=l(null),[o,c]=s(),[u,h]=s(),[p,m]=s(!1),f=d((()=>i?p||o||u?!p||o||u?o&&!u?{status:"success",token:o}:u?{status:"error",error:u}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"}),[i,o,u,p]);return t(bs.Provider,{value:{...f,ref:a,enabled:i,siteKey:n,appId:r,setToken:c,setError:h,setExecuting:m,remove(){i&&(a.current?.remove(),m(!1),h(void 0),c(void 0))},reset(){i&&(a.current?.reset(),m(!1),h(void 0),c(void 0))},execute(){i&&(m(!0),a.current?.execute())},async waitForResult(){if(!i)return"";try{return await it((()=>a.current?.getResponse()),{interval:200,timeout:2e4})}catch(e){throw new Es("Captcha failed",null,A.CAPTCHA_TIMEOUT)}}},children:e})},xs=()=>h(bs),ks=e=>{let{enabled:r,siteKey:n,appId:i,setError:a,setToken:o,setExecuting:l,ref:s}=xs(),[,c]=d((()=>n?.split("t:")||[]),[n]);if(m((()=>s.current?.remove),[]),!r)return null;if(!c)throw Error("Unsupported captcha site key");return t("div",{className:"hidden h-0 w-0",children:t(gr,{...e,ref:s,siteKey:c,options:{action:i,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),a("Captcha failed"),l(!1)},onSuccess:t=>{e.onSuccess?.(t),o(t),l(!1)},onExpire:()=>{e.onExpire?.();try{s.current?.reset(),a(void 0),o(void 0)}catch(e){a("expired_and_failed_reset")}}})})};function As(e){at("configureMfa",e)}const Ts=({success:n,fail:i})=>e(r,{children:[t(_s,{className:n?"success":i?"fail":""}),t(Ss,{className:n?"success":i?"fail":""})]}),_s=yr.span`
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddress as n}from"@ethersproject/address";import{Web3Provider as i}from"@ethersproject/providers";import{createStore as a}from"mipd";import o,{useRef as l,useState as s,useMemo as d,useContext as h,createContext as p,useEffect as m,useCallback as f,useReducer as y,forwardRef as w}from"react";import*as v from"react-device-detect";import{isMobile as C,isIOS as b,isSafari as E,isAndroid as $}from"react-device-detect";import{P as x,f as A,a as k,b as T,c as _,d as S,e as N,g as I,n as P,u as O,h as R,i as M,j as L,k as D,I as U}from"./internal-context.mjs";import*as F from"jose";import{base64url as W}from"jose";import{g as B,C as G,H,O as z,S as j,D as q,a as V,b as K,c as Y,d as Z,V as X,T as Q,R as J,F as ee,e as te,f as re,h as ne,i as ie,j as ae,I as oe,k as le,l as se,m as de,n as ce,u as ue,o as he,p as pe,q as me,W as fe,r as ge,s as ye,t as we,v as ve,w as Ce,x as be,y as Ee,z as $e,A as xe,B as Ae,E as ke,G as Te,M as _e,J as Se,K as Ne,L as Ie,P as Pe,N as Oe,Q as Re,U as Me,X as Le,Y as De,Z as Ue,_ as Fe,$ as We,a0 as Be}from"./useWallets.mjs";export{a1 as SUPPORTED_CHAINS}from"./useWallets.mjs";import{t as Ge,r as He,i as ze,e as je,a as qe,g as Ve,b as Ke,c as Ye,f as Ze,d as Xe,B as Qe,s as Je,h as et,j as tt,k as rt,l as nt,p as it,u as at,A as ot,m as lt,n as st,M as dt,o as ct,q as ut,C as ht,v as pt,T as mt,w as ft,x as gt,y as yt,W as wt,z as vt,D as Ct,E as bt,F as Et,G as $t,L as xt,H as At,I as kt,J as Tt,K as _t,N as St,O as Nt,P as It,Q as Pt,R as Ot,S as Rt,U as Mt,V as Lt,X as Dt,Y as Ut,Z as Ft,_ as Wt,$ as Bt,a0 as Gt,a1 as Ht,a2 as zt}from"./useFundWallet.mjs";export{a4 as useConnectWallet,a5 as useFundWallet,a3 as useLogin}from"./useFundWallet.mjs";import{v4 as jt}from"uuid";import{isHexString as qt}from"@ethersproject/bytes";import Vt from"eventemitter3";import{CoinbaseWalletSDK as Kt}from"@coinbase/wallet-sdk";import{l as Yt,f as Zt,W as Xt,a as Qt,U as Jt,i as er,C as tr,P as rr,b as nr,E as ir,c as ar}from"./useSolanaWallets.mjs";export{u as useSolanaWallets}from"./useSolanaWallets.mjs";import{EthereumProvider as or,OPTIONAL_EVENTS as lr,OPTIONAL_METHODS as sr}from"@walletconnect/ethereum-provider";import{u as dr,M as cr,a as ur,e as hr,b as pr}from"./getEmbeddedConnectedWallet.mjs";export{c as addRpcUrlOverrideToChain,g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet.mjs";import{ofetch as mr}from"ofetch";import fr from"js-cookie";import{Turnstile as gr}from"@marsidev/react-turnstile";import{styled as yr,css as wr,keyframes as vr,createGlobalStyle as Cr}from"styled-components";import br from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Er from"@heroicons/react/24/outline/ArrowLeftIcon";import $r from"@heroicons/react/24/outline/ArrowRightIcon";import xr from"@heroicons/react/24/outline/XMarkIcon";import Ar from"@heroicons/react/24/outline/ExclamationTriangleIcon";import kr from"@heroicons/react/24/outline/WalletIcon";import{ExclamationCircleIcon as Tr,Square2StackIcon as _r,WalletIcon as Sr,ExclamationTriangleIcon as Nr,ChevronDownIcon as Ir}from"@heroicons/react/24/outline";import Pr from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Or from"@heroicons/react/24/solid/DocumentCheckIcon";import Rr from"@heroicons/react/20/solid/CheckIcon";import Mr from"@heroicons/react/24/outline/EnvelopeIcon";import Lr from"@heroicons/react/24/outline/PhoneIcon";import Dr from"@heroicons/react/24/solid/CheckCircleIcon";import Ur from"@heroicons/react/24/solid/XCircleIcon";import Fr from"fast-password-entropy";import*as Wr from"secure-password-utilities";import{DEFAULT_WORDLIST as Br}from"secure-password-utilities/wordlists";import Gr from"@heroicons/react/24/outline/ArrowPathIcon";import Hr from"@heroicons/react/24/outline/EyeIcon";import zr from"@heroicons/react/24/outline/EyeSlashIcon";import jr from"@heroicons/react/24/outline/KeyIcon";import qr from"@heroicons/react/24/outline/ArrowDownTrayIcon";import Vr from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import Kr from"@heroicons/react/24/outline/DocumentDuplicateIcon";import Yr from"@heroicons/react/24/outline/UserCircleIcon";import Zr from"@heroicons/react/24/solid/LockClosedIcon";import Xr from"qrcode";import Qr from"@heroicons/react/24/outline/CheckCircleIcon";import{createPublicClient as Jr,http as en,parseEther as tn,createWalletClient as rn,custom as nn,publicActions as an,encodeFunctionData as on,decodeFunctionData as ln}from"viem";import sn from"@heroicons/react/24/outline/GlobeAltIcon";import{Menu as dn,Transition as cn,Dialog as un}from"@headlessui/react";import hn from"@heroicons/react/24/outline/ClockIcon";import pn from"@heroicons/react/24/outline/TrashIcon";import mn from"@heroicons/react/24/solid/CheckBadgeIcon";import fn from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import gn from"@heroicons/react/24/outline/PencilIcon";import{parseUnits as yn,formatUnits as wn}from"@ethersproject/units";import vn from"@heroicons/react/24/outline/InformationCircleIcon";import Cn from"@heroicons/react/24/outline/QrCodeIcon";import bn from"@heroicons/react/24/outline/LinkIcon";import En from"@heroicons/react/24/outline/ChevronRightIcon";import $n from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import xn from"@heroicons/react/24/solid/IdentificationIcon";import An from"@heroicons/react/24/solid/PhoneIcon";import kn from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import Tn from"@heroicons/react/24/solid/ShieldCheckIcon";import _n from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import Sn from"@heroicons/react/24/outline/FingerPrintIcon";import Nn from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import In from"@heroicons/react/24/outline/ShieldCheckIcon";import{VoidSigner as Pn}from"@ethersproject/abstract-signer";import{BigNumber as On}from"@ethersproject/bignumber";import{Contract as Rn}from"@ethersproject/contracts";import{serialize as Mn}from"@ethersproject/transactions";import Ln from"fetch-retry";import Dn from"@heroicons/react/24/outline/ChevronDownIcon";import Un from"@heroicons/react/24/outline/CalendarIcon";import Fn from"@heroicons/react/24/outline/LockClosedIcon";import Wn from"@heroicons/react/24/outline/PencilSquareIcon";import{isVersionedTransaction as Bn}from"@solana/wallet-adapter-base";import Gn from"@heroicons/react/24/outline/ClipboardDocumentIcon";import Hn from"@heroicons/react/24/outline/ExclamationCircleIcon";import{ErrorCode as zn}from"@ethersproject/logger";import{toUtf8String as jn}from"@ethersproject/strings";import"tinycolor2";import"@heroicons/react/24/outline/Square2StackIcon";let qn={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"}}},Vn={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0},Kn={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},Yn={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"}}},Zn={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0},Xn={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},Qn={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"}}},Jn={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0},ei={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},ti={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"}}},ri={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0},ni={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"}}},ii={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},ai={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},oi=e=>[qn.id,Vn.id,Kn.id].includes(e),li=e=>[56,97].includes(e),si="0x420000000000000000000000000000000000000F",di=["function getL1Fee(bytes memory _data) external view returns (uint256)"],ci=e=>[Yn.id,Zn.id,Xn.id,Qn.id,Jn.id,ei.id,ni.id,ai.id,ii.id,81457,168587773].includes(e);let ui={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},hi=Ln(fetch,{retries:3,retryDelay:500}),pi=e=>[ti.id,ri.id,ui.id].includes(e),mi=e=>({maxPriorityFee:yn(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:yn(e.maxFee.toFixed(9),"gwei").toHexString()}),fi=async e=>{let t="";switch(e){case ti.id:t="https://gasstation.polygon.technology/v2";break;case ri.id:t="https://gasstation-testnet.polygon.technology/v2";break;case ui.id:t="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}let r=await hi(t),n=await r.json();if(r.status>399)throw n;return{safeLow:mi(n.safeLow),standard:mi(n.standard),fast:mi(n.fast)}};async function gi(e,t){if(!e.gasLimit)throw new Yt("gasLimit was not successfully set for transaction.");let r=ze(e.gasLimit),n=On.from(0);if(2==e.type){if(!e.maxFeePerGas)throw new Yt("maxFeePerGas was not successfully set for transaction of type 2.");n=ze(e.maxFeePerGas)}else{if(!e.gasPrice)throw new Yt("gasPrice was not successfully set for transaction of type 0 or 1.");n=ze(e.gasPrice)}let i=r.mul(n),a=On.from(0);if(e.chainId&&ci(e.chainId))try{a=await async function(e,t){if(!e.chainId||e.chainId&&!ci(e.chainId))return On.from(0);let r=On.from(0);try{let n=new Rn(si,di,t),i=He(e),a=Mn(i);r=await n.getL1Fee(a)}catch(e){}return r}(e,t),i=i.add(a)}catch(e){}return{totalGasEstimate:i,l1ExecutionFeeEstimate:a}}function yi(e){return/^-?0x[a-f0-9]+$/i.test(e)}async function wi(e,t,r){if(t.chainId=Number(t.chainId),function(e){for(let t of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=e[t];if(void 0!==r&&!function(e){let t="number"==typeof e,r="bigint"==typeof e,n="string"==typeof e&&yi(e);return t||r||n}(r))throw Error(`Transaction request property '${t}' must be a valid number, bigint, or hex string representing a quantity`)}if("number"!=typeof e.chainId)throw Error("Transaction request property 'chainId' must be a number")}(t),t.from||(t.from=e),!t.nonce){let n=new Pn(e,r);t.nonce=await n.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await async function(e,t){try{return(await t.estimateGas(e)).toHexString()}catch(r){let n;if("message"in r&&r.message.includes("insufficient funds")&&(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'value'`),n=await async function({txRequest:e,provider:t}){try{let r={...e,value:void 0};return(await t.estimateGas(r)).toHexString()}catch(e){return console.warn(`Gas estimation failed with error: ${e} when omitting the 'value'`),null}}({txRequest:e,provider:t})),n||(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from'`),n=await async function({txRequest:e,provider:t}){try{let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}catch(e){return console.warn(`Gas estimation failed with error: ${e} when omitting the 'from' address`),null}}({txRequest:e,provider:t})),!n)throw r;return n}}(t,r)),"string"==typeof t.type&&yi(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),0===(t=pi(t.chainId)?await async function(e){if(!pi(e.chainId))throw Error("Invalid chain ID for Polygon gas estimation.");if(void 0===e.type&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{let{standard:t}=await fi(e.chainId);e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=t.maxPriorityFee),e.maxFeePerGas||(e.maxFeePerGas=t.maxFee),e.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete e.gasPrice)}catch(e){throw Error(`Failed to set gas prices from Polygon gas station with error: ${e}.`)}return e}(t):oi(t.chainId)?await(async(e,t)=>{if(!oi(e.chainId))throw Error("Invalid chain ID for Arbitrum gas estimation.");if(void 0===e.type&&(e.type=2),e.maxFeePerGas)return e;try{let{lastBaseFeePerGas:r}=await t.getFeeData();if(r){let t=r.mul(On.from(120)).div(On.from(100));e.maxFeePerGas=Ge(t),e.maxPriorityFeePerGas=Ge(On.from(0))}}catch(e){throw Error(`Failed to set gas price for Arbitrum transaction: ${e}.`)}return e})(t,r):ci(t.chainId)?await(async(e,t)=>{if(!ci(e.chainId))throw Error("Invalid chain ID for OP Stack gas estimation.");if(void 0===e.type&&(e.type=2),e.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete e.gasPrice),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{if(!e.maxPriorityFeePerGas){let r=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=r}if(e.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),e.maxPriorityFeePerGas>=e.maxFeePerGas))throw Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!e.maxFeePerGas){let{lastBaseFeePerGas:r}=await t.getFeeData();if(!r)throw Error("Unable to fetch baseFee for last block.");let n=On.from(r).mul(On.from(126)).div(On.from(100)).add(On.from(e.maxPriorityFeePerGas));e.maxFeePerGas=Ge(n)}}catch(e){throw Error(`Failed to set gas price for OP stack transaction: ${e}.`)}return e})(t,r):li(t.chainId)?await(async(e,t)=>{if(!li(e.chainId))throw Error("Invalid chain ID for BSC gas estimation.");if(void 0===e.type?e.type=0:1!=e.type&&2!=e.type||console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e})(t,r):await(async(e,t)=>{if(void 0===e.type&&(e.type=2),2===e.type){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let r=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=r.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=r.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e})(t,r)).type&&delete t.accessList,2!==t.type&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}var vi={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"470123456",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"90011234",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"32123456",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"67622901",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"12221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"},Ci={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0(4(?:[14]4|56)|[579])?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|63\\d{6}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0-79])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([3-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","9008\\d{3}|(?:[2-467]\\d\\d|510|862)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[25]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29[1289]|389)","529(?:1[1-46-9]|2[013-8]|90)|5(?:298|389)[0-46-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5293[01]\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|9[0-289])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[0189]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|2[0-2]|6[0-8]|8[0-3]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:[27]2|44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[047]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-5]))\\d{4}"],["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-27]|8[0-8]|9[0-479]))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[27]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-8]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[04]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["5056(?:[0-35-9]\\d|4[46])\\d{4}|(?:4722|505[2-57-9]|983[29])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[0-2]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","(?:0004|4)\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10,13],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","200\\d{6}|(?:33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|5[0-4]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[013-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function bi(e,t){var r=Array.prototype.slice.call(t);return r.push(Ci),e.apply(this,r)}function Ei(e){return(Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $i(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xi(e){var t="function"==typeof Map?new Map:void 0;return(xi=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Ai(e,arguments,_i(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ti(r,e)})(e)}function Ai(e,t,r){return(Ai=ki()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&Ti(i,r.prototype),i}).apply(null,arguments)}function ki(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Ti(e,t){return(Ti=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _i(e){return(_i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Si=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ti(e,t)}(n,xi(Error));var t,r=(t=ki(),function(){var e=_i(n);return function(e,t){if(t&&("object"===Ei(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return $i(e)}(this,t?Reflect.construct(e,arguments,_i(this).constructor):e.apply(this,arguments))});function n(e){var t;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),Object.setPrototypeOf($i(t=r.call(this,e)),n.prototype),t.name=t.constructor.name,t}return Object.defineProperty(n,"prototype",{writable:!1}),n}(),Ni="0-90-9٠-٩۰-۹",Ii="".concat("-‐-―−ー-").concat("//").concat("..").concat(" ").concat("()()[]\\[\\]").concat("~⁓∼~");function Pi(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),i=0;i<3;i++){var a=Number(r[i]),o=Number(n[i]);if(a>o)return 1;if(o>a)return-1;if(!isNaN(a)&&isNaN(o))return 1;if(isNaN(a)&&!isNaN(o))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}function Oi(e){return(Oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ri(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function Mi(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Li=" ext. ",Di=/^\d+$/,Ui=function(){function e(t){Ri(this,e),function(e){if(!e)throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!zi(e)||!zi(e.countries))throw Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(zi(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+ji(e)+": "+e,"."))}(t),this.metadata=t,Vi.call(this,t)}return Mi(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(e){return"001"!==e}))}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&Di.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw Error("Unknown country: ".concat(e));this.numberingPlan=new Fi(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw Error("Unknown calling code: ".concat(t));this.numberingPlan=new Fi(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var r=this.nonGeographic()[e];if(r)return r}else{var n=this.countryCallingCodes()[e];if(n&&1===n.length&&"001"===n[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),e}(),Fi=function(){function e(t,r){Ri(this,e),this.globalMetadataObject=r,this.metadata=t,Vi.call(this,r.metadata)}return Mi(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map((function(t){return new Wi(t,e)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return!(this.types()&&0===this.types().length||!this.types())}},{key:"type",value:function(e){if(this.hasTypes()&&Hi(this.types(),e))return new Gi(Hi(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?Li:this.metadata[13]||Li}}]),e}(),Wi=function(){function e(t,r){Ri(this,e),this._format=t,this.metadata=r}return Mi(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||Bi.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),e}(),Bi=/^\(?\$1\)?$/,Gi=function(){function e(t,r){Ri(this,e),this.type=t,this.metadata=r}return Mi(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),e}();function Hi(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}var zi=function(e){return"object"===Oi(e)},ji=function(e){return Oi(e)};function qi(e,t){if((t=new Ui(t)).hasCountry(e))return t.country(e).countryCallingCode();throw Error("Unknown country: ".concat(e))}function Vi(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===Pi(t,"1.2.0")?this.v2=!0:-1===Pi(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var Ki=function(e){return"([".concat(Ni,"]{1,").concat(e,"})")};function Yi(e){var t="[ \\t,]*",r="[:\\..]?[ \\t,-]*",n="[ \\t]*";return";ext="+Ki("20")+"|"+t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+r+Ki("20")+"#?|"+t+"(?:[xx##~~]|int|int)"+r+Ki("9")+"#?|[- ]+"+Ki("6")+"#|"+n+"(?:,{2}|;)"+r+Ki("15")+"#?|"+n+"(?:,)+"+r+Ki("9")+"#?"}var Zi=RegExp("^[++]{0,1}(?:["+Ii+"]*["+Ni+"]){1,2}$","i"),Xi="[++]{0,1}(?:["+Ii+"]*["+Ni+"]){3,}["+Ii+Ni+"]*(?:"+Yi()+")?",Qi=RegExp("^["+Ni+"]{2}$|^"+Xi+"$","i"),Ji=RegExp("(?:"+Yi()+")$","i");function ea(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ta={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function ra(e){for(var t,r="",n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ea(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ea(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;){var i=ta[t.value];i&&(r+=i)}return r}function na(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ia(e){for(var t,r="",n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return na(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return na(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;)r+=function(e,t){if("+"===e){if(t)return;return"+"}return ta[e]}(t.value,r)||"";return r}function aa(e,t){return function(e,t,r){var n=r.type(t),i=n&&n.possibleLengths()||r.possibleLengths();if(!i)return"IS_POSSIBLE";var a=e.length,o=i[0];return o===a?"IS_POSSIBLE":o>a?"TOO_SHORT":i[i.length-1]<a?"TOO_LONG":i.indexOf(a,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(e,void 0,t)}function oa(e,t){return"IS_POSSIBLE"===aa(e,t)}function la(e,t){return e=e||"",RegExp("^(?:"+t+")$").test(e)}function sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var da=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function ca(e,t,r){if(t=t||{},e.country){(r=new Ui(r)).selectNumberingPlan(e.country,e.countryCallingCode);var n=t.v2?e.nationalNumber:e.phone;if(la(n,r.nationalNumberPattern())){if(ua(n,"FIXED_LINE",r))return r.type("MOBILE")&&""===r.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":r.type("MOBILE")?ua(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var i,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return sa(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sa(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(da);!(i=a()).done;){var o=i.value;if(ua(n,o,r))return o}}}}function ua(e,t,r){return!(!(t=r.type(t))||!t.pattern())&&!(t.possibleLengths()&&0>t.possibleLengths().indexOf(e.length))&&la(e,t.pattern())}function ha(e){return e.replace(RegExp("[".concat(Ii,"]+"),"g")," ").trim()}var pa=/(\$\d)/;function ma(e,t,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var a=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():i&&t.nationalPrefixFormattingRule()?t.format().replace(pa,t.nationalPrefixFormattingRule()):t.format());return n?ha(a):a}var fa=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function ga(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ya(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ya(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ya(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var va={formatExtension:function(e,t,r){return"".concat(e).concat(r.ext()).concat(t)}};function Ca(e,t,r,n,i){var a=function(e,t){for(var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ga(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ga(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(r=n()).done;){var i=r.value;if(i.leadingDigitsPatterns().length>0){var a=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(0!==t.search(a))continue}if(la(t,i.pattern()))return i}}(n.formats(),e);return a?ma(e,a,{useInternationalFormat:"INTERNATIONAL"===r,withNationalPrefix:!a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix,carrierCode:t,metadata:n}):e}function ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ea(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ba(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $a=function(){var e;function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),!e)throw TypeError("`country` or `countryCallingCode` not passed");if(!r)throw TypeError("`nationalNumber` not passed");if(!n)throw TypeError("`metadata` not passed");var i,a,o,l=(o=new Ui(n),xa(e)?(i=e,o.selectNumberingPlan(i),a=o.countryCallingCode()):a=e,{country:i,countryCallingCode:a}),s=l.country,d=l.countryCallingCode;this.country=s,this.countryCallingCode=d,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return e=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){var e,t,r,n;return this.country?[this.country]:(e=this.countryCallingCode,t=this.nationalNumber,(n=new Ui(r=this.getMetadata()).getCountryCodesForCallingCode(e))?n.filter((function(e){var n;return(n=new Ui(r)).selectNumberingPlan(e),n.numberingPlan.possibleLengths().indexOf(t.length)>=0})):[])}},{key:"isPossible",value:function(){return function(e,t,r){if(void 0===t&&(t={}),r=new Ui(r),t.v2){if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return oa(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){var e,t;return e={v2:!0},t=this.getMetadata(),e=e||{},(t=new Ui(t)).selectNumberingPlan(this.country,this.countryCallingCode),t.hasTypes()?void 0!==ca(this,e,t.metadata):la(e.v2?this.nationalNumber:this.phone,t.nationalNumberPattern())}},{key:"isNonGeographic",value:function(){return new Ui(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return ca(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return function(e,t,r,n){if(r=r?wa(wa({},va),r):va,n=new Ui(n),e.country&&"001"!==e.country){if(!n.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));n.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";n.selectNumberingPlan(e.countryCallingCode)}var i,a,o,l,s,d,c,u,h,p,m,f,g,y=n.countryCallingCode(),w=r.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return w?(i=g=Ca(w,e.carrierCode,"NATIONAL",n,r),a=e.ext,o=n,l=r.formatExtension,a?l(i,a,o):i):"";case"INTERNATIONAL":return w?(g=Ca(w,null,"INTERNATIONAL",n,r),s=g="+".concat(y," ").concat(g),d=e.ext,c=n,u=r.formatExtension,d?u(s,d,c):s):"+".concat(y);case"E.164":return"+".concat(y).concat(w);case"RFC3966":return function(e){var t=e.number,r=e.ext;if(!t)return"";if("+"!==t[0])throw Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}({number:"+".concat(y).concat(w),ext:e.ext});case"IDD":if(!r.fromCountry)return;return h=function(e,t,r,n,i){if(qi(n,i.metadata)===r){var a,o=Ca(e,t,"NATIONAL",i);return"1"===r?r+" "+o:o}var l=(void 0,(a=new Ui(i.metadata)).selectNumberingPlan(n,undefined),a.defaultIDDPrefix()?a.defaultIDDPrefix():fa.test(a.IDDPrefix())?a.IDDPrefix():void 0);if(l)return"".concat(l," ").concat(r," ").concat(Ca(e,null,"INTERNATIONAL",i))}(w,e.carrierCode,y,r.fromCountry,n),p=e.ext,m=n,f=r.formatExtension,p?f(h,p,m):h;default:throw Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}(this,e,t?Ea(Ea({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),xa=function(e){return/^[A-Z]{2}$/.test(e)},Aa=RegExp("(["+Ni+"])");function ka(e,t,r,n){if(t){var i=new Ui(n);i.selectNumberingPlan(t,r);var a=new RegExp(i.IDDPrefix());if(0===e.search(a)){var o=(e=e.slice(e.match(a)[0].length)).match(Aa);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return e}}}function Ta(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var i,a,o,l=n.length-1,s=l>0&&n[l];if(t.nationalPrefixTransformRule()&&s)i=e.replace(r,t.nationalPrefixTransformRule()),l>1&&(a=n[1]);else{var d=n[0];i=e.slice(d.length),s&&(a=n[1])}if(s){var c=e.indexOf(n[1]);e.slice(0,c)===t.numberingPlan.nationalPrefix()&&(o=t.numberingPlan.nationalPrefix())}else o=n[0];return{nationalNumber:i,nationalPrefix:o,carrierCode:a}}}return{nationalNumber:e}}function _a(e,t){var r=Ta(e,t),n=r.carrierCode,i=r.nationalNumber;return i!==e&&(la(e,t.nationalNumberPattern())&&!la(i,t.nationalNumberPattern())||t.possibleLengths()&&!function(e,t){switch(aa(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(i,t))?{nationalNumber:e}:{nationalNumber:i,carrierCode:n}}function Sa(e,t,r,n){var i=t?qi(t,n):r;if(0===e.indexOf(i)){(n=new Ui(n)).selectNumberingPlan(t,r);var a=e.slice(i.length),o=_a(a,n).nationalNumber,l=_a(e,n).nationalNumber;if(!la(l,n.nationalNumberPattern())&&la(o,n.nationalNumberPattern())||"TOO_LONG"===aa(l,n))return{countryCallingCode:i,number:a}}return{number:e}}function Na(e,t,r,n){if(!e)return{};if("+"!==e[0]){var i,a=ka(e,t,r,n);if(!a||a===e){if(t||r){var o=Sa(e,t,r,n),l=o.countryCallingCode,s=o.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:s}}return{number:e}}i=!0,e="+"+a}if("0"===e[1])return{};n=new Ui(n);for(var d=2;d-1<=3&&d<=e.length;){var c=e.slice(1,d);if(n.hasCallingCode(c))return n.selectNumberingPlan(c),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:e.slice(d)};d++}return{}}function Ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Pa(e,t){var r=t.countries,n=t.defaultCountry,i=t.metadata;i=new Ui(i);for(var a,o=[],l=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ia(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ia(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(a=l()).done;){var s=a.value;if(i.country(s),i.leadingDigits()){if(e&&0===e.search(i.leadingDigits()))return s}else if(ca({phone:e,country:s},void 0,i.metadata)){if(!n||s===n)return s;o.push(s)}}if(o.length>0)return o[0]}function Oa(e,t){var r=t.nationalNumber,n=t.defaultCountry,i=t.metadata,a=i.getCountryCodesForCallingCode(e);return a?1===a.length?a[0]:Pa(r,{countries:a,defaultCountry:n,metadata:i.metadata}):void 0}var Ra="(["+Ni+"]|[\\-\\.\\(\\)]?)",Ma=RegExp("^\\+"+Ra+"*["+Ni+"]"+Ra+"*$","g"),La=RegExp("^(["+Ni+"]+((\\-)*["+Ni+"])*\\.)*[a-zA-Z]+((\\-)*["+Ni+"])*\\.?$","g"),Da="tel:",Ua=";phone-context=",Fa=RegExp("[++"+Ni+"]"),Wa=RegExp("[^"+Ni+"#]+$");function Ba(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ga(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ba(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ha(e){return(Ha="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function za(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ja(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function qa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Va(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qa(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qa(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ya(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ka(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ka(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Za(){var e=function(e){var t,r,n,i=function(e){if(Array.isArray(e))return e}(t=Array.prototype.slice.call(e))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),4!==a.length);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw i}}return a}}(t)||function(e,t){if(e){if("string"==typeof e)return ja(e,4);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ja(e,4)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],o=i[1],l=i[2],s=i[3];if("string"!=typeof a)throw TypeError("A text for parsing must be a string.");if(o&&"string"!=typeof o){if("object"!==Ha(o))throw Error("Invalid second argument: ".concat(o));l?(r=o,n=l):n=o}else s?(r=l,n=s):(r=void 0,n=l),o&&(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?za(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):za(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({defaultCountry:o},r));return{text:a,options:r,metadata:n}}(arguments),t=e.text,r=e.options,n=e.metadata,i=function(e,t,r){var n;t&&t.defaultCountry&&(n=t.defaultCountry,!r.countries.hasOwnProperty(n))&&(t=Va(Va({},t),{},{defaultCountry:void 0}));try{return function(e,t,r){if(t=t||{},r=new Ui(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry)){if(t.v2)throw new Si("INVALID_COUNTRY");throw Error("Unknown country: ".concat(t.defaultCountry))}var n,i=function(e,t,r){var n=function(e,t){var r,n=t.extractFormattedPhoneNumber,i=function(e){var t=e.indexOf(Ua);if(t<0)return null;var r=t+15;if(r>=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}(e);if(null!==i&&(0===i.length||!Ma.test(i)&&!La.test(i)))throw new Si("NOT_A_NUMBER");if(null===i)r=n(e)||"";else{r="","+"===i.charAt(0)&&(r+=i);var a,o=e.indexOf(Da);a=o>=0?o+4:0;var l=e.indexOf(Ua);r+=e.substring(a,l)}var s=r.indexOf(";isub=");if(s>0&&(r=r.substring(0,s)),""!==r)return r}(e,{extractFormattedPhoneNumber:function(e){return function(e,t,r){if(e){if(e.length>250){if(r)throw new Si("TOO_LONG");return}if(!1===t)return e;var n=e.search(Fa);if(!(n<0))return e.slice(n).replace(Wa,"")}}(e,r,t)}});if(!n)return{};if(!(n.length>=2&&Qi.test(n)))return Zi.test(n)?{error:"TOO_SHORT"}:{};var i=function(e){var t=e.search(Ji);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(Ji),i=1;i<n.length;){if(n[i])return{number:r,ext:n[i]};i++}}(n);return i.ext?i:{number:n}}(e,t.v2,t.extract),a=i.number,o=i.ext,l=i.error;if(!a){if(t.v2){if("TOO_SHORT"===l)throw new Si("TOO_SHORT");throw new Si("NOT_A_NUMBER")}return{}}var s=function(e,t,r,n){var i,a=Na(ia(e),t,r,n.metadata),o=a.countryCallingCodeSource,l=a.countryCallingCode,s=a.number;if(l)n.selectNumberingPlan(l);else{if(!s||!t&&!r)return{};n.selectNumberingPlan(t,r),t&&(i=t),l=r||qi(t,n.metadata)}if(!s)return{countryCallingCodeSource:o,countryCallingCode:l};var d=_a(ia(s),n),c=d.nationalNumber,u=d.carrierCode,h=Oa(l,{nationalNumber:c,defaultCountry:t,metadata:n});return h&&(i=h,"001"===h||n.country(i)),{country:i,countryCallingCode:l,countryCallingCodeSource:o,nationalNumber:c,carrierCode:u}}(a,t.defaultCountry,t.defaultCallingCode,r),d=s.country,c=s.nationalNumber,u=s.countryCallingCode,h=s.countryCallingCodeSource,p=s.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new Si("INVALID_COUNTRY");return{}}if(!c||c.length<2){if(t.v2)throw new Si("TOO_SHORT");return{}}if(c.length>17){if(t.v2)throw new Si("TOO_LONG");return{}}if(t.v2){var m=new $a(u,c,r.metadata);return d&&(m.country=d),p&&(m.carrierCode=p),o&&(m.ext=o),m.__countryCallingCodeSource=h,m}var f=!!(t.extended?r.hasSelectedNumberingPlan():d)&&la(c,r.nationalNumberPattern());return t.extended?{country:d,countryCallingCode:u,carrierCode:p,valid:f,possible:!!f||!(!0!==t.extended||!r.possibleLengths()||!oa(c,r)),phone:c,ext:o}:f?(n={country:d,phone:c},o&&(n.ext=o),n):{}}(e,Ga(Ga({},t),{},{v2:!0}),r)}catch(e){if(!(e instanceof Si))throw e}}(t,r=Ya(Ya({},r),{},{extract:!1}),n);return i&&i.isPossible()||!1}var Xa=function(){var e;function t(e){var r=e.onCountryChange,n=e.onCallingCodeChange;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.onCountryChange=r,this.onCallingCodeChange=n}return e=[{key:"reset",value:function(e){var t=e.country,r=e.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,r)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"update",value:function(e){for(var t=0,r=Object.keys(e);t<r.length;t++){var n=r[t];this[n]=e[n]}}},{key:"initCountryAndCallingCode",value:function(e,t){this.setCountry(e),this.setCallingCode(t)}},{key:"setCountry",value:function(e){this.country=e,this.onCountryChange(e)}},{key:"setCallingCode",value:function(e){this.callingCode=e,this.onCallingCodeChange(e,this.country)}},{key:"startInternationalNumber",value:function(e,t){this.international=!0,this.initCountryAndCallingCode(e,t)}},{key:"appendDigits",value:function(e){this.digits+=e}},{key:"appendNationalSignificantNumberDigits",value:function(e){this.nationalSignificantNumber+=e}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function Qa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ja=/x/;function eo(e,t){if(t<1)return"";for(var r="";t>1;)1&t&&(r+=e),t>>=1,e+=e;return r+e}function to(e,t){return")"===e[t]&&t++,function(e){for(var t=[],r=0;r<e.length;)"("===e[r]?t.push(r):")"===e[r]&&t.pop(),r++;var n=0,i="";t.push(e.length);for(var a=0;a<t.length;a++){var o=t[a];i+=e.slice(n,o),n=o+1}return i}(e.slice(0,t))}function ro(e,t,r){var n=r.metadata,i=r.useNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix,o=ma(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:i,metadata:n});if(i||(e.nationalPrefix?o=e.nationalPrefix+a(t)+o:e.complexPrefixBeforeNationalSignificantNumber&&(o=e.complexPrefixBeforeNationalSignificantNumber+" "+o)),ra(o)===e.getNationalDigits())return o}var no=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t)}return e=[{key:"parse",value:function(e){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(e),1!==this.context.length)throw Error("Non-finalized contexts left when pattern parse ended");var t=this.context[0],r=t.branches,n=t.instructions;if(r)return{op:"|",args:r.concat([oo(n)])};if(0===n.length)throw Error("Pattern is required");return 1===n.length?n[0]:n}},{key:"startContext",value:function(e){this.context.push(e)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(e){if(!e)throw Error("Pattern is required");var t=e.match(ao);if(t){var r=t[1],n=e.slice(0,t.index),i=e.slice(t.index+r.length);switch(r){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw Error('No instructions found after "|" operator in an "or" group');var a=this.getContext().branches;a.push(oo(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:a});break;case"|":if(!this.getContext().or)throw Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(oo(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:function(e){for(var t=[],r=0;r<e.length;){if("-"===e[r]){if(0===r||r===e.length-1)throw Error("Couldn't parse a one-of set pattern: ".concat(e));for(var n=e[r-1].charCodeAt(0)+1,i=e[r+1].charCodeAt(0)-1,a=n;a<=i;)t.push(String.fromCharCode(a)),a++}else t.push(e[r]);r++}return t}(n)});break;default:throw Error("Unknown operator: ".concat(r))}i&&this.parsePattern(i)}else{if(io.test(e))throw Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""))}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),io=/[\(\)\[\]\?\:\|]/,ao=RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function oo(e){return 1===e.length?e[0]:e}function lo(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return so(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return so(e,void 0)}}(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function so(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var co=function(){var e;function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.matchTree=(new no).parse(e)}return e=[{key:"match",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!e)throw Error("String is required");var r=function e(t,r,n){if("string"==typeof r){var i=t.join("");return 0===r.indexOf(i)?t.length===r.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===i.indexOf(r)?n&&t.length>r.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,r.length)}:void 0}if(Array.isArray(r)){for(var a=t.slice(),o=0;o<r.length;){var l=e(a,r[o],n&&o===r.length-1);if(!l)return;if(l.overflow)return l;if(!l.match){if(l.partialMatch)return{partialMatch:!0};throw Error("Unsupported match result:\n".concat(JSON.stringify(l,null,2)))}if(0===(a=a.slice(l.matchedChars.length)).length)return o===r.length-1?{match:!0,matchedChars:t}:{partialMatch:!0};o++}return n?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-a.length)}}switch(r.op){case"|":for(var s,d,c=lo(r.args);!(d=c()).done;){var u=e(t,d.value,n);if(u){if(u.overflow)return u;if(u.match)return{match:!0,matchedChars:u.matchedChars};if(!u.partialMatch)throw Error("Unsupported match result:\n".concat(JSON.stringify(u,null,2)));s=!0}}return s?{partialMatch:!0}:void 0;case"[]":for(var h,p=lo(r.args);!(h=p()).done;){var m=h.value;if(t[0]===m)return 1===t.length?{match:!0,matchedChars:t}:n?{overflow:!0}:{match:!0,matchedChars:[m]}}return;default:throw Error("Unsupported instruction tree: ".concat(r))}}(e.split(""),this.matchTree,!0);if(r&&r.match&&delete r.matchedChars,!r||!r.overflow||t)return r}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function uo(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ho(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ho(e,void 0)}}(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ho(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var po=eo("9",15),mo=/[- ]/,fo=RegExp("["+Ii+"]*\\$1["+Ii+"]*(\\$\\d["+Ii+"]*)*$"),go=function(){var e;function t(e){e.state;var r=e.metadata;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.metadata=r,this.resetFormat()}return e=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(e,t){this.resetFormat(),e?(this.isNANP="1"===e.callingCode(),this.matchingFormats=e.formats(),t.nationalSignificantNumber&&this.narrowDownMatchingFormats(t)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(e,t){var r=this;if("IS_POSSIBLE"===aa(t.nationalSignificantNumber,this.metadata))for(var n,i=uo(this.matchingFormats);!(n=i()).done;){var a=n.value,o=function(e,t,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return function(e,t,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,a=r.getSeparatorAfterNationalPrefix;if(e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode,i(t)){var o=ro(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:a,metadata:n});if(o)return o}return ro(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:a,metadata:n})}(e,t,{metadata:n,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:a})}(t,a,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(e){return r.shouldTryNationalPrefixFormattingRule(e,{international:t.international,nationalPrefix:t.nationalPrefix})},getSeparatorAfterNationalPrefix:function(e){return r.getSeparatorAfterNationalPrefix(e)}});if(o)return this.resetFormat(),this.chosenFormat=a,this.setNationalNumberTemplate(o.replace(/\d/g,"x"),t),this.populatedNationalNumberTemplate=o,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf("x"),o}return this.formatNationalNumberWithNextDigits(e,t)}},{key:"formatNationalNumberWithNextDigits",value:function(e,t){var r=this.chosenFormat,n=this.chooseFormat(t);if(n)return n===r?this.formatNextNationalNumberDigits(e):this.formatNextNationalNumberDigits(t.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(e){var t=this,r=e.nationalSignificantNumber,n=e.nationalPrefix,i=e.international,a=r.length-3;a<0&&(a=0),this.matchingFormats=this.matchingFormats.filter((function(e){return t.formatSuits(e,i,n)&&t.formatMatches(e,r,a)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(e,t,r){return!(r&&!e.usesNationalPrefix()&&!e.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!t&&!r&&e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(e,t,r){var n=e.leadingDigitsPatterns().length;if(0===n)return!0;r=Math.min(r,n-1);var i=e.leadingDigitsPatterns()[r];if(t.length<3)try{return void 0!==new co(i).match(t,{allowOverflow:!0})}catch(e){return console.error(e),!0}return new RegExp("^(".concat(i,")")).test(t)}},{key:"getFormatFormat",value:function(e,t){return t?e.internationalFormat():e.format()}},{key:"chooseFormat",value:function(e){for(var t,r,n=uo(this.matchingFormats.slice());!(r=n()).done&&"break"!=(t=r.value,this.chosenFormat===t?"break":fo.test(this.getFormatFormat(t,e.international))?this.createTemplateForFormat(t,e)?(this.chosenFormat=t,"break"):(this.matchingFormats=this.matchingFormats.filter((function(e){return e!==t})),"continue"):"continue"););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(e,t){if(!(e.pattern().indexOf("|")>=0)){var r=this.getTemplateForFormat(e,t);return r?(this.setNationalNumberTemplate(r,t),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&mo.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var r=e.IDDPrefix,n=e.missingPlus;return r?t&&!1===t.spacing?r:r+" ":n?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,r=0,n=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";r<n.length+e.getDigitsWithoutInternationalPrefix().length;)t=this.template.indexOf("x",t+1),r++;return to(this.template,t+1)}}},{key:"setNationalNumberTemplate",value:function(e,t){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,t.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g,"x")+eo("x",t.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,t){var r=t.nationalSignificantNumber,n=t.international,i=t.nationalPrefix,a=t.complexPrefixBeforeNationalSignificantNumber,o=e.pattern();o=o.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");var l=po.match(o)[0];if(!(r.length>l.length)){var s=RegExp("^"+o+"$"),d=r.replace(/\d/g,"9");s.test(d)&&(l=d);var c,u=this.getFormatFormat(e,n);if(this.shouldTryNationalPrefixFormattingRule(e,{international:n,nationalPrefix:i})){var h=u.replace(pa,e.nationalPrefixFormattingRule());if(ra(e.nationalPrefixFormattingRule())===(i||"")+ra("$1")&&(u=h,c=!0,i))for(var p=i.length;p>0;)u=u.replace(/\d/,"x"),p--}var m=l.replace(new RegExp(o),u).replace(/9/g,"x");return c||(a?m=eo("x",a.length)+" "+m:i&&(m=eo("x",i.length)+this.getSeparatorAfterNationalPrefix(e)+m)),n&&(m=ha(m)),m}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,r){for(var n,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Qa(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qa(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.split(""));!(n=i()).done;){var a=n.value;if(0>e.slice(t+1).search(Ja))return;t=e.search(Ja),e=e.replace(Ja,a)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(t)return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],to(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var r=t.international,n=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var i=e.usesNationalPrefix();if(i&&n||!i&&!r)return!0}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function yo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wo(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var vo=RegExp("^["+Ii+Ni+"]+$","i"),Co="(?:[++]["+Ii+Ni+"]*|["+Ii+Ni+"]+)",bo=RegExp("[^"+Ii+Ni+"]+.*$"),Eo=/[^\d\[\]]/,$o=function(){var e;function t(e){var r=e.defaultCountry,n=e.defaultCallingCode,i=e.metadata,a=e.onNationalSignificantNumberChange;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=i,this.onNationalSignificantNumberChange=a}return e=[{key:"input",value:function(e,t){var r,n,i,a,o,l=(i=(n=yo("+"===(r=function(e){var t,r=e.search(Co);if(!(r<0))return"+"===(e=e.slice(r))[0]&&(t=!0,e=e.slice(1)),e=e.replace(bo,""),t&&(e="+"+e),e}(e)||"")[0]?[r.slice(1),!0]:[r],2))[0],a=n[1],vo.test(i)||(i=""),[i,a]),s=yo(l,2),d=s[0],c=s[1],u=ra(d);return c&&(t.digits||(t.startInternationalNumber(),u||(o=!0))),u&&this.inputDigits(u,t),{digits:u,justLeadingPlus:o}}},{key:"inputDigits",value:function(e,t){var r=t.digits,n=r.length<3&&r.length+e.length>=3;if(t.appendDigits(e),n&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),(function(e){return t.update(e)}))}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,r=e.callingCode;return t&&!r}},{key:"extractCountryCallingCode",value:function(e){var t=Na("+"+e.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode,n=t.number;if(r)return e.setCallingCode(r),e.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&Eo.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var r=Ta(e,this.metadata),n=r.nationalPrefix,i=r.nationalNumber,a=r.carrierCode;if(i!==e)return this.onExtractedNationalNumber(n,a,i,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,r){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,r);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=Ta(e,this.metadata),i=n.nationalPrefix,a=n.nationalNumber,o=n.carrierCode;if(a!==t)return this.onExtractedNationalNumber(i,o,a,e,r),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,r,n,i){var a,o,l=n.lastIndexOf(r);if(l>=0&&l===n.length-r.length){o=!0;var s=n.slice(0,l);s!==e&&(a=s)}i({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:r,nationalSignificantNumberMatchesInput:o,complexPrefixBeforeNationalSignificantNumber:a}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,(function(t){return e.update(t)}))||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,r=e.IDDPrefix,n=e.digits;if(e.nationalSignificantNumber,!t&&!r){var i=ka(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==i&&i!==n?(e.update({IDDPrefix:n.slice(0,n.length-i.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=Sa(e.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode;if(t.number,r)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:r}),!0}}},{key:"startInternationalNumber",value:function(e,t){var r=t.country,n=t.callingCode;e.startInternationalNumber(r,n),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),(function(t){return e.update(t)}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function xo(e){return(xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ko=function(){var e;function t(e,r){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.metadata=new Ui(r);var n,i=function(e){if(Array.isArray(e))return e}(n=this.getCountryAndCallingCode(e))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(a.push(n.value),2!==a.length);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw i}}return a}}(n)||function(e,t){if(e){if("string"==typeof e)return Ao(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ao(e,2)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],o=i[1];this.defaultCountry=a,this.defaultCallingCode=o,this.reset()}return e=[{key:"getCountryAndCallingCode",value:function(e){var t,r;return e&&("object"===xo(e)?(t=e.defaultCountry,r=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),[t,r]}},{key:"input",value:function(e){var t,r=this.parser.input(e,this.state),n=r.digits;if(r.justLeadingPlus)this.formattedOutput="+";else if(n){if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(t=this.formatter.format(n,this.state)),void 0===t&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var i=this.state.getNationalDigits();i&&(t=this.formatter.format(i,this.state))}this.formattedOutput=t?this.getFullNumber(t):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var e=this;return this.state=new Xa({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,r){e.metadata.selectNumberingPlan(r,t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new go({state:this.state,metadata:this.metadata}),this.parser=new $o({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){return this.state.country}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(e){if(this.isInternational()){var t,r=this.state.callingCode;return t=r?e?"".concat(r," ").concat(e):r:"".concat(this.state.getDigitsWithoutInternationalPrefix()),this.formatter.getInternationalPrefixBeforeCountryCallingCode(this.state,{spacing:!!t})+t}return e}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.complexPrefixBeforeNationalSignificantNumber,n=e.nationalPrefix,i=t,a=r||n;return a&&(i=a+i),i}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(e?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,"x")}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(Oa(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,r=e.callingCode,n=e.country,i=e.nationalSignificantNumber;if(t)return this.isInternational()?r?"+"+r+i:"+"+t:n||r?"+"+(n?this.metadata.countryCallingCode():r)+i:void 0}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.carrierCode,n=e.callingCode,i=this._getCountry();if(t&&(i||n)){if(i&&i===this.defaultCountry){var a=new Ui(this.metadata.metadata);a.selectNumberingPlan(i);var o=a.numberingPlan.callingCode(),l=this.metadata.getCountryCodesForCallingCode(o);if(l.length>1){var s=Pa(t,{countries:l,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});s&&(i=s)}}var d=new $a(i||n,t,this.metadata.metadata);return r&&(d.carrierCode=r),d}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function To(e){return new Ui(e).getCountries()}function _o(e,t,r){if(t[e])return new $a(e,t[e],r)}function So(e){return ko.call(this,e,Ci)}function No(){return bi(qi,arguments)}So.prototype=Object.create(ko.prototype,{}),So.prototype.constructor=So;let Io=(e,t)=>function(){return bi(Za,arguments)}(String(e),t),Po=(e,t)=>`+${No(t)} ${e}`,Oo=e=>`*${e.replaceAll("-","").slice(-4)}`,Ro=function(){return bi(To,arguments)}().map((e=>({code:e,callCode:No(e)})));const Mo="/api/v1/sessions",Lo="/api/v1/sessions/logout",Do="/api/v1/sessions/fork/recover",Uo="/api/v1/oauth/init",Fo="/api/v1/oauth/authenticate",Wo="/api/v1/oauth/link",Bo="/api/v1/analytics_events";class Go{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/custom_jwt_account/authenticate",{token:this.meta.token});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw A(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}}class Ho{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{let e=await this.api.post("/api/v1/passwordless/authenticate",{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw A(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new x("Email and email code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless/link",{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw A(e)}}async sendCodeEmail(e,t){if(!this.api)throw new x("Auth flow has no API instance");if(e&&(this.meta.email=e),t&&(this.meta.captchaToken=t),!this.meta.email)throw new x("Email must be set when initialzing authentication.");try{return await this.api.post("/api/v1/passwordless/init",{email:this.meta.email,token:this.meta.captchaToken})}catch(e){throw A(e)}}constructor(e,t,r=!1){this.meta={email:e,captchaToken:t,disableSignup:r}}}class zo extends Ho{async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new x("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post("/api/v1/passwordless/update",{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw A(e)}}constructor(e,t,r){super(t,r),this.meta={email:t,captchaToken:r,oldAddress:e,disableSignup:!1}}}const jo=e=>{let t;try{t=new URL(e).hostname}catch(e){return}for(let[e,r]of Object.entries(qo))if(t.includes(r.hostname))return{walletClientType:e,entry:r}},qo={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function Vo(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}let Ko="WALLETCONNECT_DEEPLINK_CHOICE";function Yo(e){return e.startsWith("http://")||e.startsWith("https://")}function Zo(e,t){if(Yo(e))return Xo(e,t);let r=e;return r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(t)}`,href:r}}function Xo(e,t){if(!Yo(e))return Zo(e,t);let r=e;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(t)}`,href:r}}function Qo(e,t){window.open(e,t,"noreferrer noopener")}class Jo{execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}class el{get meta(){return this._meta}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.channelToken)throw new x("Auth flow must be initialized first");try{let e=await this.api.post("/api/v1/farcaster/authenticate",{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new x("No response from authentication");return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw A(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{return await this.api.post("/api/v1/farcaster/link",{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw A(e)}}async _startChannelOnce(){if(!this.api)throw new x("Auth flow has no API instance");let e=await this.api.post("/api/v1/farcaster/init",{token:this.captchaToken});C&&!b&&e.connect_uri&&Qo(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new x("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.channelToken)throw new x("Auth flow must be initialized first");let e=await this.api.get("/api/v1/farcaster/status",{headers:{"farcaster-channel-token":this.meta.channelToken}});return"completed"===e.state&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,t=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new Jo(this._startChannelOnce.bind(this)),this.pollForReady=new Jo(this._pollForReady.bind(this)),this._meta.disableSignup=t}}function tl(e){return crypto.getRandomValues(new Uint8Array(e))}class rl{getOrCreateGuestCredential(e){let t=B(e);if(je()){if(qe.get(t))return qe.get(t);{let e=W.encode(tl(32));return qe.put(t,e),e}}return W.encode(tl(32))}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/guest/authenticate",{guest_credential:this.meta.guestCredential});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw A(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}}function nl(){return W.encode(tl(36))}function il(){return nl()}async function al(e,t="S256"){if("S256"!=t)return e;{let t=await async function(e){let t=(new TextEncoder).encode(e);return new Uint8Array(await crypto.subtle.digest("SHA-256",t))}(e);return W.encode(t)}}function ol(){return!!qe.get(H)}class ll{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if("undefined"===this.meta.authorizationCode)throw new x("User denied confirmation during OAuth flow");let e=function(){let e=qe.get(G);if(!e)throw new x("Authentication error.");return e}();try{let t=await this.api.post(Fo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return qe.del(G),qe.del(H),qe.del(z),{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user,oauth_tokens:t.oauth_tokens}}catch(e){let t=A(e);if(t.privyErrorCode)throw new x(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new x("Invalid code during oauth flow.",void 0,k.OAUTH_USER_DENIED);throw new x("Invalid code during OAuth flow.",void 0,k.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if("undefined"===this.meta.authorizationCode)throw new x("User denied confirmation during OAuth flow");let e=qe.get(G);if(!e)throw new x("Authentication error.");try{let t=await this.api.post(Wo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return qe.del(G),t}catch(e){throw A(e)}}async getAuthorizationUrl(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.provider)throw new x("Provider must be set when initializing OAuth authentication.");let e=nl();qe.put(G,e);let t=il();qe.put(j,t);let r=await al(e);this.meta.headless&&qe.put(H,!0),this.meta.disableSignup&&qe.put(z,!0);try{return await this.api.post(Uo,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:t})}catch(e){throw A(e)}}constructor(e){let t="boolean"==typeof e.headless?e.headless:ol();this.meta={...e,headless:t}}}function sl(e){return e.charAt(0).toUpperCase()+e.slice(1)}const dl=({style:r,...n})=>e("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...r},...n,children:[t("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),t("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]}),cl=({style:r,...n})=>e("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...r},...n,children:[t("g",{clipPath:"url(#clip0)",children:t("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),t("defs",{children:t("clipPath",{id:"clip0",children:t("rect",{width:"71",height:"55",fill:"white"})})})]}),ul=({style:e,...r})=>t("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...r,children:t("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})}),hl=({style:e})=>t(sn,{style:{color:"var(--privy-color-error)",...e}}),pl=({style:r,...n})=>e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...r},...n,children:[t("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),t("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),t("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),t("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});function ml(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...r,children:[e("defs",{children:[e("linearGradient",{id:"b",children:[t("stop",{offset:"0",stopColor:"#3771c8"}),t("stop",{stopColor:"#3771c8",offset:".128"}),t("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),e("linearGradient",{id:"a",children:[t("stop",{offset:"0",stopColor:"#fd5"}),t("stop",{offset:".1",stopColor:"#fd5"}),t("stop",{offset:".5",stopColor:"#ff543e"}),t("stop",{offset:"1",stopColor:"#c837ab"})]}),t("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),t("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),t("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),t("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),t("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}function fl({style:e,...r}){return t("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...r,children:t("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:t("g",{transform:"scale(5.12,5.12)",children:t("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}function gl(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...r,children:[t("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),t("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}function yl(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...r,children:[t("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),t("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),t("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}const wl=({style:e,...r})=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...r,children:t("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});let vl={google:{name:"Google",component:pl},discord:{name:"Discord",component:cl},github:{name:"Github",component:ul},linkedin:{name:"LinkedIn",component:fl},twitter:{name:"Twitter",component:wl},spotify:{name:"Spotify",component:gl},instagram:{name:"Instagram",component:ml},tiktok:{name:"Tiktok",component:yl},apple:{name:"Apple",component:dl}};const Cl=e=>e in vl?vl[e]:{name:"Unknown",component:hl};function bl(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),n=e.get("privy_oauth_provider");if(!t||!r||!n)return{inProgress:!1};let i=!1;try{i=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:n,headless:ol(),popupFlow:null!==window.opener&&i,disableSignup:!!qe.get(z)}}function El(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),qe.del(j),window.history.replaceState({},"",e)}class $l{async initAuthenticationFlow(){if(!this.api)throw new x("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new x("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let e=await import("@simplewebauthn/browser");if(!this.api)throw new x("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new x("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let t=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options));this.meta.setPasskeyAuthState?.({status:"submitting-response"});let r=await this.api.post("/api/v1/passkeys/authenticate",{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(t)});return{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(e){if("NotAllowedError"===e.name)throw new x("Passkey request timed out or rejected by user.",void 0,k.PASSKEY_NOT_ALLOWED);throw A(e)}}async link(){let e=await import("@simplewebauthn/browser");if(!this.api)throw new x("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new x("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let t=this.meta.initLinkResponse.options,r=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(t));return await this.api.post("/api/v1/passkeys/link",{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(r)})}catch(e){if("NotAllowedError"===e.name)throw new x("Passkey request timed out or rejected by user.",void 0,k.PASSKEY_NOT_ALLOWED);throw A(e)}}async _initAuthenticateOnce(){if(!this.api)throw new x("Auth flow has no API instance");return await this.api.post("/api/v1/passkeys/authenticate/init",{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new x("Auth flow has no API instance");return await this.api.post("/api/v1/passkeys/link/init",{})}_transformInitLinkOptionsToCamelCase(e){return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map((e=>({type:e.type,alg:e.alg}))),timeout:e.timeout,excludeCredentials:e.exclude_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports}))),authenticatorSelection:{authenticatorAttachment:e.authenticator_selection?.authenticator_attachment,requireResidentKey:e.authenticator_selection?.require_resident_key,residentKey:e.authenticator_selection?.resident_key,userVerification:e.authenticator_selection?.user_verification},attestation:e.attestation,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props?.rk,hmacCreateSecret:e.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){return{challenge:e.challenge,allowCredentials:e.allow_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports})))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor(e,t){this.initAuthenticateOnce=new Jo(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Jo(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:t}}}const xl=({address:e,chainId:t,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account:\n${e}\n\nBy signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: ${t}\nNonce: ${r}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`;class Al{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new x("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign(),r=await this.client.authenticateWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user}}catch(e){throw A(e)}}async link(){if(!this.client)throw new x("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw A(e)}}async sign(){if(!this.client)throw new x("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new x("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new x("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new x("SiweFlow has no client instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=xl({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}constructor(e,t,r,n=!1){this._meta={disableSignup:!1},this.getNonceOnce=new Jo(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=t,this._meta.disableSignup=n}}class kl{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new x("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign(),r=await this.client.authenticateWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user}}catch(e){throw A(e)}}async link(){if(!this.client)throw new x("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw A(e)}}async sign(){if(!this.client)throw new x("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new x("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new x("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new x("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new x("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=(({address:e,nonce:t})=>`${window.location.host} wants you to sign in with your Solana account:\n${e}\n\nYou are proving you own ${e}.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: mainnet\nNonce: ${t}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`)({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,t,r,n=!1){this._meta={disableSignup:!1},this.getNonceOnce=new Jo(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=t,this._meta.disableSignup=n}}class Tl{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{let e=await this.api.post("/api/v1/passwordless_sms/authenticate",{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw A(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new x("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless_sms/link",{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw A(e)}}async sendSmsCode(e,t){if(!this.api)throw new x("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),t&&(this.meta.captchaToken=t),!this.meta.phoneNumber)throw new x("phone nNumber must be set when initialzing authentication.");try{return await this.api.post("/api/v1/passwordless_sms/init",{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(e){throw A(e)}}constructor(e,t,r=!1){this.meta={phoneNumber:e,captchaToken:t,disableSignup:r}}}class _l extends Tl{async link(){if(!this.api)throw new x("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new x("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post("/api/v1/passwordless_sms/update",{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw A(e)}}constructor(e,t,r){super(t,r),this.meta={phoneNumber:t,captchaToken:r,oldPhoneNumber:e,disableSignup:!1}}}class Sl{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/telegram/authenticate",{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw A(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{return await this.api.post("/api/v1/telegram/link",{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw A(e)}}constructor(e,t=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=t}}function Nl(e){let t={detail:"",retryable:!1};return e?.privyErrorCode===k.LINKED_TO_ANOTHER_USER&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode===k.DISALLOWED_LOGIN_METHOD&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode===k.INVALID_DATA&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===k.CANNOT_LINK_MORE_OF_TYPE&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===k.INVALID_CREDENTIALS&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===k.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===k.TOO_MANY_REQUESTS&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Il(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}const Pl=({style:r,...n})=>e("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),Ol=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"];class Rl{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new T(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((e=>{throw Zt(e)}))}constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new Xt,t=this.rpcTimeoutDuration)=>new Promise(((r,n)=>setTimeout((()=>{n(e)}),t))),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach((e=>{this.removeListener(e.eventName,e.listener)})),this.walletProvider=e,this._subscriptions.forEach((e=>{this.walletProvider?.on(e.eventName,e.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=t||q,this._subscriptions=[]}}let Ml=class extends Error{constructor(e,t,r){super(e),this.code=t,this.data=r}};class Ll extends Vt{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new Ml(`Invalid params for ${e.method}`,4200);let t=e.params[0];if(!await Tv()||!this.address)throw new Ml("Disconnected",4900);return(await Nv(t,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new Ml(`Invalid params for ${e.method}`,4200);if("string"==typeof e.params[0])t=e.params[0];else{if(!("chainId"in e.params[0])||"string"!=typeof e.params[0].chainId)throw new Ml(`Invalid params for ${e.method}`,4200);t=e.params[0].chainId}this.chainId=Number(t),this.provider=Ve(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",t)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let t=e.params[0],r=e.params[1];return await _v(t,void 0,r)}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let t=e.params[0],r="string"==typeof e.params[1]?JSON.parse(e.params[1]):e.params[1];return await Sv(Ke(r),void 0,t)}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let t={...e.params[0],chainId:Ye(this.chainId)};try{return await this.provider.send("eth_estimateGas",[t])}catch(e){console.warn(`Gas estimation failed with error: ${e}. Retrying gas estimation by omitting the 'from' address`);try{return delete t.from,await this.provider.send("eth_estimateGas",[t])}catch(t){throw console.warn(`Gas estimation failed with error: ${t} when omitting the 'from' address`),e}}}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Ye(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!(e=>Ol.includes(e))(e.method))return this.provider.send(e.method,e.params);{let t=await Tv();if(await Iv(),!t||!this.address)throw new Ml("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.rootAddress,accessToken:t,hdWalletIndex:this.walletIndex,request:{method:e.method,params:e.params}})).response.data}catch(e){throw console.error(e),new Ml("Disconnected",4900)}}}async connect(){let e=await Tv();if(!e||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:e})).address}catch(e){return console.error(e),null}}constructor({walletProxy:e,address:t,rootAddress:r,rpcConfig:n,chains:i,appId:a,chainId:o=1,walletIndex:l}){super(),this.walletProxy=e,this.address=t,this.rootAddress=r,this.chainId=o,this.rpcConfig=n,this.chains=i,this.provider=Ve(o,this.chains,n,{appId:a}),this.rpcTimeoutDuration=ls(n,"privy"),this.appId=a,this.walletIndex=l}}class Dl extends Rl{constructor(e){super(e,e.rpcTimeoutDuration)}}class Ul extends Rl{sendAsync(e,t){throw Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}constructor(e){super(e,e.rpcTimeoutDuration)}}let Fl;function Wl(e){return"ethereum"===e.chainType}function Bl(e){return"ethereum"===e.type}class Gl extends Qt{buildConnectedWallet(e,t,r,a){let o=async()=>!!this.wallets.find((t=>n(t.address)===n(e)));return{type:"ethereum",address:n(e),chainId:t,meta:r,imported:a,switchChain:async r=>{let i,a;if(!o)throw new T("Wallet is not currently connected.");let l=this.wallets.find((t=>n(t.address)===n(e)))?.chainId;if(!l)throw new T("Unable to determine current chainId.");if("number"==typeof r?(i=`0x${r.toString(16)}`,a=r):(i=r,a=Number(r)),l===Ze(i))return;let s=this.chains.find((e=>e.id===a));if(!s)throw new T(`Unsupported chainId: ${r}`);let d=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:i}]})};try{return await d()}catch(e){if(((e,t)=>"coinbase_wallet"===t?e.message.includes("addEthereumChain"):4902===e.code||e.message?.includes("4902"))(e,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:i,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[s.rpcUrls.default?.http[0]??""],blockExplorerUrls:[s.blockExplorers?.default.url??""]}]}),d();if("rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain"))throw new T(`Rainbow does not support the chainId ${t}`);throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:o,getEthereumProvider:async()=>{if(!await o())throw new T("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await o())throw new T("Wallet is not currently connected.");return new i(new Dl(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await o())throw new T("Wallet is not currently connected.");return new Ul(this.proxyProvider)},sign:async e=>{if(!await o())throw new T("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t,r=e;try{if(void 0===r){let e=await Xe((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,e),Array.isArray(e)&&(r=e)}}catch(e){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let i=r[0],a=n(i),o=[];if("privy"===this.walletClientType){let e=qe.get(V(a));this.chains.find((t=>t.id===Number(e)))||(qe.del(V(a)),e=null),t=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){console.warn(`Unable to switch embedded wallet to chain ID ${t} on initialization`)}}else try{let e=await Xe((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,e),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t=`0x${e.toString(16)}`}}catch(e){console.warn(`Failed to get chainId from provider, defaulting to ${K}`,e),t=K}let l=Ze(t);if(!o.find((e=>n(e.address)===a))){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};o.push(this.buildConnectedWallet(n(i),l,e,"embedded_imported"===this.connectorType))}ds(o,this.wallets)||(this.wallets=o,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt)).find((t=>e.find((e=>n(e)===n(t.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),new i(new Dl(this.proxyProvider)).getSigner().signMessage(e)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,r,n){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{this.wallets.forEach((t=>{t.chainId=Ze(e),"privy"===this.walletClientType&&qe.put(V(t.address),e)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=r,this.rpcConfig=n,this.rpcTimeoutDuration=ls(n,e),this.connected=!1,this.initialized=!1}}let Hl=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],zl=(e,t)=>e.makeWeb3Provider({options:t});class jl extends Gl{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Pl,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new T("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Zt(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType="smartWalletOnly"===e?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(zl(Fl,this.connectionOptions))}constructor(e,t,r,n,i,a){if(super("coinbase_wallet",e,t,r),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new Rl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=n.coinbaseWallet.connectionOptions??"all",this.walletClientType="smartWalletOnly"===this.connectionOptions?"coinbase_smart_wallet":"coinbase_wallet","coinbase_smart_wallet"===this.walletClientType&&(this.displayName="Coinbase Smart Wallet"),!Fl){let r=[t.id].concat(e.map((e=>e.id))),n="eoaOnly"!==this.connectionOptions?r.filter((e=>!Hl.includes(e))):[];n.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${n.join(", ")}`),Fl=new Kt({appName:i,appLogoUrl:a,appChainIds:r})}this.proxyProvider.setWalletProvider(zl(Fl,this.connectionOptions))}}class ql extends Gl{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Ye(e?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Qe,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:t,defaultChain:r,rpcConfig:n,imported:i,walletIndex:a}){super("privy",t,r,n),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=a,i&&(this.connectorType="embedded_imported"),this.subscribeListeners()}}const Vl=({style:e,...r})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...r,children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),Kl=({style:r,...n})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...r},...n,children:[t("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),t("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),t("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),t("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),t("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),t("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),t("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),t("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),t("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),t("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),t("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),t("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),t("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),Yl=({style:r,...n})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});function Zl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var Xl=0;class Ql extends Gl{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new T("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Zt(e)}}constructor(e,t,r,n,i){super(i||"unknown",e,t,r),this.connectorType="injected",this.proxyProvider=new Rl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=n;let a=n.provider;this.proxyProvider.setWalletProvider(a)}}var Jl="__private_"+Xl+++"__walletBranding";class es extends Gl{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Zl(this,Jl)[Jl]??{name:"Browser Extension",icon:Vl,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new T("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Zt(e)}}constructor(e,t,r,n,i){super(i??"unknown",e,t,r),Object.defineProperty(this,Jl,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new Rl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(n),"metamask"===i?Zl(this,Jl)[Jl]={name:"MetaMask",icon:Kl,id:"io.metamask"}:"phantom"===i&&(Zl(this,Jl)[Jl]={name:"Phantom",icon:Yl,id:"phantom"})}}class ts extends Ql{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{C||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new T("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Zt(e)}}}class rs extends Gl{get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${e}`)}constructor(e,t){super(e,[],t,{}),this.connectorType="null",this.proxyProvider=new Rl(void 0,q),this.connectorType=e}}class ns extends rs{get walletBranding(){return{name:"Phantom",icon:Yl,id:"phantom"}}constructor(e){super("phantom",e)}}const is=({style:r,...n})=>{let{app:i}=dr();return e("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"28",height:"28",rx:"3",fill:"dark"===i?.appearance.palette.colorScheme?"#3396ff":"#141414"}),t("g",{clipPath:"url(#clip0_1765_9946)",children:t("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),t("defs",{children:t("clipPath",{id:"clip0_1765_9946",children:t("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};class as extends Gl{async initialize(){let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){if(this.walletProvider?.session?.peer.metadata.url){let e=jo(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:t}=await import("@walletconnect/modal");this.modal=new t({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal((e=>{e.open||this.walletProvider?.session||!this.onQrModalClosed||this.onQrModalClosed()}))}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return"metamask"===this.walletClientType?{name:"MetaMask",icon:Kl,id:"io.metamask"}:{name:Je(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||is,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=qo[e],this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(Ko)}catch{}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise(((e,t)=>{this.onQrModalClosed=()=>{t(new Jt)},(async()=>{let t="",r=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(r?.length&&(t=r[0]),!t||""===t)throw new T("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let e=jo(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=ls(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(r),e()})().catch((e=>{t(e?Zt(e):new T("Unknown error during connection"))})).finally((()=>this.modal?.closeModal()))}))}disconnect(){this.walletProvider?.disconnect().then((()=>this.onDisconnect())).catch((()=>console.warn("Unable to disconnect Wallet Connect provider")))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let t of this.chains){let r=et(t.id,this.chains,this.rpcConfig,this.privyAppId);r&&(e[t.id]=r)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],r=this.chains.map((e=>e.id)),n=await or.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:r,optionalEvents:lr,optionalMethods:sr,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return n.on("display_uri",(e=>{if(n.signer.abortPairingAttempt(),C&&this.walletEntry){let{redirect:t,href:r}=function(e,t){let r=Vo(t);if(r.deepLink)return Zo(r.deepLink,e);if(r.universalLink)return Xo(r.universalLink,e);throw new x(`Unsupported wallet ${t.id}`)}(e,this.walletEntry);(function({href:e,name:t}){try{localStorage.setItem(Ko,JSON.stringify({href:e,name:t}))}catch{}})({href:r,name:this.walletEntry.displayName}),this.redirectUri=t;let n=function(e,t){let r=Vo(t);if(r.universalLink)return Xo(r.universalLink,e)}(e,this.walletEntry);n?.redirect&&(this.fallbackUniversalRedirectUri=n.redirect),Qo(t,"_self")}else this.modal?.openModal({uri:e,chains:[this.defaultChain.id]})})),n.on("connect",(()=>{if(this.modal?.closeModal(),n.session?.peer.metadata.url){let e=jo(n.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown"}})),n}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await(this.walletProvider?.enable())}constructor(e,t,r,n,i,a,o,l){super(l||"unknown",r,n,t),this.connectorType="wallet_connect_v2",this.privyAppId=a,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=t,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new Rl(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=qo[l],this.walletClientType=l)}}const os=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>qt(e))).map((e=>n(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length},ls=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||q;class ss extends Vt{get wallets(){let e=new Set,t=this.walletConnectors.flatMap((e=>e.wallets)).sort(((e,t)=>e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0)).filter((t=>{let r=`${t.address}${t.walletClientType}${t.connectorType}`;return!e.has(r)&&(e.add(r),!0)})),r=t.findIndex((e=>e.address===(this.activeWallet?this.activeWallet:"unknown")));return r>=0&&t.unshift(t.splice(r,1)[0]),t}async initialize(){if(this.initialized)return;qe.get(Y)&&(qe.getKeys().forEach((e=>{e.startsWith("walletconnect")&&qe.del(e)})),qe.del(Y));let e=tt(this.store,this.walletList,this.externalWalletConfig).then((e=>{e.forEach((({type:e,eip6963InjectedProvider:t,legacyInjectedProvider:r})=>{this.createEthereumWalletConnector("injected",e,{eip6963InjectedProvider:t,legacyInjectedProvider:r})}))}));this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector("coinbase_wallet","coinbase_wallet"),!rt()&&this.walletList.includes("phantom")&&this.createEthereumWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector("wallet_connect_v2","unknown"),this.externalWalletConfig.solana.connectors?.get().forEach(this.addSolanaWalletConnector),this.externalWalletConfig.solana.connectors?._setOnConnectorsUpdated?.((e=>{e?.forEach(this.addSolanaWalletConnector)})),await e,this.initialized=!0}findWalletConnector(e,t){return"wallet_connect_v2"===e?this.walletConnectors.filter(Wl).find((t=>t.connectorType===e))??null:this.walletConnectors.filter(Wl).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findSolanaWalletConnector(e,t){return this.walletConnectors.filter(er).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter((e=>"embedded"===e.connectorType))}onInitialized(e){e.wallets.forEach((e=>{let t=this.storedConnections.find((t=>t.address===e.address&&t.connectorType===e.connectorType&&t.walletClientType===e.walletClientType));t&&(e.connectedAt=t.connectedAt)})),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:e,rootWallet:t,embeddedWallets:r,defaultChain:n,appId:i}){for(let a of r){let r=this.findEmbeddedWalletConnectors().find((e=>e.walletIndex===a.walletIndex));if(r&&Wl(r))r.proxyProvider.walletProxy=e;else{let r=new ql({provider:new Ll({walletProxy:e,address:a.address,rootAddress:t.address,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:n.id,walletIndex:a.walletIndex}),chains:this.chains,defaultChain:n,rpcConfig:this.rpcConfig,imported:!1,walletIndex:a.walletIndex});this.addWalletConnector(r)}}}addImportedWalletConnector(e,t,r,n){let i=this.findWalletConnector("embedded_imported","privy");if(i&&Wl(i))i.proxyProvider.walletProxy=e;else{let i=new ql({provider:new Ll({walletProxy:e,rootAddress:t,address:t,walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:n,chainId:r.id}),chains:this.chains,walletIndex:0,defaultChain:r,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(i)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter((e=>"embedded"!==e.connectorType)),this.saveConnectionHistory(),this.storedConnections=cs(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1),this.saveConnectionHistory(),this.storedConnections=cs(),this.emit("walletsUpdated")}}async createEthereumWalletConnector(e,t,r){let n=this.findWalletConnector(e,t);if(n&&Wl(n))return n instanceof as&&n.resetConnection(t),n;let i=(()=>"injected"!==e?"coinbase_wallet"===e?new jl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):"phantom"===e?new ns(this.defaultChain):new as(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,t):"metamask"===t&&r?.eip6963InjectedProvider?new ts(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):"metamask"===t&&r?.legacyInjectedProvider?new es(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):"phantom"===t&&r?.legacyInjectedProvider?new es(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&"unknown_browser_extension"===t?new es(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new Ql(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,t):void 0)();return i&&this.addWalletConnector(i),i||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",(()=>this.onInitialized(e))),e.on("walletsUpdated",(()=>this.onWalletsUpdated(e))),e.initialize().catch((e=>{console.debug("Failed to initialize connector",e)}))}saveConnectionHistory(){let e=this.wallets.map((e=>({address:e.address,connectorType:e.connectorType,walletClientType:e.walletClientType,connectedAt:e.connectedAt})));qe.put(Z,e)}async activeWalletSign(e){let t=this.wallets,r=t.length>0?t[0]:null;return r&&Bl(r)?r.sign(e):null}setActiveWallet(e){this.activeWallet=n(e),this.emit("walletsUpdated")}constructor(e,t,r,n,i,a,o,l,s,d,c){super(),this.addSolanaWalletConnector=async e=>{this.findWalletConnector("solana_adapter",e.walletClientType)||this.addWalletConnector(e)},this.getEthereumProvider=()=>{let e=this.wallets[0],t=this.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new Rl},this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=r,this.chains=n,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=a,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=l,this.externalWalletConfig=s,this.privyAppName=d,this.privyAppLogo=c,this.storedConnections=cs()}}function ds(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=e[r],i=t[r];if(n?.address!==i?.address||n&&i&&Bl(n)&&Bl(i)&&n?.chainId!==i?.chainId||n?.connectorType!==i?.connectorType||n?.connectedAt!==i?.connectedAt||n?.walletClientType!==i?.walletClientType||n?.isConnected!==i?.isConnected||n?.linked!==i?.linked)return!1}return!0}const cs=()=>{let e=qe.get(Z);return e&&Array.isArray(e)&&e.map((e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e))).every(Boolean)?e:[]};let us=[Mo,Do,Lo,Bo];class hs{async get(e,t){try{return await this.baseFetch(e,t)}catch(e){throw A(e)}}async post(e,t,r){try{return await this.baseFetch(e,{method:"POST",...t?{body:t}:{},...r})}catch(e){throw A(e)}}async delete(e,t){try{return await this.baseFetch(e,{method:"DELETE",...t})}catch(e){throw A(e)}}constructor({appId:e,appClientId:t,client:r,defaults:n}){this.appId=e,this.appClientId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=X,this.client=r,this.defaults=n,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=mr.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:e,options:t})=>{let r=new Headers(t.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client",`react-auth:${this.sdkVersion}`);let n=us.includes(e.toString());if(!r.has("authorization")){let e=await this.client.getAccessToken({disableAutoRefresh:n});null!==e&&r.set("authorization",`Bearer ${e}`)}t.headers=r,t.retryDelay&&(t.retryDelay=3*t.retryDelay)},onRequestError:({error:e})=>{if(e instanceof DOMException&&"AbortError"===e.name)throw new _}})}}function ps(){return!(E&&window.location.origin.startsWith("http://localhost"))}class ms{static parse(e){try{return new ms(e)}catch(e){return null}}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=F.decodeJwt(e)}}class fs{get token(){try{let e=qe.get(Q);return"string"==typeof e?new ms(e).value:null}catch(e){return console.error(e),this.destroyLocalState(),null}}get refreshToken(){try{let e=qe.get(J);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}get forkedToken(){try{let e=qe.get(ee);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let t=qe.get(te(e));if("string"!=typeof t)return null;{let r=new ms(t);return r.isExpired()?(qe.del(te(e)),null):r.value}}catch(e){return console.error(e),null}}get mightHaveServerCookies(){try{let e=fr.get(re);return void 0!==e&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||"string"==typeof this.token&&"string"==typeof this.refreshToken&&this.refreshToken!==ne}hasRecoveryCredentials(){return"string"==typeof this.forkedToken}hasActiveToken(){let e=ms.parse(this.token);return null!==e&&!e.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,t){"string"==typeof t?qe.put(te(e),t):qe.del(te(e))}async _authenticate(e){try{let t=await e.authenticate(),{user:r,is_new_user:n,oauth_tokens:i}=t;this.handleTokenResponse(t);let a=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0,o=function(e){return e instanceof Ho?"email":e instanceof Tl?"sms":e instanceof Al?"siwe":e instanceof rl?"guest":e instanceof Go?"custom_auth":e instanceof ll?e.meta.provider:null}(e);return o&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:o,isNewUser:n}}),"siwe"===o&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}}),{user:nt(r),isNewUser:n,oAuthTokens:a}}catch(e){throw console.warn("Error authenticating session"),S(e)}}async _link(e){try{let t=await e.link(),r=t.oauth_tokens,n=r?{provider:r.provider,accessToken:r.access_token,accessTokenExpiresInSeconds:r.access_token_expires_in_seconds,refreshToken:r.refresh_token,refreshTokenExpiresInSeconds:r.refresh_token_expires_in_seconds,scopes:r.scopes}:void 0;return{user:nt(t),oAuthTokens:n}}catch(e){throw console.warn("Error linking account"),S(e)}}async _refresh(){if(!this.api)throw new x("Session has no API instance");if(!this.client)throw new x("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,t=this.refreshToken,r=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(e&&t||this.mightHaveServerCookies){let i={};e&&(i.authorization=`Bearer ${e}`),n=await this.api.post(Mo,t?{refresh_token:t}:{},{headers:i}),r&&this.clearForkedToken()}else{if(!r)return null;n=await this.api.post(Do,{refresh_token:r}),this.clearForkedToken()}return this.handleTokenResponse(n),nt(n.user)}catch(e){if(e instanceof N&&e.privyErrorCode===k.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw S(e)}}handleTokenResponse(e){e.session_update_action?"set"===e.session_update_action?(this.storeRefreshToken(e.refresh_token),this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token)):"clear"===e.session_update_action?this.destroyLocalState():"ignore"===e.session_update_action&&e.token&&(this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token)):(this.storeRefreshToken(e.refresh_token),this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token))}async _destroy(){try{await(this.api?.post(Lo,{refresh_token:this.refreshToken}))}catch(e){console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new x("Session has no API instance");let e=this.refreshToken;try{let t=await this.api.post("/api/v1/sessions/fork",{refresh_token:e});return this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.new_session_refresh_token}catch(e){throw S(e)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(e){if("string"==typeof e){let t=qe.get(Q);if(qe.put(Q,e),!this.client?.useServerCookies){let t=ms.parse(e)?.expiration;fr.set(ie,e,{sameSite:"Strict",secure:ps(),expires:t?new Date(1e3*t):void 0})}t!==e&&this.client?.onStoreToken?.(e)}else qe.del(Q),fr.remove(ie),this.client?.onDeleteToken?.()}storeRefreshToken(e){"string"==typeof e?(qe.put(J,e),this.client?.useServerCookies||fr.set(re,"t",{sameSite:"Strict",secure:ps(),expires:30})):(qe.del(J),fr.remove(ae),fr.remove(re))}storeIdentityToken(e){if(this.client?.useServerCookies)return;qe.put(oe,e);let t=ms.parse(e)?.expiration;fr.set(le,e,{sameSite:"Strict",secure:ps(),expires:t?new Date(1e3*t):void 0})}clearIdentityToken(){qe.del(oe),fr.remove(le)}clearForkedToken(){qe.del(ee)}constructor(){this.authenticateOnce=new Jo((async e=>this._authenticate(e))),this.linkOnce=new Jo((async e=>this._link(e))),this.refreshOnce=new Jo(this._refresh.bind(this)),this.destroyOnce=new Jo(this._destroy.bind(this)),this.forkSessionOnce=new Jo(this._forkSession.bind(this))}}let gs;var ys=0,ws="__private_"+ys+++"__getOrGenerateClientAnalyticsId";class vs{initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:l,appName:s}){this.connectors||(this.connectors=new ss(this.appId,e,t,r,n,i,a,o,l,s))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let e=new hs({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new x("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new x("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter((e=>"cross_app"===e.type)).forEach((e=>{this.storeProviderAccessToken(e.providerApp.id,null)}))}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post("/api/v1/mfa/passwordless_sms/init",{action:"verify"})}catch(e){throw A(e)}}async initMfaPasskeyVerification(){try{return(e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports})))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}))((await this.api.post("/api/v1/mfa/passkeys/init",{})).options)}catch(e){throw A(e)}}async acceptTerms(){try{let e=await this.api.post("/api/v1/users/me/accept_terms",{});return nt(e)}catch(e){throw S(e)}}async unlinkEmail(e){try{let t=await this.api.post("/api/v1/passwordless/unlink",{address:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkPhone(e){try{let t=await this.api.post("/api/v1/passwordless_sms/unlink",{phoneNumber:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkEthereumWallet(e){try{let t=await this.api.post("/api/v1/siwe/unlink",{address:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkSolanaWallet(e){try{let t=await this.api.post("/api/v1/siws/unlink",{address:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkOAuth(e,t){try{let r=await this.api.post("/api/v1/oauth/unlink",{provider:e,subject:t});return await this.getAuthenticatedUser()??nt(r)}catch(e){throw S(e)}}async unlinkFarcaster(e){try{let t=await this.api.post("/api/v1/farcaster/unlink",{fid:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkTelegram(e){try{let t=await this.api.post("/api/v1/telegram/unlink",{telegram_user_id:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async unlinkPasskey(e){try{let t=await this.api.post("/api/v1/passkeys/unlink",{credential_id:e});return await this.getAuthenticatedUser()??nt(t)}catch(e){throw S(e)}}async createAnalyticsEvent({eventName:e,payload:t,timestamp:r,options:n}){if("undefined"!=typeof window)try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(Bo,{event_name:e,client_id:this.clientAnalyticsId,payload:{...t||{},clientTimestamp:r?r.toISOString():(new Date).toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch(e){}}async signMoonpayOnRampUrl(e){try{return this.api.post("/api/v1/plugins/moonpay_on_ramp/sign",e)}catch(e){throw S(e)}}async initCoinbaseOnRamp(e){try{return this.api.post("/api/v1/funding/coinbase_on_ramp/init",e)}catch(e){throw S(e)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`/api/v1/funding/coinbase_on_ramp/status?partnerUserId=${e}`)}catch(e){throw S(e)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(e){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?ms.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!e?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getSmartWalletsConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:e});return r.enabled?{enabled:r.enabled,smartWalletType:r.smart_wallet_type,configuredNetworks:r.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url})))}:{enabled:r.enabled}}catch(e){throw S(e)}}async getServerConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:e}),n=r.telegram_auth_config?{botId:r.telegram_auth_config.bot_id,botName:r.telegram_auth_config.bot_name,linkEnabled:r.telegram_auth_config.link_enabled,seamlessAuthEnabled:r.telegram_auth_config.seamless_auth_enabled}:void 0,i=r.funding_config?{methods:r.funding_config.methods,defaultRecommendedAmount:r.funding_config.default_recommended_amount,defaultRecommendedCurrency:r.funding_config.default_recommended_currency,promptFundingOnWalletCreation:r.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,spotifyOAuth:r.spotify_oauth,instagramOAuth:r.instagram_oauth,tiktokOAuth:r.tiktok_oauth,linkedinOAuth:r.linkedin_oauth,appleOAuth:r.apple_oauth,farcasterAuth:r.farcaster_auth,passkeyAuth:r.passkey_auth,telegramAuth:r.telegram_auth,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:r.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:r.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:r.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:r.privacy_policy_url,requireUsersAcceptTerms:r.require_users_accept_terms,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,fiatOnRampEnabled:r.fiat_on_ramp_enabled,captchaEnabled:r.captcha_enabled,captchaSiteKey:r.captcha_site_key,createdAt:new Date(1e3*r.created_at),updatedAt:new Date(1e3*r.updated_at),mfaMethods:r.mfa_methods,enforceWalletUis:r.enforce_wallet_uis,legacyWalletUiConfig:r.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(e){throw S(e)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch(t){return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch(e){return void console.error("Unable to fetch token price for SOL")}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:e,captchaToken:t}){try{return(await this.api.post("/api/v1/siwe/init",{address:e,token:t})).nonce}catch(e){throw S(e)}}async authenticateWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i,mode:a}){return await this.api.post("/api/v1/siwe/authenticate",{message:e,signature:t,chainId:r,walletClientType:n,connectorType:i,mode:a})}async linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){return await this.api.post("/api/v1/siwe/link",{message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})}async linkSmartWallet({message:e,signature:t,smartWalletType:r}){try{let n=await this.api.post("/api/v1/siwe/link_smart_wallet",{message:e,signature:t,smart_wallet_type:r});return nt(n)}catch(e){throw S(e)}}async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i});return nt(a)}catch(e){throw S(e)}}async generateSiwsNonce({address:e,captchaToken:t}){try{return(await this.api.post("/api/v1/siws/init",{address:e,token:t})).nonce}catch(e){throw S(e)}}async authenticateWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n,mode:i}){return await this.api.post("/api/v1/siws/authenticate",{message:e,signature:t,walletClientType:r,connectorType:n,mode:i})}async sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,farcasterEmbeddedAddress:a,oAuthUserInfo:o}){try{let l,s;switch(r){case"email":l="/api/v1/passwordless/transfer",s={nonce:e,email:t};break;case"sms":l="/api/v1/passwordless_sms/transfer",s={nonce:e,phoneNumber:t};break;case"siwe":if(l="/api/v1/siwe/transfer",!n)throw Error("Wallet parameters must be defined");s={nonce:e,address:t,...n};break;case"farcaster":l="/api/v1/farcaster/transfer",s={nonce:e,farcaster_id:t,farcaster_embedded_address:a};break;case"telegram":l="/api/v1/telegram/transfer",s={nonce:e,telegram_auth_result:i};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:l="/api/v1/oauth/transfer",s={nonce:e,userInfo:o}}let d=await this.api.post(l,s);return await this.getAuthenticatedUser()??nt(d)}catch(e){throw S(e)}}async linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n}){return await this.api.post("/api/v1/siws/link",{message:e,signature:t,walletClientType:r,connectorType:n})}async linkWithSiws({message:e,signature:t,walletClientType:r,connectorType:n}){try{let i=await this.linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n});return nt(i)}catch(e){throw S(e)}}constructor(e){Object.defineProperty(this,ws,{value:Cs}),this.apiUrl=e.apiUrl||se,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!e.apiUrl&&e.apiUrl.startsWith("https://privy."),this.timeout=e.timeout||de,this.appId=e.appId,this.appClientId=e.appClientId,this.clientAnalyticsId=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}(this,ws)[ws](),gs||(gs=new fs),this.session=gs,this.api=this.generateApi(),this.session.client=this}}function Cs(){if("undefined"==typeof window)return null;try{let e=qe.get(ce);if("string"==typeof e&&e.length>0)return e}catch(e){}let e=jt();try{return qe.put(ce,e),e}catch(t){return e}}const bs=p({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:P,setError:P,setExecuting:P,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:P,reset:P,execute:P});class Es extends I{constructor(e,t,r){super(e||"Captcha failed"),this.type="Captcha",t instanceof Error&&(this.cause=t),this.privyErrorCode=r}}const $s=({children:e,id:r,captchaSiteKey:n,captchaEnabled:i})=>{let a=l(null),[o,c]=s(),[u,h]=s(),[p,m]=s(!1),f=d((()=>i?p||o||u?!p||o||u?o&&!u?{status:"success",token:o}:u?{status:"error",error:u}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"}),[i,o,u,p]);return t(bs.Provider,{value:{...f,ref:a,enabled:i,siteKey:n,appId:r,setToken:c,setError:h,setExecuting:m,remove(){i&&(a.current?.remove(),m(!1),h(void 0),c(void 0))},reset(){i&&(a.current?.reset(),m(!1),h(void 0),c(void 0))},execute(){i&&(m(!0),a.current?.execute())},async waitForResult(){if(!i)return"";try{return await it((()=>a.current?.getResponse()),{interval:200,timeout:2e4})}catch(e){throw new Es("Captcha failed",null,k.CAPTCHA_TIMEOUT)}}},children:e})},xs=()=>h(bs),As=e=>{let{enabled:r,siteKey:n,appId:i,setError:a,setToken:o,setExecuting:l,ref:s}=xs(),[,c]=d((()=>n?.split("t:")||[]),[n]);if(m((()=>s.current?.remove),[]),!r)return null;if(!c)throw Error("Unsupported captcha site key");return t("div",{className:"hidden h-0 w-0",children:t(gr,{...e,ref:s,siteKey:c,options:{action:i,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),a("Captcha failed"),l(!1)},onSuccess:t=>{e.onSuccess?.(t),o(t),l(!1)},onExpire:()=>{e.onExpire?.();try{s.current?.reset(),a(void 0),o(void 0)}catch(e){a("expired_and_failed_reset")}}})})};function ks(e){at("configureMfa",e)}const Ts=({success:n,fail:i})=>e(r,{children:[t(_s,{className:n?"success":i?"fail":""}),t(Ss,{className:n?"success":i?"fail":""})]}),_s=yr.span`
|
|
2
2
|
&& {
|
|
3
3
|
width: 82px;
|
|
4
4
|
height: 82px;
|
|
@@ -140,7 +140,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
140
140
|
opacity: 1;
|
|
141
141
|
animation: fadein 200ms ease;
|
|
142
142
|
}
|
|
143
|
-
`;const
|
|
143
|
+
`;const Us=({children:r,loading:n,disabled:i,loadingText:a="Loading...",...o})=>t(Fs,{disabled:n||i,...o,children:n?e("span",{children:[t(Ns,{}),a?t("span",{children:a}):null]}):r});let Fs=yr(Ps)`
|
|
144
144
|
&& {
|
|
145
145
|
border-width: 1px;
|
|
146
146
|
border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
|
|
@@ -503,7 +503,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
503
503
|
display: flex;
|
|
504
504
|
justify-content: center;
|
|
505
505
|
align-items: center;
|
|
506
|
-
`;let $d=()=>t(Ed,{children:t(wd,{iconSize:60})});const xd=({address:n,onClose:i,onRetry:a,onTransfer:o,isTransferring:l,transferSuccess:s})=>{let{defaultChain:d}=ue(),c=d.blockExplorers?.default.url??"https://etherscan.io";return e(r,{children:[t(Ks,{onClose:i,backFn:a}),e(fd,{children:[t($d,{}),e(gd,{children:[t("h3",{children:"Check account assets before transferring"}),t("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),e(Cd,{children:[t("p",{children:" To check your balance, you can:"}),t(bd,{children:"Log out and log back into the other account, or "}),e(bd,{children:["Copy your wallet address and use a"," ",t("u",{children:t("a",{target:"_blank",href:c,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),e(yd,{onClick:()=>navigator.clipboard.writeText(n).catch(console.error),children:[t(Sr,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),t(ot,{address:n,showCopyIcon:!1}),t(vd,{})]}),t(md,{onTransfer:o,isTransferring:l,transferSuccess:s})]})]}),t(lt,{})]})},
|
|
506
|
+
`;let $d=()=>t(Ed,{children:t(wd,{iconSize:60})});const xd=({address:n,onClose:i,onRetry:a,onTransfer:o,isTransferring:l,transferSuccess:s})=>{let{defaultChain:d}=ue(),c=d.blockExplorers?.default.url??"https://etherscan.io";return e(r,{children:[t(Ks,{onClose:i,backFn:a}),e(fd,{children:[t($d,{}),e(gd,{children:[t("h3",{children:"Check account assets before transferring"}),t("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),e(Cd,{children:[t("p",{children:" To check your balance, you can:"}),t(bd,{children:"Log out and log back into the other account, or "}),e(bd,{children:["Copy your wallet address and use a"," ",t("u",{children:t("a",{target:"_blank",href:c,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),e(yd,{onClick:()=>navigator.clipboard.writeText(n).catch(console.error),children:[t(Sr,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),t(ot,{address:n,showCopyIcon:!1}),t(vd,{})]}),t(md,{onTransfer:o,isTransferring:l,transferSuccess:s})]})]}),t(lt,{})]})},Ad=({onClose:n,onContinue:i,onInfo:a,onTransfer:o,transferSuccess:l,isTransferring:s,data:d})=>{if(!d?.accountTransfer?.linkMethod||!d?.accountTransfer?.displayName)return;let c={method:d?.accountTransfer?.linkMethod,handle:d?.accountTransfer?.displayName,disclosedAccount:d?.accountTransfer?.embeddedWalletAddress?{type:"wallet",handle:d?.accountTransfer?.embeddedWalletAddress}:void 0};return e(r,{children:[t(Ks,{closeable:!0}),e(fd,{children:[t(td,{children:e("div",{children:[t(pd,{color:"var(--privy-color-error)"}),t(Ar,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),e(gd,{children:[e("h3",{children:[function(e){switch(e){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"twitter":case"telegram":case"farcaster":return`${sl(e.replace("_oauth",""))} profile`;default:return e}}(c.method)," is associated with another account"]}),e("p",{children:["Do you want to transfer",t("b",{children:c.handle?` ${c.handle}`:""})," to this account instead? This will delete your other account."]}),t(kd,{onClick:a,disclosedAccount:c.disclosedAccount})]}),e(gd,{style:{gap:12,marginTop:12},children:[d?.accountTransfer?.embeddedWalletAddress?t(Os,{onClick:i,children:"Continue"}):t(md,{onTransfer:o,transferSuccess:l,isTransferring:s}),t(Us,{onClick:n,children:"No thanks"})]})]}),t(lt,{})]})};function kd({disclosedAccount:r,onClick:n}){return r?e(yd,{onClick:n,children:[t(kr,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),t(ot,{address:r.handle,showCopyIcon:!1}),t(wd,{iconSize:15})]}):null}const Td=yr.div`
|
|
507
507
|
display: flex;
|
|
508
508
|
flex-direction: column;
|
|
509
509
|
align-items: center;
|
|
@@ -593,7 +593,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
593
593
|
&&:hover {
|
|
594
594
|
color: var(--privy-color-error);
|
|
595
595
|
}
|
|
596
|
-
`,
|
|
596
|
+
`,Ud=yr.div`
|
|
597
597
|
display: flex;
|
|
598
598
|
align-items: center;
|
|
599
599
|
gap: 0.5rem;
|
|
@@ -603,7 +603,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
603
603
|
height: 20px !important;
|
|
604
604
|
width: 20px !important;
|
|
605
605
|
}
|
|
606
|
-
`,
|
|
606
|
+
`,Fd=yr.div`
|
|
607
607
|
display: flex;
|
|
608
608
|
align-items: center;
|
|
609
609
|
gap: 6px;
|
|
@@ -672,7 +672,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
672
672
|
}
|
|
673
673
|
`,zd=yr.div`
|
|
674
674
|
color: var(--privy-color-error);
|
|
675
|
-
`,jd=({termsAndConditionsUrl:n,privacyPolicyUrl:i,onAccept:a,onDecline:o})=>e(r,{children:[t(Ks,{closeable:!1}),t(Or,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),t(_d,{style:{marginTop:24},children:"One last step"}),t(Sd,{children:"By signing up, you agree to our terms and privacy policy."}),e(id,{style:{marginTop:24},children:[n&&e(dd,{target:"_blank",href:n,children:["View Terms ",t(Pr,{style:{marginLeft:"auto"}})]}),i&&e(dd,{target:"_blank",href:i,children:["View Privacy Policy ",t(Pr,{style:{marginLeft:"auto"}})]})]}),e(qd,{style:{marginTop:24},children:[t(
|
|
675
|
+
`,jd=({termsAndConditionsUrl:n,privacyPolicyUrl:i,onAccept:a,onDecline:o})=>e(r,{children:[t(Ks,{closeable:!1}),t(Or,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),t(_d,{style:{marginTop:24},children:"One last step"}),t(Sd,{children:"By signing up, you agree to our terms and privacy policy."}),e(id,{style:{marginTop:24},children:[n&&e(dd,{target:"_blank",href:n,children:["View Terms ",t(Pr,{style:{marginLeft:"auto"}})]}),i&&e(dd,{target:"_blank",href:i,children:["View Privacy Policy ",t(Pr,{style:{marginLeft:"auto"}})]})]}),e(qd,{style:{marginTop:24},children:[t(Us,{onClick:o,children:"No thanks"}),t(Os,{onClick:a,children:"Accept"})]}),t(lt,{})]});let qd=yr.div`
|
|
676
676
|
display: flex;
|
|
677
677
|
gap: 10px;
|
|
678
678
|
`;const Vd=({style:e,...r})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:t("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});let Kd=yr.div`
|
|
@@ -892,10 +892,10 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
892
892
|
gap: 4px;
|
|
893
893
|
background: var(--privy-color-background-2);
|
|
894
894
|
color: var(--privy-color-foreground-2);
|
|
895
|
-
`,
|
|
895
|
+
`,Ac=yr.span`
|
|
896
896
|
font-weight: 500;
|
|
897
897
|
word-break: break-all;
|
|
898
|
-
`;const
|
|
898
|
+
`;const kc=({icon:n})=>t(r,{children:t(Tc,{children:e("div",{children:[t(Ts,{}),"string"==typeof n?t("span",{style:{background:`url('${n}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):n?t(n,{style:{width:"38px",height:"38px"}}):t("span",{})]})})});let Tc=yr.div`
|
|
899
899
|
display: flex;
|
|
900
900
|
flex-direction: column;
|
|
901
901
|
justify-content: center;
|
|
@@ -950,7 +950,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
950
950
|
flex-wrap: wrap;
|
|
951
951
|
gap: 8px;
|
|
952
952
|
margin-left: auto;
|
|
953
|
-
`;const
|
|
953
|
+
`;const Uc=["coinbase_wallet"];let Fc=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"];const Wc=["safe"],Bc=["phantom","universal_profile"],Gc=({connectOnly:t})=>{let{connectors:n}=O(),{app:i,data:a}=dr();return e(r,{children:[...Hc(a?.externalConnectWallet?.walletList??i.appearance.walletList,i.appearance.walletChainType,n,t,i.appearance.walletList,i.externalWallets.walletConnect.enabled)]})},Hc=(e,r,n,i,a,o)=>{let l=[],s=[],d=[],c=(n=n.filter((e=>"ethereum-only"===r?"ethereum"===e.chainType:"solana-only"!==r||"solana"===e.chainType))).find((e=>"wallet_connect_v2"===e.connectorType));for(let[u,h]of e.entries())if("detected_wallets"===h)for(let[e,o]of n.filter((({chainType:e,connectorType:t,walletClientType:n})=>"uniswap_wallet_extension"===n||"uniswap_extension"===n?!a.includes("uniswap"):"crypto.com_wallet_extension"===n?!a.includes("cryptocom"):"solana"===e?"ethereum-only"!==r:"injected"===t&&!a.includes(n))).entries()){let{walletClientType:r,walletBranding:n,chainType:a}=o;("unknown"===r?s:l).push(t(Rc,{connectOnly:i,provider:r,logo:n.icon,displayName:n.name,connector:o},`${u}-${h}-${r}-${a}-${e}`))}else if(Bc.includes(h)){let e=n.find((e=>"injected"===e.connectorType&&e.walletClientType===h||e.connectorType===h));e&&l.push(t(Rc,{connectOnly:i,provider:h,connector:e},`${u}-${h}`))}else if(Fc.includes(h)){let e=n.find((e=>"uniswap"===h?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===h?"crypto.com_wallet_extension"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===h));o&&!e&&(e=c),e&&l.push(t(Rc,{connectOnly:i,provider:h,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${u}-${h}`))}else if(Uc.includes(h)){let e=n.find((({connectorType:e})=>e===h));e&&l.push(t(Rc,{connectOnly:i,provider:h,connector:e},`${u}-${h}`))}else Wc.includes(h)?c&&d.push(t(Rc,{connectOnly:i,provider:h,connector:c},`${u}-${h}`)):"wallet_connect"===h&&c&&d.push(t(Rc,{connectOnly:i,provider:h,connector:c},`${u}-${h}`));return[...s,...l,...d]};const zc=e=>e?.privyErrorCode===k.LINKED_TO_ANOTHER_USER?tr.ERROR_USER_EXISTS:e instanceof rr&&!e.details.default?e.details:e instanceof Xt?tr.ERROR_TIMED_OUT:e instanceof Jt?tr.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode===k.CANNOT_LINK_MORE_OF_TYPE?tr.ERROR_USER_LIMIT_REACHED:tr.ERROR_WALLET_CONNECTION;let jc=yr.div`
|
|
954
954
|
display: flex;
|
|
955
955
|
flex-direction: column;
|
|
956
956
|
align-items: center;
|
|
@@ -1051,7 +1051,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1051
1051
|
transform: rotate(360deg);
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
`;const ru=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];class nu extends Error{constructor(e,t){super(t),this.type=e}}function iu(e){let t=e.type;return"string"==typeof t&&ru.includes(t)}function au(e){return iu(e)&&"wallet_not_on_device"===e.type}function ou(e){return!!iu(e)&&"mfa_timeout"===e.type}function lu(e){return!!iu(e)&&"missing_or_invalid_mfa"===e.type}function su(e){return!!iu(e)&&"mfa_verification_max_attempts_reached"===e.type}function du(e){return!(!iu(e)||!e.message.includes("code 429"))}function cu(e){return!!function(e){let t=e.type;return"string"==typeof t&&"client_error"===t}(e)&&"MFA canceled"===e.message}function uu({isCreatingWallet:e,skipSplashScreen:t}){return e?cr.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN:t?cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN:cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN}function hu({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?cr.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||1===t.length?uu({isCreatingWallet:"create"===e,skipSplashScreen:n}):cr.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function pu(e){switch(e){case"user-passcode":return cr.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN;case"google-drive":case"icloud":return cr.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN;default:throw Error("Recovery method not supported")}}async function mu({api:e,provider:t}){let r=nl(),n=il(),i=await al(r);try{return"icloud"===t?{url:(await e.post("/api/v1/recovery/oauth/init_icloud",{client_type:"web"})).url}:{url:(await e.post("/api/v1/recovery/oauth/init",{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:t}}catch(e){throw
|
|
1054
|
+
`;const ru=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];class nu extends Error{constructor(e,t){super(t),this.type=e}}function iu(e){let t=e.type;return"string"==typeof t&&ru.includes(t)}function au(e){return iu(e)&&"wallet_not_on_device"===e.type}function ou(e){return!!iu(e)&&"mfa_timeout"===e.type}function lu(e){return!!iu(e)&&"missing_or_invalid_mfa"===e.type}function su(e){return!!iu(e)&&"mfa_verification_max_attempts_reached"===e.type}function du(e){return!(!iu(e)||!e.message.includes("code 429"))}function cu(e){return!!function(e){let t=e.type;return"string"==typeof t&&"client_error"===t}(e)&&"MFA canceled"===e.message}function uu({isCreatingWallet:e,skipSplashScreen:t}){return e?cr.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN:t?cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN:cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN}function hu({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?cr.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||1===t.length?uu({isCreatingWallet:"create"===e,skipSplashScreen:n}):cr.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function pu(e){switch(e){case"user-passcode":return cr.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN;case"google-drive":case"icloud":return cr.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN;default:throw Error("Recovery method not supported")}}async function mu({api:e,provider:t}){let r=nl(),n=il(),i=await al(r);try{return"icloud"===t?{url:(await e.post("/api/v1/recovery/oauth/init_icloud",{client_type:"web"})).url}:{url:(await e.post("/api/v1/recovery/oauth/init",{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:t}}catch(e){throw A(e)}}async function fu({api:e,provider:t,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new x("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===i)throw new x("User denied confirmation during OAuth flow");try{return(await e.post("/api/v1/recovery/oauth/authenticate",{authorization_code:i,state_code:r,code_verifier:n,provider:t})).access_token}catch(e){let t=A(e);if(t.privyErrorCode)throw new x(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new x("Invalid code during oauth flow.",void 0,k.OAUTH_USER_DENIED);throw new x("Invalid code during OAuth flow.",void 0,k.UNKNOWN_AUTH_ERROR)}}let gu=yr.div`
|
|
1055
1055
|
height: 44px;
|
|
1056
1056
|
`;const yu=({children:r,theme:n})=>e(wu,{$theme:n,children:[t(Nr,{width:"1.25rem",color:"dark"===n?"#FDE68A":"var(--privy-color-warn)"}),r]});let wu=yr.div`
|
|
1057
1057
|
display: flex;
|
|
@@ -1114,7 +1114,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1114
1114
|
border-radius: var(--privy-border-radius-md);
|
|
1115
1115
|
background-color: var(--privy-color-background-2);
|
|
1116
1116
|
color: var(--privy-color-foreground-3);
|
|
1117
|
-
`;function
|
|
1117
|
+
`;function Au(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=O(),n=l(!1);return{createWallet:f((async i=>{let a=await Tv();if(!a)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let o=await r(fe);if(!o)throw Error("walletProxy does not exist.");let l=new Promise(((e,t)=>{setTimeout((()=>{t(Error("walletProxy.create timed out."))}),2e4)}));if(!await Promise.race([o.create({accessToken:a,recoveryPassword:i}),l]))throw Error("walletProxy.create did not send a response.");let s=await e();if(!s)throw Error("Failed to refresh user.");let d=yt(s);if(!d)throw Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:d.address}}),n.current=!0,d}catch(i){if(n.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:i.toString()}}),console.warn(i),i}}),[])}}let ku=yr.div`
|
|
1118
1118
|
height: 44px;
|
|
1119
1119
|
`,Tu=wr`
|
|
1120
1120
|
font-size: 14px;
|
|
@@ -1232,7 +1232,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1232
1232
|
@media (max-width: 440px) {
|
|
1233
1233
|
height: var(--privy-height-modal-compact);
|
|
1234
1234
|
}
|
|
1235
|
-
`;const
|
|
1235
|
+
`;const Uu=yr(Ps)`
|
|
1236
1236
|
display: flex;
|
|
1237
1237
|
flex: 1;
|
|
1238
1238
|
gap: 4px;
|
|
@@ -1244,7 +1244,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1244
1244
|
border-color: var(--privy-color-foreground-3);
|
|
1245
1245
|
border-width: 1px;
|
|
1246
1246
|
}
|
|
1247
|
-
`,
|
|
1247
|
+
`,Fu=yr.div`
|
|
1248
1248
|
position: absolute;
|
|
1249
1249
|
right: 0.5rem;
|
|
1250
1250
|
|
|
@@ -1295,7 +1295,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1295
1295
|
transition: all 0.1s ease-out;
|
|
1296
1296
|
background: ${({label:e})=>("Strong"===e?"#78dca6":"Medium"===e&&"var(--privy-color-warn)")||"var(--privy-color-error)"};
|
|
1297
1297
|
}
|
|
1298
|
-
`,zu=({buttonHideAnimations:n,buttonLoading:i,password:a,onSubmit:o,onBack:l})=>{let[d,c]=s(!0),[u,h]=s(!1),[p,f]=s(""),g=a===p;return m((()=>{p&&!u&&h(!0)}),[p]),e(r,{children:[t(Ks,{closeable:!1,backFn:l}),t(ic,{}),e(Su,{children:[e(Mu,{children:[t(
|
|
1298
|
+
`,zu=({buttonHideAnimations:n,buttonLoading:i,password:a,onSubmit:o,onBack:l})=>{let[d,c]=s(!0),[u,h]=s(!1),[p,f]=s(""),g=a===p;return m((()=>{p&&!u&&h(!0)}),[p]),e(r,{children:[t(Ks,{closeable:!1,backFn:l}),t(ic,{}),e(Su,{children:[e(Mu,{children:[t(Ar,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),e(Ru,{children:[t(Pu,{value:p,onChange:e=>f(e.target.value),onKeyUp:e=>{"Enter"===e.key&&o()},onBlur:()=>h(!0),placeholder:"confirm your password",type:d?"password":"text",style:{paddingRight:"2.3rem"}}),t(Fu,{style:{right:"0.75rem"},children:d?t(Bu,{onClick:()=>c(!1)}):t(Gu,{onClick:()=>c(!0)})})]}),t(_u,{"aria-hidden":!u||g,error:!0,children:"Passwords do not match"})]}),t(Nu,{onClick:o,loading:i,disabled:!g,hideAnimations:n,children:"Continue"}),t(ac,{}),t(lt,{})]})},ju=({className:r,checked:n,color:i="var(--privy-color-accent)",...a})=>t("label",{children:e(qu,{className:r,children:[t(Ku,{checked:n,...a}),t(Yu,{color:i,checked:n,children:t(Vu,{viewBox:"0 0 24 24",children:t("polyline",{points:"20 6 9 17 4 12"})})})]})});yr.label`
|
|
1299
1299
|
&& {
|
|
1300
1300
|
cursor: pointer;
|
|
1301
1301
|
display: flex;
|
|
@@ -1347,17 +1347,17 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1347
1347
|
${Vu} {
|
|
1348
1348
|
visibility: ${e=>e.checked?"visible":"hidden"};
|
|
1349
1349
|
}
|
|
1350
|
-
`;const Zu=({buttonHideAnimations:n,buttonLoading:i,onSubmit:a,onBack:o,config:l})=>{let[d,c]=s(!1);return e(r,{children:[t(Ks,{closeable:!1,backFn:o}),t(ic,{}),e(Su,{children:[e(Mu,{children:[t(
|
|
1350
|
+
`;const Zu=({buttonHideAnimations:n,buttonLoading:i,onSubmit:a,onBack:o,config:l})=>{let[d,c]=s(!1);return e(r,{children:[t(Ks,{closeable:!1,backFn:o}),t(ic,{}),e(Su,{children:[e(Mu,{children:[t(Ar,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),t(Lu,{children:e(Du,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),c((e=>!e))},children:[t(ju,{color:"var(--privy-color-error)",readOnly:!0,checked:d}),t(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),e(Xu,{children:["user"===l.initiatedBy&&t(Us,{onClick:l.onCancel,disabled:i,children:"Cancel"}),t(Nu,{onClick:a,loading:i,hideAnimations:n,disabled:!d,children:"Set Password"})]}),t(ac,{}),t(lt,{})]})};let Xu=yr.div`
|
|
1351
1351
|
display: flex;
|
|
1352
1352
|
gap: 10px;
|
|
1353
|
-
`,Qu=/[a-z]/,Ju=/[A-Z]/,eh=/[0-9]/,th="!@#$%^&*()\\-_+.",rh=`a-zA-Z0-9${th}`,nh=RegExp(`[${th}]`),ih=RegExp(`[${rh}]`);const ah=RegExp(`^[${rh}]{6,}$`),oh=()=>Wr.generatePassphrase(4,Br);function lh(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function sh(e=""){return(.3*function(e){if(e.length<8)return 0;let t=0;return Qu.test(e)&&(t+=1),Ju.test(e)&&(t+=1),eh.test(e)&&(t+=1),nh.test(e)&&(t+=1),Math.max(0,Math.min(1,t/3))}(e)+
|
|
1353
|
+
`,Qu=/[a-z]/,Ju=/[A-Z]/,eh=/[0-9]/,th="!@#$%^&*()\\-_+.",rh=`a-zA-Z0-9${th}`,nh=RegExp(`[${th}]`),ih=RegExp(`[${rh}]`);const ah=RegExp(`^[${rh}]{6,}$`),oh=()=>Wr.generatePassphrase(4,Br);function lh(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function sh(e=""){return(.3*function(e){if(e.length<8)return 0;let t=0;return Qu.test(e)&&(t+=1),Ju.test(e)&&(t+=1),eh.test(e)&&(t+=1),nh.test(e)&&(t+=1),Math.max(0,Math.min(1,t/3))}(e)+Fr(e)/95)/2}const dh=({buttonHideAnimations:n,buttonLoading:i,password:a="",config:o,isResettingPassword:l,onSubmit:c,onClose:u,onBack:h,onPasswordChange:p,onPasswordGenerate:f})=>{let[g,y]=s(!1),[w,v]=s(!1);m((()=>{a&&!w&&v(!0)}),[a]);let C=d((()=>w?6>(a?.length||0)?"Password must be at least 6 characters":ah.test(a||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ih.test(e))).map((e=>e.replace(" ","SPACE"))))])(a).join(" ")} )`:null),[a,w]),b=d((()=>C?{value:0,label:"Weak"}:function(e=""){let t=sh(e);return{value:t,label:lh(t)}}(a)),[a,C]),E=d((()=>!a?.length||!!C),[C,a]);return e(r,{children:[t(Ks,{onClose:u,closeable:"user"===o.initiatedBy,backFn:h}),t(ic,{}),e(Su,{children:[e(Mu,{children:[t(jr,{height:48,width:48,stroke:"var(--privy-color-accent)"}),e("h3",{style:{color:"var(--privy-color-foreground)"},children:[l?"Reset":"Set"," your password"]}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),e(Ru,{children:[t(Pu,{value:a,onChange:e=>p(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},placeholder:"enter or generate a strong password",type:g?"password":"text",style:{paddingRight:"3.8rem"}}),e(Fu,{style:{width:"3.5rem"},children:[g?t(Bu,{onClick:()=>y(!1)}):t(Gu,{onClick:()=>y(!0)}),t(Wu,{onClick:f})]})]}),t(Hu,{value:0===b.value?.01:b.value,label:b.label}),t(_u,{error:!!C,children:C||`Password Strength: ${w?b.label:"--"}`}),e(uh,{children:[t(ch,{children:e(Lu,{children:[e(Du,{children:[t(Dr,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),e(Du,{children:[t(Dr,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),t(Nu,{onClick:c,loading:i,disabled:E,hideAnimations:n,children:"Continue"})]})]}),t(ac,{}),t(lt,{})]})};let ch=yr(Lu)`
|
|
1354
1354
|
flex: 1;
|
|
1355
1355
|
padding-top: 1rem;
|
|
1356
1356
|
`,uh=yr.div`
|
|
1357
1357
|
display: flex;
|
|
1358
1358
|
flex-direction: column;
|
|
1359
1359
|
height: 100%;
|
|
1360
|
-
`;const hh=({buttonHideAnimations:n,buttonLoading:i,appName:a,password:o,onSubmit:l,onBack:d})=>{let[c,u]=s(!1),h=f((()=>{u(!0),o&&navigator.clipboard.writeText(o)}),[o]),p=f((()=>{let e=document.createElement("a"),t=a.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),r=new Blob([ph(a,o)],{type:"text/plain"}),n=URL.createObjectURL(r);e.href=n,e.target="_blank",e.download=`${t}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[o]);return e(r,{children:[t(Ks,{backFn:d,closeable:!1}),t(ic,{}),e(Su,{children:[e(Mu,{children:[t(
|
|
1360
|
+
`;const hh=({buttonHideAnimations:n,buttonLoading:i,appName:a,password:o,onSubmit:l,onBack:d})=>{let[c,u]=s(!1),h=f((()=>{u(!0),o&&navigator.clipboard.writeText(o)}),[o]),p=f((()=>{let e=document.createElement("a"),t=a.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),r=new Blob([ph(a,o)],{type:"text/plain"}),n=URL.createObjectURL(r);e.href=n,e.target="_blank",e.download=`${t}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[o]);return e(r,{children:[t(Ks,{backFn:d,closeable:!1}),t(ic,{}),e(Su,{children:[e(Mu,{children:[t(Ar,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),t(Ru,{centered:!0,children:t(Ou,{children:o})}),e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[t(Uu,{onClick:h,children:e(r,c?{children:[t(Vr,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[t(Kr,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),e(Uu,{onClick:p,children:[t(qr,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),t(Nu,{onClick:l,loading:i,hideAnimations:n,children:"Continue"}),t(ac,{}),t(lt,{})]})};let ph=(e,t)=>`Your wallet recovery password for ${e} is\n\n${t}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const mh=({error:n,onClose:i})=>e(r,{children:[t(Ks,{closeable:!1}),t(ic,{}),e(ec,n?{children:[t(Ur,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),t(uc,{title:"Something went wrong",description:n})]}:{children:[t(Dr,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),t(uc,{title:"Success"})]}),t(Os,{onClick:i,children:"Close"}),t(ac,{}),t(lt,{})]});let fh=(e,t)=>{switch(e){case"creating":return"back"===t?e:"saving";case"saving":return"back"===t?"creating":"confirming";case"confirming":return"back"===t?"saving":"finalizing";case"finalizing":return"back"===t?"confirming":"done";default:return e}};const gh=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:i}=dr(),{send:a,state:o}=(()=>{let[e,t]=y(fh,"creating");return{send:t,state:e}})(),l=f((async()=>{"finalizing"===o&&await e(),a("next")}),[o,a,e]);m((()=>{let e;return"done"===o&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),pe)),()=>{e&&clearTimeout(e)}}),[o,r.config.initiatedBy,r.onClose]);let s=f((()=>{a("back")}),[a]),d=f((()=>{i(cr.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN)}),[n,i]);return"creating"===o?t(dh,{...r,onSubmit:l,onBack:n===cr.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN?d:void 0}):"saving"===o?t(hh,{...r,onSubmit:l,onBack:s}):"confirming"===o?t(zu,{...r,onSubmit:l,onBack:s}):"finalizing"===o?t(Zu,{...r,onSubmit:l,onBack:s}):"done"===o?t(mh,{...r,onSubmit:l}):null};const yh=({error:n,backFn:i,onClick:a})=>{let{reset:o}=xs(),{app:l}=dr(),s=((e,r)=>{let n=t(Ar,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof x)switch(e.privyErrorCode){case k.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:n};case k.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:n};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:n}}else{if(e instanceof nu&&"twilio_verification_failed"===e.type)return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t(Lr,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(e instanceof I))return e instanceof N&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:n}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:n};switch(e.privyErrorCode){case k.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:n};case k.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:n};case k.ALLOWLIST_REJECTED:return{title:r.errorTitle||"You don't have access to this app",detail:r.errorDetail||"Have you been invited?",ctaText:r.errorCtaText||"Try another account",icon:t(Vd,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case k.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:t("span",{})};case k.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:t("span",{})};case k.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:n};case k.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:n};case k.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:n};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:n}}}})(n,l.allowlistConfig);return e(r,{children:[t(Ks,{backFn:i}),e(wh,{children:[t(td,{children:e("div",{children:[t(pd,{color:"var(--privy-color-error)"}),s.icon]})}),e(vh,{children:[t("h3",{children:s.title}),t("p",{children:s.detail})]}),t(Os,{color:"var(--privy-color-error)",onClick:()=>{n instanceof I&&(n.privyErrorCode===k.INVALID_CAPTCHA&&o(),n.privyErrorCode===k.ALLOWLIST_REJECTED&&l.allowlistConfig.errorCtaLink)?window.location.href=l.allowlistConfig.errorCtaLink:a?.()},children:s.ctaText})]})]})};let wh=yr.div`
|
|
1361
1361
|
display: flex;
|
|
1362
1362
|
flex-direction: column;
|
|
1363
1363
|
align-items: center;
|
|
@@ -1445,7 +1445,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1445
1445
|
width: 14px;
|
|
1446
1446
|
height: 14px;
|
|
1447
1447
|
}
|
|
1448
|
-
`;const
|
|
1448
|
+
`;const Ah=()=>t("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:t("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let kh=(e,t,r,n,i)=>{for(let a=t;a<t+n;a++)for(let t=r;t<r+i;t++){let r=e?.[t];r&&r[a]&&(r[a]=0)}return e},Th=({x:e,y:n,cellSize:i,bgColor:a,fgColor:o})=>t(r,{children:[0,1,2].map((r=>t("circle",{r:i*(7-2*r)/2,cx:e+7*i/2,cy:n+7*i/2,fill:r%2!=0?a:o},`finder-${e}-${n}-${r}`)))}),_h=({cellSize:e,matrixSize:n,bgColor:i,fgColor:a})=>t(r,{children:[[0,0],[(n-7)*e,0],[0,(n-7)*e]].map((([r,n])=>t(Th,{x:r,y:n,cellSize:e,bgColor:i,fgColor:a},`finder-${r}-${n}`)))}),Sh=({matrix:e,cellSize:n,color:i})=>t(r,{children:e.map(((e,r)=>e.map(((e,a)=>e?t("rect",{height:n-.4,width:n-.4,x:r*n+.1*n,y:a*n+.1*n,rx:.5*n,ry:.5*n,fill:i},`cell-${r}-${a}`):t(o.Fragment,{},`circle-${r}-${a}`)))))}),Nh=({cellSize:n,matrixSize:i,element:a,sizePercentage:o,bgColor:l})=>{if(!a)return t(r,{});let s=i*(o||.14),d=Math.floor(i/2-s/2),c=Math.floor(i/2+s/2);(c-d)%2!=i%2&&(c+=1);let u=(c-d)*n,h=u-.2*u,p=d*n;return e(r,{children:[t("rect",{x:d*n,y:d*n,width:u,height:u,fill:l}),t(a,{x:p+.1*u,y:p+.1*u,height:h,width:h})]})},Ih=r=>{let n=r.outputSize,i=((e,t)=>{let r=Xr.create(e,{errorCorrectionLevel:t}).modules,n=bt(Array.from(r.data),r.size);return n=kh(n,0,0,7,7),n=kh(n,n.length-7,0,7,7),kh(n,0,n.length-7,7,7)})(r.url,r.errorCorrectionLevel),a=n/i.length,o=Et(2*a,{min:.025*n,max:.036*n});return e("svg",{height:r.outputSize,width:r.outputSize,viewBox:`0 0 ${r.outputSize} ${r.outputSize}`,style:{height:"100%",width:"100%",padding:`${o}px`},children:[t(Sh,{matrix:i,cellSize:a,color:r.fgColor}),t(_h,{cellSize:a,matrixSize:i.length,fgColor:r.fgColor,bgColor:r.bgColor}),t(Nh,{cellSize:a,element:r.logo?.element,bgColor:r.bgColor,matrixSize:i.length})]})},Ph=yr.div`
|
|
1449
1449
|
display: flex;
|
|
1450
1450
|
justify-content: center;
|
|
1451
1451
|
align-items: center;
|
|
@@ -1459,7 +1459,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1459
1459
|
border-color: ${e=>e.borderColor};
|
|
1460
1460
|
border-radius: var(--privy-border-radius-md);
|
|
1461
1461
|
}
|
|
1462
|
-
`;const Oh=e=>{let{appearance:r}=ue(),n=e.bgColor||"#FFFFFF",i=e.fgColor||"#000000",a=e.size||160,o="dark"===r.palette.colorScheme?n:i;return t(Ph,{size:a,bgColor:n,fgColor:i,borderColor:o,children:t(Ih,{url:e.url,logo:{element:e.squareLogoElement??
|
|
1462
|
+
`;const Oh=e=>{let{appearance:r}=ue(),n=e.bgColor||"#FFFFFF",i=e.fgColor||"#000000",a=e.size||160,o="dark"===r.palette.colorScheme?n:i;return t(Ph,{size:a,bgColor:n,fgColor:i,borderColor:o,children:t(Ih,{url:e.url,logo:{element:e.squareLogoElement??Ah},outputSize:a,bgColor:n,fgColor:i,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})},Rh=({style:r,...n})=>e("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...r},...n,children:[t("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),t("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),t("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),t("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});let Mh="#8a63d2";let Lh=yr.div`
|
|
1463
1463
|
display: flex;
|
|
1464
1464
|
flex-direction: column;
|
|
1465
1465
|
align-items: center;
|
|
@@ -1474,7 +1474,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1474
1474
|
justify-content: center;
|
|
1475
1475
|
gap: 24px;
|
|
1476
1476
|
width: 100%;
|
|
1477
|
-
`,
|
|
1477
|
+
`,Uh="#8a63d2";let Fh=yr.div`
|
|
1478
1478
|
display: flex;
|
|
1479
1479
|
flex-direction: column;
|
|
1480
1480
|
align-items: center;
|
|
@@ -1568,7 +1568,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1568
1568
|
text-align: right;
|
|
1569
1569
|
|
|
1570
1570
|
${xt}
|
|
1571
|
-
`;let op={[ye.id]:r=>t("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...r,children:t("g",{id:"Layer_x0020_1",children:e("g",{id:"_2405588477232",children:[t("rect",{fill:"none",width:"2500",height:"2500"}),t("g",{children:e("g",{children:[t("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),t("g",{children:e("g",{children:[t("g",{children:t("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),t("g",{children:t("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),t("g",{children:t("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),t("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),e("g",{children:[t("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),t("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),[we.id]:r=>e("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),[ve.id]:r=>e("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),t("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),[Ce.id]:r=>e("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),t("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),[be.id]:r=>e("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"199.4",height:"207.623",fill:"#121212"}),e("g",{"clip-path":"url(#clip0_2303_643)",children:[t("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),t("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),t("defs",{children:t("clipPath",{id:"clip0_2303_643",children:t("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),[Ee.id]:r=>e("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 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...r,children:[t("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),t("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),t("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),t("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),t("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),[$e.id]:r=>e("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),t("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),t("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),[xe.id]:r=>e("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),t("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),[ke.id]:r=>e("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),e("defs",{children:[t("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:t("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),t("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]})};const lp=({chainId:e,...r})=>{let n=op[e];return t(n||sn,{...r})},sp=({balance:e,className:r,chain:n})=>t(kt,{className:r,$state:void 0,children:t(dp,{balance:e,chain:n})}),dp=({balance:n,chain:i})=>e(r,{children:[e(cp,{children:[t(up,{chainId:i.id}),t(ap,{children:i.name})]}),t(ht,{isLoading:!1,isPulsing:!1,color:"gray",children:n})]});let cp=yr.div`
|
|
1571
|
+
`;let op={[ye.id]:r=>t("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...r,children:t("g",{id:"Layer_x0020_1",children:e("g",{id:"_2405588477232",children:[t("rect",{fill:"none",width:"2500",height:"2500"}),t("g",{children:e("g",{children:[t("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),t("g",{children:e("g",{children:[t("g",{children:t("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),t("g",{children:t("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),t("g",{children:t("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),t("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),e("g",{children:[t("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),t("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),[we.id]:r=>e("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),[ve.id]:r=>e("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),t("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),[Ce.id]:r=>e("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),t("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),[be.id]:r=>e("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"199.4",height:"207.623",fill:"#121212"}),e("g",{"clip-path":"url(#clip0_2303_643)",children:[t("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),t("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),t("defs",{children:t("clipPath",{id:"clip0_2303_643",children:t("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),[Ee.id]:r=>e("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 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...r,children:[t("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),t("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),t("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),t("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),t("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),[$e.id]:r=>e("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),t("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),t("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),[xe.id]:r=>e("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),t("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),[Ae.id]:r=>e("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),e("defs",{children:[t("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:t("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),t("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]})};const lp=({chainId:e,...r})=>{let n=op[e];return t(n||sn,{...r})},sp=({balance:e,className:r,chain:n})=>t(At,{className:r,$state:void 0,children:t(dp,{balance:e,chain:n})}),dp=({balance:n,chain:i})=>e(r,{children:[e(cp,{children:[t(up,{chainId:i.id}),t(ap,{children:i.name})]}),t(ht,{isLoading:!1,isPulsing:!1,color:"gray",children:n})]});let cp=yr.div`
|
|
1572
1572
|
display: flex;
|
|
1573
1573
|
align-items: center;
|
|
1574
1574
|
`,up=yr(lp)`
|
|
@@ -1616,7 +1616,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1616
1616
|
height: 1rem;
|
|
1617
1617
|
margin-left: 0.5rem;
|
|
1618
1618
|
`,yp=yr.button`
|
|
1619
|
-
${
|
|
1619
|
+
${kt}
|
|
1620
1620
|
|
|
1621
1621
|
/* Push the chip all the way to the right */
|
|
1622
1622
|
span {
|
|
@@ -1632,7 +1632,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1632
1632
|
rotate: -180deg;
|
|
1633
1633
|
}
|
|
1634
1634
|
}
|
|
1635
|
-
`;const wp=({style:e,...r})=>t("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...r,children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})}),vp=({style:r,...n})=>e("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...r},xmlns:"http://www.w3.org/2000/svg",...n,children:[e("g",{clipPath:"url(#clip0_113_33841)",children:[t("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),t("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),t("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),t("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),t("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),t("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),t("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),t("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),t("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),t("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),t("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),t("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),t("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),t("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),t("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),t("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),t("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),t("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),t("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),t("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),t("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),t("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),t("defs",{children:t("clipPath",{id:"clip0_113_33841",children:t("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});let Cp=({passkeys:r,expanded:n,onUnlink:i,onExpand:a})=>{let[o,l]=s([]),d=n?r.length:2,c=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device";return e("div",{children:[t(Np,{children:"Your passkeys"}),e(Ap,{children:[r.slice(0,d).map((r=>e(Op,{children:[e("div",{children:[t(Ip,{children:c(r)}),e(Pp,{children:["Last used: ",(r.latestVerifiedAt??r.verifiedAt).toLocaleString()]})]}),t(Mp,{disabled:o.includes(r.credentialId),onClick:()=>(async e=>{l((t=>t.concat([e]))),await i(e),l((t=>t.filter((t=>t!==e))))})(r.credentialId),children:o.includes(r.credentialId)?t(Ns,{}):t(pn,{height:"1.6em"})})]},r.credentialId))),r.length>2&&!n&&t(kp,{onClick:a,children:"View all"})]})]})},bp=()=>e(Ap,{children:[e(Od,{children:[t(Pd,{children:t(mn,{})}),"Log in with Touch ID, Face ID, or a security key."]}),e(Od,{children:[t(Pd,{children:t(Zr,{})}),"More secure than a password."]}),e(Od,{children:[t(Pd,{children:t(hn,{})}),"Takes seconds to set up and use."]})]});const Ep=yr.div`
|
|
1635
|
+
`;const wp=({style:e,...r})=>t("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...r,children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})}),vp=({style:r,...n})=>e("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...r},xmlns:"http://www.w3.org/2000/svg",...n,children:[e("g",{clipPath:"url(#clip0_113_33841)",children:[t("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),t("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),t("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),t("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),t("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),t("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),t("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),t("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),t("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),t("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),t("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),t("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),t("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),t("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),t("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),t("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),t("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),t("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),t("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),t("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),t("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),t("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),t("defs",{children:t("clipPath",{id:"clip0_113_33841",children:t("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});let Cp=({passkeys:r,expanded:n,onUnlink:i,onExpand:a})=>{let[o,l]=s([]),d=n?r.length:2,c=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device";return e("div",{children:[t(Np,{children:"Your passkeys"}),e(kp,{children:[r.slice(0,d).map((r=>e(Op,{children:[e("div",{children:[t(Ip,{children:c(r)}),e(Pp,{children:["Last used: ",(r.latestVerifiedAt??r.verifiedAt).toLocaleString()]})]}),t(Mp,{disabled:o.includes(r.credentialId),onClick:()=>(async e=>{l((t=>t.concat([e]))),await i(e),l((t=>t.filter((t=>t!==e))))})(r.credentialId),children:o.includes(r.credentialId)?t(Ns,{}):t(pn,{height:"1.6em"})})]},r.credentialId))),r.length>2&&!n&&t(Ap,{onClick:a,children:"View all"})]})]})},bp=()=>e(kp,{children:[e(Od,{children:[t(Pd,{children:t(mn,{})}),"Log in with Touch ID, Face ID, or a security key."]}),e(Od,{children:[t(Pd,{children:t(Zr,{})}),"More secure than a password."]}),e(Od,{children:[t(Pd,{children:t(hn,{})}),"Takes seconds to set up and use."]})]});const Ep=yr.div`
|
|
1636
1636
|
display: flex;
|
|
1637
1637
|
align-items: center;
|
|
1638
1638
|
justify-content: center;
|
|
@@ -1681,9 +1681,9 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1681
1681
|
box-shadow: none;
|
|
1682
1682
|
}
|
|
1683
1683
|
}
|
|
1684
|
-
`;const
|
|
1684
|
+
`;const Ap=yr.button`
|
|
1685
1685
|
${xp}
|
|
1686
|
-
`;let
|
|
1686
|
+
`;let kp=yr.div`
|
|
1687
1687
|
display: flex;
|
|
1688
1688
|
flex-direction: column;
|
|
1689
1689
|
align-items: stretch;
|
|
@@ -1769,13 +1769,13 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1769
1769
|
svg {
|
|
1770
1770
|
border-radius: var(--privy-border-radius-sm);
|
|
1771
1771
|
}
|
|
1772
|
-
`,
|
|
1772
|
+
`,Up=yr.div`
|
|
1773
1773
|
display: flex;
|
|
1774
1774
|
flex-direction: column;
|
|
1775
1775
|
justify-content: center;
|
|
1776
1776
|
align-items: center;
|
|
1777
1777
|
gap: 8px;
|
|
1778
|
-
`,
|
|
1778
|
+
`,Fp=yr.div`
|
|
1779
1779
|
display: flex;
|
|
1780
1780
|
align-items: baseline;
|
|
1781
1781
|
gap: 4px;
|
|
@@ -1816,7 +1816,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1816
1816
|
margin-right: 6px;
|
|
1817
1817
|
margin: auto;
|
|
1818
1818
|
}
|
|
1819
|
-
`,qp=yr(
|
|
1819
|
+
`,qp=yr(Ap)`
|
|
1820
1820
|
margin-top: 16px;
|
|
1821
1821
|
`;let Vp=vr`
|
|
1822
1822
|
from {
|
|
@@ -1828,12 +1828,12 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1828
1828
|
`;const Kp=yr(Ws)`
|
|
1829
1829
|
border-radius: var(--privy-border-radius-md) !important;
|
|
1830
1830
|
animation: ${Vp} 0.3s ease-in-out;
|
|
1831
|
-
`,Yp=({displayName:n,errorMessage:i,configuredFundingChain:a,formattedBalance:o,fundingAmount:l,fundingCurrency:s,fundingAmountInUsd:d,options:c,selectedOption:u,isPreparing:h,isSubmitting:p,onSubmit:m,onSelect:f})=>e(r,{children:[t(Bh,{}),t(ic,{}),t(Cu,{children:"Transfer from another network"}),e(vu,{children:["You need more funds on the ",a.name," network. Bridge from another blockchain network."]}),e(
|
|
1831
|
+
`,Yp=({displayName:n,errorMessage:i,configuredFundingChain:a,formattedBalance:o,fundingAmount:l,fundingCurrency:s,fundingAmountInUsd:d,options:c,selectedOption:u,isPreparing:h,isSubmitting:p,onSubmit:m,onSelect:f})=>e(r,{children:[t(Bh,{}),t(ic,{}),t(Cu,{children:"Transfer from another network"}),e(vu,{children:["You need more funds on the ",a.name," network. Bridge from another blockchain network."]}),e(Up,{style:{marginTop:"2rem"},children:[e(Fp,{children:[t(Wp,{children:l}),t(Hp,{children:s})]}),d&&t(zp,{children:d})]}),t(np,{style:{marginTop:"1.5rem"},children:t(ip,{children:"From"})}),t(hp,{selected:{chain:u.chain,balance:Tt(u.balance,u.chain.nativeCurrency.symbol,3,!0)},options:c.map((({chain:e,balance:t})=>({chain:e,balance:Tt(t,e.nativeCurrency.symbol,3,!0)}))),onSelect:f}),t(np,{children:t(ip,{style:{marginTop:"1.5rem"},children:"To"})}),t(sp,{chain:a,balance:o}),t(_t,{style:{marginTop:"1rem"},children:i}),e(Rs,{style:{marginTop:"1rem"},loading:p||h,disabled:h||p,onClick:m,children:["Confirm with ",n]}),t(ac,{}),t(lt,{})]}),Zp=({wallet:n,displayName:i,addressToFund:a,chain:o,isBridging:l,isErc20Flow:s,totalPriceInNativeCurrency:d,totalPriceInUsd:c,gasPriceInNativeCurrency:u,gasPriceInUsd:h})=>e(r,{children:[t(Bh,{}),t(Gh,{}),t(Xd,{style:{marginTop:"16px"},children:t(Sc,{icon:Pc(n.walletClientType,n.connectorType,n.walletClientType),name:n.walletClientType})}),t(uc,{style:{marginTop:"8px",marginBottom:"12px"},title:`${l?"Bridging":"Confirming"} with ${i}`}),!l&&!s&&e(rp,{children:[e(np,{children:[t(ip,{children:"Total"}),t(ap,{children:c||d})]}),e(np,{children:[t(ip,{children:"To"}),t(ap,{children:t(ot,{address:a,showCopyIcon:!1})})]}),e(np,{children:[t(ip,{children:"Network"}),t(ap,{children:e(Xp,{children:[t(lp,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),u&&e(np,{children:[t(ip,{children:"Estimated fee"}),t(ap,{children:h||u})]})]}),t(lc,{height:24}),t(lt,{})]});let Xp=yr.div`
|
|
1832
1832
|
display: flex;
|
|
1833
1833
|
flex-direction: row;
|
|
1834
1834
|
align-items: center;
|
|
1835
1835
|
gap: 4px;
|
|
1836
|
-
`;class Qp{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{return await this.api.post(
|
|
1836
|
+
`;class Qp{async authenticate(){if(!this.api)throw new x("Auth flow has no API instance");try{return await this.api.post(Fo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw A(e)}}async link(){if(!this.api)throw new x("Auth flow has no API instance");try{return await this.api.post(Wo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw A(e)}}constructor({authorizationCode:e,stateCode:t,codeVerifier:r,provider:n}){this.meta={authorizationCode:e,stateCode:t,codeVerifier:r,provider:n}}}async function Jp({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find((e=>e.provider_app_id===r));if(!n)throw new x("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}const em=async({user:e,address:t,client:r,request:n,requesterAppId:i,reconnect:a})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:n.method}});let o=e?.linkedAccounts.find((e=>!("cross_app"!==e.type||!e.embeddedWallets.find((e=>e.address===t)))));if(!e||!o)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new x("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(o.providerApp.id),s=await Jp({api:r.api,requesterAppId:i,providerAppId:o.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new x("Cannot transact against a read-only provider app");await a({appId:o.providerApp.id,action:"link"})&&(l=r.getProviderAccessToken(o.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new x("Transactions require a valid token");let d=window.open(void 0,void 0,rm({w:400,h:680}));if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new x("Failed to initialize signature request");let c=new URL(`${s.apiUrl}/oauth/transact`);return c.searchParams.set("token",l||""),c.searchParams.set("request",tm(n)),d.location=c.href,new Promise(((e,i)=>{let a=setTimeout((()=>{c(),i(new x("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})}),12e4),l=setInterval((()=>{d.closed&&(c(),i(new x("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))}),300),s=a=>{a.data&&("set"===a.data.token?.action&&void 0!==a.data.token?.value?r.storeProviderAccessToken(o.providerApp.id,a.data.token.value):"clear"===a.data.token?.action&&r.storeProviderAccessToken(o.providerApp.id,null),"PRIVY_CROSS_APP_ACTION_RESPONSE"===a.data.type&&a.data.result&&(c(),e(a.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:n.method}})),"PRIVY_CROSS_APP_ACTION_ERROR"===a.data.type&&a.data.error&&(c(),i(a.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:a.data.error,address:t}})))};window.addEventListener("message",s);let c=()=>{d.close(),clearInterval(l),clearTimeout(a),window.removeEventListener("message",s)}}))};let tm=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin});const rm=({w:e,h:t})=>{let r=void 0!==window.screenLeft?window.screenLeft:window.screenX,n=void 0!==window.screenTop?window.screenTop:window.screenY,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${(i-e)/2/(i/window.screen.availWidth)+r},top=${(a-t)/2/(a/window.screen.availHeight)+n}`};let nm=new Set([Ee.id,ve.id,$e.id,xe.id,ye.id]),im=new Set([Ee.id,ve.id,xe.id,$e.id]),am={[Ee.id]:"ethereum",[ve.id]:"base",[$e.id]:"optimism",[xe.id]:"polygon",[ye.id]:"arbitrum"};let om=Math.floor(160);let lm=({isSucccess:n,onClickCta:i})=>{let{title:a,body:o,cta:l}=d((()=>(e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""})(n)),[n]);return e(r,{children:[e(cm,{children:[t(sm,{isSucccess:n}),e(rc,{children:[t("h3",{children:a}),t(dm,{children:o})]})]}),l&&t(Os,{onClick:i,children:l})]})},sm=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";return e("div",{style:{position:"relative"},children:[t(_s,{color:r,style:{position:"absolute"}}),t(Ss,{color:r}),t(Pl,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=(e=>e?Dr:()=>t(fn,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}))(r),i=(e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)")(r);return t("div",{style:{borderColor:i,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&t(n,{width:"4rem",height:"4rem",color:i})})},dm=yr.p`
|
|
1837
1837
|
font-size: 1rem;
|
|
1838
1838
|
color: var(--privy-color-foreground-3);
|
|
1839
1839
|
margin-bottom: 1rem;
|
|
@@ -1867,7 +1867,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1867
1867
|
border: 1px solid var(--privy-color-error);
|
|
1868
1868
|
border-radius: var(--privy-border-radius-sm);
|
|
1869
1869
|
}
|
|
1870
|
-
`;const pm=async({address:e,chain:t,rpcConfig:r,privyAppId:n})=>{try{let i=Jr({chain:t,transport:en($t(t,r,n))}),[a,o]=await Promise.all([i.readContract({abi:mm,address:e,functionName:"symbol"}),i.readContract({abi:mm,address:e,functionName:"decimals"})]);return{decimals:o,symbol:a}}catch(e){return console.log(e),null}};let mm=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];const fm="moonpay";let gm=new Set([Ee.id,ye.id,ve.id,xe.id]),ym=new Set([Ee.id,ye.id,$e.id,ve.id,xe.id]);function wm(e,t){switch(e){case ye.id:return"native-currency"===t?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case ve.id:return"native-currency"===t?"ETH_BASE":"USDC_BASE";case Ce.id:return"CELO_CELO";case xe.id:return"native-currency"===t?"MATIC_POLYGON":"USDC_POLYGON";case Ee.id:return"native-currency"===t?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function vm(e){return parseFloat(e)}function Cm(e){return!!e&&void 0!==e.config&&void 0!==e.provider}function bm(e){return!!e&&(void 0!==e.chain||void 0!==e.amount)}function Em(e,t=!1){let[r,n]=s(null),{createAnalyticsEvent:i}=O(),{data:a,navigate:o,setModalData:d}=dr(),c=a?.funding,u=l(0);return m((()=>{let r=setInterval((async()=>{if(e)try{let[a]=await async function(e,t){return mr(`${t?_e:Se}/transactions/ext/${e}`,{query:{apiKey:t?Ne:Ie}})}(e,t),l="waitingAuthorization"===a.status&&"credit_debit_card"===a.paymentMethod?"pending":a.status;if(["failed","completed","awaitingAuthorization"].includes(l)&&(i({eventName:Zh,payload:{status:l,provider:fm,paymentMethod:a.paymentMethod,cardPaymentType:a.cardPaymentType,currency:a.currency?.code,baseCurrencyAmount:a.baseCurrencyAmount,quoteCurrencyAmount:a.quoteCurrencyAmount,feeAmount:a.feeAmount,extraFeeAmount:a.extraFeeAmount,networkFeeAmount:a.networkFeeAmount,isSandbox:t}}),clearInterval(r)),"failed"===l||"serviceFailure"===l)return d({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),void o(cr.FUNDING_METHOD_SELECTION_SCREEN);n(l)}catch(e){404!==e.response?.status&&(u.current+=1),u.current>=3&&(i({eventName:Zh,payload:{status:"serviceFailure",provider:fm}}),clearInterval(r),d({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),o(cr.FUNDING_METHOD_SELECTION_SCREEN))}}),3e3);return()=>clearInterval(r)}),[e,u]),r}const $m=({size:r=61,...n})=>t("svg",{width:r,height:r,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:e("g",{id:"moonpay_symbol_wht 2",children:[t("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),t("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});let xm=({...e})=>t(Qe,{color:"black",...e}),
|
|
1870
|
+
`;const pm=async({address:e,chain:t,rpcConfig:r,privyAppId:n})=>{try{let i=Jr({chain:t,transport:en($t(t,r,n))}),[a,o]=await Promise.all([i.readContract({abi:mm,address:e,functionName:"symbol"}),i.readContract({abi:mm,address:e,functionName:"decimals"})]);return{decimals:o,symbol:a}}catch(e){return console.log(e),null}};let mm=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];const fm="moonpay";let gm=new Set([Ee.id,ye.id,ve.id,xe.id]),ym=new Set([Ee.id,ye.id,$e.id,ve.id,xe.id]);function wm(e,t){switch(e){case ye.id:return"native-currency"===t?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case ve.id:return"native-currency"===t?"ETH_BASE":"USDC_BASE";case Ce.id:return"CELO_CELO";case xe.id:return"native-currency"===t?"MATIC_POLYGON":"USDC_POLYGON";case Ee.id:return"native-currency"===t?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function vm(e){return parseFloat(e)}function Cm(e){return!!e&&void 0!==e.config&&void 0!==e.provider}function bm(e){return!!e&&(void 0!==e.chain||void 0!==e.amount)}function Em(e,t=!1){let[r,n]=s(null),{createAnalyticsEvent:i}=O(),{data:a,navigate:o,setModalData:d}=dr(),c=a?.funding,u=l(0);return m((()=>{let r=setInterval((async()=>{if(e)try{let[a]=await async function(e,t){return mr(`${t?_e:Se}/transactions/ext/${e}`,{query:{apiKey:t?Ne:Ie}})}(e,t),l="waitingAuthorization"===a.status&&"credit_debit_card"===a.paymentMethod?"pending":a.status;if(["failed","completed","awaitingAuthorization"].includes(l)&&(i({eventName:Zh,payload:{status:l,provider:fm,paymentMethod:a.paymentMethod,cardPaymentType:a.cardPaymentType,currency:a.currency?.code,baseCurrencyAmount:a.baseCurrencyAmount,quoteCurrencyAmount:a.quoteCurrencyAmount,feeAmount:a.feeAmount,extraFeeAmount:a.extraFeeAmount,networkFeeAmount:a.networkFeeAmount,isSandbox:t}}),clearInterval(r)),"failed"===l||"serviceFailure"===l)return d({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),void o(cr.FUNDING_METHOD_SELECTION_SCREEN);n(l)}catch(e){404!==e.response?.status&&(u.current+=1),u.current>=3&&(i({eventName:Zh,payload:{status:"serviceFailure",provider:fm}}),clearInterval(r),d({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),o(cr.FUNDING_METHOD_SELECTION_SCREEN))}}),3e3);return()=>clearInterval(r)}),[e,u]),r}const $m=({size:r=61,...n})=>t("svg",{width:r,height:r,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:e("g",{id:"moonpay_symbol_wht 2",children:[t("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),t("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});let xm=({...e})=>t(Qe,{color:"black",...e}),Am=r=>{let[n,i]=s(!1);return t(Im,{onClick:()=>{i(!0),navigator.clipboard.writeText(r.text),setTimeout((()=>i(!1)),1500)},children:e(Nm,{children:[n?t(Ch,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):t(Kr,{style:{height:"16px",width:"16px"}}),n?"Copied":"Copy address"]})})},km=yr.div`
|
|
1871
1871
|
display: flex;
|
|
1872
1872
|
flex-direction: row;
|
|
1873
1873
|
gap: 8px;
|
|
@@ -1935,7 +1935,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1935
1935
|
width: 18px;
|
|
1936
1936
|
height: 18px;
|
|
1937
1937
|
}
|
|
1938
|
-
`;const Pm=({title:r,desc:n,icon:i})=>e(
|
|
1938
|
+
`;const Pm=({title:r,desc:n,icon:i})=>e(Fm,{children:[t(Bm,{children:i}),e(Wm,{children:[t(Dm,{children:r}),t(Um,{children:n})]})]}),Om=({app:n,signedUrl:i,onContinue:a})=>e(r,{children:[e(Mm,{children:[t($m,{size:"3.75rem"}),e(Lm,{children:[n?.name," uses ",t("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),e(Gm,{children:[t(Pm,{icon:t(bn,{width:"1rem"}),title:"Purchase assets to fund your account",desc:e(r,{children:["Connect a payment method (",t("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),t(Pm,{icon:t(hn,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),t(Pm,{icon:t(zr,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),t(Hm,{className:"mobile-only"})]}),t(Rm,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),t(Ls,{disabled:!i,href:i??"#",target:"_blank",rel:"noopener noreferrer",onClick:a,children:"Continue to Moonpay"})]});let Rm=yr.span`
|
|
1939
1939
|
display: inline-block;
|
|
1940
1940
|
color: var(--privy-color-foreground-3);
|
|
1941
1941
|
text-align: center;
|
|
@@ -1965,12 +1965,12 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
1965
1965
|
font-weight: 500;
|
|
1966
1966
|
line-height: 1.225rem;
|
|
1967
1967
|
width: 100%;
|
|
1968
|
-
`,
|
|
1968
|
+
`,Um=yr.span`
|
|
1969
1969
|
color: var(--privy-color-foreground-2);
|
|
1970
1970
|
font-size: 0.875rem;
|
|
1971
1971
|
font-weight: 400;
|
|
1972
1972
|
line-height: 1.225rem;
|
|
1973
|
-
`,
|
|
1973
|
+
`,Fm=yr.div`
|
|
1974
1974
|
display: flex;
|
|
1975
1975
|
align-items: flex-start;
|
|
1976
1976
|
gap: 0.5rem;
|
|
@@ -2033,7 +2033,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2033
2033
|
}
|
|
2034
2034
|
`;const Zm=yr.button`
|
|
2035
2035
|
${Ym}
|
|
2036
|
-
`,Xm=({onClick:r,text:n})=>e(sd,{onClick:r,children:[t(
|
|
2036
|
+
`,Xm=({onClick:r,text:n})=>e(sd,{onClick:r,children:[t(kr,{}),t(rd,{children:n}),t(En,{})]});let Qm=yr.div`
|
|
2037
2037
|
border-radius: 50%;
|
|
2038
2038
|
height: 68px;
|
|
2039
2039
|
width: 68px;
|
|
@@ -2156,7 +2156,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2156
2156
|
}
|
|
2157
2157
|
`;const ff=({isEditable:n,setIsEditable:i,defaultValue:a})=>{let o=l(null);return e(r,{children:[t(cd,{$if:!n,children:t(hf,{ref:o,defaultValue:a})}),t(cd,{$if:n,children:e(sd,{onClick:()=>{i(),setTimeout((()=>{o.current?.focus()}),0)},children:[t(Mr,{})," Continue with Email"]})})]})},gf=()=>{let[r,n]=s(!1),{currentScreen:i,navigate:a,setModalData:o,data:l}=dr(),{enabled:d,token:c}=xs(),{initLoginWithFarcaster:u}=O(),{accountType:h}=ct();return e(sd,{onClick:async()=>{n(!0);try{d&&!c?(o({captchaModalData:{callback:e=>u(e,l?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:cr.AWAITING_FARCASTER_CONNECTION,onErrorNavigateTo:cr.ERROR_SCREEN}}),a(cr.CAPTCHA_SCREEN)):(await u(c,l?.login?.disableSignup),a(cr.AWAITING_FARCASTER_CONNECTION))}catch(e){o({errorModalData:{error:e,previousScreen:i||cr.LANDING}}),a(cr.ERROR_SCREEN)}finally{n(!1)}},disabled:!1,children:[t(Rh,{})," Farcaster",r&&t(Ns,{}),"farcaster"===h&&t(yf,{color:"gray",children:"Recent"})]})};let yf=yr(ht)`
|
|
2158
2158
|
margin-left: auto;
|
|
2159
|
-
`;const wf=({value:r,onChange:n})=>t("select",{value:r,onChange:n,children:Ro.map((t=>e("option",{value:t.code,children:[t.code," +",t.callCode]},t.code)))}),vf=w(((n,i)=>{let{app:a}=dr(),[o,l]=s(!1),{accountType:d}=ct(),[c,u]=s(""),[h,p]=s(a?.intl.defaultCountry??"US"),f=Io(c,h),g=(e=>new So(e))(h),y=(e=>{let t=function(){return bi(_o,arguments)}(e,vi)?.formatInternational();return t?.substring(t.indexOf(" ")+1)})(h),w=No(h),v=!f,[C,b]=s(!1),E=w.length,$=e=>{let t=e.target.value;p(t),u(""),n.onChange&&n.onChange({rawPhoneNumber:c,qualifiedPhoneNumber:Po(c,t),countryCode:t,isValid:Io(c,h)})},x=(e,t)=>{try{let r=e.replace(/\D/g,"")===c.replace(/\D/g,"")?e:g.input(e);u(r),n.onChange&&n.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:Po(e,t),countryCode:t,isValid:Io(e,t)})}catch(e){console.error("Error processing phone number:",e)}},
|
|
2159
|
+
`;const wf=({value:r,onChange:n})=>t("select",{value:r,onChange:n,children:Ro.map((t=>e("option",{value:t.code,children:[t.code," +",t.callCode]},t.code)))}),vf=w(((n,i)=>{let{app:a}=dr(),[o,l]=s(!1),{accountType:d}=ct(),[c,u]=s(""),[h,p]=s(a?.intl.defaultCountry??"US"),f=Io(c,h),g=(e=>new So(e))(h),y=(e=>{let t=function(){return bi(_o,arguments)}(e,vi)?.formatInternational();return t?.substring(t.indexOf(" ")+1)})(h),w=No(h),v=!f,[C,b]=s(!1),E=w.length,$=e=>{let t=e.target.value;p(t),u(""),n.onChange&&n.onChange({rawPhoneNumber:c,qualifiedPhoneNumber:Po(c,t),countryCode:t,isValid:Io(c,h)})},x=(e,t)=>{try{let r=e.replace(/\D/g,"")===c.replace(/\D/g,"")?e:g.input(e);u(r),n.onChange&&n.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:Po(e,t),countryCode:t,isValid:Io(e,t)})}catch(e){console.error("Error processing phone number:",e)}},A=()=>{b(!0);let e=Po(c,h);n.onSubmit({rawPhoneNumber:c,qualifiedPhoneNumber:e,countryCode:h,isValid:Io(c,h)}).finally((()=>b(!1)))};return m((()=>{if(n.defaultValue){let e=(e=>{let t=new So;t.input(e);let r=t.getCountry()||"US",n=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+n,"")}})(n.defaultValue);g.reset(),$({target:{value:e.countryCode}}),x(e.phone,e.countryCode)}}),[n.defaultValue]),e(r,{children:[t(Cf,{children:e(bf,{callingCodeLength:E,stacked:n.stacked,children:[t(wf,{value:h,onChange:$}),t("input",{ref:i,id:"phone-number-input",type:"tel",placeholder:y,onFocus:()=>l(!0),onChange:e=>{x(e.target.value,h)},onKeyUp:e=>{"Enter"===e.key&&A()},value:c,autoComplete:"tel"}),"phone"!==d||o||n.hideRecent?n.stacked||n.noIncludeSubmitButton?t("span",{}):t(Bs,{isSubmitting:C,onClick:A,disabled:v,children:"Submit"}):t(ht,{color:"gray",children:"Recent"})]})}),n.stacked&&!n.noIncludeSubmitButton?t(Os,{loading:C,loadingText:null,onClick:A,disabled:v,children:"Submit"}):null]})}));let Cf=yr.div`
|
|
2160
2160
|
width: 100%;
|
|
2161
2161
|
`,bf=yr.label`
|
|
2162
2162
|
--country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
|
|
@@ -2251,15 +2251,15 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2251
2251
|
&& > input::placeholder {
|
|
2252
2252
|
color: var(--privy-color-foreground-3);
|
|
2253
2253
|
}
|
|
2254
|
-
`;const Ef=({isEditable:n,setIsEditable:i,defaultValue:a})=>{let o=l(null),{authenticated:s}=he(),{navigate:d,setModalData:c,currentScreen:u,data:h}=dr(),{initLoginWithSms:p}=O(),{enabled:m,token:f}=xs();return e(r,{children:[t(cd,{$if:!n,children:t(vf,{ref:o,onSubmit:async function({qualifiedPhoneNumber:e}){if(!m||f||s)try{await p(e,f,h?.login?.disableSignup),d(cr.AWAITING_PASSWORDLESS_CODE)}catch(e){c({errorModalData:{error:e,previousScreen:u||cr.LANDING}}),d(cr.ERROR_SCREEN)}else c({captchaModalData:{callback:t=>p(e,t,h?.login?.disableSignup),userIntentRequired:!1,onSuccessNavigateTo:cr.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:cr.ERROR_SCREEN}}),d(cr.CAPTCHA_SCREEN)},defaultValue:a})}),t(cd,{$if:n,children:e(sd,{onClick:()=>{i(),setTimeout((()=>{o.current?.focus()}),0)},children:[t(Lr,{})," Continue with SMS"]})})]})};let $f={apple:{logo:t(dl,{}),displayName:"Apple"},discord:{logo:t(cl,{}),displayName:"Discord"},github:{logo:t(ul,{}),displayName:"GitHub"},google:{logo:t(pl,{}),displayName:"Google"},linkedin:{logo:t(fl,{}),displayName:"LinkedIn"},spotify:{logo:t(gl,{}),displayName:"Spotify"},instagram:{logo:t(ml,{}),displayName:"Instagram"},twitter:{logo:t(wl,{}),displayName:"Twitter"},tiktok:{logo:t(yl,{}),displayName:"TikTok"}};const xf=({provider:r})=>{let{enabled:n,token:i}=xs(),{navigate:a,setModalData:o,data:l}=dr(),[d,c]=s(!1),{initLoginWithOAuth:u}=O(),{accountType:h}=ct(),p=h?sf(h):null,{displayName:m,logo:f}=$f[r];return e(sd,{onClick:()=>{c(!0),n&&!i?(o({captchaModalData:{callback:e=>u(r,e,l?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:cr.ERROR_SCREEN}}),a(cr.CAPTCHA_SCREEN)):u(r,void 0,l?.login?.disableSignup)},disabled:d,children:[f," ",m,p?.loginMethod===r&&t(
|
|
2254
|
+
`;const Ef=({isEditable:n,setIsEditable:i,defaultValue:a})=>{let o=l(null),{authenticated:s}=he(),{navigate:d,setModalData:c,currentScreen:u,data:h}=dr(),{initLoginWithSms:p}=O(),{enabled:m,token:f}=xs();return e(r,{children:[t(cd,{$if:!n,children:t(vf,{ref:o,onSubmit:async function({qualifiedPhoneNumber:e}){if(!m||f||s)try{await p(e,f,h?.login?.disableSignup),d(cr.AWAITING_PASSWORDLESS_CODE)}catch(e){c({errorModalData:{error:e,previousScreen:u||cr.LANDING}}),d(cr.ERROR_SCREEN)}else c({captchaModalData:{callback:t=>p(e,t,h?.login?.disableSignup),userIntentRequired:!1,onSuccessNavigateTo:cr.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:cr.ERROR_SCREEN}}),d(cr.CAPTCHA_SCREEN)},defaultValue:a})}),t(cd,{$if:n,children:e(sd,{onClick:()=>{i(),setTimeout((()=>{o.current?.focus()}),0)},children:[t(Lr,{})," Continue with SMS"]})})]})};let $f={apple:{logo:t(dl,{}),displayName:"Apple"},discord:{logo:t(cl,{}),displayName:"Discord"},github:{logo:t(ul,{}),displayName:"GitHub"},google:{logo:t(pl,{}),displayName:"Google"},linkedin:{logo:t(fl,{}),displayName:"LinkedIn"},spotify:{logo:t(gl,{}),displayName:"Spotify"},instagram:{logo:t(ml,{}),displayName:"Instagram"},twitter:{logo:t(wl,{}),displayName:"Twitter"},tiktok:{logo:t(yl,{}),displayName:"TikTok"}};const xf=({provider:r})=>{let{enabled:n,token:i}=xs(),{navigate:a,setModalData:o,data:l}=dr(),[d,c]=s(!1),{initLoginWithOAuth:u}=O(),{accountType:h}=ct(),p=h?sf(h):null,{displayName:m,logo:f}=$f[r];return e(sd,{onClick:()=>{c(!0),n&&!i?(o({captchaModalData:{callback:e=>u(r,e,l?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:cr.ERROR_SCREEN}}),a(cr.CAPTCHA_SCREEN)):u(r,void 0,l?.login?.disableSignup)},disabled:d,children:[f," ",m,p?.loginMethod===r&&t(Af,{color:"gray",children:"Recent"})]})};let Af=yr(ht)`
|
|
2255
2255
|
margin-left: auto;
|
|
2256
|
-
`;function
|
|
2256
|
+
`;function kf(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...r,children:[t("defs",{children:e("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[t("stop",{offset:"0",stopColor:"#1d93d2"}),t("stop",{offset:"1",stopColor:"#38b0e3"})]})}),t("title",{children:"Telegram_logo"}),t("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),t("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),t("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),t("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}const Tf=()=>{let{enabled:r,token:n}=xs(),{navigate:i,setModalData:a,data:o}=dr(),[l,d]=s(!1),{initLoginWithTelegram:c}=O(),{accountType:u}=ct();async function h(e){try{await c(e,o?.login?.disableSignup),i(cr.TELEGRAM_AUTH_SCREEN)}catch(e){console.error(e),d(!1)}}return e(sd,{onClick:async function(){if(d(!0),r&&!n)return a({captchaModalData:{callback:h,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:cr.ERROR_SCREEN}}),void i(cr.CAPTCHA_SCREEN);await h()},disabled:l,children:[t(kf,{}),"Telegram","telegram"===u&&t(_f,{color:"gray",children:"Recent"})]})};let _f=yr(ht)`
|
|
2257
2257
|
margin-left: auto;
|
|
2258
|
-
`;const Sf=({onClick:r,text:n,icon:i})=>e(sd,{onClick:r,children:[i,t(rd,{children:n}),t(En,{})]}),Nf=({connectOnly:n})=>{let{closePrivyModal:i,connectors:a}=O(),{app:o,onUserCloseViaDialogOrKeybindRef:l,data:d}=dr(),{appearance:{palette:{colorScheme:c}}}=ue(),{accountType:u,walletClientType:h}=ct(),p=u?sf(u):null,f=o.loginMethodsAndOrder?.primary??[],g=o.loginMethodsAndOrder?.overflow??[],y=[...f,...g],w=o.loginMethods.passkey,v=d?.login,C=[];h&&y.includes(h)?C.push(h):u&&y.includes(p?.loginMethod)&&C.push(p?.loginMethod);let[b,E]=s("default"),[$,x]=s("phone"===u?"sms":"email");m((()=>{"phone"===u&&x("sms");let e=y.indexOf("sms"),t=y.indexOf("email");e>-1&&e<t&&x("sms")}),[u,f,g]);let
|
|
2258
|
+
`;const Sf=({onClick:r,text:n,icon:i})=>e(sd,{onClick:r,children:[i,t(rd,{children:n}),t(En,{})]}),Nf=({connectOnly:n})=>{let{closePrivyModal:i,connectors:a}=O(),{app:o,onUserCloseViaDialogOrKeybindRef:l,data:d}=dr(),{appearance:{palette:{colorScheme:c}}}=ue(),{accountType:u,walletClientType:h}=ct(),p=u?sf(u):null,f=o.loginMethodsAndOrder?.primary??[],g=o.loginMethodsAndOrder?.overflow??[],y=[...f,...g],w=o.loginMethods.passkey,v=d?.login,C=[];h&&y.includes(h)?C.push(h):u&&y.includes(p?.loginMethod)&&C.push(p?.loginMethod);let[b,E]=s("default"),[$,x]=s("phone"===u?"sms":"email");m((()=>{"phone"===u&&x("sms");let e=y.indexOf("sms"),t=y.indexOf("email");e>-1&&e<t&&x("sms")}),[u,f,g]);let A=()=>{i({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{E("default")}),150)};l.current=A;let k=e=>"email"===e?t(ff,{isEditable:"email"===$,setIsEditable:()=>{x("email")},defaultValue:"email"===v?.prefill?.type?v.prefill.value:void 0},e):"sms"===e?t(Ef,{isEditable:"sms"===$,setIsEditable:()=>{x("sms")},defaultValue:"phone"===v?.prefill?.type?v.prefill.value:void 0},e):"apple"===e?t(xf,{provider:"apple"},e):"discord"===e?t(xf,{provider:"discord"},e):"farcaster"===e?t(gf,{},e):"github"===e?t(xf,{provider:"github"},e):"google"===e?t(xf,{provider:"google"},e):"linkedin"===e?t(xf,{provider:"linkedin"},e):"spotify"===e?t(xf,{provider:"spotify"},e):"instagram"===e?t(xf,{provider:"instagram"},e):"tiktok"===e?t(xf,{provider:"tiktok"},e):"twitter"===e?t(xf,{provider:"twitter"},e):"telegram"===e?t(Tf,{},e):Hc([e],o.appearance.walletChainType,a,n,y,o.externalWallets.walletConnect.enabled),T=C.flatMap(k),_=f.filter((e=>e!==h&&e!==p?.loginMethod)).flatMap(k),S=g.filter((e=>e!==h&&e!==p?.loginMethod)).flatMap(k),[N,I]=Ot([...T,..._,...S],If({primary:_.length+T.length,overflow:S.length}));return e(r,{children:[t(Ks,{title:o.appearance.landingHeader,onClose:A,backFn:"default"===b?void 0:()=>{E("default")}}),"default"===b&&t(Pf,{}),"default"===b&&("string"==typeof o.appearance.loginMessage?t(ld,{children:o.appearance.loginMessage}):o.appearance.loginMessage),t(nd,{style:{overflow:"hidden"},children:e(ad,{$colorScheme:c,style:{maxHeight:400,overflowY:"scroll",padding:2},children:["default"===b&&e(r,{children:[...N,I.length>0&&t(Sf,{text:"More options",icon:t(Yr,{}),onClick:()=>E("overflow")})]}),"overflow"===b&&e(r,{children:[...I]}),w&&"default"===b&&t(Km,{})]})}),o&&t(mt,{app:o}),t(lt,{})]})};let If=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,Pf=yr(cf)`
|
|
2259
2259
|
margin-bottom: 16px;
|
|
2260
|
-
`;const Of=({...r})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...r,children:[e("g",{clipPath:"url(#clip0_2856_1743)",children:[t("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),t("defs",{children:t("clipPath",{id:"clip0_2856_1743",children:t("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),Rf=({connectOnly:n})=>{let{closePrivyModal:i,connectors:a}=O(),{data:o,onUserCloseViaDialogOrKeybindRef:l}=dr(),c=ue(),{accountType:u,walletClientType:h}=ct(),p=u?sf(u):null,f=o?.login,{email:g,sms:y,google:w,twitter:v,discord:C,github:b,spotify:E,instagram:$,tiktok:x,linkedin:
|
|
2260
|
+
`;const Of=({...r})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...r,children:[e("g",{clipPath:"url(#clip0_2856_1743)",children:[t("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),t("defs",{children:t("clipPath",{id:"clip0_2856_1743",children:t("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),Rf=({connectOnly:n})=>{let{closePrivyModal:i,connectors:a}=O(),{data:o,onUserCloseViaDialogOrKeybindRef:l}=dr(),c=ue(),{accountType:u,walletClientType:h}=ct(),p=u?sf(u):null,f=o?.login,{email:g,sms:y,google:w,twitter:v,discord:C,github:b,spotify:E,instagram:$,tiktok:x,linkedin:A,apple:k,wallet:T,farcaster:_,telegram:S}=d((()=>f?.loginMethods?((e,t=!0)=>e.reduce(((e,r)=>({...e,[r]:t})),{}))(f.loginMethods,!0):null),[f])??c.loginMethods,{passkey:N}=c.loginMethods,I=[g&&"email",y&&"sms",w&&"google",v&&"twitter",C&&"discord",b&&"github",E&&"spotify",$&&"instagram",x&&"tiktok",A&&"linkedin",k&&"apple",_&&"farcaster",S&&"telegram"].filter((e=>!!e)),P=I.length>0,R=d((()=>T&&!P?"web3-first":T&&c?.appearance.loginGroupPriority||"web2-first"),[T,P,c?.appearance.loginGroupPriority]),M=c?.appearance.hideDirectWeb2Inputs,[L,D]=s("default"),[U,F]=s(Ff({mostRecentlyUsedAccountType:u,smsAvailable:y,emailAvailable:g,prefilledType:f?.prefill?.type}));m((()=>{F(Ff({mostRecentlyUsedAccountType:u,smsAvailable:y,emailAvailable:g,prefilledType:f?.prefill?.type}))}),[g,y,u]);let W=()=>{i({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{D("default")}),150)};l.current=W;let B=[];h&&T?B.push(h):p?.loginMethod&&I.includes(p.loginMethod)&&B.push(p.loginMethod);let G=e=>"email"===e?t(ff,{isEditable:"email"===U,setIsEditable:()=>{F("email")},defaultValue:"email"===f?.prefill?.type?f.prefill.value:void 0},e):"sms"===e?t(Ef,{isEditable:"sms"===U,setIsEditable:()=>{F("sms")},defaultValue:"phone"===f?.prefill?.type?f.prefill.value:void 0},e):"apple"===e?t(xf,{provider:"apple"},e):"discord"===e?t(xf,{provider:"discord"},e):"farcaster"===e?t(gf,{},e):"github"===e?t(xf,{provider:"github"},e):"google"===e?t(xf,{provider:"google"},e):"linkedin"===e?t(xf,{provider:"linkedin"},e):"tiktok"===e?t(xf,{provider:"tiktok"},e):"spotify"===e?t(xf,{provider:"spotify"},e):"instagram"===e?t(xf,{provider:"instagram"},e):"twitter"===e?t(xf,{provider:"twitter"},e):"telegram"===e?t(Tf,{},e):Hc([e],c.appearance.walletChainType,a,n,[],c.externalWallets.walletConnect.enabled),H=Hc(c.appearance.walletList.filter((e=>e!==h)),c.appearance.walletChainType,a,n,[...c.appearance.walletList,h],c.externalWallets.walletConnect.enabled),z=I.filter((e=>e!==p?.loginMethod)).flatMap(G),j=B.flatMap(G);"web3-first"===R&&"default"===L?H.unshift(...j):"web2-first"===R&&z.unshift(...j);let q=I.filter((e=>"email"!==e&&"sms"!==e)),V=Lf({priority:R,email:g,sms:y,social:q}),K=Df({priority:R,email:g,sms:y,social:q}),Y=t(Xm,{text:Uf({priority:R}),onClick:()=>D("web3-overflow")}),Z=t(Sf,{text:V,icon:K,onClick:()=>D("web2-overflow")}),X=M?0:1;return e(r,{children:[t(Ks,{title:c.appearance.landingHeader,onClose:W,backFn:"default"===L?void 0:()=>{D("default")}}),"default"===L&&t(Mf,{}),"default"===L&&("string"==typeof c.appearance.loginMessage?t(ld,{children:c.appearance.loginMessage}):c.appearance.loginMessage),t(nd,{style:{overflow:"hidden",padding:2},children:e(id,{children:["default"===L&&"web2-first"===R&&e(r,{children:[...z.length>4?z.slice(0,3):z,z.length>4&&Z,T&&Y]}),"default"===L&&"web3-first"===R&&e(r,{children:[T&&e(r,{children:[...H.length>4?H.slice(0,3):H,H.length>4&&Y]}),z.length>X&&Z,z.length===X&&z[0]]}),"web2-overflow"===L&&e(r,{children:[..."web3-first"===R?z:z.slice(3)]}),..."web3-overflow"===L?H:[],N&&"default"===L&&t(Km,{})]})}),c&&t(mt,{app:c}),t(lt,{})]})};let Mf=yr(cf)`
|
|
2261
2261
|
margin-bottom: 16px;
|
|
2262
|
-
`,Lf=({priority:e,email:t,sms:r,social:n})=>"web2-first"===e?"Other socials":t&&r&&n.length>0||t&&n.length>0?"Log in with email or socials":r&&n.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",Df=({priority:e,email:r,sms:n,social:i})=>"web2-first"===e||i.length>0?t(Yr,{}):r&&n?t(Of,{}):r?t(Mr,{}):n?t(Lr,{}):null,
|
|
2262
|
+
`,Lf=({priority:e,email:t,sms:r,social:n})=>"web2-first"===e?"Other socials":t&&r&&n.length>0||t&&n.length>0?"Log in with email or socials":r&&n.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",Df=({priority:e,email:r,sms:n,social:i})=>"web2-first"===e||i.length>0?t(Yr,{}):r&&n?t(Of,{}):r?t(Mr,{}):n?t(Lr,{}):null,Uf=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets",Ff=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:r,prefilledType:n})=>r&&("email"===e&&"phone"!==n||"email"===n)||!t||"phone"!==e&&"phone"!==n?"email":"sms";const Wf=({style:r,...n})=>e("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...r},...n,children:[t("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});function Bf(){let{promptMfa:e,init:t,submit:r,cancel:n,mfaMethods:i}=h(Pe);return{promptMfa:e,init:t,submit:r,cancel:n,mfaMethods:i}}function Gf(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:n,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:a,unenroll:o,enrollInMfa:l}=h(Pe);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:n,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:a,unenrollWithSms:()=>o("sms"),unenrollWithTotp:()=>o("totp"),unenrollWithPasskey:()=>o("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}const Hf=r=>e(zf,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...r,children:[t("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]});let zf=yr.svg`
|
|
2263
2263
|
height: 90px;
|
|
2264
2264
|
width: 90px;
|
|
2265
2265
|
|
|
@@ -2270,7 +2270,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2270
2270
|
> path {
|
|
2271
2271
|
fill: white;
|
|
2272
2272
|
}
|
|
2273
|
-
`;const jf=({showIntro:n,userMfaMethods:i,appMfaMethods:a,userHasAuthSms:o,isTotpLoading:l,isPasskeyLoading:s,error:d,onClose:c,onBackToIntro:u,handleSelectMethod:h,setRemovingMfaMethod:p})=>{let m=i.reduce(((e,t)=>({...e,[t]:!0})),{}),f=a.reduce(((e,t)=>({...e,[t]:!0})),{});return e(r,{children:[t(Ks,{backFn:n?u:void 0,onClose:c},"header"),t(Td,{children:t(Hd,{children:t(Tn,{})})}),t(_d,{children:"Choose a verification method"}),i.length>0?t(Sd,{children:"To add or delete verification methods, verification is required."}):t(Sd,{children:"How would you like to verify your identity? You can change this later."}),d&&t(zd,{style:{marginTop:"1.25rem"},children:d.message}),e(Md,{children:[(f.totp||m.totp)&&e(Ld,{children:[t(sd,{style:{justifyContent:"center"},disabled:m.totp||l,onClick:()=>h("totp"),children:l?t(_s,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):e(Wd,{children:[e(
|
|
2273
|
+
`;const jf=({showIntro:n,userMfaMethods:i,appMfaMethods:a,userHasAuthSms:o,isTotpLoading:l,isPasskeyLoading:s,error:d,onClose:c,onBackToIntro:u,handleSelectMethod:h,setRemovingMfaMethod:p})=>{let m=i.reduce(((e,t)=>({...e,[t]:!0})),{}),f=a.reduce(((e,t)=>({...e,[t]:!0})),{});return e(r,{children:[t(Ks,{backFn:n?u:void 0,onClose:c},"header"),t(Td,{children:t(Hd,{children:t(Tn,{})})}),t(_d,{children:"Choose a verification method"}),i.length>0?t(Sd,{children:"To add or delete verification methods, verification is required."}):t(Sd,{children:"How would you like to verify your identity? You can change this later."}),d&&t(zd,{style:{marginTop:"1.25rem"},children:d.message}),e(Md,{children:[(f.totp||m.totp)&&e(Ld,{children:[t(sd,{style:{justifyContent:"center"},disabled:m.totp||l,onClick:()=>h("totp"),children:l?t(_s,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):e(Wd,{children:[e(Ud,{children:[t(_n,{}),"Authenticator App"]}),m.totp?e(Fd,{children:[t(Rr,{}),"Added"]}):t(Fd,{children:"Recommended"})]})}),m.totp&&t(Dd,{onClick:()=>p("totp"),children:t(pn,{})})]},"totp"),(f.sms||m.sms)&&e(Ld,{children:[t(sd,{disabled:m.sms||o,onClick:()=>h("sms"),children:e(Wd,{children:[e(Ud,{children:[t(Lr,{}),"SMS"]}),m.sms&&e(Fd,{children:[t(Rr,{}),"Added"]}),o&&t(Fd,{children:"Disabled"})]})}),m.sms&&t(Dd,{onClick:()=>p("sms"),children:t(pn,{})})]},"sms"),(f.passkey||m.passkey)&&e(Ld,{children:[t(sd,{style:{justifyContent:"center"},onClick:()=>h("passkey"),disabled:m.passkey||s,children:s?t(_s,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):e(Wd,{children:[e(Ud,{children:[t(Sn,{}),"Passkey"]}),m.passkey?e(Fd,{children:[t(Rr,{}),"Added"]}):t(Fd,{isAccent:!0,children:t(En,{})})]})}),m.passkey&&t(Dd,{onClick:()=>p("passkey"),children:t(pn,{})})]},"passkey")]}),t(dt,{})]})},qf=({onComplete:e,onClose:r,onReset:n})=>{let{user:i}=he(),{data:a}=dr(),{initLinkWithPasskey:o,linkWithPasskey:l}=O(),{initEnrollmentWithPasskey:c,submitEnrollmentWithPasskey:u}=Gf(),[h,p]=s(!1),[m,f]=s(!1),[g,y]=s(!1),[w,v]=s(null),C=d((()=>i?.linkedAccounts.filter((e=>"passkey"===e.type))??[]),[i]),b=()=>{a?.mfaEnrollmentFlow?.onSuccess(),e()},E=async e=>{p(!0);try{await c(),await u({credentialIds:e}),y(!0)}catch(e){v(e)}finally{p(!1)}},$=async()=>{f(!0),v(null);try{await o();let e=await l(),t=e?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];await E(t)}catch(e){v(e)}finally{f(!1)}};return 0===C.length||m?t(Vf,{onReset:n,onClose:r,onClick:$,isCreating:m}):g?t(Yf,{onClick:b,onClose:b}):w?t(yh,{error:w,backFn:()=>v(null),onClick:()=>v(null)}):t(Kf,{passkeys:C,isSubmitting:h,isCreating:m,onReset:n,onClose:r,onSubmitEnrollment:()=>E(C.map((e=>e.credentialId))),onAddPasskey:$})};let Vf=({onReset:n,onClose:i,onClick:a,isCreating:o})=>e(r,{children:[t(Ks,{backFn:n,onClose:i},"header"),t(Td,{children:e(Ep,{children:[t(wp,{}),t(vp,{})]})}),t(_d,{children:"Set up passkey verification"}),e(Id,{children:[e(Od,{children:[t(Pd,{children:t(In,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),e(Od,{children:[t(Pd,{children:t(hn,{})}),"Takes seconds to set up and use"]}),e(Od,{children:[t(Pd,{children:t(Nn,{})}),"Use your passkey to verify transactions and login to your account"]})]}),t(Os,{style:{marginTop:"2.25rem"},onClick:a,loading:o,children:"Add a new passkey"}),t(dt,{})]}),Kf=({onReset:n,onClose:i,onAddPasskey:a,onSubmitEnrollment:o,passkeys:l,isSubmitting:d,isCreating:c})=>{let[u,h]=s(!1),p=u?l.length:l.length>3?2:3;return e(r,{children:[t(Ks,{backFn:u?()=>h(!1):n,onClose:i},"header"),!u&&t(Td,{children:e(Ep,{children:[t(wp,{}),t(vp,{})]})}),t(_d,{children:"Enable your passkeys for verification"}),e(Id,{children:[l.slice(0,p).map((r=>e(Zf,{children:[t(Xf,{children:Jf(r)}),e(Qf,{children:["Last used: ",r.latestVerifiedAt?.toLocaleString()]})]},r.credentialId))),!u&&l.length>3&&t(eg,{onClick:()=>h(!0),children:"View All"})]}),t(Os,{style:{marginTop:"1.5rem"},onClick:o,loading:d,children:"Enable passkeys"}),l.length<5&&t(eg,{style:{marginTop:"0.5rem"},onClick:a,disabled:c,children:c?t(_s,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),t(dt,{})]})},Yf=({onClick:n,onClose:i})=>e(r,{children:[t(Ks,{onClose:i},"header"),t(Td,{children:t(Hd,{status:"success",children:t(Dr,{})})}),t(_d,{children:"Passkey verification added"}),t(Sd,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),t(Rd,{children:t(Os,{onClick:n,children:"Done"})}),t(dt,{})]}),Zf=yr.div`
|
|
2274
2274
|
&& {
|
|
2275
2275
|
padding: 0.75rem 1rem;
|
|
2276
2276
|
text-align: left;
|
|
@@ -2391,7 +2391,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2391
2391
|
width: 100%;
|
|
2392
2392
|
|
|
2393
2393
|
color: ${e=>e.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
2394
|
-
`;const dg=({onComplete:n,onReset:i,onClose:a})=>{let[o,l]=s(""),[d,c]=s(!1),[u,h]=s(null),[p,m]=s("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:g}=Gf(),{app:y,data:w}=dr();function v(){w?.mfaEnrollmentFlow?.onSuccess(),n()}return u?t(yh,{error:u,backFn:()=>h(null),onClick:()=>h(null)}):e(r,"enroll"===p?{children:[t(Ks,{backFn:i,onClose:a},"header"),t(Td,{children:t(Hd,{children:t(
|
|
2394
|
+
`;const dg=({onComplete:n,onReset:i,onClose:a})=>{let[o,l]=s(""),[d,c]=s(!1),[u,h]=s(null),[p,m]=s("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:g}=Gf(),{app:y,data:w}=dr();function v(){w?.mfaEnrollmentFlow?.onSuccess(),n()}return u?t(yh,{error:u,backFn:()=>h(null),onClick:()=>h(null)}):e(r,"enroll"===p?{children:[t(Ks,{backFn:i,onClose:a},"header"),t(Td,{children:t(Hd,{children:t(An,{})})}),t(_d,{children:"Set up SMS verification"}),t(Sd,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),e(Nd,{children:[t(vf,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await f({phoneNumber:e}),l(e),m("verify")}catch(e){h(e)}},hideRecent:!0}),e(Bd,{children:["By providing your mobile number, you agree to receive text messages from ",y?.name,". Some carrier charges may apply"]})]}),t(dt,{})]}:d?{children:[t(Ks,{onClose:v},"header"),t(Td,{children:t(Hd,{status:"success",children:t(Dr,{})})}),t(_d,{children:"SMS verification added"}),t(Sd,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),t(Rd,{children:t(Os,{onClick:v,children:"Done"})}),t(dt,{})]}:{children:[t(Ks,{backFn:function(){"verify"===p?m("enroll"):i()},onClose:a},"header"),t(Td,{children:t(Hd,{children:t(An,{})})}),t(_d,{children:"Enter enrollment code"}),e(Nd,{children:[t(og,{onChange:async function(e){try{if(!e)return;await g({phoneNumber:o,mfaCode:e}),c(!0)}catch(e){if(du(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(lu(e))throw Error("The code you entered is not valid");if(ou(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw cu(e)?Error("Verification canceled"):Error("Unknown error")}}}),e(Sd,{children:["To continue, enter the 6-digit code sent to ",t("strong",{children:Oo(o)})]})]}),t(dt,{})]})},cg=({size:e,authUrl:r})=>t(Oh,{url:r,squareLogoElement:Tn,size:e,fgColor:"#1F1F1F"}),ug=({onComplete:n,onClose:i,onReset:a,totpInfo:o})=>{let[l,d]=s("enroll"),[c,u]=s(!1),{submitEnrollmentWithTotp:h}=Gf(),{data:p}=dr();function m(){p?.mfaEnrollmentFlow?.onSuccess(),n()}return e(r,"enroll"===l?{children:[t(Ks,{backFn:a,onClose:i},"header"),t(_d,{children:"Scan QR code"}),t(Sd,{children:"Open your authenticator app and scan the QR code to continue."}),t(Jd,{children:t(cg,{authUrl:o.authUrl,size:200})}),e(Rd,{children:[t(Xd,{children:t(bh,{itemName:"secret",text:o.secret})}),t(Os,{onClick:function(){d("verify")},children:"Continue"})]}),t(dt,{})]}:c?{children:[t(Ks,{onClose:m},"header"),t(Td,{children:t(Hd,{status:"success",children:t(Dr,{})})}),t(_d,{children:"Authenticator app verification added"}),t(Sd,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),t(Rd,{children:t(Os,{onClick:m,children:"Done"})}),t(dt,{})]}:{children:[t(Ks,{backFn:function(){"verify"===l?d("enroll"):a()},onClose:i},"header"),t(Td,{children:t(Hd,{children:t($n,{})})}),t(_d,{children:"Enter enrollment code"}),t(Nd,{children:t(og,{onChange:async function(e){try{if(!e)return;await h({mfaCode:e}),u(!0)}catch(e){if(du(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(lu(e))throw Error("The code you entered is not valid");if(ou(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw cu(e)?Error("Verification canceled"):Error("Unknown error")}}})}),e(Sd,{children:["To continue, enter the 6-digit code generated from your ",t("strong",{children:"authenticator app"})]}),t(dt,{})]})},hg=({label:r,children:n,valueStyles:i})=>e(pg,{children:[t("div",{children:r}),t(mg,{style:{...i},children:n})]});let pg=yr.div`
|
|
2395
2395
|
display: flex;
|
|
2396
2396
|
align-items: center;
|
|
2397
2397
|
justify-content: space-between;
|
|
@@ -2415,7 +2415,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2415
2415
|
border-radius: var(--privy-border-radius-full);
|
|
2416
2416
|
background-color: var(--privy-color-background-2);
|
|
2417
2417
|
padding: 4px 8px;
|
|
2418
|
-
`,fg=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function gg(e,t=6,r=!1){let n=(parseFloat(e.toString())/1e9).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return r?`${n} SOL`:`${"0"===n?"<0.001":n} SOL`}function yg(e,t){let r=parseFloat(e.toString())/1e9,n=fg.format(t*r);return"$0.00"===n?"<$0.01":n}function wg(e){return"version"in e}function vg(e,t,r=0){let n="from"===t?0:"to"===t?1:2;if(wg(e)){let t=e.message.getAccountKeys(),i=e.message.compiledInstructions.at(r)?.accountKeyIndexes[n];if(null==i)throw Error("Transaction does not contain a public key");let a=t.get(i);if(!a)throw Error("Transaction does not contain a public key");return a}let i=e.instructions.at(r)?.keys.at(n)?.pubkey;if(null==i)throw Error("Transaction does not contain a public key");return i}function Cg(e,t=!1,r=0){let n=t?1:4;if(wg(e)){let t=e.message.compiledInstructions.at(r)?.data;if(!t)throw Error("Transaction does not contain data");return Buffer.from(t).readBigInt64LE(n)}let i=e.instructions.at(r)?.data.readBigInt64LE(n);if(null==i)throw Error("Transaction does not contain lamports");return i}function bg(e,t=0){let r;if(wg(e)){let n=e.message.compiledInstructions.at(t)?.programIdIndex;if(null==n)throw Error("Transaction does not contain a Program ID");r=e.message.getAccountKeys().get(n)?.toBase58()}else r=e.instructions.at(t)?.programId.toBase58();if(!r)throw Error("Transaction does not contain a Program ID");if("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"===r)return"approve";if("11111111111111111111111111111111"===r)return"transfer";throw Error("Unsupported Program ID")}function Eg(e,t){return{signature:e,parsedTransaction:t,fees:BigInt(t?.meta?.fee||0)}}async function $g(e,t){let r=[],n=wg(e)?e.message.compiledInstructions.length:e.instructions.length,i={},a=BigInt(await async function(e,t){return wg(e)?(await t.getFeeForMessage(e.message)).value:await e.getEstimatedFee(t)}(e,t)||0);for(let a=0;a<n;a++){let n=bg(e,a),o=vg(e,"from",a),l=vg(e,"to",a),s=Cg(e,"approve"===n,a),d="transfer"===n?void 0:vg(e,"owner",a);null==i[o.toBase58()]&&(i[o.toBase58()]=BigInt(await t.getBalance(o)));let c=i[o.toBase58()]||0n;r.push({from:o,to:l,spender:d,action:n,amount:s,balance:c,hasFunds:c>=s})}return{fees:a,instructions:r}}const xg=({weiQuantities:e,tokenPrice:r,tokenSymbol:n})=>{let i=Nt(e),a=r?It(i,r):void 0,o=Tt(i,n);return t(Tg,{children:a||o})},
|
|
2418
|
+
`,fg=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function gg(e,t=6,r=!1){let n=(parseFloat(e.toString())/1e9).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return r?`${n} SOL`:`${"0"===n?"<0.001":n} SOL`}function yg(e,t){let r=parseFloat(e.toString())/1e9,n=fg.format(t*r);return"$0.00"===n?"<$0.01":n}function wg(e){return"version"in e}function vg(e,t,r=0){let n="from"===t?0:"to"===t?1:2;if(wg(e)){let t=e.message.getAccountKeys(),i=e.message.compiledInstructions.at(r)?.accountKeyIndexes[n];if(null==i)throw Error("Transaction does not contain a public key");let a=t.get(i);if(!a)throw Error("Transaction does not contain a public key");return a}let i=e.instructions.at(r)?.keys.at(n)?.pubkey;if(null==i)throw Error("Transaction does not contain a public key");return i}function Cg(e,t=!1,r=0){let n=t?1:4;if(wg(e)){let t=e.message.compiledInstructions.at(r)?.data;if(!t)throw Error("Transaction does not contain data");return Buffer.from(t).readBigInt64LE(n)}let i=e.instructions.at(r)?.data.readBigInt64LE(n);if(null==i)throw Error("Transaction does not contain lamports");return i}function bg(e,t=0){let r;if(wg(e)){let n=e.message.compiledInstructions.at(t)?.programIdIndex;if(null==n)throw Error("Transaction does not contain a Program ID");r=e.message.getAccountKeys().get(n)?.toBase58()}else r=e.instructions.at(t)?.programId.toBase58();if(!r)throw Error("Transaction does not contain a Program ID");if("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"===r)return"approve";if("11111111111111111111111111111111"===r)return"transfer";throw Error("Unsupported Program ID")}function Eg(e,t){return{signature:e,parsedTransaction:t,fees:BigInt(t?.meta?.fee||0)}}async function $g(e,t){let r=[],n=wg(e)?e.message.compiledInstructions.length:e.instructions.length,i={},a=BigInt(await async function(e,t){return wg(e)?(await t.getFeeForMessage(e.message)).value:await e.getEstimatedFee(t)}(e,t)||0);for(let a=0;a<n;a++){let n=bg(e,a),o=vg(e,"from",a),l=vg(e,"to",a),s=Cg(e,"approve"===n,a),d="transfer"===n?void 0:vg(e,"owner",a);null==i[o.toBase58()]&&(i[o.toBase58()]=BigInt(await t.getBalance(o)));let c=i[o.toBase58()]||0n;r.push({from:o,to:l,spender:d,action:n,amount:s,balance:c,hasFunds:c>=s})}return{fees:a,instructions:r}}const xg=({weiQuantities:e,tokenPrice:r,tokenSymbol:n})=>{let i=Nt(e),a=r?It(i,r):void 0,o=Tt(i,n);return t(Tg,{children:a||o})},Ag=({weiQuantities:n,tokenPrice:i,tokenSymbol:a})=>{let o=Nt(n),l=i?It(o,i):void 0,s=Tt(o,a);return t(Tg,{children:l?e(r,{children:[t(_g,{children:"USD"}),"<$0.01"===l?e(Ng,{children:[t(Sg,{children:"<"}),"$0.01"]}):l]}):s})},kg=({quantities:n,tokenPrice:i})=>{let a=n.reduce(((e,t)=>e+t),0n),o=i?yg(a,i):void 0,l=gg(a);return t(Tg,{children:o?t(r,{children:"<$0.01"===o?e(Ng,{children:[t(Sg,{children:"<"}),"$0.01"]}):o}):l})};let Tg=yr.span`
|
|
2419
2419
|
font-size: 14px;
|
|
2420
2420
|
line-height: 140%;
|
|
2421
2421
|
display: flex;
|
|
@@ -2430,7 +2430,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2430
2430
|
`,Ng=yr.span`
|
|
2431
2431
|
display: flex;
|
|
2432
2432
|
align-items: center;
|
|
2433
|
-
`;const Ig=({gas:r,tokenPrice:n,tokenSymbol:i})=>e(tc,{style:{paddingBottom:"12px"},children:[e(Og,{children:[t(Mg,{children:"Est. Fees"}),t("div",{children:t(
|
|
2433
|
+
`;const Ig=({gas:r,tokenPrice:n,tokenSymbol:i})=>e(tc,{style:{paddingBottom:"12px"},children:[e(Og,{children:[t(Mg,{children:"Est. Fees"}),t("div",{children:t(Ag,{weiQuantities:[r],tokenPrice:n,tokenSymbol:i})})]}),n&&t(Rg,{children:`${Tt(r,i)}`})]}),Pg=({transactionData:r,gas:n,tokenPrice:i,tokenSymbol:a})=>{let o=ze(r.value||0).add(ze(n)).toHexString();return e(tc,{children:[e(Og,{children:[t(Mg,{children:"Total (including fees)"}),t("div",{children:t(Ag,{weiQuantities:[r.value||0,n],tokenPrice:i,tokenSymbol:a})})]}),i&&t(Rg,{children:Tt(o,a)})]})};let Og=yr.div`
|
|
2434
2434
|
display: flex;
|
|
2435
2435
|
flex-direction: row;
|
|
2436
2436
|
justify-content: space-between;
|
|
@@ -2449,7 +2449,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2449
2449
|
font-size: 14px;
|
|
2450
2450
|
line-height: 22.4px;
|
|
2451
2451
|
font-weight: 400;
|
|
2452
|
-
`;const Lg=p(void 0),Dg=p(void 0),
|
|
2452
|
+
`;const Lg=p(void 0),Dg=p(void 0),Ug=({defaultValue:e,children:r})=>{let[n,i]=s(e||null);return t(Lg.Provider,{value:{activePanel:n,togglePanel:e=>{i(n===e?null:e)}},children:t(Hg,{children:r})})},Fg=({value:e,children:r})=>{let{activePanel:n,togglePanel:i}=h(Lg),a=n===e;return t(Dg.Provider,{value:{onToggle:()=>i(e),value:e},children:t(Vg,{isActive:a,"data-open":a,children:r})})},Wg=({children:n})=>{let{activePanel:i}=h(Lg),{onToggle:a,value:o}=h(Dg),l=i===o;return e(r,{children:[e(zg,{onClick:a,"data-open":l,children:[t(qg,{children:n}),t(Zg,{isactive:l,children:t(Dn,{height:"16px",width:"16px",strokeWidth:"2"})})]}),t(jg,{})]})},Bg=({children:e})=>{let{activePanel:r}=h(Lg),{value:n}=h(Dg);return t(Kg,{"data-open":r===n,children:t(Yg,{children:e})})},Gg=({children:e})=>{let{activePanel:r}=h(Lg),{value:n}=h(Dg);return t(Yg,{children:"function"==typeof e?e({isActive:r===n}):e})};let Hg=yr.div`
|
|
2453
2453
|
display: flex;
|
|
2454
2454
|
flex-direction: column;
|
|
2455
2455
|
width: 100%;
|
|
@@ -2511,17 +2511,17 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2511
2511
|
&:hover {
|
|
2512
2512
|
text-decoration: underline;
|
|
2513
2513
|
}
|
|
2514
|
-
`;const ty=({from:r,to:n,txn:i,transactionInfo:a,tokenPrice:o,gas:l,tokenSymbol:s})=>{let d=i?.value||0;return t(
|
|
2514
|
+
`;const ty=({from:r,to:n,txn:i,transactionInfo:a,tokenPrice:o,gas:l,tokenSymbol:s})=>{let d=i?.value||0;return t(Ug,{...ue().render.standalone?{defaultValue:"details"}:{},children:e(Fg,{value:"details",children:[t(Wg,{children:e(ry,{children:[t("div",{children:a?.title||a?.actionDescription||"Details"}),t(ny,{children:t(xg,{weiQuantities:[d],tokenPrice:o,tokenSymbol:s})})]})}),e(Bg,{children:[t(hg,{label:"From",children:t(Jg,{walletAddress:r,chainId:i.chainId||ge,network:"ethereum"})}),t(hg,{label:"To",children:t(Jg,{walletAddress:n,chainId:i.chainId||ge,network:"ethereum"})}),a&&a.action&&t(hg,{label:"Action",children:a.action}),l&&t(Ig,{transactionData:i,gas:l,tokenPrice:o,tokenSymbol:s})]}),t(Gg,{children:({isActive:e})=>t(Pg,{transactionData:i,displayFee:e,gas:l||"0x0",tokenPrice:o,tokenSymbol:s})})]})})};let ry=yr.div`
|
|
2515
2515
|
display: flex;
|
|
2516
2516
|
flex-direction: row;
|
|
2517
2517
|
justify-content: space-between;
|
|
2518
2518
|
`,ny=yr.div`
|
|
2519
2519
|
flex-shrink: 0;
|
|
2520
2520
|
padding-left: 8px;
|
|
2521
|
-
`;const iy=({pendingTransaction:e})=>{let{getAccessToken:r}=he(),{wallets:n}=
|
|
2521
|
+
`;const iy=({pendingTransaction:e})=>{let{getAccessToken:r}=he(),{wallets:n}=ke(),{walletProxy:i,rpcConfig:a,chains:o,appId:l,nativeTokenSymbolForChainId:c}=O(),[u,h]=s(null),[p,f]=s(e),{tokenPrice:g}=Vh(p),y=c(e.chainId)||"ETH",w=d((()=>n.find((e=>"privy"===e.walletClientType))),[n]);return m((()=>{(async function(){if(!await r()||!i||!w)return p;let e=Ve(p.chainId,o,a,{appId:l}),t=await wi(w.address,p,e),{totalGasEstimate:n}=await gi(t,e);return h(n.toHexString()),t})().then(f).catch(console.error)}),[i]),w?t(ay,{children:t(ty,{from:w.address,to:p.to,txn:p,gas:u??void 0,tokenPrice:g,tokenSymbol:y})}):null};let ay=yr.div`
|
|
2522
2522
|
width: 100%;
|
|
2523
2523
|
padding: 1rem 0;
|
|
2524
|
-
`;const oy=({hasBlockingError:n,error:i,onClose:a,onBack:o,handleSubmit:l,account:s,submitSuccess:d})=>{let{pendingTransaction:c}=O();return e(r,{children:[t(Ks,{onClose:a},"header"),t(td,{children:e("div",{children:[t(Ts,{success:d,fail:!!i}),t(i?
|
|
2524
|
+
`;const oy=({hasBlockingError:n,error:i,onClose:a,onBack:o,handleSubmit:l,account:s,submitSuccess:d})=>{let{pendingTransaction:c}=O();return e(r,{children:[t(Ks,{onClose:a},"header"),t(td,{children:e("div",{children:[t(Ts,{success:d,fail:!!i}),t(i?Ar:wp,{style:{width:"38px",height:"38px"}})]})}),t(_d,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),e(Id,{children:[e(Od,{children:[t(Pd,{children:t(In,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),e(Od,{children:[t(Pd,{children:t(Un,{})}),"You last added a passkey on"," ",s?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),c&&t(Nd,{children:t(iy,{pendingTransaction:c})}),i&&e(r,{children:[t(zd,{style:{marginTop:"1.25rem"},children:i.message}),t(Os,{disabled:n,onClick:l,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&t(Gd,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),t(dt,{})]})},ly=({open:n,onClose:i})=>{let{user:a}=he(),[o,l]=s(null),{init:d,cancel:c,submit:u}=Bf(),[h,p]=s(!1),[f,g]=s(!1),[y,w]=s(null),[v,C]=s(null);m((()=>{n&&a?.mfaMethods&&a.mfaMethods.length>0?$(a.mfaMethods[0]):l(null)}),[a?.mfaMethods,n]);let b=e=>su(e)?(p(!0),Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):lu(e)?(p(!1),Error("The code you entered is not valid")):ou(e)?(p(!0),Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(e),p(!1),Error("Something went wrong."));async function E(e){C(null);try{if(!e||!o)return;await u(o,e),g(!0),p(!1),i()}catch(e){throw b(e)}}async function $(e){if("passkey"!==e)try{l(e),await d(e)}catch(e){console.error(e)}else try{l(e);let t=await d(e);if(!t)throw Error("something went wrong");w(t),await u(e,t),g(!0),p(!1),i()}catch(e){C(b(e))}}let x=()=>{l(null),C(null),c(),i()};return n&&a?"passkey"===o?t(oy,{account:a.linkedAccounts.filter((e=>"passkey"===e.type&&e.enrolledInMfa)).sort(((e,t)=>t.firstVerifiedAt.valueOf()-e.firstVerifiedAt.valueOf()))[0],selectedMethod:o,submitSuccess:f,hasBlockingError:h,error:v,onClose:x,onBack:()=>{l(null),C(null)},handleSubmit:()=>E(y).catch(C)}):o?t(sy,{submitSuccess:f,hasBlockingError:h,handleSubmitCode:E,selectedMethod:o,onClose:x,onBack:a.mfaMethods.length>1?()=>l(null):void 0}):e(r,{children:[t(Ks,{onClose:x},"header"),t(Td,{children:t(Hd,{children:t(In,{})})}),t(_d,{children:"Verify your identity"}),t(Sd,{children:"Choose a verification method"}),e(Md,{children:[a.mfaMethods.includes("totp")&&e(sd,{onClick:()=>$("totp"),children:[t(_n,{}),"Authenticator App"]},"totp"),a.mfaMethods.includes("sms")&&e(sd,{onClick:()=>$("sms"),children:[t(Lr,{}),"SMS"]},"sms"),a.mfaMethods.includes("passkey")&&e(sd,{onClick:()=>$("passkey"),children:[t(Sn,{}),"Passkey"]},"passkey")]}),t(dt,{})]}):null};let sy=({selectedMethod:n,submitSuccess:i,hasBlockingError:a,onClose:o,onBack:l,handleSubmitCode:s})=>{let{app:d}=dr(),{pendingTransaction:c}=O();switch(n){case"sms":return e(r,{children:[t(Ks,{onClose:o},"header"),t(Td,{children:t(Hd,{children:t(An,{})})}),t(_d,{children:"Enter verification code"}),e(Nd,{children:[t(og,{success:i,disabled:a,onChange:s}),e(Sd,{children:["To continue, please enter the 6-digit code sent to your ",t("strong",{children:"mobile device"})]}),c&&t(iy,{pendingTransaction:c})]}),l&&t(Gd,{theme:d?.appearance.palette.colorScheme,onClick:l,children:"Choose another method"}),t(Us,{onClick:o,children:"Not now"}),t(dt,{})]});case"totp":return e(r,{children:[t(Ks,{onClose:o},"header"),t(Td,{children:t(Hd,{children:t($n,{})})}),t(_d,{children:"Enter verification code"}),e(Nd,{children:[t(og,{success:i,disabled:a,onChange:s}),e(Sd,{children:["To continue, please enter the 6-digit code generated from your"," ",t("strong",{children:"authenticator app"})]}),c&&t(iy,{pendingTransaction:c})]}),l&&t(Gd,{theme:d?.appearance.palette.colorScheme,onClick:l,children:"Choose another method"}),t(Us,{onClick:o,children:"Not now"}),t(dt,{})]});default:return null}};let dy=yr.div`
|
|
2525
2525
|
display: flex;
|
|
2526
2526
|
flex-direction: column;
|
|
2527
2527
|
align-items: center;
|
|
@@ -2622,7 +2622,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2622
2622
|
border-style: solid;
|
|
2623
2623
|
border-color: ${e=>e.$color??"var(--privy-color-accent)"};
|
|
2624
2624
|
border-radius: 50%;
|
|
2625
|
-
`;async function
|
|
2625
|
+
`;async function Ay({tx:e,accessToken:t,walletProxy:r}){let n=vg(e,"from"),i=wg(e)?Buffer.from(e.message.serialize()):e.serializeMessage(),{response:a}=await r.rpcSolana({accessToken:t,publicKey:n.toBase58(),request:{method:"signMessage",params:{message:i.toString("base64")}}}),o=a.data.signature;e.addSignature(n,Buffer.from(o,"base64"))}async function ky({tx:e,connection:t,accessToken:r,walletProxy:n,transactionOptions:i}){let a;try{await Ay({tx:e,accessToken:r,walletProxy:n});let o=e.serialize();a=await t.sendRawTransaction(o,i);let l=await t.confirmTransaction(a);if(l.value.err||l.value.err){let e=l.value.err||l.value.err;if("string"==typeof e)throw Error(e);throw e}return{signature:a,receipt:await t.getParsedTransaction(a,{maxSupportedTransactionVersion:0})}}catch(e){throw e.txSignature=a,e}}const Ty=({transactionIndex:e,maxIndex:t})=>"number"!=typeof e||0===t?"":` (${e+1} / ${t+1})`,_y=({img:n,submitError:i,prepareError:a,onClose:o,action:l,amount:s,title:d,subtitle:c,total:u,txValue:h,to:p,network:m,missingFunds:f,fee:g,from:y,cta:w,disabled:v,chain:C,isSubmitting:b,isPreparing:E,isTokenPriceLoading:$,isTokenContractInfoLoading:x,isSponsored:A,symbol:k,balance:T,onClick:_,spender:S,transactionIndex:N,maxIndex:I,onBack:P,chainName:O})=>e(r,{children:[t(Ks,{onClose:o,backFn:P}),n&&t(Py,{children:n}),e(Cu,{style:{marginTop:n?"1.5rem":0},children:[d,t(Ty,{maxIndex:I,transactionIndex:N})]}),t(vu,{children:c}),e(rp,{style:{marginTop:"2rem"},children:[u&&e(np,{children:[t(ip,{children:"Total"}),t(ap,{$isLoading:E||$,children:u})]}),l&&"transaction"!==l&&"transfer"!==l&&e(np,{children:[t(ip,{children:"Action"}),t(ap,{children:l})]}),s?e(np,{children:[t(ip,{children:"Amount"}),e(ap,{$isLoading:x,children:[Iy(s)," ",k]})]}):null,S?e(np,{children:[t(ip,{children:"Spender"}),t(ap,{children:t(ot,{address:S,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,p&&e(np,{children:[t(ip,{children:"To"}),t(ap,{children:t(ot,{address:p,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),e(np,{children:[t(ip,{children:"Network"}),t(ap,{children:m})]}),e(np,{children:[t(ip,{children:"Estimated fee"}),t(ap,{$isLoading:E||$||void 0===A,children:A?"Sponsored":g})]})]}),t(rd,{}),i?t(_t,{style:{marginTop:"2rem"},children:i.message}):a?t(_t,{style:{marginTop:"2rem"},children:Ny}):null,t(Sy,{$useSmallMargins:!(!a&&!i),title:Number(h)>0?void 0:!1!==A?"Your wallet":void 0,address:y,balance:T,isLoading:E||$,errMsg:E||a||i||!f?void 0:`Add funds on ${C?.name??O} to complete transaction.`}),t(Os,{style:{marginTop:"1rem"},loading:b,disabled:v||E,onClick:_,children:w}),t(lt,{})]});let Sy=yr(wt)`
|
|
2626
2626
|
${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
|
|
2627
2627
|
`,Ny="There was an error preparing your transaction. Your transaction request will likely fail.",Iy=e=>e.toLocaleString(),Py=yr.div`
|
|
2628
2628
|
display: flex;
|
|
@@ -2634,12 +2634,12 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2634
2634
|
object-fit: contain;
|
|
2635
2635
|
border-radius: var(--privy-border-radius-sm);
|
|
2636
2636
|
}
|
|
2637
|
-
`,Oy=new Set([zn.CALL_EXCEPTION,zn.NONCE_EXPIRED,zn.REPLACEMENT_UNDERPRICED,zn.TRANSACTION_REPLACED]);const Ry=e=>{let t;return e.code&&-32e3!==e.code&&Oy.has(e.code)&&(t=e.transactionHash),t},My=e=>"SERVER_ERROR"===e.code?e.error?.message??e.reason??e.message??"unknown error":"SERVER_ERROR"===e.error?.code?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";let Ly=()=>e(By,{children:[t(Hy,{}),t(Gy,{})]});const Dy=({transactionError:n,chainId:i,onClose:a,onRetry:o,network:l,connection:d})=>{let{chains:c}=O(),[u,h]=s(!1),{errorCode:p,transactionHash:m,errorMessage:f}=((e,t)=>{if("ethereum"===t)return{errorCode:e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",transactionHash:Ry(e),errorMessage:My(e)};let r=e.txSignature,n=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let t=e.logs.find((e=>/Transfer: insufficient lamports/gi.test(e)));t&&(n=t)}return{transactionHash:r,errorMessage:n}})(n,l),g=(({chains:e,chainId:t,network:r,connection:n,transactionHash:i})=>"ethereum"===r?e.find((e=>e.id===t))?.blockExplorers?.default.url??"https://etherscan.io":function(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`}(i||"",Xg(n?.rpcEndpoint||"")))({chains:c,chainId:i,network:l,connection:d,transactionHash:m});return e(r,{children:[t(Ks,{onClose:a}),e(
|
|
2637
|
+
`,Oy=new Set([zn.CALL_EXCEPTION,zn.NONCE_EXPIRED,zn.REPLACEMENT_UNDERPRICED,zn.TRANSACTION_REPLACED]);const Ry=e=>{let t;return e.code&&-32e3!==e.code&&Oy.has(e.code)&&(t=e.transactionHash),t},My=e=>"SERVER_ERROR"===e.code?e.error?.message??e.reason??e.message??"unknown error":"SERVER_ERROR"===e.error?.code?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";let Ly=()=>e(By,{children:[t(Hy,{}),t(Gy,{})]});const Dy=({transactionError:n,chainId:i,onClose:a,onRetry:o,network:l,connection:d})=>{let{chains:c}=O(),[u,h]=s(!1),{errorCode:p,transactionHash:m,errorMessage:f}=((e,t)=>{if("ethereum"===t)return{errorCode:e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",transactionHash:Ry(e),errorMessage:My(e)};let r=e.txSignature,n=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let t=e.logs.find((e=>/Transfer: insufficient lamports/gi.test(e)));t&&(n=t)}return{transactionHash:r,errorMessage:n}})(n,l),g=(({chains:e,chainId:t,network:r,connection:n,transactionHash:i})=>"ethereum"===r?e.find((e=>e.id===t))?.blockExplorers?.default.url??"https://etherscan.io":function(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`}(i||"",Xg(n?.rpcEndpoint||"")))({chains:c,chainId:i,network:l,connection:d,transactionHash:m});return e(r,{children:[t(Ks,{onClose:a}),e(Uy,{children:[t(Ly,{}),t(Fy,{children:p}),t(Wy,{children:"Please try again."}),e(qy,{children:[t(jy,{children:"Error message"}),t(Ky,{clickable:!1,children:f})]}),m&&e(qy,{children:[t(jy,{children:"Transaction hash"}),e(Vy,{children:["Copy this hash to view details about the transaction on a"," ",t("u",{children:t("a",{href:g,children:"block explorer"})}),"."]}),e(Ky,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(m),h(!0)},children:[m,t(Xy,{clicked:u})]})]}),t(zy,{onClick:()=>o({resetNonce:!!m}),children:"Retry transaction"})]}),t(dt,{})]})};let Uy=yr.div`
|
|
2638
2638
|
display: flex;
|
|
2639
2639
|
flex-direction: column;
|
|
2640
2640
|
align-items: center;
|
|
2641
2641
|
justify-content: center;
|
|
2642
|
-
`,
|
|
2642
|
+
`,Fy=yr.span`
|
|
2643
2643
|
color: var(--privy-color-foreground);
|
|
2644
2644
|
text-align: center;
|
|
2645
2645
|
font-size: 1.125rem;
|
|
@@ -2728,7 +2728,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2728
2728
|
right: 13px;
|
|
2729
2729
|
width: 24px;
|
|
2730
2730
|
height: 24px;
|
|
2731
|
-
`,Xy=({clicked:e})=>t(e?Zy:Yy,{});const Qy=({instructions:n,fees:i,transactionInfo:a,solPrice:o,rpcEndpoint:l})=>{let d=n.reduce(((e,{amount:t})=>e+t),0n),[c,u]=s(0),[h,p]=s(!1),f=n[c];return m((()=>{u(0)}),[n]),e(rp,{children:[e(np,{children:[t(ip,{children:"Total"}),t(ap,{children:t(
|
|
2731
|
+
`,Xy=({clicked:e})=>t(e?Zy:Yy,{});const Qy=({instructions:n,fees:i,transactionInfo:a,solPrice:o,rpcEndpoint:l})=>{let d=n.reduce(((e,{amount:t})=>e+t),0n),[c,u]=s(0),[h,p]=s(!1),f=n[c];return m((()=>{u(0)}),[n]),e(rp,{children:[e(np,{children:[t(ip,{children:"Total"}),t(ap,{children:t(kg,{quantities:[d,i],tokenPrice:o})})]}),a&&a.action&&e(np,{children:[t(ip,{children:"Action"}),t(ap,{children:a.action})]}),e(np,{children:[t(ip,{children:"Fees"}),t(ap,{children:t(kg,{quantities:[i||0n],tokenPrice:o})})]}),n.length>1?e(r,{children:[t(np,{children:e(aw,{onClick:()=>p((e=>!e)),children:[t("span",{children:"Details"}),t(Dn,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:h?"rotate(180deg)":void 0}})]})}),h&&t(np,{children:e(ew,{children:[e(tw,{children:[e(rw,{children:[c+1," of ",n.length," instructions"]}),e(iw,{children:[c>0&&t(zs,{backFn:()=>u((e=>e-1))}),c<n.length-1&&t(js,{nextFn:()=>u((e=>e+1))})]})]}),t(nw,{children:t(Jy,{instruction:f,rpcEndpoint:l,solPrice:o})})]})})]}):t(Jy,{instruction:f,rpcEndpoint:l,solPrice:o,hideAmount:!0})]})};function Jy({instruction:r,rpcEndpoint:n,solPrice:i,hideAmount:a}){return r?e(rp,{children:[!a&&e(np,{children:[t(ip,{children:"Amount"}),t(ap,{children:t(kg,{quantities:[r.amount],tokenPrice:i})})]}),e(np,{children:[t(ip,{children:"To"}),t(ap,{children:t(Jg,{walletAddress:r.to,rpcEndpoint:n,network:"solana"})})]}),e(np,{children:[t(ip,{children:"From"}),t(ap,{children:t(Jg,{walletAddress:r.from,rpcEndpoint:n,network:"solana"})})]})]}):null}let ew=yr.div`
|
|
2732
2732
|
display: flex;
|
|
2733
2733
|
flex-direction: column;
|
|
2734
2734
|
width: 100%;
|
|
@@ -2765,19 +2765,19 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2765
2765
|
margin-top: 24px;
|
|
2766
2766
|
}
|
|
2767
2767
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2768
|
-
`;async function sw({accessToken:e,rootWallet:t,transactingWallet:r,walletProxy:n,transactionRequest:i,provider:a,requesterAppId:o}){!function(e){for(let t of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=e[t];if(void 0!==r&&!function(e){let t="number"==typeof e,r="bigint"==typeof e,n="string"==typeof e&&/^-?0x[a-f0-9]+$/i.test(e);return t||r||n}(r))throw Error(`Transaction request property '${t}' must be a valid number, bigint, or hex string representing a quantity`)}if("number"!=typeof e.chainId)throw Error("Transaction request property 'chainId' must be a number")}(i=Object.assign({chainId:ge},i));let l=(await n.rpc({address:t.address,hdWalletIndex:r.walletIndex??void 0,accessToken:e,requesterAppId:o,request:{method:"eth_signTransaction",params:[i]}})).response.data;return await a.sendTransaction(l)}async function dw(e,t,r,n){let i=await n.getBalance(e),a=t.value||0,o=!i.sub(ze(a)).sub(r).isNegative();return{balance:i,hasSufficientFunds:o}}function cw(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}const uw={[Ee.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[Oe.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[$e.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[Re.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[xe.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[Me.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[ve.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[Le.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[we.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[De.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[ye.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[
|
|
2768
|
+
`;async function sw({accessToken:e,rootWallet:t,transactingWallet:r,walletProxy:n,transactionRequest:i,provider:a,requesterAppId:o}){!function(e){for(let t of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=e[t];if(void 0!==r&&!function(e){let t="number"==typeof e,r="bigint"==typeof e,n="string"==typeof e&&/^-?0x[a-f0-9]+$/i.test(e);return t||r||n}(r))throw Error(`Transaction request property '${t}' must be a valid number, bigint, or hex string representing a quantity`)}if("number"!=typeof e.chainId)throw Error("Transaction request property 'chainId' must be a number")}(i=Object.assign({chainId:ge},i));let l=(await n.rpc({address:t.address,hdWalletIndex:r.walletIndex??void 0,accessToken:e,requesterAppId:o,request:{method:"eth_signTransaction",params:[i]}})).response.data;return await a.sendTransaction(l)}async function dw(e,t,r,n){let i=await n.getBalance(e),a=t.value||0,o=!i.sub(ze(a)).sub(r).isNegative();return{balance:i,hasSufficientFunds:o}}function cw(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}const uw={[Ee.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[Oe.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[$e.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[Re.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[xe.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[Me.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[ve.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[Le.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[we.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[De.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[ye.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[Ue.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},hw=({address:e,appConfig:t,fundWalletConfig:r,methodScreen:n,chainIdOverride:i,comingFromSendTransactionScreen:a=!1})=>{let o,l;if(!t.fundingConfig||0===t.fundingConfig.methods.length)return;o=i||(bm(r)&&r.chain?r.chain.id:hr(t.fundingConfig.defaultRecommendedCurrency.chain));let s=t.chains.find((e=>e.id===o));if(!s)throw new x(`Funding chain ${o} is not in PrivyProvider chains list`);let d=bm(r)&&r.amount?r.amount:t.fundingConfig.defaultRecommendedAmount,c=!1;function u(){if(!o)return;let e=uw[o];t.fundingConfig?.methods.includes("external")&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),l=e,c=!0}return bm(r)&&"asset"in r?"USDC"===r.asset?u():"string"!=typeof r.asset&&"erc20"in r.asset&&(c=((e,t)=>e===uw[t.id])(l=r.asset.erc20,s)):"USDC"===t.fundingConfig.defaultRecommendedCurrency.asset&&u(),{address:e,amount:d,chain:s,erc20Address:l,erc20ContractInfo:c?{symbol:"USDC",decimals:6}:void 0,isUSDC:c,methodScreen:n,comingFromSendTransactionScreen:a,...Cm(r)?{moonpayConfigOverride:r.config}:{}}},pw=[cr.FUNDING_METHOD_SELECTION_SCREEN,cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN,cr.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN,cr.FUNDING_MANUAL_TRANSFER_SCREEN,cr.MOONPAY_PROMPT_SCREEN,cr.MOONPAY_STATUS_SCREEN],mw={[cr.FUNDING_METHOD_SELECTION_SCREEN]:null,[cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN]:"external",[cr.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN]:"external",[cr.FUNDING_MANUAL_TRANSFER_SCREEN]:"manual",[cr.MOONPAY_PROMPT_SCREEN]:"moonpay",[cr.MOONPAY_STATUS_SCREEN]:"moonpay"},fw={moonpay:cr.MOONPAY_PROMPT_SCREEN,"coinbase-onramp":cr.COINBASE_ONRAMP_STATUS_SCREEN,external:cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN};function gw({fundingMethods:e}){if(0===e.length)throw Error("Wallet funding is not enabled");return 1===e.length?fw[e[0]]:cr.FUNDING_METHOD_SELECTION_SCREEN}let yw=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=On.from(e.gasUsed),n=On.from(e.effectiveGasPrice),i=r.mul(n);if(t){let e=On.from(t);i=i.add(e)}return i.toString()}catch(e){return}};const ww=({txn:n,receipt:i,transactionInfo:a,onClose:o,tokenPrice:l,tokenSymbol:s,l1GasEstimate:d,receiptHeader:c,receiptDescription:u})=>e(r,{children:[t(Ks,{onClose:o}),t(dc,{title:c??"Transaction complete!",description:u??"You're all set."}),t(ty,{tokenPrice:l,from:i.from,to:i.to,gas:yw(i,d),txn:n,transactionInfo:a,tokenSymbol:s}),t(rd,{}),t(vw,{loading:!1,onClick:o,children:"All Done"}),t(ac,{}),t(lt,{})]});let vw=yr(Os)`
|
|
2769
2769
|
&& {
|
|
2770
2770
|
margin-top: 24px;
|
|
2771
2771
|
}
|
|
2772
2772
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2773
|
-
`;let Cw=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],bw=e=>{try{return ln({abi:Cw,data:e})}catch(e){return null}},Ew=e=>{try{return ln({abi:Kh,data:e})}catch(e){return null}};const $w=(e,t,r)=>{let[n,i]=s(null),{getAccessToken:a}=he(),{walletProxy:o}=O();return m((()=>{n&&i(null),(async()=>{if(!await a()||!o||!t)return null;let n=[],i=await wi(t.address,e,r).catch((t=>(n.push(t),e))),{totalGasEstimate:l,l1ExecutionFeeEstimate:s}=await gi(i,r).catch((e=>(n.push(e),{totalGasEstimate:null,l1ExecutionFeeEstimate:null}))),{balance:d,hasSufficientFunds:c}=await dw(t.address,i,l??On.from(0),r).catch((e=>(n.push(e),{balance:null,hasSufficientFunds:!1})));return{tx:i,totalGasEstimate:l,l1ExecutionFeeEstimate:s,balance:d,hasFunds:c,errors:n}})().then(i)}),[e]),n};let xw=new rr(new nr("There was an issue preparing your transaction",ir.E32603_DEFAULT_INTERNAL_ERROR.eipCode));const
|
|
2773
|
+
`;let Cw=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],bw=e=>{try{return ln({abi:Cw,data:e})}catch(e){return null}},Ew=e=>{try{return ln({abi:Kh,data:e})}catch(e){return null}};const $w=(e,t,r)=>{let[n,i]=s(null),{getAccessToken:a}=he(),{walletProxy:o}=O();return m((()=>{n&&i(null),(async()=>{if(!await a()||!o||!t)return null;let n=[],i=await wi(t.address,e,r).catch((t=>(n.push(t),e))),{totalGasEstimate:l,l1ExecutionFeeEstimate:s}=await gi(i,r).catch((e=>(n.push(e),{totalGasEstimate:null,l1ExecutionFeeEstimate:null}))),{balance:d,hasSufficientFunds:c}=await dw(t.address,i,l??On.from(0),r).catch((e=>(n.push(e),{balance:null,hasSufficientFunds:!1})));return{tx:i,totalGasEstimate:l,l1ExecutionFeeEstimate:s,balance:d,hasFunds:c,errors:n}})().then(i)}),[e]),n};let xw=new rr(new nr("There was an issue preparing your transaction",ir.E32603_DEFAULT_INTERNAL_ERROR.eipCode));const Aw=yr.img`
|
|
2774
2774
|
&& {
|
|
2775
2775
|
height: ${e=>"sm"===e.size?"65px":"140px"};
|
|
2776
2776
|
width: ${e=>"sm"===e.size?"65px":"140px"};
|
|
2777
2777
|
border-radius: 16px;
|
|
2778
2778
|
margin-bottom: 12px;
|
|
2779
2779
|
}
|
|
2780
|
-
`;let
|
|
2780
|
+
`;let kw=e=>{if(!qt(e))return e;try{return jn(e)}catch{return e}},Tw=e=>JSON.stringify(e,null,2),_w=({data:r})=>{let n=r=>"object"==typeof r&&null!==r?t(Iw,{children:Object.entries(r).map((([t,r])=>e("li",{children:[e("strong",{children:[t,":"]})," ",n(r)]},t)))}):t("span",{children:String(r)});return t("div",{children:n(r)})},Sw=n=>{let{types:i,primaryType:a,...o}=n.typedData;return e(r,{children:[t(Nw,{children:t(_w,{data:o})}),t(bh,{text:Tw(n.typedData),itemName:"full payload to clipboard"})," "]})};let Nw=yr.div`
|
|
2781
2781
|
margin-top: 1.5rem;
|
|
2782
2782
|
background-color: var(--privy-color-background-2);
|
|
2783
2783
|
border-radius: var(--privy-border-radius-md);
|
|
@@ -2839,9 +2839,9 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
2839
2839
|
margin-left: 27px;
|
|
2840
2840
|
margin-right: 27px;
|
|
2841
2841
|
gap: 24px;
|
|
2842
|
-
`;const Dw=w(((n,i)=>{let[a,o]=s(""),[l,d]=s(!1),{authenticated:c,user:u}=he(),{initUpdateEmail:h}=O(),{navigate:p,setModalData:m,currentScreen:f}=dr(),{enabled:g,token:y}=xs(),w=Pt(a),v=l||!w,C=()=>{!g||y||c?(async e=>{if(!u?.email)throw Error("User is required to have an email address to update it.");d(!0);try{await h(u.email.address,a,e),p(cr.AWAITING_PASSWORDLESS_CODE)}catch(e){m({errorModalData:{error:e,previousScreen:f||cr.LANDING}})}d(!1)})(y):(m({captchaModalData:{callback:e=>{if(!u?.email)throw Error("User is required to have an email address to update it.");return h(u.email.address,a,e)},userIntentRequired:!1,onSuccessNavigateTo:cr.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:cr.ERROR_SCREEN}}),p(cr.CAPTCHA_SCREEN))};return e(r,{children:[t(
|
|
2842
|
+
`;const Dw=w(((n,i)=>{let[a,o]=s(""),[l,d]=s(!1),{authenticated:c,user:u}=he(),{initUpdateEmail:h}=O(),{navigate:p,setModalData:m,currentScreen:f}=dr(),{enabled:g,token:y}=xs(),w=Pt(a),v=l||!w,C=()=>{!g||y||c?(async e=>{if(!u?.email)throw Error("User is required to have an email address to update it.");d(!0);try{await h(u.email.address,a,e),p(cr.AWAITING_PASSWORDLESS_CODE)}catch(e){m({errorModalData:{error:e,previousScreen:f||cr.LANDING}})}d(!1)})(y):(m({captchaModalData:{callback:e=>{if(!u?.email)throw Error("User is required to have an email address to update it.");return h(u.email.address,a,e)},userIntentRequired:!1,onSuccessNavigateTo:cr.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:cr.ERROR_SCREEN}}),p(cr.CAPTCHA_SCREEN))};return e(r,{children:[t(Uw,{children:e(Fw,{children:[t(Mr,{}),t("input",{ref:i,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>o(e.target.value),onKeyUp:e=>{"Enter"===e.key&&C()},value:a,autoComplete:"email"}),n.stacked?null:t(Bs,{isSubmitting:l,onClick:C,disabled:v,children:"Submit"})]})}),n.stacked?t(Os,{loadingText:null,loading:l,disabled:v,onClick:C,children:"Submit"}):null]})}));let Uw=yr.div`
|
|
2843
2843
|
width: 100%;
|
|
2844
|
-
`,
|
|
2844
|
+
`,Fw=yr.label`
|
|
2845
2845
|
display: block;
|
|
2846
2846
|
position: relative;
|
|
2847
2847
|
width: 100%;
|
|
@@ -3087,7 +3087,7 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
3087
3087
|
align-items: center;
|
|
3088
3088
|
justify-content: center;
|
|
3089
3089
|
height: 100%;
|
|
3090
|
-
`;let Qw={[cr.LANDING]:()=>{let{app:e}=dr();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?t(Nf,{connectOnly:!1}):t(Rf,{connectOnly:!1})},[cr.CONNECT_OR_CREATE]:()=>{let{app:e}=dr();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?t(Nf,{connectOnly:!0}):t(Rf,{connectOnly:!0})},[cr.AWAITING_PASSWORDLESS_CODE]:()=>{let{app:n,navigate:i,lastScreen:a,navigateBack:o,setModalData:l,onUserCloseViaDialogOrKeybindRef:d}=dr(),{closePrivyModal:c,resendEmailCode:u,resendSmsCode:h,getAuthMeta:p,loginWithCode:f,updateWallets:g,createAnalyticsEvent:y}=O(),{authenticated:w,logout:v,user:b}=he(),[E,$]=s(wc),[x,k]=s(!1),[T,_]=s(null),[S,I]=s(null),[P,M]=s(0);d.current=()=>null;let L=p()?.email?0:1,D=pe-500;m((()=>{if(P){let e=setTimeout((()=>{M(P-1)}),1e3);return()=>clearTimeout(e)}}),[P]),m((()=>{if(w&&x&&b){if(n?.legal.requireUsersAcceptTerms&&!b.hasAcceptedTerms){let e=setTimeout((()=>{i(cr.AFFIRMATIVE_CONSENT_SCREEN)}),D);return()=>clearTimeout(e)}if(st(b,n?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{l({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),y({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),i(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),D);return()=>clearTimeout(e)}{g();let e=setTimeout((()=>c({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe);return()=>clearTimeout(e)}}}),[w,x,b]),m((()=>{if(T&&0===S){let e=setTimeout((()=>{$(wc),_(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[T]);let F=e=>{e.preventDefault();let t=e.currentTarget.value.replace(" ","");if(""===t)return;if(isNaN(Number(t)))return _("Code should be numeric"),void I(1);_(null),I(null);let r=Number(e.currentTarget.name?.charAt(5)),n=[...t||[""]].slice(0,6-r),o=[...E.slice(0,r),...n,...E.slice(r+n.length)];$(o);let s=Math.min(Math.max(r+n.length,0),5);if(!isNaN(Number(e.currentTarget.value))){let e=document.querySelector(`input[name=code-${s}]`);e?.focus()}if(o.every((e=>e&&!isNaN(+e)))){let e=document.querySelector(`input[name=code-${s}]`);e?.blur(),f(o.join("")).then((()=>k(!0))).catch((e=>{if(e instanceof N&&e.privyErrorCode===A.INVALID_CREDENTIALS)_("Invalid or expired verification code");else if(e instanceof N&&e.privyErrorCode===A.CANNOT_LINK_MORE_OF_TYPE)_(e.message);else{if(e instanceof N&&e.privyErrorCode===A.USER_LIMIT_REACHED)return console.error(new R(e).toString()),void i(cr.USER_LIMIT_REACHED_SCREEN);if(e instanceof N&&e.privyErrorCode===A.USER_DOES_NOT_EXIST)return void i(cr.ACCOUNT_NOT_FOUND_SCREEN);if(e instanceof N&&e.privyErrorCode===A.LINKED_TO_ANOTHER_USER)return l({errorModalData:{error:e,previousScreen:a??cr.AWAITING_PASSWORDLESS_CODE}}),void i(cr.ERROR_SCREEN,!1);if(e instanceof N&&e.privyErrorCode===A.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return l({accountTransfer:{nonce:e.data?.data?.nonce,account:0===L?p()?.email:p()?.phoneNumber,displayName:e.data?.data?.account?.displayName,linkMethod:0===L?"email":"sms",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void i(cr.LINK_CONFLICT_SCREEN);_("Issue verifying code")}I(0)}))}},U=0==L?t(Mr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):t(Lr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),W=e("p",0==L?{children:["Please check ",t(kc,{children:p()?.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",t(kc,{children:p()?.phoneNumber})," for a message from ",n?.name||"Privy"," and enter your code below."]});return e(r,{children:[t(Ks,{backFn:()=>o()},"header"),e(vc,{children:[t(uc,{title:"Enter confirmation code",description:W,icon:U}),e(Qd,{children:[e(Cc,{children:[t(bc,{$fail:!!T,$success:x,children:t("span",{children:T||(x?"Success!":"")})}),t("div",{children:E.map(((e,r)=>t("input",{name:`code-${r}`,type:"text",value:E[r],onChange:F,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(1===S&&(_(null),I(null)),$([...E.slice(0,e),"",...E.slice(e+1)]),e>0){let t=document.querySelector(`input[name=code-${e-1}]`);t?.focus()}})(r)},inputMode:"numeric",autoFocus:0===r,pattern:"[0-9]",className:`${x?"success":""} ${T?"fail":""}`,autoComplete:C?"one-time-code":"off"},r)))})]}),e(Ec,{children:[e("span",{children:["Didn't get ",0==L?"an email":"a message","?"]}),P?e(xc,{children:[t(Rr,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),t("span",{children:"Code sent"})]}):t($c,{children:t("button",{onClick:async()=>{M(30),0==L?await u():await h()},children:"Resend code"})})]})]})]}),t(lt,{})]})},[cr.AWAITING_CONNECTION]:()=>{let n,[i,a]=s(!1),[o,d]=s(!1),[c,u]=s(void 0),{authenticated:h,logout:p}=he(),{app:g,navigate:y,navigateBack:w,lastScreen:v,currentScreen:b,setModalData:E,data:$}=dr(),{getAuthFlow:x,walletConnectionStatus:k,closePrivyModal:T,initLoginWithWallet:_,loginWithWallet:S,updateWallets:N,createAnalyticsEvent:I}=O(),{walletConnectors:P}=he(),[M,L]=s(0),{user:D}=he(),[F]=s(D?.linkedAccounts.length||0),[U,W]=s(""),[B,G]=s(""),[H,z]=s(!1),{hasTabbedAway:j}=function(){let[e,t]=s(!1),r=f((()=>{document.hidden&&t(!0)}),[]);return m((()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r))),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:q,token:V}=xs(),K=C&&"wallet_connect_v2"===k?.connector?.connectorType||C&&"coinbase_wallet"===k?.connector?.connectorType||C&&"injected"===k?.connector?.connectorType&&"phantom"===k?.connector?.walletClientType,Y="connected"===k?.status,Z="switching_to_supported_chain"===k?.status;m((()=>{let e=x(),t=e instanceof kl||e instanceof Al?e:void 0;Y&&!t&&(!q||V||h?_(k.connectedWallet,V,$?.login?.disableSignup).then((()=>{z(!0)})):(E({captchaModalData:{callback:e=>_(k.connectedWallet,e,$?.login?.disableSignup).then((()=>{z(!0)})),userIntentRequired:!1,onSuccessNavigateTo:cr.AWAITING_CONNECTION,onErrorNavigateTo:cr.ERROR_SCREEN}}),y(cr.CAPTCHA_SCREEN,!1))),t&&K&&Y&&!t.preparedMessage?t.buildMessage():t&&!K&&Y&&(o||(async()=>{d(!0),u(void 0);try{"wallet_connect_v2"===k?.connector?.connectorType&&"metamask"===k?.connector?.walletClientType&&await ft(2500),await Q()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{d(!1)}})())}),[M,Y,H]),m((()=>{if(D&&i){let e=pe-500;if(g?.legal.requireUsersAcceptTerms&&!D.hasAcceptedTerms){let t=setTimeout((()=>{y(cr.AFFIRMATIVE_CONSENT_SCREEN)}),e);return()=>clearTimeout(t)}if(st(D,g?.embeddedWallets?.createOnLogin)){let t=setTimeout((()=>{E({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),I({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),p()},callAuthOnSuccessOnClose:!0}}),y(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),e);return()=>clearTimeout(t)}N();let t=setTimeout((()=>T({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe);return()=>clearTimeout(t)}}),[D,i]);let X=e=>{if(e?.privyErrorCode!==A.ALLOWLIST_REJECTED){if(e?.privyErrorCode===A.USER_LIMIT_REACHED)return console.error(new R(e).toString()),void y(cr.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode!==A.USER_DOES_NOT_EXIST)return e?.privyErrorCode===A.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(E({accountTransfer:{nonce:e.data?.data?.nonce,account:x()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:x()?.meta.walletClientType,chainId:x()?.meta.chainId,connectorType:x()?.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void y(cr.LINK_CONFLICT_SCREEN)):void u(zc(e));y(cr.ACCOUNT_NOT_FOUND_SCREEN)}else y(cr.ALLOWLIST_REJECTION_SCREEN)};async function Q(){try{await S(),a(!0)}catch(e){X(e)}finally{d(!1)}}m((()=>{k?.connectError&&X(k?.connectError)}),[k]),((e,t)=>{let r=l((()=>{}));m((()=>{r.current=e})),m((()=>{if(null!==t){let e=setInterval((()=>r.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===J&&k?.connector instanceof as?k.connector.redirectUri:void 0;e&&W(e);let t="wallet_connect_v2"===J&&k?.connector instanceof as?k.connector.fallbackUniversalRedirectUri:void 0;t&&G(t)}),k?.connector instanceof as&&!U?500:null);let J=k?.connector?.connectorType||"injected",ee=k?.connector?.walletClientType||"unknown",te=Nc[ee]?.displayName||k?.connector?.walletBranding.name||"Browser Extension",re=Nc[ee]?.logo||k?.connector?.walletBranding.icon||(e=>t(Vl,{...e})),ne="Browser Extension"===te?te.toLowerCase():te;n=i?`Successfully connected with ${ne}`:c?c.message:Z?"Switching networks":Y?o&&K?"Signing":"Sign to verify":`Waiting for ${ne}`;let ie="Don’t see your wallet? Check your other browser windows.";i?ie=F===(D?.linkedAccounts.length||0)?"Wallet was already linked.":"You’re good to go!":M>=2&&c?ie="Unable to connect wallet":c?ie=c.detail:Z?ie="Switch your wallet to the requested network.":Y&&K?ie="Sign the message in your wallet to verify it belongs to you.":"metamask"===ee&&C?ie="Click continue to open and connect MetaMask.":"metamask"===ee?ie="For the best experience, connect only one wallet at a time.":"wallet_connect"===J?ie="Open your mobile wallet app to continue":"coinbase_wallet"!==J||ut()||(ie=os(D)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let ae=P?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),oe="coinbase_wallet"===ee&&(os(D)||c===tr.ERROR_USER_EXISTS);return e(r,{children:[t(Ks,{backFn:v&&b!==v?w:void 0}),e(jc,{children:[t(Vc,{walletLogo:re,success:i,fail:!!c}),e(rc,{children:[t("h3",{children:n}),t("p",{children:ie}),Y||!U||j?null:e("p",{children:["Still here?"," ",t("a",{href:U,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),B&&e(r,{children:[" ","or"," ",t("a",{href:B,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),oe?t(Os,{onClick:()=>ae&&ae?.disconnect(),disabled:i,children:"Use a different wallet"}):c==tr.ERROR_USER_EXISTS&&b!==v?t(Os,{onClick:w,children:"Use a different wallet"}):Y&&!i&&K?t(Os,{onClick:()=>{d(!0),Q()},disabled:o,children:o?"Signing":"Sign with your wallet"}):!i&&c?.retryable&&M<2?t(Os,{onClick:()=>{L(M+1),u(void 0),Y?(d(!0),Q()):k?.connectRetry()},disabled:!i&&(!c?.retryable||M>=2),children:"Retry"}):i||c?null:t(Os,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),t(dt,{})]})},[cr.AWAITING_CONNECT_ONLY_CONNECTION]:()=>{let n,{navigateBack:i,navigate:a,lastScreen:o,currentScreen:l,data:d}=dr(),{walletConnectionStatus:c,closePrivyModal:u}=O(),[h,p]=s(void 0),[f,g]=s(0),y="connected"===c?.status,w="switching_to_supported_chain"===c?.status;m((()=>{if(y){let e;if(d?.externalConnectWallet?.onCompleteNavigateTo){let t=d.externalConnectWallet.onCompleteNavigateTo;e=setTimeout((()=>{a(t)}),pe)}else e=setTimeout(u,pe);return()=>clearTimeout(e)}}),[y]);m((()=>{c?.connectError&&(e=>{p(zc(e))})(c?.connectError)}),[c]);let v=c?.connector?.connectorType||"injected",b=c?.connector?.walletClientType||"unknown",E=Nc[b]?.displayName||c?.connector?.walletBranding.name||"Browser Extension",$=Nc[b]?.logo||c?.connector?.walletBranding.icon||(e=>t(Vl,{...e})),x="Browser Extension"===E?E.toLowerCase():E;n=y?`Successfully connected with ${x}`:h?h.message:w?"Switching networks":`Waiting for ${x}`;let k="Don’t see your wallet? Check your other browser windows.";return y?k="You’re good to go!":f>=2&&h?k="Unable to connect wallet":h?k=h.detail:w?k="Switch your wallet to the requested network.":"metamask"===b&&C?k="Click to continue to open and connect MetaMask.":"metamask"===b?k="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===v?k="Open your mobile wallet app to continue":"coinbase_wallet"===v&&(k="Open the Coinbase app on your phone to continue."),e(r,{children:[t(Ks,{backFn:l===o?void 0:i}),e(Kc,{children:[t(Vc,{walletLogo:$,success:y,fail:!!h}),e(rc,{children:[t("h3",{children:n}),t("p",{children:k})]}),h==tr.ERROR_USER_EXISTS?t(Os,{onClick:i,children:"Use a different wallet"}):!y&&h?.retryable&&f<2?t(Os,{onClick:()=>{g(f+1),p(void 0),c?.connectRetry()},disabled:!y&&(!h?.retryable||f>=2),children:"Retry"}):!y&&h&&f>=2?t(Os,{onClick:i,children:"Use a different wallet"}):null]}),t(dt,{})]})},[cr.AWAITING_FARCASTER_CONNECTION]:()=>{let{authenticated:n,logout:i,ready:a,user:o}=he(),{lastScreen:d,navigate:c,navigateBack:u,setModalData:h,app:p}=dr(),{getAuthFlow:f,loginWithFarcaster:g,closePrivyModal:y,createAnalyticsEvent:w}=O(),[v,E]=s(void 0),[$,x]=s(!1),[k,T]=s(!1),_=l([]),S=f(),N=S?.meta.connectUri;return m((()=>{let e=Date.now(),t=setInterval((async()=>{let r=await S.pollForReady.execute(),n=Date.now()-e;if(r){clearInterval(t),x(!0);try{await g(),T(!0)}catch(e){let t={retryable:!1,message:"Authentication failed"};if(e?.privyErrorCode===A.ALLOWLIST_REJECTED)return void c(cr.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===A.USER_LIMIT_REACHED)return console.error(new R(e).toString()),void c(cr.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===A.USER_DOES_NOT_EXIST)return void c(cr.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===A.LINKED_TO_ANOTHER_USER)t.detail="This account has already been linked to another user.";else{if(e?.privyErrorCode===A.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return h({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:"farcaster",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,farcasterEmbeddedAddress:e.data?.data?.otherUser?.farcasterEmbeddedAddress}}),void c(cr.LINK_CONFLICT_SCREEN);e?.privyErrorCode===A.INVALID_CREDENTIALS?(t.retryable=!0,t.detail="Something went wrong. Try again."):e?.privyErrorCode===A.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again.")}E(t)}}else n>12e4&&(clearInterval(t),E({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(t),_.current.forEach((e=>clearTimeout(e)))}}),[]),m((()=>{if(a&&n&&k&&o){if(p?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(cr.AFFIRMATIVE_CONSENT_SCREEN)}),pe);return()=>clearTimeout(e)}k&&(st(o,p?.embeddedWallets.createOnLogin)?_.current.push(setTimeout((()=>{h({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),c(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),pe)):_.current.push(setTimeout((()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe)))}}),[k,a,n,o]),e(r,C||$?{children:[t(Ks,{backFn:d?u:void 0,onClose:y},"header"),t(ic,{}),t(r,b?{children:e(Dh,{children:[t(td,{children:e("div",{children:[t(Ts,{success:k,fail:!!v}),t(Rh,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t(_d,{children:v?v.message:"Sign in with Farcaster"}),t(Sd,{children:v?v.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),N&&t(Os,{onClick:e=>{e.preventDefault(),window.location.href=N},children:"Open Warpcast app"})]})}:{children:e(Lh,{children:[t(td,{children:e("div",{children:[t(Ts,{success:k,fail:!!v}),t(Rh,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t(_d,{children:v?v.message:"Signing in with Farcaster"}),t(Sd,{children:v?v.detail:"This should only take a moment"}),t(Xd,{children:N&&C&&t($h,{text:"Take me to Warpcast",url:N,color:Mh})})]})]})}),t(dt,{})]}:{children:[t(Ks,{backFn:d?u:void 0,onClose:y},"header"),t(ic,{}),t(Lh,{children:e("div",{children:[t(_d,{children:"Sign in with Farcaster"}),t(Sd,{children:"Scan with your phone's camera to continue."}),t(Jd,{children:N?t(Oh,{url:N,size:275,squareLogoElement:Rh}):t(_s,{})}),e(Xd,{children:[t(Sd,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),N&&t(bh,{text:N,itemName:"link",color:Mh})]})]})}),t(dt,{})]})},[cr.AWAITING_FARCASTER_SIGNER]:()=>{let{lastScreen:n,navigateBack:i,data:a,app:o}=dr(),{requestFarcasterSignerStatus:d,closePrivyModal:c}=O(),[u,h]=s(void 0),[p,f]=s(!1),[g,y]=s(!1),w=l([]),v=a?.farcasterSigner;m((()=>{let e=Date.now(),t=setInterval((async()=>{if(!v?.public_key)return clearInterval(t),void h({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===v.status&&(clearInterval(t),f(!1),y(!0),w.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),pe)));let r=await d(v?.public_key),n=Date.now()-e;"approved"===r.status?(clearInterval(t),f(!1),y(!0),w.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),pe))):n>3e5?(clearInterval(t),h({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),h({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(t),w.current.forEach((e=>clearTimeout(e)))}}),[]);let E="pending_approval"===v?.status?v.signer_approval_url:void 0;return e(r,C||p?{children:[t(Ks,{backFn:n?i:void 0,onClose:c},"header"),t(ic,{}),t(r,b?{children:e(Wh,{children:[t(td,{children:e("div",{children:[t(Ts,{success:g,fail:!!u}),t(Rh,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t(_d,{children:u?u.message:"Add a signer to Farcaster"}),t(Sd,{children:u?u.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),E&&t(Os,{onClick:e=>{e.preventDefault(),window.location.href=E},children:"Open Warpcast app"})]})}:{children:e(Uh,{children:[t(td,{children:e("div",{children:[t(Ts,{success:g,fail:!!u}),t(Rh,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t(_d,{children:u?u.message:"Requesting signer from Farcaster"}),t(Sd,{children:u?u.detail:"This should only take a moment"}),t(Xd,{children:E&&C&&t($h,{text:"Take me to Warpcast",url:E,color:Fh})})]})]})}),t(dt,{})]}:{children:[t(Ks,{backFn:n?i:void 0,onClose:c},"header"),t(ic,{}),t(Uh,{children:e("div",{children:[t(_d,{children:"Add a signer to Farcaster"}),e(Sd,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),t(Jd,{children:"pending_approval"===v?.status?t(Oh,{url:v.signer_approval_url,size:275,squareLogoElement:Rh}):t(_s,{})}),e(Xd,{children:[t(Sd,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),"pending_approval"===v?.status&&t(bh,{text:v.signer_approval_url,itemName:"link",color:Fh})]})]})}),t(dt,{})]})},[cr.AWAITING_PASSKEY_SYSTEM_DIALOGUE]:()=>{let{lastScreen:n,currentScreen:i,navigateBack:a}=dr(),{loginWithPasskey:o,closePrivyModal:d}=O(),[c,u]=s("loading"),[h,p]=s(null),f=l([]);m((()=>()=>{f.current.forEach((e=>clearTimeout(e))),f.current=[]}),[]);let g=async()=>{u("loading");try{await o(),u("success")}catch(e){p(e),u("error")}};return m((()=>{"success"===c&&(e=>{f.current=[e,...f.current]})(setTimeout((()=>{d({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),pe))}),[c]),m((()=>{g()}),[]),e(r,{children:[t(Ks,{backFn:n&&i!==n?a:void 0}),e(cy,{children:[t(td,{children:e("div",{children:[t(Ts,{success:"success"===c,fail:"error"===c}),t(vp,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t("h3",{children:(()=>{switch(c){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})()}),t("p",{style:{whiteSpace:"pre-wrap"},children:(()=>{switch(c){case"loading":return"Please follow prompts to verify your passkey.\nYou will have to sign up with another method first to register a passkey for your account.";case"success":return"You've successfully logged in with your passkey.";case"error":if(h instanceof I){if(h.privyErrorCode===A.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(h.privyErrorCode===A.PASSKEY_NOT_ALLOWED)return"Passkey request timed out or rejected by user.\nYou will have to sign up with another method first to register a passkey for your account."}return"An unknown error occurred.\nYou will have to sign up with another method first to register a passkey for your account."}})()})]}),(()=>{switch(c){case"loading":case"success":return t(Os,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return t(Os,{onClick:g,disabled:!1,children:"Retry"})}})()]}),t(dt,{})]})},[cr.PHANTOM_INTERSTITIAL_SCREEN]:()=>{let{forkSession:n,ready:i,authenticated:a}=he(),{walletConnectionStatus:o}=O(),[l,d]=s(""),[c,u]=s(!1);m((()=>{i&&a&&n().then(d)}),[i,a]);let h=((e,t,r)=>{let n=encodeURIComponent(new URL(window.location.href).href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=${r?"solana_adapter":"injected"}&privy_wallet_client=${r?"phantom_solana":"phantom"}`);if(!rt()&&C)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${n}?ref=${n}`})(l,!c,"solana"===o?.connector?.chainType),p={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return i&&(p.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",p.footnote="Once you're done, you can always return here and refresh to view your updated account."),c&&(p.title="Still here?",p.description="You may need to install the Phantom mobile app.",p.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(cc,{title:p.title,description:p.description}),e(Zd,{children:[t(uy,{children:t(Yl,{style:{width:"72px",height:"72px"}})}),t(Ls,{href:h,onClick:()=>{setTimeout((()=>u(!0)),1e3)},loading:i&&!h,children:c?"Go to App Store":"Continue"}),p.footnote?t("p",{children:p.footnote}):null]}),t(ac,{}),t(lt,{})]})},[cr.LOGIN_FAILED_SCREEN]:()=>{let{closePrivyModal:n}=O(),{navigate:i}=dr();return e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(Wf,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),t(cc,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),e(Zd,{children:[t(Os,{onClick:()=>i(cr.LANDING),children:"Try again"}),t(Fs,{onClick:()=>n(),children:"Cancel"})]}),t(ac,{}),t(lt,{})]})},[cr.AWAITING_OAUTH_SCREEN]:()=>{let{authenticated:n,logout:i,ready:a,user:o}=he(),{app:l,setModalData:d,navigate:c,resetNavigation:u}=dr(),{getAuthMeta:h,initLoginWithOAuth:p,loginWithOAuth:f,updateWallets:g,setReadyToTrue:y,closePrivyModal:w,createAnalyticsEvent:v}=O(),[C,b]=s(!1),[E,$]=s(void 0),x=h()?.provider||"google",{name:k,component:T}=Cl(x),_=Mt();m((()=>{f(x).then((e=>{b(!0),y(!0),e&&_("login","onOAuthLoginComplete",e)})).catch((e=>{if(y(!1),e?.privyErrorCode===A.ALLOWLIST_REJECTED)return $(void 0),u(),void c(cr.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===A.USER_LIMIT_REACHED)return console.error(new R(e).toString()),$(void 0),u(),void c(cr.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===A.USER_DOES_NOT_EXIST)return $(void 0),u(),void c(cr.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===A.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return $(void 0),u(),d({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:h()?.provider,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void c(cr.LINK_CONFLICT_SCREEN);let{retryable:t,detail:r}=function(e,t){let r={detail:"",retryable:!1},n=sl(t);if(e?.privyErrorCode===A.LINKED_TO_ANOTHER_USER&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode===A.INVALID_CREDENTIALS&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode===A.OAUTH_USER_DENIED&&(r.detail=`Retry and check ${n} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode===A.TOO_MANY_REQUESTS&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===A.TOO_MANY_REQUESTS&&e.message.includes("provider rate limit")){let e=Cl(t).name;r.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode===A.OAUTH_ACCOUNT_SUSPENDED){let e=Cl(t).name;r.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===A.CANNOT_LINK_MORE_OF_TYPE&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===A.OAUTH_UNEXPECTED&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}(e,x);$({retryable:t,detail:r,message:"Authentication failed"})})).finally((()=>{El()}))}),[k,x]),m((()=>{if(a&&n&&C&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(cr.AFFIRMATIVE_CONSENT_SCREEN)}),pe);return()=>clearTimeout(e)}if(st(o,l?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{d({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:x,screen:"OAuthStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),c(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),pe);return()=>clearTimeout(e)}{let e=setTimeout((()=>w({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe);return g(),()=>clearTimeout(e)}}}),[a,n,C,o]);let S=C?`Successfully connected with ${k}`:E?E.message:`Verifying connection to ${k}`,N="";return N=C?"You’re good to go!":E?E.detail:"Just a few moments more",e(r,{children:[t(Ks,{}),t(ic,{}),e(dy,{children:[t(td,{children:e("div",{children:[t(Ts,{success:C,fail:!!E}),t(T,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t("h3",{children:S}),t("p",{children:N})]}),E&&E?.retryable?t(Ws,{onClick:()=>{El(),p(x),$(void 0)},disabled:!C&&!E?.retryable,children:"Retry"}):null]}),t(ac,{}),t(dt,{})]})},[cr.CROSS_APP_AUTH_SCREEN]:()=>{let n=ue(),{data:i,navigate:a,setModalData:o,onUserCloseViaDialogOrKeybindRef:l}=dr(),{crossAppAuthFlow:c,updateWallets:u,closePrivyModal:h,createAnalyticsEvent:p}=O(),{logout:f}=gt(),[g,y]=s({}),w=i?.crossAppAuth,v={id:w.appId,name:w.name,logoUrl:w.logoUrl},C=new x(`There was an issue connecting your ${v.name} account. Please try again.`),b=new Jo((async e=>{if(w.popup)try{let t=await c({appId:e,popup:w.popup,action:w.action});y({data:t})}catch(e){e instanceof x?y({error:e}):(e instanceof N&&w.popup&&w.popup.close(),y({error:C}))}else y({error:C})})),E=()=>{g.data&&(u(),w.onSuccess(g.data),h({shouldCallAuthOnSuccess:!0,isSuccess:!0})),w.onError(g.error??new x("User canceled flow")),h({shouldCallAuthOnSuccess:!1,isSuccess:!1})};l.current=E,m((()=>{v.id.length&&b.execute(v.id)}),[v.id]),m((()=>{if(!g.data)return;let e=g.data;if(n.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{a(cr.AFFIRMATIVE_CONSENT_SCREEN)}),pe);return()=>clearTimeout(e)}if(st(e,n.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{o({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),p({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${v.id}`,screen:"CrossAppAuthScreen"}}),f()},callAuthOnSuccessOnClose:!0}}),a(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),pe);return()=>clearTimeout(e)}let t=setTimeout(E,pe);return()=>clearTimeout(t)}),[g.data]);let{title:$,subtitle:k}=d((()=>g.data?{title:`Successfully connected with ${v.name}`,subtitle:"You're good to go!"}:g.error?{title:"Authentication failed",subtitle:g.error.message}:{title:`Connecting to ${v.name}`,subtitle:`Please check the pop-up from ${v.name} to continue`}),[g,v.name]);return e(r,{children:[t(Ks,{onClose:E}),t(ic,{}),e(Zc,{children:[t(td,{children:e("div",{children:[t(Ts,{success:!!g.data,fail:!!g.error}),t(Yc,{name:v.name,logoUrl:v.logoUrl})]})}),e(rc,{children:[t("h3",{children:$}),t("p",{children:k})]})]}),t(ac,{}),t(dt,{})]})},[cr.ALLOWLIST_REJECTION_SCREEN]:()=>{let{navigate:n,app:i}=dr(),a=i?.allowlistConfig.errorTitle||"You don't have access to this app",o=i?.allowlistConfig.errorDetail||"Have you been invited?",l=i?.allowlistConfig.errorCtaText||"Try another account";return e(r,{children:[t(Ks,{}),e(Kd,{children:[t(td,{children:e("div",{children:[t(pd,{}),t(Vd,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),e(Yd,{children:[t("string"==typeof a?"h3":r,{children:a}),t("string"==typeof o?"p":r,{children:o})]}),i?.allowlistConfig.errorCtaLink?t(Os,{as:"a",href:i.allowlistConfig.errorCtaLink,children:l}):t(Os,{onClick:()=>{n(cr.LANDING)},children:l})]})]})},[cr.ACCOUNT_NOT_FOUND_SCREEN]:()=>{let{navigate:n,app:i}=dr();return e(r,{children:[t(Ks,{}),e(ud,{children:[t(td,{children:e("div",{children:[t(Hs,{color:"var(--privy-color-warn-light)"}),t(br,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),e(hd,{children:[t("h3",{children:"Account not found"}),e("p",{children:["Please try logging in again or go to ",i.name," to create an account."]})]}),t(rd,{}),t(Os,{onClick:()=>n(cr.LANDING),children:"Try logging in again"})]})]})},[cr.USER_LIMIT_REACHED_SCREEN]:()=>{let{navigate:n}=dr();return e(r,{children:[t(Ks,{}),e(Bw,{children:[t(Gw,{children:t(Ww,{})}),e(Hw,{children:[t("h3",{children:"Unable to sign in"}),t("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),t(Os,{onClick:()=>{n(cr.LANDING)},children:"Go back"})]}),t(lt,{})]})},[cr.INSTALL_PHANTOM_SCREEN]:()=>{let{navigateBack:n}=dr();return e(r,{children:[t(Ks,{backFn:n},"header"),t(ic,{}),t(af,{}),t(ac,{}),e(dt,{children:[t("span",{children:"Still not sure? "}),t("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},[cr.LINK_EMAIL_SCREEN]:()=>{let{app:n}=dr();return e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(uc,{title:"Connect your email",description:`Add your email to your ${n?.name} account`,icon:t(Mr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(Zd,{children:t(hf,{stacked:!0})}),t(ac,{}),t(lt,{})]})},[cr.LINK_PHONE_SCREEN]:()=>{let{app:n,currentScreen:i,data:a,navigate:o,setModalData:l}=dr(),{initLoginWithSms:s}=O();return e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(uc,{title:"Connect your phone",description:`Add your number to your ${n?.name} account`,icon:t(Lr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),t(Zd,{children:t(vf,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:e}){try{await s(e),o(cr.AWAITING_PASSWORDLESS_CODE)}catch(e){l({errorModalData:{error:e,previousScreen:a?.errorModalData?.previousScreen||i||cr.LINK_PHONE_SCREEN}}),o(cr.ERROR_SCREEN)}},hideRecent:!0})}),t(ac,{}),t(lt,{})]})},[cr.LINK_WALLET_SCREEN]:()=>{let{app:n,data:i}=dr(),a=i?.externalConnectWallet?.suggestedAddress,o=a?e("span",{children:["Link the wallet with address ",t(ot,{showCopyIcon:!1,address:a})," ",n?.name?`to ${n.name}.`:"."]}):`Link a wallet to your ${n?.name} account`;return e(r,{children:[t(Ks,{},"header"),t(cc,{title:"Link your wallet",description:o}),t(id,{children:t(Gc,{connectOnly:!1})}),t(lt,{})]})},[cr.LINK_PASSKEY_SCREEN]:()=>{let{user:n,unlinkPasskey:i}=he(),{linkWithPasskey:a,closePrivyModal:o}=O(),l=n?.linkedAccounts.filter((e=>"passkey"===e.type)),[d,c]=s(!1),[u,h]=s(""),[p,f]=s(!1),[g,y]=s(!1);m((()=>{0===l.length&&y(!1)}),[l.length]);let w=async e=>(c(!0),await i(e).then((()=>f(!0))).catch((e=>{e instanceof I&&e.privyErrorCode===A.MISSING_MFA_CREDENTIALS?h("Cannot unlink a passkey enrolled in MFA"):h("Unknown error occurred.")})).finally((()=>{c(!1)})));return e(r,p?{children:[t(Ks,{onClose:()=>o()},"header"),t(Td,{children:t(Hd,{status:"success",children:t(Dr,{})})}),t(Tp,{children:"Passkey added"}),t(_p,{children:"From now on, you can use your passkey to log in."}),t(Rd,{children:t(Os,{onClick:()=>o(),children:"Done"})}),t(dt,{})]}:g?{children:[t(Ks,{backFn:()=>y(!1),onClose:()=>o()},"header"),t(Cp,{passkeys:l,expanded:g,onUnlink:w,onExpand:()=>y(!0)}),t(dt,{})]}:{children:[t(Ks,{onClose:()=>o()},"header"),t(Td,{children:e(Ep,{children:[t(wp,{}),t(vp,{})]})}),t(Tp,{children:"Secure your account with a passkey"}),t(Sp,{}),0===l.length?t(bp,{}):t(Cp,{passkeys:l,expanded:g,onUnlink:w,onExpand:()=>y(!0)}),e(Rd,{style:{marginTop:"12px"},children:[u&&t($p,{$fail:!0,children:u}),t(Os,{onClick:()=>{c(!0),a().then((()=>f(!0))).catch((e=>{if(e instanceof I){if(e.privyErrorCode===A.CANNOT_LINK_MORE_OF_TYPE)return void h("Cannot link more passkeys to account.");if(e.privyErrorCode===A.PASSKEY_NOT_ALLOWED)return void h("Passkey request timed out or rejected by user.")}h("Unknown error occurred.")})).finally((()=>{c(!1)}))},loading:d,children:"Add new passkey"})]}),t(dt,{})]})},[cr.UPDATE_EMAIL_SCREEN]:()=>e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(uc,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:t(Mr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(Zd,{children:t(Dw,{stacked:!0})}),t(ac,{}),t(lt,{})]}),[cr.UPDATE_PHONE_SCREEN]:()=>{let{currentScreen:n,data:i,navigate:a,setModalData:o}=dr(),{user:l}=he(),{initUpdatePhone:s}=O();return e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(uc,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:t(Lr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(Zd,{children:t(vf,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:e}){try{if(!l?.phone?.number)throw Error("User is required to have an phone number to update it.");await s(l?.phone?.number,e),a(cr.AWAITING_PASSWORDLESS_CODE)}catch(e){o({errorModalData:{error:e,previousScreen:i?.errorModalData?.previousScreen||n||cr.LINK_PHONE_SCREEN}}),a(cr.ERROR_SCREEN)}},hideRecent:!0})}),t(ac,{}),t(lt,{})]})},[cr.CONNECT_ONLY_LANDING_SCREEN]:()=>{let{app:n,data:i}=dr(),a=i?.externalConnectWallet?.suggestedAddress,o=a?e("span",{children:["Connect the wallet with address ",t(ot,{showCopyIcon:!1,address:a})," ",n?.name?`to ${n.name}.`:"."]}):`Connect a wallet to your ${n?.name} account`;return e(r,{children:[t(Ks,{},"header"),t(dc,{title:"Connect your wallet",description:o}),t(id,{children:t(Gc,{connectOnly:!0})}),n&&t(mt,{app:n,alwaysShowImplicitConsent:!0}),t(lt,{})]})},[cr.CONNECT_ONLY_AUTHENTICATED_SCREEN]:()=>{let{app:n,data:i}=dr(),a=i?.externalConnectWallet?.suggestedAddress,o=a?`Connect the wallet with address ${pt(a)} ${n?.name?`to ${n.name}.`:"."}`:`Connect a wallet to ${n?.name}`;return e(r,{children:[t(Ks,{},"header"),t(cc,{title:"Connect your wallet",description:o}),t(id,{children:t(Gc,{connectOnly:!0})}),t(lt,{})]})},[cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN]:()=>{let{app:n,setModalData:i,navigate:a,data:o,onUserCloseViaDialogOrKeybindRef:l}=dr(),[d,c]=s(""),{embeddedWallets:u}=ue(),{authenticated:h}=he(),{closePrivyModal:p}=O(),{onSuccess:f,onFailure:g,callAuthOnSuccessOnClose:y}=o.createWallet,w=!0===n?.embeddedWallets.requireUserOwnedRecoveryOnCreate,{createWallet:v}=ku(),[C,b]=s(null),E=new Jo((async()=>{try{let e=await v();if(!e)return;b(e),a(cr.EMBEDDED_WALLET_CREATED_SCREEN)}catch(e){c(e.message)}}));return m((()=>h?w?(i({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}}),a(hu({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:u.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void E.execute():(a(cr.LANDING),void g(Error("User must be authenticated before creating a Privy wallet")))),[w,h]),l.current=()=>null,d?e(r,{children:[t(Ks,{closeable:!1}),e(ec,{children:[t(Fr,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),t(uc,{title:"Something went wrong",description:d})]}),t(Os,{onClick:()=>{C?(f(C),p({shouldCallAuthOnSuccess:y})):(g(new M("User wallet creation failed")),p({shouldCallAuthOnSuccess:!1}))},children:"Close"}),t(Au,{})]}):t(Xc,{})},[cr.EMBEDDED_WALLET_CREATED_SCREEN]:()=>{let{user:n}=he(),{closePrivyModal:i,isNewUserThisSession:a,updateWallets:o}=O(),{app:l,data:s,onUserCloseViaDialogOrKeybindRef:d}=dr(),{onSuccess:c,onFailure:u,callAuthOnSuccessOnClose:h}=s.createWallet,p=()=>{let e=yt(n);e?(o(),c(e)):u(Error("Failed to create wallet")),i({shouldCallAuthOnSuccess:h})};return m((()=>{let e=setTimeout(p,me);return()=>clearTimeout(e)}),[]),d.current=p,e(r,{children:[t(Ks,{onClose:p}),t(ic,{}),e(ec,{children:[t(Dr,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),t(uc,{title:a?"Welcome"+(l?.name?` to ${l?.name}`:""):"All set!",description:a?"You’ve successfully created an account.":"Your account is secured."})]}),t(ac,{}),t(lt,{})]})},[cr.EMBEDDED_WALLET_CONNECTING_SCREEN]:()=>{let{authenticated:n,user:i,getAccessToken:a}=he(),{closePrivyModal:o,createAnalyticsEvent:l,walletProxy:c}=O(),{navigate:u,data:h,setModalData:p,onUserCloseViaDialogOrKeybindRef:f}=dr(),g=d((()=>Date.now()),[]),[y,w]=s(!1),{onCompleteNavigateTo:v,onFailure:C,shouldForceMFA:b,address:E}=h?.connectWallet,$=e=>{y||(w(!0),C("string"==typeof e?Error(e):e))};m((()=>{let e,t=E?i?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===E)):yt(i);return n&&t?c?((async()=>{let r=await a();if(!r)return $("User must be authenticated and have a Privy wallet before it can be connected");let n="ethereum"===t.chainType;try{n?await c.connect({accessToken:r,address:t.address}):await c.connectSolana({accessToken:r,publicKey:t.address}),b&&await c.verifyMfa({accessToken:r});let i=(Date.now()-g)/1e3;v===cr.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&i<1?e=setTimeout((()=>{u(v,!1)}),1e3*(1-i)):u(v,!1)}catch(e){if(au(e)&&"privy"===t.recoveryMethod){let e=await a();if(!e)return $("User must be authenticated and have a Privy wallet before it can be recovered");try{if(l({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:t.address}}),n){let r=await(c?.recover({address:t.address,accessToken:e,recoveryMethod:t.recoveryMethod}));r?.address||$(Error("Unable to recover wallet"))}else{let r=await(c?.recoverSolana({publicKey:t.address,accessToken:e}));r?.publicKey||$(Error("Unable to recover wallet"))}v?u(v):o({shouldCallAuthOnSuccess:!1}),l({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t.address}}),u(v)}catch(e){$("An error has occurred, please try again.")}}else au(e)&&"privy"!==t.recoveryMethod?(p({...h,recoverWallet:{privyWallet:t,onCompleteNavigateTo:v,onFailure:C},recoveryOAuthStatus:{provider:t.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),u(pu(t.recoveryMethod))):$(e)}})(),()=>clearTimeout(e)):void 0:$("User must be authenticated and have a Privy wallet before it can be connected")}),[n,i,c]);let x=()=>{$("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return f.current=x,e(r,{children:[t(Ks,{onClose:x}),y?e(r,{children:[e(ec,{children:[t(Fr,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),t(uc,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),t(Os,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):t(Xc,{}),t(gu,{})]})},[cr.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN]:()=>{let[n,i]=s(!0),{authenticated:a,getAccessToken:o}=he(),{walletProxy:l,closePrivyModal:d,createAnalyticsEvent:c}=O(),{navigate:u,data:h,onUserCloseViaDialogOrKeybindRef:p}=dr(),[f,g]=s(void 0),[y,w]=s(""),[v,C]=s(!1),{privyWallet:b,onCompleteNavigateTo:E,onSuccess:$,onFailure:x}=h.recoverWallet,k=(e="User exited before their wallet could be recovered")=>{d({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?new M(e):e)};p.current=k,m((()=>{if(!a||!b)return k("User must be authenticated and have a Privy wallet before it can be recovered")}),[a]);return e(r,{children:[t(Ks,{onClose:k}),t(ic,{}),e(py,{children:[e(hy,{children:[t(In,{height:48,width:48,stroke:"var(--privy-color-accent)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),e("div",{children:[e(Ru,{children:[t(Pu,{type:n?"password":"text",onChange:e=>(e=>{e&&g(e)})(e.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),t(Uu,{style:{right:"0.75rem"},children:n?t(Bu,{onClick:()=>i(!1)}):t(Gu,{onClick:()=>i(!0)})})]}),!!y&&t(my,{children:y})]}),e("div",{children:[e(nc,{children:[t("h4",{children:"Why is this necessary?"}),t("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),t(fy,{loading:v||!l,disabled:!f,onClick:async()=>{C(!0);let e=await o();if(!e||!b||null===f)return k("User must be authenticated and have a Privy wallet before it can be recovered");try{c({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:b.address}}),await(l?.recover({address:b.address,accessToken:e,recoveryPin:f,recoveryMethod:b.recoveryMethod})),w(""),E?u(E):d({shouldCallAuthOnSuccess:!1}),$?.(b),c({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:b.address}})}catch(e){!function(e){return iu(e)&&("invalid_recovery_pin"===e.type||"invalid_request_arguments"===e.type)}(e)?w("An error has occurred, please try again."):w("Invalid recovery password, please try again.")}finally{C(!1)}},warn:!1,hideAnimations:!b&&v,children:"Recover your account"})]})]}),t(ac,{}),t(lt,{})]})},[cr.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN]:()=>{let[n,i]=s(!1),{navigate:a,lastScreen:o,navigateBack:l,setModalData:d,data:c,onUserCloseViaDialogOrKeybindRef:u}=dr(),{user:h}=he(),{embeddedWallets:p}=ue(),{closePrivyModal:m}=O(),f=yt(h),g=null===f,{isInAccountCreateFlow:y,isResettingPassword:w}=c.recoverySelection,v=f&&"privy"!==f.recoveryMethod,C=v?e("span",{children:["Your account is currently secured using"," ",t("strong",{children:Ey[f?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function b(e){d({recoveryOAuthStatus:{provider:e,action:g?"create-wallet":"set-recovery",isInAccountCreateFlow:y}}),a(cr.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN)}function E(){c?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),m({shouldCallAuthOnSuccess:c?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return u.current=E,e(r,{children:[t(Ks,{onClose:E,backFn:n?()=>i(!1):o?l:void 0,infoFn:o||n?void 0:()=>i(!0)},"header"),n?t($y,{onClose:()=>i(!1)}):e(r,{children:[t(uc,{title:v?"Update backup method":"Secure your account",icon:t(Un,{width:48}),description:C}),t(wy,{children:p.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(f?.recoveryMethod||"")||e!==f?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":return e(sd,{onClick:()=>b("google-drive"),children:[t(by,{children:t(yy,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":return e(sd,{onClick:()=>b("icloud"),children:[t(by,{children:t(gy,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":return e(sd,{onClick:()=>{a(uu({isCreatingWallet:g,skipSplashScreen:!0}))},children:[t(by,{children:t(Wn,{style:{width:18}})}),w?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),t(lt,{})]})},[cr.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN]:()=>{let{user:n,getAccessToken:i}=he(),a=yt(n),{walletProxy:o,refreshUser:l,closePrivyModal:d}=O(),c=dr(),[u,h]=s(!1),[p,m]=s(null),[f,g]=s(null);function y(){if(!u){if(f)return c.data?.setWalletPassword?.onFailure(f),void d();if(!p)return c.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void d()}}c.onUserCloseViaDialogOrKeybindRef.current=y;let w=!(!u&&!p);return e(r,f?{children:[t(Ks,{onClose:y},"header"),t(xy,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:t(kr,{height:38,width:38,stroke:"var(--privy-color-error)"})}),t(Cu,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),t(rd,{style:{minHeight:"2rem"}}),t(Rs,{onClick:()=>g(null),children:"Try again"}),t(lt,{})]}:{children:[t(Ks,{onClose:y},"header"),t(Un,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),t(Cu,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),t(vu,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),t(rd,{style:{minHeight:"2rem"}}),t(Rs,{loading:u,disabled:w,onClick:()=>async function(){h(!0);try{let e=await i();if(!e||!o||!a)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:a.address,accessToken:e})).address)throw Error("Unable to set recovery on wallet");let t=await l();if(!t)throw Error("Unable to set recovery on wallet");let r=yt(t);if(!r)throw Error("Unabled to set recovery on wallet");m(!!t),setTimeout((()=>{c.data?.setWalletPassword?.onSuccess(r),d()}),pe)}catch(e){g(e)}finally{h(!1)}}(),children:p?"Success":"Confirm"}),t(lt,{})]})},[cr.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN]:()=>{let{logout:n}=he(),{navigate:i,setModalData:a,data:o}=dr(),{recoveryOAuthFlow:l,closePrivyModal:d,createAnalyticsEvent:c}=O(),[u,h]=s(!1),{provider:p,action:g,isInAccountCreateFlow:y}=o?.recoveryOAuthStatus,[w,v]=s(void 0),[C,b]=s("create-wallet"===g);if("user-passcode"===p)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let E=Cy[p].name,$=Cy[p].component,x=o?.recoverWallet?.onCompleteNavigateTo,k=new Jo((async(e="create-wallet")=>(b(!0),new Promise(((t,r)=>{setTimeout((async()=>{try{let r=window.open();await l(p,e,r),h(!0),t()}catch(t){v({message:`${"recover"===e?"Recovery":"Back up"} with ${E} unsuccessful`,detail:"recover"===g?`Please verify that you are selecting the ${E} account associated with your backup.`:"",retryable:!0}),r()}}),0)})))));m((()=>{"recover"!==g&&k.execute(y?"create-wallet":"set-recovery")}),[]),m((()=>{if(!u)return;let e=setTimeout((()=>{y?(a({createWallet:{onSuccess:()=>{},onFailure:e=>{c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),i(cr.EMBEDDED_WALLET_CREATED_SCREEN)):d({shouldCallAuthOnSuccess:!1})}),pe);return()=>clearTimeout(e)}),[u]);let A=f((async()=>{await k.execute("recover"),x?i(x):h(!0)}),[]),T="google-drive"===p?"Google Drive":"Apple iCloud",_=u&&`Successfully ${"recover"===g?"recovered":"backed up"} with ${T}.`||w&&w.message||`${"recover"===g?"Recovering":"Backing up"} with ${T}...`,S=w?w.detail:"";return e(r,{children:[t(Ks,{}),C?t(r,{children:e(wy,{children:[t(uc,{title:_,icon:t($,{style:{width:"38px",height:"38px"}}),description:S}),w&&w?.retryable?t(Os,{onClick:()=>{El(),v(void 0),"create-wallet"===g?k.execute("create-wallet"):A()},disabled:!u&&!w?.retryable,children:"Try again"}):null]})}):e(wy,{children:[t(uc,{title:"Confirm it's really you",icon:t($,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${T} where your account is backed up.`}),e(Os,{onClick:A,children:["Confirm with ",T]})]}),t(lt,{})]})},[cr.EMBEDDED_WALLET_KEY_EXPORT_SCREEN]:()=>{let[n,i]=s(null),{authenticated:a,user:o,getAccessToken:l}=he(),{closePrivyModal:d,createAnalyticsEvent:c,clientAnalyticsId:u}=O(),h=ue(),{data:p,onUserCloseViaDialogOrKeybindRef:f}=dr(),{onFailure:g,onSuccess:y,origin:w,appId:v,appClientId:C,wallet:b}=p.keyExport,E=e=>{d({shouldCallAuthOnSuccess:!1}),g("string"==typeof e?Error(e):e)},$=()=>{d({shouldCallAuthOnSuccess:!1}),y(),c({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:b.address}})};return m((()=>{if(!a||!b)return E("User must be authenticated before exporting their wallet");l().then(i,E)}),[a,o]),f.current=$,e(r,{children:[t(Ks,{onClose:$}),e(Eu,{children:[t(Cu,{children:"Transfer wallet"}),e(vu,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",t("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),t(yu,{theme:h.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),t(wt,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:b.address,showIcon:!0}),t("div",{style:{width:"100%"},children:n&&t(bu,{origin:w,appId:v,appClientId:C,accessToken:n,clientAnalyticsId:u,wallet:b,dimensions:{height:"44px"}})})]}),t(lt,{})]})},[cr.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN]:()=>{let{authenticated:n}=he(),{initializeWalletProxy:i,closePrivyModal:a}=O(),{navigate:o,data:l,onUserCloseViaDialogOrKeybindRef:d}=dr(),[c,u]=s(!0),[h,p]=s(""),[f,g]=s(),[y,w]=s(null),[v,C]=s(!1),b=null!==y;m((()=>{n||o(cr.LANDING)}),[n]),m((()=>{i(fe).then((e=>{u(!1),e||(p("An error has occurred, please try again."),g(new rr(new nr(h,ir.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:E,data:$,confirmAndSign:x,onSuccess:k,onFailure:A,uiOptions:T}=l.signMessage,_={title:T.title||"Sign message",description:T.description||"Signing this message will not cost you any fees.",buttonText:T.buttonText||"Sign and continue"},S=e=>{e?k(e):A(f||new rr(new nr("The user rejected the request.",ir.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{w(null),p(""),g(void 0)}),200)};return d.current=()=>{S(y)},e(r,{children:[t(Ks,{onClose:()=>S(y)}),t(ic,{}),T.iconUrl&&"string"==typeof T.iconUrl?t(Rw,{children:t(kw,{size:"sm",src:T.iconUrl,alt:"app image"})}):null,t(Cu,{children:_.title}),t(vu,{children:_.description}),"personal_sign"===E&&t(Nw,{children:Aw($)}),"eth_signTypedData_v4"===E&&t(Sw,{typedData:$}),"solana_signMessage"===E&&t(Nw,{children:$}),t(Mw,{}),t(Pw,{$fail:!0,children:h}),t(Rs,{disabled:v||b||c,loading:v,onClick:async()=>{C(!0),p("");try{let e=await x();w(e),C(!1),setTimeout((()=>{S(e)}),pe)}catch(e){console.error(e),p("An error has occurred, please try again."),g(new rr(new nr(h,ir.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),C(!1)}},children:v?"Signing...":b?e(Ow,{children:[t(Ch,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",t("span",{children:"Success"})]}):_.buttonText}),t(ac,{}),t(lt,{})]})},[cr.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN]:()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=dr(),{rpcConfig:a,chains:o,closePrivyModal:l,walletProxy:c}=O(),{getAccessToken:u,user:h}=he(),p=ue(),[f,g]=s(0),y=(e=>e?.sendTransaction?"transactionRequest"in e.sendTransaction?0:e.sendTransaction.transactionRequests.length-1:0)(e),[w,v]=s(((e,t)=>e?.sendTransaction?"transactionRequest"in e.sendTransaction?e.sendTransaction.transactionRequest:e.sendTransaction.transactionRequests[t]:void 0)(e,f)),[C,b]=s(null),[E,$]=s(),[x,k]=s(!1),[A,T]=s(null),[_,S]=s(null);if(!w||!e?.sendTransaction||!e?.sendTransaction.transactingWallet)return t(yh,{error:Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(xw),l({shouldCallAuthOnSuccess:!1})}});let N=e.sendTransaction.rootWallet,I=e.sendTransaction.transactingWallet,P=d((()=>o.find((e=>Number(e.id)===Number(w.chainId)))),[w.chainId]),R=P?.nativeCurrency.symbol??"ETH",{action:M,amount:L,spender:D,isErc20Ish:F}=d((()=>(e=>{let t=bw(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=Ew(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}})(w.data)),[w.data]);m((()=>{w.to&&P&&F&&pm({address:w.to,chain:P,rpcConfig:p.rpcConfig,privyAppId:p.id}).then(b).catch(console.error)}),[w.to,P]);let{tokenPrice:U,isTokenPriceLoading:W}=Vh(w),B=d((()=>Ve(Number(w.chainId),o,a,{appId:p.id})),[w.chainId,a]),G=$w(w,I,B);m((()=>{e.sendTransaction?.getIsSponsored?e.sendTransaction.getIsSponsored().then($).catch(console.error):$(!1)}),[e.sendTransaction.getIsSponsored]);let H=()=>{if(!x)return A?e?.sendTransaction?.onSuccess(A.response):_||G?.errors[0]?e?.sendTransaction?.onFailure(_??G?.errors[0]??xw):e?.sendTransaction?.onFailure(new rr(new nr("The user rejected the request",ir.E4001_USER_REJECTED_REQUEST.eipCode))),l({shouldCallAuthOnSuccess:!1})};r.current=H;let z=!!(p.fundingConfig&&p.fundingConfig.methods.length>0&&e.funding),j="fiat-currency"===p.embeddedWallets.priceDisplay.primary,q=ze(G?.tx.value??0).add(ze(G?.totalGasEstimate?.toBigInt()??0)).toHexString(),V=Tt(q,R),K=j&&U?It(q,U):void 0,Y=Tt(G?.totalGasEstimate?.toString()??0,R),Z=j&&U?It(G?.totalGasEstimate?.toString()??0,U):void 0,X=Tt(G?.balance?.toString()??0,R,void 0,!0),Q=j&&U?It(G?.balance?.toString()??0,U):void 0,J=e.sendTransaction?.uiOptions?.transactionInfo?.title||("approve"===M?"Confirm address":`Approve ${M}`),ee=e.sendTransaction?.uiOptions?.description||`${p.name} wants your permission to approve the following transaction.`,te=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?t("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,re=!(!G||G.errors[0]||G.hasFunds||!1!==E),ne=re&&z,ie=ne?"Add funds":e.sendTransaction?.uiOptions?.buttonText||(f<y?"Continue":"Approve");return A?.receipt?t(ww,{txn:G?.tx??w,onClose:H,receipt:A.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:U,tokenSymbol:R,l1GasEstimate:G?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):_?t(Dy,{transactionError:_,network:"ethereum",chainId:G?.tx.chainId??w.chainId,onClose:H,onRetry:({resetNonce:e})=>{S(null);let t={...G?.tx??w};e&&(t.nonce=void 0),v(t)}}):t(_y,{transactionIndex:f,onBack:0!==y&&"number"==typeof f&&0!==f?()=>{g(f-1)}:void 0,maxIndex:y,disabled:re&&!z,isSubmitting:x,submitError:_,isPreparing:!G,isTokenPriceLoading:W,isTokenContractInfoLoading:!C,prepareError:G?.errors[0],symbol:C?.symbol,chain:P,img:te,title:J,subtitle:ee,spender:D,total:w.value?K??V:void 0,txValue:w.value,fee:Z??Y,isSponsored:E,to:w.to,network:p.chains.find((e=>e.id===w.chainId))?.name??"",from:I?.address??"",cta:ie,missingFunds:re,action:M,balance:Q??X,amount:L&&C?Yh({amount:L,decimals:C.decimals}):L,onClose:H,onClick:ne?async()=>{if(!I)return;if(!z)throw Error("Funding wallet is not enabled");let t=gw({fundingMethods:p.fundingConfig.methods});n({...e,funding:{...e.funding,methodScreen:t}}),i(t)}:async()=>{if(f<y)g(f+1);else{k(!0);try{let t=await u();if(x||!t||!I||!c||!h)return;let r=e?.sendTransaction?.onConfirm?await e.sendTransaction.onConfirm():(await sw({accessToken:t,transactingWallet:I,rootWallet:N,walletProxy:c,transactionRequest:G?.tx??w,provider:B,requesterAppId:e.sendTransaction?.requesterAppId})).hash,n=await B.getTransaction(r),i=await n.wait();T({receipt:cw(i),response:n})}catch(e){console.warn({transaction:G?.tx??w,error:e}),S(e)}finally{k(!1)}}}})},[cr.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN]:()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:r}=dr(),{closePrivyModal:n,walletProxy:i}=O(),a=ue(),{user:o}=he(),[l,d]=s(e?.sendSolanaTransaction?.transactionRequest),[c,u]=s(),[h,p]=s(),[f,g]=s(0),[y,w]=s(!1),[v,C]=s(),[b,E]=s(null),$=e?.sendSolanaTransaction?.connection,x=e?.sendSolanaTransaction?.transactingWallet,k=c?.instructions.at(f),A=c?.instructions.length??1;if(m((()=>{!async function(){if(l&&$)try{p(void 0);let e=await $g(l,$);u(e),g(0)}catch(e){console.warn("Failed to prepare transaction",e),p(e)}}()}),[l,$]),!(l&&e?.sendSolanaTransaction&&x&&$)){let r=Error("Invalid transaction request");return t(yh,{error:r,onClick:()=>{e?.sendSolanaTransaction?.onFailure(r),n({shouldCallAuthOnSuccess:!1})}})}let{solPrice:T,isSolPriceLoading:_}=(()=>{let{showFiatPrices:e,getUsdPriceForSol:t}=O(),[r,n]=s(!0),[i,a]=s(void 0),[o,l]=s(void 0);return m((()=>{(async()=>{if(e)try{n(!0);let e=await t();e?l(e):a(Error("Unable to fetch SOL price"))}catch(e){a(e)}finally{n(!1)}else n(!1)})()}),[]),{solPrice:o,isSolPriceLoading:r,solPriceError:i}})(),S=()=>{if(!y)return v?e?.sendSolanaTransaction?.onSuccess(v):(e?.sendSolanaTransaction?.onFailure(b??h??Error("User exited the modal before submitting the transaction")),g(0)),n({shouldCallAuthOnSuccess:!1})};r.current=S;let N="fiat-currency"===a.embeddedWallets.priceDisplay.primary,I=e.sendTransaction?.uiOptions?.transactionInfo?.title||("approve"===k?.action?"Confirm address":"Approve transaction"),P=e.sendTransaction?.uiOptions?.description||`${a.name} wants your permission to approve the following transaction.`,R=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?t("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,M=k?.amount||0n,L=0===f&&c?.fees||0n,D=k?.balance||0n,F=k?.from,U=k?.to,W=M+L,B=gg(W),G=N&&T?yg(W,T):void 0,H=L?gg(L):void 0,z=N&&T?yg(L,T):void 0,j=D?gg(D):void 0,q=N&&T?yg(D,T):void 0,V=e.sendTransaction?.uiOptions?.buttonText||"Approve";return v?t(ow,{instructions:c?.instructions.map((({from:e,to:t,amount:r})=>({from:e.toBase58(),to:t.toBase58(),amount:r})))??[],fees:0===f?v.fees:0n,onClose:S,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,solPrice:T,receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription,rpcEndpoint:$.rpcEndpoint}):b?t(Dy,{transactionError:b,connection:$,onClose:S,network:"solana",onRetry:async()=>{E(null);let{blockhash:e}=await $.getLatestBlockhash();Bn(l)?l.message.recentBlockhash=e:l.recentBlockhash=e,d(l)}}):t(_y,{isSubmitting:y,submitError:b,isPreparing:!c,isTokenPriceLoading:_,isTokenContractInfoLoading:!1,symbol:"SOL",chain:void 0,img:R,title:I,subtitle:P,from:F?.toBase58()||"",to:U?.toBase58(),fee:z??H,total:null!=M?G??B:void 0,txValue:M,spender:k?.spender?.toBase58(),network:"Solana",cta:V,missingFunds:!h&&!k?.hasFunds,action:k?.action,balance:q??j,prepareError:h,chainName:"Solana",onClose:S,onClick:async()=>{if(f<(c?.instructions.length??1)-1)g(f+1);else try{w(!0);let t=await Tv();if(y||!t||!x||!i||!o)return;let{signature:r,receipt:n}=await Ay({tx:l,accessToken:t,connection:$,walletProxy:i,transactionOptions:e.sendSolanaTransaction?.transactionOptions});C(Eg(r,n))}catch(e){console.warn({transaction:l,error:e}),E(e)}finally{w(!1)}},isSponsored:!1,transactionIndex:f,maxIndex:A-1,disabled:!k?.hasFunds,onBack:f>0&&A>1?()=>g(f-1):void 0})},[cr.FUNDING_METHOD_SELECTION_SCREEN]:()=>{let{wallets:i}=Ae(),{navigate:a,data:o,setModalData:d}=dr(),c=ue(),u=o?.funding,h=l(null),[p,f]=s(!1);m((()=>{h.current&&h.current.style.setProperty("--funding-input-length",Math.max(u.amount.length,1).toString())}),[u.amount,h.current]);let g=c.fundingConfig?.methods.slice()??[],{tokenPrice:y}=Vh({chainId:u.chain.id});m((()=>{u.erc20Address&&u.chain&&!u.erc20ContractInfo&&pm({address:u.erc20Address,chain:u.chain,rpcConfig:c.rpcConfig,privyAppId:c.id}).then((e=>d({...o,funding:{...o.funding,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}}))).catch(console.error)}),[u.erc20Address,u.chain]);let w=y?St(u.amount,y):void 0,v=i.find((e=>n(e.address)===n(u.address))),C=v&&"privy"!==v.walletClientType?Ic(v.walletClientType,v.connectorType,v.walletClientType):c.name,b=parseFloat(u.amount),E=!isNaN(b)&&b>0,$=!(!u.erc20Address||u.erc20ContractInfo),x=u.isUSDC?"USDC":u.erc20Address?void 0:"native-currency",k=x&&((e,t)=>{switch(t){case"native-currency":return gm.has(e);case"USDC":return ym.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}})(Number(u.chain.id),x),A=x&&((e,t)=>{switch(t){case"native-currency":return nm.has(e);case"USDC":return im.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}})(Number(u.chain.id),x),T=u.erc20Address||!u.erc20Address&&!u.isUSDC;return e(r,{children:[t(Bh,{}),e("h3",{children:["Add funds to your"," ",C?.toLowerCase().endsWith("wallet")?C:C+" wallet"]}),t(tc,{style:{marginTop:"32px"},children:t(Fp,{children:$?t(Gh,{size:"50px"}):e(r,{children:[e(Up,{onClick:()=>h.current?.focus(),children:[t(Bp,{ref:h,value:u.amount,onFocus:()=>f(!0),onBlur:()=>f(!1),onChange:e=>{let t=e.target.value;/^[0-9.]*$/.test(t)&&t.split(".").length-1<=1&&d({...o,funding:{...u,amount:t}})}}),t(Hp,{children:u.erc20Address?u.erc20ContractInfo?.symbol:u.chain.nativeCurrency.symbol}),!p&&t(Gp,{children:t(gn,{width:12,height:12})})]}),!u.erc20Address&&t(zp,{children:w&&E?w:""})]})})}),e(Lp,{children:[u.errorMessage&&t(um,{children:u.errorMessage}),g.sort().map((r=>{switch(r){case"moonpay":return k?e(sd,{disabled:!E||$,onClick:()=>{a(cr.MOONPAY_PROMPT_SCREEN)},children:[t(Dp,{children:t($m,{style:{width:24}})}),"Moonpay"]},r):null;case"coinbase-onramp":return A?e(sd,{disabled:!E||$,onClick:()=>{a(cr.COINBASE_ONRAMP_STATUS_SCREEN)},children:[t(Dp,{children:t(Pl,{style:{width:24}})}),"Coinbase Onramp"]},r):null;case"external":return T?e(sd,{disabled:!E||$,onClick:()=>{a(cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN)},children:[t(Dp,{children:t(Ar,{style:{width:24}})}),"Transfer from wallet"]},r):null}})),t(qp,{disabled:!E,onClick:()=>a(cr.FUNDING_MANUAL_TRANSFER_SCREEN),children:"Send funds manually"})]}),t(lt,{})]})},[cr.MOONPAY_PROMPT_SCREEN]:()=>{let{app:n,data:i,navigate:a,setModalData:o}=dr(),{createAnalyticsEvent:l,getMoonpaySignedUrl:d}=O(),[c,u]=s(null),h=i?.funding,p=h.isUSDC?"USDC":"native-currency";return m((()=>{!c&&h&&async function(){if(!n.fundingConfig)return;let{signedUrl:e,externalTransactionId:t}=await d(h.address,{...n.fundingMethodConfig.moonpay,...h.moonpayConfigOverride,currencyCode:h.moonpayConfigOverride?.currencyCode??wm(h.chain.id,p),quoteCurrencyAmount:h.moonpayConfigOverride?.quoteCurrencyAmount??vm(h.amount)});u(e),o({moonpayStatus:{externalTransactionId:t},funding:i?.funding})}()}),[c,h]),e(r,{children:[t(Bh,{}),t(Om,{app:n,signedUrl:c,onContinue:()=>{l({eventName:"sdk_fiat_on_ramp_started",payload:{provider:fm}}),a(cr.MOONPAY_STATUS_SCREEN)}}),t(lt,{})]})},[cr.MOONPAY_STATUS_SCREEN]:()=>{let{app:n,data:i}=dr(),{closePrivyModal:a}=O(),{externalTransactionId:o}=i?.moonpayStatus,l=Em(o||null,n.fundingMethodConfig.moonpay.useSandbox??!1);return e(r,{children:[t(Ks,{title:"Fund account"},"header"),t(zm,{status:l,onClickCta:a}),t(lt,{})]})},[cr.COINBASE_ONRAMP_STATUS_SCREEN]:()=>{let{data:n,setModalData:i,navigate:a}=dr(),{closePrivyModal:o,createAnalyticsEvent:l,initCoinbaseOnRamp:d,getCoinbaseOnRampStatus:c}=O(),u=n?.funding,h=u.isUSDC?"USDC":"ETH",[p,f]=s(!1),[g,y]=s(!1);return m((()=>{if(p)return;f(!0);let e=async()=>{try{l({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:u.amount,chainId:u.chain.id}});let e=window.open(void 0,void 0,rm({w:440,h:680})),t=function(e){let t=am[e];if(!t)throw new x(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}(u.chain.id),r=await d({addresses:[{address:u.address,blockchains:[t]}],assets:[h]}),{url:n}=(({input:e,amount:t,blockchain:r})=>{let n=new URL("https://pay.coinbase.com/buy/select-asset");return n.searchParams.set("appId",e.app_id),n.searchParams.set("sessionToken",e.session_token),n.searchParams.set("defaultExperience","buy"),n.searchParams.set("presetCryptoAmount",t.startsWith(".")?`0${t}`:t),n.searchParams.set("defaultNetwork",r),n.searchParams.set("partnerUserId",e.partner_user_id),{url:n}})({input:r,amount:u.amount,blockchain:t});if(!e)throw Error("Unable to initiate Coinbase Onramp flow.");e.location=n.toString();let i=0,a=!1;for(;i<om;){i++;let{status:t}=await c({partnerUserId:r.partner_user_id});if("success"===t){a=!0;break}if("failure"===t)throw Error("There was an error completing Coinbase Onramp flow.");if(e.closed)throw Error("User exited Coinbase Onramp flow before transaction response.");await new Promise((e=>setTimeout(e,1500)))}if(!a)throw Error("Timed out waiting for transaction response from Coinbase Onramp.");y(!0)}catch(e){console.error(e),l({eventName:Zh,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...u,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),a(cr.FUNDING_METHOD_SELECTION_SCREEN)}finally{f(!1)}},t=setTimeout((()=>{e()}),500);return()=>clearTimeout(t)}),[]),e(r,{children:[t(Ks,{title:"Fund account"},"header"),t(lm,{isSucccess:g,onClickCta:o}),t(lt,{})]})},[cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN]:()=>{let{connectors:n}=O(),{app:i,setModalData:a,data:o,navigate:l}=dr(),[d,c]=s("default"),u=Hc(i.appearance.walletList,"ethereum-only",n,!0,i.appearance.walletList,i.externalWallets.walletConnect.enabled),h=t(Xm,{text:"More wallets",onClick:()=>c("overflow")});return m((()=>{a({...o,externalConnectWallet:{onCompleteNavigateTo:cr.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN}})}),[]),e(r,"overflow"===d?{children:[t(Ks,{backFn:()=>c("default")},"header"),e(id,{children:[t(vu,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),u]}),t(lt,{})]}:{children:[t(Bh,{}),t(uc,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),e(id,{children:[...u.length>3?u.slice(0,2):u,u.length>3&&h,t(Zm,{onClick:()=>l(cr.FUNDING_MANUAL_TRANSFER_SCREEN),children:"Send funds manually"})]}),t(lt,{})]})},[cr.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN]:()=>{let{rpcConfig:n,appId:i,closePrivyModal:a,createAnalyticsEvent:o}=O(),{navigate:l,setModalData:d,app:c,data:u}=dr(),{wallets:h}=Ae(),[p,f]=s(!1),[g,y]=s(0n),[w,v]=s(!1),[C,b]=s(null),[E,$]=s(null),[k,T]=s([]),[_,S]=s(0),[N,I]=s(!1),[P,R]=s(!1),[M,L]=s(!1),[D,F]=s(!1),{erc20ContractInfo:U,erc20Address:W,address:B,chain:G,amount:H}=u.funding;m((()=>{W&&!U&&b(Error("Unable to fetch token details"))}),[]);let z=!!W&&!!U,j=z?BigInt(parseFloat(H)*10**U.decimals):tn(H),q=h[0],[V,K]=s(null);m((()=>{(async()=>{if(!q)return;let e=await q.getEthereumProvider();K(rn({account:q.address,transport:nn(e)}).extend(an))})().catch(console.error)}),[q]);let[Y,Z]=s(0n);m((()=>{Jr({chain:G,transport:en($t(G,n,i))}).getBalance({address:B}).then(Z).catch(console.error)}),[]);let[X,Q]=s(0n);m((()=>{z&&(async({chain:e,address:t,appId:r,rpcConfig:n,erc20Address:i})=>{let a=Jr({chain:e,transport:en($t(e,n,r))});return{balance:await a.readContract({address:i,abi:tp,functionName:"balanceOf",args:[t]}).catch((()=>0n)),chain:e}})({chain:G,address:B,appId:i,rpcConfig:n,erc20Address:W}).then((e=>Q(e.balance))).catch(console.error)}),[]);let{tokenPrice:J}=Vh({chainId:G.id}),[ee,te]=s({to:B,chain:G,value:j,data:void 0});m((()=>{(async()=>{let e,t;if(!V||!q||N||M)return;I(!0);let r=Jr({chain:ee.chain,transport:en($t(ee.chain,n,i))});if(z&&!ee.data)return await r.simulateContract({address:W,chain:ee.chain,abi:Kh,functionName:"transfer",args:[B,j],account:q.address}).catch((e=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",e)}))?(I(!1),void te({to:W,chain:ee.chain,data:on({abi:Kh,functionName:"transfer",args:[B,j]}),value:"0x0"})):(I(!1),void v(!0));try{e=await r.prepareTransactionRequest({account:q.address,to:ee.to,chain:ee.chain,data:ee.data,value:BigInt(ee.value??0)})}catch(e){console.error(e),k.length>1&&$(e.shortMessage??"Something went wrong")}if(!e)return I(!1),void v(!0);I(!1),L(!0),f(!0),y(e.gas);try{await V.switchChain({id:ee.chain.id})}catch(e){await V.addChain({chain:ee.chain}),await V.switchChain({id:ee.chain.id})}try{t=await V.sendTransaction(e),o({eventName:Zh,payload:{provider:"external",status:"success",address:q.address,chainId:ee.chain.id,value:ee.value?.toString(),txHash:t}})}catch(e){console.error(e),"TransactionExecutionError"===e.name&&(k.length<1?b(new x(e.shortMessage,void 0,A.TRANSACTION_FAILURE)):$(e.shortMessage??"Something went wrong"))}t?(await V.waitForTransactionReceipt({hash:t}),L(!1),F(!0)):L(!1)})().catch(console.error)}),[V,ee]),m((()=>{(async()=>{if(!w||!V||!q)return;let e=ur(c.chains).filter((e=>e.id!==u.funding.chain.id&&!!e.testnet==!!u.funding.chain.testnet));z&&e.unshift(u.funding.chain);let t=await(({chains:e,appId:t,address:r,rpcConfig:n})=>Promise.all(e.map((async e=>{let i=Jr({chain:e,transport:en($t(e,n,t))});return{balance:await i.getBalance({address:r}).catch((()=>0n)),chain:e}}))))({chains:e,address:q.address,appId:i,rpcConfig:n}),r=z?t.filter((e=>e.balance>0n)):t.filter((e=>e.balance>j));if(r.length<1)return void b(new x(`Wallet ${pt(q.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE));r.sort(((e,t)=>Number(t.balance-e.balance)));let a=(await Promise.allSettled(r.map((async e=>({quote:await Jh({isTestnet:!!u.funding?.chain.testnet,input:Qh({amount:j.toString(),user:q.address,recipient:B,destinationChainId:G.id,destinationCurrency:W,originChainId:e.chain.id})}),...e}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(a.length<1)return void b(new x(`Wallet ${pt(q.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE));let o=a.map((e=>({bridgeTx:ep(e.quote),balance:e.balance,chain:e.chain}))).filter((e=>!!e.bridgeTx));if(o.length>1)return void T(o);let l=o[0];l?(R(!0),te({data:l.bridgeTx.data,to:l.bridgeTx.to,value:l.bridgeTx.value,chain:l.chain})):b(new x(`Wallet ${pt(q.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE))})().catch(console.error)}),[w]),m((()=>{if(!C)return;let e={error:C,previousScreen:cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN};d({funding:u?.funding,sendTransaction:u?.sendTransaction,errorModalData:e}),l(cr.ERROR_SCREEN,!1)}),[C]);let re=q?Ic(q.walletClientType,q.connectorType,q.walletClientType)||"wallet":null,ne=!z&&J?St(u?.funding?.amount??"0",J):void 0,ie=z?g:Nt([g,j]),ae=ie&&J?It(ie,J):void 0,oe=ie?Tt(ie,"ETH"):void 0,le=g&&J?It(g,J):void 0,se=g?Tt(g,"ETH"):void 0;if(m((()=>{if(!D)return;let e=setTimeout(a,Te);return()=>clearTimeout(e)}),[D]),D)return e(r,{children:[t(Bh,{}),t(ic,{}),e(ec,{children:[t(Qr,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),t(uc,{title:"Success!",description:`You’ve successfully added ${H} ${z?U.symbol:G.nativeCurrency.symbol} to your ${c.name} wallet. It may take a minute before the funds are available to use.`})]}),t(ac,{}),t(lt,{})]});let de=z?`${Yh({amount:X,decimals:U.decimals})} ${U.symbol}`:Tt(Y,G.nativeCurrency.symbol,3,!0),ce=k[_];return k.length>1&&ce?t(Yp,{displayName:re,configuredFundingChain:G,formattedBalance:de,fundingAmount:H,fundingCurrency:z?U.symbol:G.nativeCurrency.symbol,fundingAmountInUsd:ne,options:k,selectedOption:ce,isPreparing:N,isSubmitting:M,errorMessage:E,onSubmit:()=>{te({to:ce.bridgeTx.to,data:ce.bridgeTx.data,value:ce.bridgeTx.value,chain:ce.chain})},onSelect:e=>{e!==_&&($(null),S(e))}}):p&&g&&q&&u?.funding?t(Zp,{wallet:q,displayName:re,addressToFund:B,isBridging:P,isErc20Flow:z,totalPriceInUsd:ae,totalPriceInNativeCurrency:oe,gasPriceInUsd:le,gasPriceInNativeCurrency:se,chain:u.funding.chain}):e(r,{children:[t(Bh,{}),t(Gh,{}),t("div",{style:{marginTop:"1rem"}}),t(lt,{})]})},[cr.FUNDING_MANUAL_TRANSFER_SCREEN]:()=>{let{wallets:n}=Ae(),{app:i,data:a,setModalData:o,navigate:l,lastScreen:c}=dr(),{chains:u,rpcConfig:h,appId:p,closePrivyModal:f,createAnalyticsEvent:g}=O(),[y,w]=s("default"),[v,C]=s(void 0),b=a?.funding,{tokenPrice:E}=Vh({chainId:b.chain.id}),$=E?St(b.amount,E):void 0,x=n.find((e=>pt(e.address)===pt(b.address))),k=x&&"privy"!==x.walletClientType?Ic(x.walletClientType,x.connectorType,x.walletClientType):i.name;if(!b)return o({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:c||cr.FUNDING_METHOD_SELECTION_SCREEN},funding:a?.funding,sendTransaction:a?.sendTransaction}),l(cr.ERROR_SCREEN),t(r,{});m((()=>{let e=Ve(b.chain.id,u,h,{appId:p});function t(){e.getBalance(b.address).then((e=>{let t=parseFloat(wn(e,"ether"));C((e=>(e&&t>e&&g({eventName:Zh,payload:{provider:"manual",status:"success",address:x?.address,value:(t-e).toString()}}),t)))})).catch((()=>C(void 0)))}let r=setInterval(t,2e3);return t(),()=>clearInterval(r)}),[]);let A=d((()=>void 0!==v&&v>=parseFloat(b.amount)),[v,b.amount]),T=e(r,{children:[t(wt,{title:"Your wallet",errMsg:void 0,isLoading:!b||void 0===v,isPulsing:!A,balance:`${void 0!==v?v.toPrecision(2):""} ETH`,address:b.address,statusColor:A?"green":"gray"}),A&&t(Kp,{onClick:()=>f(),children:"Close"})]});return e(r,"qr-code"===y?{children:[t(Ks,{backFn:()=>w("default")}),e(tc,{style:{gap:"24px",marginBottom:"24px"},children:[e("div",{children:[t(_d,{children:"Scan QR code"}),e(Sd,{children:["Scan this code using your mobile wallet to send funds to your ",k," ","wallet."]})]}),t(Oh,{url:b.address,size:200,squareLogoElement:xm}),T]}),t(lt,{})]}:{children:[t(Bh,{}),t(uc,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),e(tc,{style:{gap:"16px"},children:[e(Tm,{children:[t(vn,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),e(_m,{children:["Make sure to send on ",b.chain.name,"."]})]}),e(Sm,{children:[t(lc,{height:16}),e(Fp,{children:[e(Up,{children:[t(Wp,{children:b.amount}),t(Hp,{children:b.chain.nativeCurrency.symbol})]}),t(zp,{children:$?`${$} USD`:"..."}),e(jp,{children:[t(lp,{chainId:b.chain.id,height:16,width:16})," ",b.chain.name]})]}),t(lc,{height:8}),e(Am,{children:[t(km,{text:b.address}),t(Im,{onClick:()=>w("qr-code"),children:e(Nm,{children:[t(Cn,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),T]}),t(lc,{height:16}),t(lt,{})]})},[cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN]:()=>{let{closePrivyModal:n}=O(),{data:i,setModalData:a,navigate:o,onUserCloseViaDialogOrKeybindRef:l}=dr(),{onSuccess:s,onFailure:d}=i.setWalletPassword,c=()=>{d(new M("Exited before password was added to wallet")),n({shouldCallAuthOnSuccess:!1})};return l.current=c,e(r,{children:[t(Ks,{onClose:c}),t(ic,{}),e(ec,{children:[e(oc,{children:[t(Yr,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),t(sc,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:t(Zr,{width:"12px",height:"12px",fill:"white"})})]}),e(uc,{title:"Secure Your Account",children:["Please set a password to secure your account.",t("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),t(Os,{onClick:()=>{a({createWallet:{onFailure:d,onSuccess:s,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o(cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),t(ac,{}),t(lt,{})]})},[cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN]:()=>{let[e,r]=s(null),[n,i]=s(!1),[a,o]=s(null),[l,d]=s(""),{authenticated:c,getAccessToken:u,user:h}=he(),{walletProxy:p,refreshUser:f,closePrivyModal:g,createAnalyticsEvent:y}=O(),{app:w,navigate:v,data:C,onUserCloseViaDialogOrKeybindRef:b}=dr(),{onSuccess:E,onFailure:$}=C.createWallet,x=yt(h),k="user-passcode"===e?.recoveryMethod,A="user-passcode"===x?.recoveryMethod;m((()=>{c||(v(cr.LANDING),$(new L("User must be authenticated before setting a password on a Privy wallet")))}),[c]);let T=()=>a?($(a),void g({shouldCallAuthOnSuccess:!1})):k?(E(e),void g({shouldCallAuthOnSuccess:!1})):($(new M("Exited before password was added to wallet")),void g({shouldCallAuthOnSuccess:!1}));b.current=T;return t(gh,{appName:w?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:a?"An error has occurred, please try again.":void 0,buttonLoading:n,buttonHideAnimations:!1,password:l,isResettingPassword:A,onPasswordGenerate:()=>d(oh()),onPasswordChange:d,onSubmit:async()=>{k?(E(e),g({shouldCallAuthOnSuccess:!1})):(i(!0),o(null),await(async()=>{let e=await u();if(e&&x?.address&&l&&p)try{if(y({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:A}}),!(await p.setRecovery({accessToken:e,address:x.address,recoveryPassword:l,recoveryMethod:"user-passcode"})).address)return o(new M("Error setting password on privy wallet")),void y({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:A,reason:"error setting password"}});let t=await f(),n=yt(t);if(!n)return o(new M("Error setting password on privy wallet")),void y({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:A,reason:"wallet disconnected"}});r(n),y({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:A}})}catch(e){console.warn(e),o(e instanceof Error?e:Error("Error setting password on privy wallet")),y({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:x.address,reason:e}})}})(),i(!1))},onClose:T})},[cr.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN]:()=>{let{app:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=dr(),[a,o]=s(""),[l,d]=s(!1),[c,u]=s(),[h,p]=s(null),{authenticated:f}=he(),{closePrivyModal:g,isNewUserThisSession:y,initializeWalletProxy:w}=O(),{onSuccess:v,onFailure:C,callAuthOnSuccessOnClose:b}=n.createWallet,{createWallet:E}=ku(),[$,x]=s(null),k=new Jo((async()=>{try{let e=await E(c);if(!e)return;x(e),y?r(cr.EMBEDDED_WALLET_CREATED_SCREEN):(v(e),g({shouldCallAuthOnSuccess:b}))}catch(e){o(e.message)}}));m((()=>{h||w(3e4).then((e=>p(e)))}),[h]),m((()=>{if(!f)return r(cr.LANDING),void C(Error("User must be authenticated before creating a Privy wallet"))}),[f]),i.current=()=>null;return t(gh,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!h,buttonLoading:l,buttonHideAnimations:!$&&l,isResettingPassword:!1,error:a,password:c||"",onClose:()=>{$&&"user-passcode"!==$?.recoveryMethod?(C(new M("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):$?(v($),g({shouldCallAuthOnSuccess:b})):(C(new M("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))},onPasswordChange:u,onPasswordGenerate:()=>u(oh()),onSubmit:async()=>(d(!0),k.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>d(!1))))})},[cr.MFA_ENROLLMENT_FLOW_SCREEN]:()=>{let{user:n,enrollInMfa:i}=he(),[a,o]=s(null),{unenrollWithSms:l,unenrollWithTotp:d,unenrollWithPasskey:c}=Gf(),{app:u,ready:h,data:p,onUserCloseViaDialogOrKeybindRef:f}=dr(),{closePrivyModal:g}=O(),{promptMfa:y}=Bf(),{initEnrollmentWithTotp:w}=Gf(),[v,C]=s(!1),[b,E]=s(null),[$,x]=s(null),k=()=>{g({shouldCallAuthOnSuccess:!0}),i(!1),setTimeout((()=>{o(null),E(null)}),500)},{initEnrollmentWithPasskey:A,submitEnrollmentWithPasskey:T}=Gf(),[_,S]=s(!1),[N,I]=s(null);f.current=k;let P=n?.mfaMethods.includes("sms"),R=!!n?.phone,M=n?.mfaMethods.includes("totp"),L=n?.mfaMethods.includes("passkey"),D=P||M||L,F=n?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function U(){o(null),E(null)}if(m((()=>{D&&C(!0)}),[D]),!h||!n||!u)return e(r,{children:[t(Ks,{onClose:k},"header"),t(Td,{children:t(Hf,{})}),t(Nd,{children:t(_s,{})}),t(dt,{})]});if("sms"===a)return e(r,{children:[t(Ks,{backFn:U,onClose:k},"header"),t(Td,{children:t(Hd,{children:t(kn,{})})}),t(_d,{children:"Remove SMS verification?"}),e(Sd,{children:["MFA adds an extra layer of security to your ",u?.name," account. Make sure you have other methods to secure your account."]}),t(Rd,{children:t(Os,{warn:!0,onClick:async function(){o(null);try{await l()}catch(e){o(null)}},children:"Remove SMS for MFA"})}),t(dt,{})]});if("totp"===a)return e(r,{children:[t(Ks,{backFn:U,onClose:k},"header"),t(Td,{children:t(Hd,{children:t($n,{})})}),t(_d,{children:"Remove Authenticator App verification?"}),e(Sd,{children:["MFA adds an extra layer of security to your ",u?.name," account. Make sure you have other methods to secure your account."]}),t(Rd,{children:t(Os,{warn:!0,onClick:async function(){o(null);try{await d()}catch(e){o(null)}},children:"Remove Authenticator App for MFA"})}),t(dt,{})]});if("passkey"===a)return e(r,{children:[t(Ks,{backFn:U,onClose:k},"header"),t(Td,{children:t(Hd,{children:t(An,{})})}),t(_d,{children:"Are you sure you want to remove passkey verification?"}),t(Sd,{children:"This will disable any passkeys you have set up for verification. You’ll still be able to login with your passkeys if you’ve set up passkey login."}),t(Rd,{children:t(Os,{warn:!0,onClick:async function(){o(null);try{await y(),await c()}catch(e){o(null)}},children:"Yes, remove"})}),t(dt,{})]});if(0===p.mfaEnrollmentFlow.mfaMethods.length&&!D)return e(r,{children:[t(Ks,{onClose:k},"header"),t(Td,{children:t(Hd,{children:t(Tn,{})})}),t(_d,{children:"Add more security"}),e(Sd,{children:[u?.name," does not have any verification methods enabled."]}),t(Rd,{children:t(Os,{onClick:k,children:"Close"})}),t(dt,{})]});let W=!D&&!v;return W?e(r,{children:[t(Ks,{onClose:k},"header"),t(Td,{children:t(Hd,{children:t(Tn,{})})}),t(_d,{children:"Transaction Protection"}),t(Sd,{children:"Set up transaction protection to add an extra layer of security to your account"}),e(Id,{children:[e(Od,{children:[t(Pd,{children:t(mn,{})}),"Enable 2-Step verification for your ",u?.name," wallet."]}),e(Od,{children:[t(Pd,{children:t(xn,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),e(Rd,{children:[t(Os,{onClick:()=>C(!0),children:"Continue"}),t(Fs,{onClick:k,children:"Not now"})]}),t(dt,{})]}):"sms"===b?t(dg,{onComplete:k,onReset:U,onClose:k}):"totp"===b&&$?t(ug,{onComplete:k,onClose:k,onReset:U,totpInfo:$}):"passkey"===b?t(qf,{onComplete:k,onReset:U,onClose:k}):t(jf,{showIntro:W,userMfaMethods:n.mfaMethods,appMfaMethods:u.mfa.methods,userHasAuthSms:R,onBackToIntro:function(){C(!1)},handleSelectMethod:async function(e){return await y().catch(I),"totp"===e?(E(e),x(null),void w().then((e=>{x(e)})).catch((()=>{x(null),U()}))):"passkey"===e&&1===F.length?await async function(){S(!0);try{await A(),await T({credentialIds:F})}catch(e){I(e)}finally{S(!1)}}():void E(e)},isTotpLoading:"totp"===b&&!$,isPasskeyLoading:_,error:N,onClose:k,setRemovingMfaMethod:o})},[cr.CAPTCHA_SCREEN]:()=>{let{lastScreen:n,currentScreen:i,data:a,navigateBack:o,navigate:d,setModalData:c}=dr(),{status:u,token:h,waitForResult:p,reset:f,execute:g}=xs(),y=l([]),w=e=>{y.current=[e,...y.current]},[v,C]=s(!0);m((()=>(w(setTimeout(C,1e3,!1)),()=>{y.current.forEach((e=>clearTimeout(e))),y.current=[]})),[]);let[b,E]=s(""),[$,x]=s("Checking that you are a human..."),[k,A]=s(t(Os,{onClick:()=>{},disabled:!0,children:"Continue"})),[T,_]=s(!1),[S,N]=s(3),I=a?.captchaModalData,P=async e=>{try{await(I?.callback(e)),I?.onSuccessNavigateTo&&d(I?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof Es)return;c({errorModalData:{error:e,previousScreen:n||cr.LANDING}}),d(I?.onErrorNavigateTo||cr.ERROR_SCREEN,!1)}};m((()=>{"success"===u?w(setTimeout((async()=>{let e=await p();!e||I?.userIntentRequired||P(e)}),1e3)):"ready"===u&&w(setTimeout((()=>{"ready"===u&&g()}),500))}),[u]),m((()=>{if(!v)switch(u){case"success":E("Success!"),x("CAPTCHA passed successfully."),A(t(Os,{onClick:()=>{_(!0),P(h)},disabled:!I?.userIntentRequired,loading:T,children:I?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":E(""),x("Checking that you are a human..."),A(t(Os,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),S<=0?(x("If you use an adblocker or VPN, try disabling and re-attempting."),A(null)):(x("You did not pass CAPTCHA. Please try again."),A(t(Os,{onClick:O,children:"Retry"})))}}),[u,v,T]);let O=async()=>{if(S<=0)return;N((e=>e-1)),f(),g();let e=await p();!e||I?.userIntentRequired||P(e)};return e(r,{children:[t(Ks,{backFn:n&&i!==n?o:void 0}),e(_c,{children:["success"===u?t(Dr,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):"error"===u?t(Fr,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):t(Ac,{}),e(rc,{children:[b?t("h3",{children:b}):null,t("p",{children:$})]}),k]}),t(dt,{})]})},[cr.ERROR_SCREEN]:()=>{let{navigate:e,navigateBack:r,data:n,lastScreen:i,currentScreen:a}=dr(),o=n?.errorModalData?.previousScreen||(i===a?void 0:i);return t(yh,{error:n?.errorModalData?.error||Error(),backFn:()=>o?e(o,!1):r(),onClick:()=>e(o||cr.LANDING,!1)})},[cr.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE]:()=>{let{closePrivyModal:n}=O();return e(r,{children:[t(Ks,{},"header"),t(Qm,{children:t(Pr,{style:{width:32,height:32}})}),t(cc,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),t(Zd,{children:t(Os,{onClick:()=>n(),children:"Close"})}),t(ac,{}),t(lt,{})]})},[cr.AFFIRMATIVE_CONSENT_SCREEN]:()=>{let{user:e,logout:r}=he(),{app:n,onUserCloseViaDialogOrKeybindRef:i,setModalData:a,navigate:o}=dr(),{acceptTerms:l,closePrivyModal:s,createAnalyticsEvent:d}=O(),c=e=>{e?.preventDefault(),s({shouldCallAuthOnSuccess:!1}),r()};i.current=c;return t(jd,{termsAndConditionsUrl:n?.legal.termsAndConditionsUrl,privacyPolicyUrl:n?.legal.privacyPolicyUrl,onAccept:async t=>{t.preventDefault(),await l(),e&&st(e,n?.embeddedWallets?.createOnLogin)?(a({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),d({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),o(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):s()},onDecline:c})},[cr.TELEGRAM_AUTH_SCREEN]:()=>{let{authenticated:n,logout:i,ready:a,user:o}=he(),{app:l,setModalData:d,navigate:c,resetNavigation:u,data:h}=dr(),{initLoginWithTelegram:p,loginWithTelegram:f,updateWallets:g,setReadyToTrue:y,closePrivyModal:w,createAnalyticsEvent:v,getAuthMeta:C}=O(),[b,E]=s(!1),[$,x]=s(void 0);async function k(){try{await f(),E(!0),y(!0)}catch(e){if(e?.privyErrorCode===A.ALLOWLIST_REJECTED)return x(void 0),u(),void c(cr.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===A.USER_LIMIT_REACHED)return console.error(new R(e).toString()),x(void 0),u(),void c(cr.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===A.USER_DOES_NOT_EXIST)return x(void 0),u(),void c(cr.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===A.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),u(),d({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:C()?.telegramAuthResult,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void c(cr.LINK_CONFLICT_SCREEN);let{retryable:t,detail:r}=Nl(e);x({retryable:t,detail:r,message:"Authentication failed"})}}m((()=>{k()}),[]),m((()=>{if(!(a&&n&&b&&o))return;if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(cr.AFFIRMATIVE_CONSENT_SCREEN)}),pe);return()=>clearTimeout(e)}if(st(o,l?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{d({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),c(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),pe);return()=>clearTimeout(e)}g();let e=setTimeout((()=>w({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe);return()=>clearTimeout(e)}),[a,n,b,o]);let T=b?"Successfully connected with Telegram":$?$.message:"Verifying connection to Telegram",_="";return _=b?"You’re good to go!":$?$.detail:"Just a few moments more",e(r,{children:[t(Ks,{}),t(ic,{}),e(Lw,{children:[t(td,{children:e("div",{children:[t(Ts,{success:b,fail:!!$}),t(Af,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t("h3",{children:T}),t("p",{children:_})]}),$&&$?.retryable?t(Ws,{onClick:()=>{p(void 0,h?.login?.disableSignup).then((async()=>k())).catch((e=>{let{retryable:t,detail:r}=Nl(e);x({retryable:t,detail:r,message:"Authentication failed"})})),x(void 0)},disabled:!b&&!$?.retryable,children:"Retry"}):null]}),t(ac,{}),t(dt,{})]})},[cr.LINK_CONFLICT_SCREEN]:()=>{let{initiateAccountTransfer:e,closePrivyModal:r}=O(),{data:n,navigate:i,lastScreen:a,setModalData:o}=dr(),[l,d]=s(void 0),[c,u]=s(!1),[h,p]=s(!1),m=async()=>{try{if(!n?.accountTransfer?.nonce||!n?.accountTransfer?.account)throw Error("missing account transfer inputs");p(!0),await e({nonce:n?.accountTransfer?.nonce,account:n?.accountTransfer?.account,accountType:n?.accountTransfer?.linkMethod,externalWalletMetadata:n?.accountTransfer?.externalWalletMetadata,telegramAuthResult:n?.accountTransfer?.telegramAuthResult,farcasterEmbeddedAddress:n?.accountTransfer?.farcasterEmbeddedAddress,oAuthUserInfo:n?.accountTransfer?.oAuthUserInfo}),u(!0),p(!1),setTimeout(r,1e3)}catch(e){o({errorModalData:{error:e,previousScreen:a||cr.LINK_CONFLICT_SCREEN}}),i(cr.ERROR_SCREEN,!0)}};return l?t(xd,{address:l,onClose:r,onRetry:()=>d(void 0),onTransfer:m,isTransferring:h,transferSuccess:c}):t(kd,{onClose:r,onInfo:()=>d(n?.accountTransfer?.embeddedWalletAddress),onContinue:()=>d(n?.accountTransfer?.embeddedWalletAddress),onTransfer:m,isTransferring:h,transferSuccess:c,data:n})}},Jw=[cr.LANDING,cr.AWAITING_CONNECTION],ev=({isMfaVerifying:n,onMfaVerificationComplete:i})=>{let{ready:a,isModalOpen:o}=he(),{headless:l}=ue(),{ready:s,currentScreen:d}=dr(),{status:c,execute:u,reset:h,enabled:p}=xs(),f=o&&d&&Jw.includes(d)&&!l&&"ready"===c;return m((()=>{f&&u()}),[f]),m((()=>{!o&&p&&h()}),[o,p]),a&&s||d===cr.AWAITING_OAUTH_SCREEN||d===cr.CROSS_APP_AUTH_SCREEN||d===cr.TELEGRAM_AUTH_SCREEN?!d&&n?t(ly,{open:n,onClose:i}):d?e(r,{children:[t(cd,{$if:!!n,children:t(Qw[d],{})}),t(cd,{$if:!n,children:t(ly,{open:n,onClose:i})})]}):null:e(r,{children:[t(Ks,{}),t(ic,{}),t(Xw,{children:t(_s,{})}),t(ac,{}),t(dt,{})]})},tv=({isMfaVerifying:e,onMfaVerificationComplete:r})=>{let n=l(null);return t(iv,{style:{height:Lt(n)},id:"privy-modal-content",children:t("div",{ref:n,children:t(ev,{isMfaVerifying:e,onMfaVerificationComplete:r})})})};const rv=({open:e})=>{let{app:r}=dr(),{gracefulClosePrivyModal:n}=(()=>{let{closePrivyModal:e}=O(),{onUserCloseViaDialogOrKeybindRef:t}=dr();return{gracefulClosePrivyModal:f((()=>{if(!t?.current)return e({shouldCallAuthOnSuccess:!1});t.current()}),[e])}})(),[i,a]=s(!1);As({onMfaRequired:()=>{r?.mfa.noPromptOnMfaRequired||a(!0)}});let o=e||i;return r.render.standalone?t(jw,{children:t(nv,{id:"privy-modal-content",children:t(ev,{isMfaVerifying:i,onMfaVerificationComplete:()=>a(!1)})})}):t(qw,{open:o,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>n(),children:t(jw,{children:t(tv,{isMfaVerifying:i,onMfaVerificationComplete:()=>a(!1)})})})};let nv=yr.div`
|
|
3090
|
+
`;let Qw={[cr.LANDING]:()=>{let{app:e}=dr();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?t(Nf,{connectOnly:!1}):t(Rf,{connectOnly:!1})},[cr.CONNECT_OR_CREATE]:()=>{let{app:e}=dr();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?t(Nf,{connectOnly:!0}):t(Rf,{connectOnly:!0})},[cr.AWAITING_PASSWORDLESS_CODE]:()=>{let{app:n,navigate:i,lastScreen:a,navigateBack:o,setModalData:l,onUserCloseViaDialogOrKeybindRef:d}=dr(),{closePrivyModal:c,resendEmailCode:u,resendSmsCode:h,getAuthMeta:p,loginWithCode:f,updateWallets:g,createAnalyticsEvent:y}=O(),{authenticated:w,logout:v,user:b}=he(),[E,$]=s(wc),[x,A]=s(!1),[T,_]=s(null),[S,I]=s(null),[P,M]=s(0);d.current=()=>null;let L=p()?.email?0:1,D=pe-500;m((()=>{if(P){let e=setTimeout((()=>{M(P-1)}),1e3);return()=>clearTimeout(e)}}),[P]),m((()=>{if(w&&x&&b){if(n?.legal.requireUsersAcceptTerms&&!b.hasAcceptedTerms){let e=setTimeout((()=>{i(cr.AFFIRMATIVE_CONSENT_SCREEN)}),D);return()=>clearTimeout(e)}if(st(b,n?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{l({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),y({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),i(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),D);return()=>clearTimeout(e)}{g();let e=setTimeout((()=>c({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe);return()=>clearTimeout(e)}}}),[w,x,b]),m((()=>{if(T&&0===S){let e=setTimeout((()=>{$(wc),_(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[T]);let U=e=>{e.preventDefault();let t=e.currentTarget.value.replace(" ","");if(""===t)return;if(isNaN(Number(t)))return _("Code should be numeric"),void I(1);_(null),I(null);let r=Number(e.currentTarget.name?.charAt(5)),n=[...t||[""]].slice(0,6-r),o=[...E.slice(0,r),...n,...E.slice(r+n.length)];$(o);let s=Math.min(Math.max(r+n.length,0),5);if(!isNaN(Number(e.currentTarget.value))){let e=document.querySelector(`input[name=code-${s}]`);e?.focus()}if(o.every((e=>e&&!isNaN(+e)))){let e=document.querySelector(`input[name=code-${s}]`);e?.blur(),f(o.join("")).then((()=>A(!0))).catch((e=>{if(e instanceof N&&e.privyErrorCode===k.INVALID_CREDENTIALS)_("Invalid or expired verification code");else if(e instanceof N&&e.privyErrorCode===k.CANNOT_LINK_MORE_OF_TYPE)_(e.message);else{if(e instanceof N&&e.privyErrorCode===k.USER_LIMIT_REACHED)return console.error(new R(e).toString()),void i(cr.USER_LIMIT_REACHED_SCREEN);if(e instanceof N&&e.privyErrorCode===k.USER_DOES_NOT_EXIST)return void i(cr.ACCOUNT_NOT_FOUND_SCREEN);if(e instanceof N&&e.privyErrorCode===k.LINKED_TO_ANOTHER_USER)return l({errorModalData:{error:e,previousScreen:a??cr.AWAITING_PASSWORDLESS_CODE}}),void i(cr.ERROR_SCREEN,!1);if(e instanceof N&&e.privyErrorCode===k.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return l({accountTransfer:{nonce:e.data?.data?.nonce,account:0===L?p()?.email:p()?.phoneNumber,displayName:e.data?.data?.account?.displayName,linkMethod:0===L?"email":"sms",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void i(cr.LINK_CONFLICT_SCREEN);_("Issue verifying code")}I(0)}))}},F=0==L?t(Mr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):t(Lr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),W=e("p",0==L?{children:["Please check ",t(Ac,{children:p()?.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",t(Ac,{children:p()?.phoneNumber})," for a message from ",n?.name||"Privy"," and enter your code below."]});return e(r,{children:[t(Ks,{backFn:()=>o()},"header"),e(vc,{children:[t(uc,{title:"Enter confirmation code",description:W,icon:F}),e(Qd,{children:[e(Cc,{children:[t(bc,{$fail:!!T,$success:x,children:t("span",{children:T||(x?"Success!":"")})}),t("div",{children:E.map(((e,r)=>t("input",{name:`code-${r}`,type:"text",value:E[r],onChange:U,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(1===S&&(_(null),I(null)),$([...E.slice(0,e),"",...E.slice(e+1)]),e>0){let t=document.querySelector(`input[name=code-${e-1}]`);t?.focus()}})(r)},inputMode:"numeric",autoFocus:0===r,pattern:"[0-9]",className:`${x?"success":""} ${T?"fail":""}`,autoComplete:C?"one-time-code":"off"},r)))})]}),e(Ec,{children:[e("span",{children:["Didn't get ",0==L?"an email":"a message","?"]}),P?e(xc,{children:[t(Rr,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),t("span",{children:"Code sent"})]}):t($c,{children:t("button",{onClick:async()=>{M(30),0==L?await u():await h()},children:"Resend code"})})]})]})]}),t(lt,{})]})},[cr.AWAITING_CONNECTION]:()=>{let n,[i,a]=s(!1),[o,d]=s(!1),[c,u]=s(void 0),{authenticated:h,logout:p}=he(),{app:g,navigate:y,navigateBack:w,lastScreen:v,currentScreen:b,setModalData:E,data:$}=dr(),{getAuthFlow:x,walletConnectionStatus:A,closePrivyModal:T,initLoginWithWallet:_,loginWithWallet:S,updateWallets:N,createAnalyticsEvent:I}=O(),{walletConnectors:P}=he(),[M,L]=s(0),{user:D}=he(),[U]=s(D?.linkedAccounts.length||0),[F,W]=s(""),[B,G]=s(""),[H,z]=s(!1),{hasTabbedAway:j}=function(){let[e,t]=s(!1),r=f((()=>{document.hidden&&t(!0)}),[]);return m((()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r))),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:q,token:V}=xs(),K=C&&"wallet_connect_v2"===A?.connector?.connectorType||C&&"coinbase_wallet"===A?.connector?.connectorType||C&&"injected"===A?.connector?.connectorType&&"phantom"===A?.connector?.walletClientType,Y="connected"===A?.status,Z="switching_to_supported_chain"===A?.status;m((()=>{let e=x(),t=e instanceof Al||e instanceof kl?e:void 0;Y&&!t&&(!q||V||h?_(A.connectedWallet,V,$?.login?.disableSignup).then((()=>{z(!0)})):(E({captchaModalData:{callback:e=>_(A.connectedWallet,e,$?.login?.disableSignup).then((()=>{z(!0)})),userIntentRequired:!1,onSuccessNavigateTo:cr.AWAITING_CONNECTION,onErrorNavigateTo:cr.ERROR_SCREEN}}),y(cr.CAPTCHA_SCREEN,!1))),t&&K&&Y&&!t.preparedMessage?t.buildMessage():t&&!K&&Y&&(o||(async()=>{d(!0),u(void 0);try{"wallet_connect_v2"===A?.connector?.connectorType&&"metamask"===A?.connector?.walletClientType&&await ft(2500),await Q()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{d(!1)}})())}),[M,Y,H]),m((()=>{if(D&&i){let e=pe-500;if(g?.legal.requireUsersAcceptTerms&&!D.hasAcceptedTerms){let t=setTimeout((()=>{y(cr.AFFIRMATIVE_CONSENT_SCREEN)}),e);return()=>clearTimeout(t)}if(st(D,g?.embeddedWallets?.createOnLogin)){let t=setTimeout((()=>{E({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),I({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),p()},callAuthOnSuccessOnClose:!0}}),y(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),e);return()=>clearTimeout(t)}N();let t=setTimeout((()=>T({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe);return()=>clearTimeout(t)}}),[D,i]);let X=e=>{if(e?.privyErrorCode!==k.ALLOWLIST_REJECTED){if(e?.privyErrorCode===k.USER_LIMIT_REACHED)return console.error(new R(e).toString()),void y(cr.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode!==k.USER_DOES_NOT_EXIST)return e?.privyErrorCode===k.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(E({accountTransfer:{nonce:e.data?.data?.nonce,account:x()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:x()?.meta.walletClientType,chainId:x()?.meta.chainId,connectorType:x()?.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void y(cr.LINK_CONFLICT_SCREEN)):void u(zc(e));y(cr.ACCOUNT_NOT_FOUND_SCREEN)}else y(cr.ALLOWLIST_REJECTION_SCREEN)};async function Q(){try{await S(),a(!0)}catch(e){X(e)}finally{d(!1)}}m((()=>{A?.connectError&&X(A?.connectError)}),[A]),((e,t)=>{let r=l((()=>{}));m((()=>{r.current=e})),m((()=>{if(null!==t){let e=setInterval((()=>r.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===J&&A?.connector instanceof as?A.connector.redirectUri:void 0;e&&W(e);let t="wallet_connect_v2"===J&&A?.connector instanceof as?A.connector.fallbackUniversalRedirectUri:void 0;t&&G(t)}),A?.connector instanceof as&&!F?500:null);let J=A?.connector?.connectorType||"injected",ee=A?.connector?.walletClientType||"unknown",te=Nc[ee]?.displayName||A?.connector?.walletBranding.name||"Browser Extension",re=Nc[ee]?.logo||A?.connector?.walletBranding.icon||(e=>t(Vl,{...e})),ne="Browser Extension"===te?te.toLowerCase():te;n=i?`Successfully connected with ${ne}`:c?c.message:Z?"Switching networks":Y?o&&K?"Signing":"Sign to verify":`Waiting for ${ne}`;let ie="Don’t see your wallet? Check your other browser windows.";i?ie=U===(D?.linkedAccounts.length||0)?"Wallet was already linked.":"You’re good to go!":M>=2&&c?ie="Unable to connect wallet":c?ie=c.detail:Z?ie="Switch your wallet to the requested network.":Y&&K?ie="Sign the message in your wallet to verify it belongs to you.":"metamask"===ee&&C?ie="Click continue to open and connect MetaMask.":"metamask"===ee?ie="For the best experience, connect only one wallet at a time.":"wallet_connect"===J?ie="Open your mobile wallet app to continue":"coinbase_wallet"!==J||ut()||(ie=os(D)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let ae=P?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),oe="coinbase_wallet"===ee&&(os(D)||c===tr.ERROR_USER_EXISTS);return e(r,{children:[t(Ks,{backFn:v&&b!==v?w:void 0}),e(jc,{children:[t(Vc,{walletLogo:re,success:i,fail:!!c}),e(rc,{children:[t("h3",{children:n}),t("p",{children:ie}),Y||!F||j?null:e("p",{children:["Still here?"," ",t("a",{href:F,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),B&&e(r,{children:[" ","or"," ",t("a",{href:B,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),oe?t(Os,{onClick:()=>ae&&ae?.disconnect(),disabled:i,children:"Use a different wallet"}):c==tr.ERROR_USER_EXISTS&&b!==v?t(Os,{onClick:w,children:"Use a different wallet"}):Y&&!i&&K?t(Os,{onClick:()=>{d(!0),Q()},disabled:o,children:o?"Signing":"Sign with your wallet"}):!i&&c?.retryable&&M<2?t(Os,{onClick:()=>{L(M+1),u(void 0),Y?(d(!0),Q()):A?.connectRetry()},disabled:!i&&(!c?.retryable||M>=2),children:"Retry"}):i||c?null:t(Os,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),t(dt,{})]})},[cr.AWAITING_CONNECT_ONLY_CONNECTION]:()=>{let n,{navigateBack:i,navigate:a,lastScreen:o,currentScreen:l,data:d}=dr(),{walletConnectionStatus:c,closePrivyModal:u}=O(),[h,p]=s(void 0),[f,g]=s(0),y="connected"===c?.status,w="switching_to_supported_chain"===c?.status;m((()=>{if(y){let e;if(d?.externalConnectWallet?.onCompleteNavigateTo){let t=d.externalConnectWallet.onCompleteNavigateTo;e=setTimeout((()=>{a(t)}),pe)}else e=setTimeout(u,pe);return()=>clearTimeout(e)}}),[y]);m((()=>{c?.connectError&&(e=>{p(zc(e))})(c?.connectError)}),[c]);let v=c?.connector?.connectorType||"injected",b=c?.connector?.walletClientType||"unknown",E=Nc[b]?.displayName||c?.connector?.walletBranding.name||"Browser Extension",$=Nc[b]?.logo||c?.connector?.walletBranding.icon||(e=>t(Vl,{...e})),x="Browser Extension"===E?E.toLowerCase():E;n=y?`Successfully connected with ${x}`:h?h.message:w?"Switching networks":`Waiting for ${x}`;let A="Don’t see your wallet? Check your other browser windows.";return y?A="You’re good to go!":f>=2&&h?A="Unable to connect wallet":h?A=h.detail:w?A="Switch your wallet to the requested network.":"metamask"===b&&C?A="Click to continue to open and connect MetaMask.":"metamask"===b?A="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===v?A="Open your mobile wallet app to continue":"coinbase_wallet"===v&&(A="Open the Coinbase app on your phone to continue."),e(r,{children:[t(Ks,{backFn:l===o?void 0:i}),e(Kc,{children:[t(Vc,{walletLogo:$,success:y,fail:!!h}),e(rc,{children:[t("h3",{children:n}),t("p",{children:A})]}),h==tr.ERROR_USER_EXISTS?t(Os,{onClick:i,children:"Use a different wallet"}):!y&&h?.retryable&&f<2?t(Os,{onClick:()=>{g(f+1),p(void 0),c?.connectRetry()},disabled:!y&&(!h?.retryable||f>=2),children:"Retry"}):!y&&h&&f>=2?t(Os,{onClick:i,children:"Use a different wallet"}):null]}),t(dt,{})]})},[cr.AWAITING_FARCASTER_CONNECTION]:()=>{let{authenticated:n,logout:i,ready:a,user:o}=he(),{lastScreen:d,navigate:c,navigateBack:u,setModalData:h,app:p}=dr(),{getAuthFlow:f,loginWithFarcaster:g,closePrivyModal:y,createAnalyticsEvent:w}=O(),[v,E]=s(void 0),[$,x]=s(!1),[A,T]=s(!1),_=l([]),S=f(),N=S?.meta.connectUri;return m((()=>{let e=Date.now(),t=setInterval((async()=>{let r=await S.pollForReady.execute(),n=Date.now()-e;if(r){clearInterval(t),x(!0);try{await g(),T(!0)}catch(e){let t={retryable:!1,message:"Authentication failed"};if(e?.privyErrorCode===k.ALLOWLIST_REJECTED)return void c(cr.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===k.USER_LIMIT_REACHED)return console.error(new R(e).toString()),void c(cr.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===k.USER_DOES_NOT_EXIST)return void c(cr.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===k.LINKED_TO_ANOTHER_USER)t.detail="This account has already been linked to another user.";else{if(e?.privyErrorCode===k.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return h({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:"farcaster",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,farcasterEmbeddedAddress:e.data?.data?.otherUser?.farcasterEmbeddedAddress}}),void c(cr.LINK_CONFLICT_SCREEN);e?.privyErrorCode===k.INVALID_CREDENTIALS?(t.retryable=!0,t.detail="Something went wrong. Try again."):e?.privyErrorCode===k.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again.")}E(t)}}else n>12e4&&(clearInterval(t),E({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(t),_.current.forEach((e=>clearTimeout(e)))}}),[]),m((()=>{if(a&&n&&A&&o){if(p?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(cr.AFFIRMATIVE_CONSENT_SCREEN)}),pe);return()=>clearTimeout(e)}A&&(st(o,p?.embeddedWallets.createOnLogin)?_.current.push(setTimeout((()=>{h({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),c(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),pe)):_.current.push(setTimeout((()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe)))}}),[A,a,n,o]),e(r,C||$?{children:[t(Ks,{backFn:d?u:void 0,onClose:y},"header"),t(ic,{}),t(r,b?{children:e(Dh,{children:[t(td,{children:e("div",{children:[t(Ts,{success:A,fail:!!v}),t(Rh,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t(_d,{children:v?v.message:"Sign in with Farcaster"}),t(Sd,{children:v?v.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),N&&t(Os,{onClick:e=>{e.preventDefault(),window.location.href=N},children:"Open Warpcast app"})]})}:{children:e(Lh,{children:[t(td,{children:e("div",{children:[t(Ts,{success:A,fail:!!v}),t(Rh,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t(_d,{children:v?v.message:"Signing in with Farcaster"}),t(Sd,{children:v?v.detail:"This should only take a moment"}),t(Xd,{children:N&&C&&t($h,{text:"Take me to Warpcast",url:N,color:Mh})})]})]})}),t(dt,{})]}:{children:[t(Ks,{backFn:d?u:void 0,onClose:y},"header"),t(ic,{}),t(Lh,{children:e("div",{children:[t(_d,{children:"Sign in with Farcaster"}),t(Sd,{children:"Scan with your phone's camera to continue."}),t(Jd,{children:N?t(Oh,{url:N,size:275,squareLogoElement:Rh}):t(_s,{})}),e(Xd,{children:[t(Sd,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),N&&t(bh,{text:N,itemName:"link",color:Mh})]})]})}),t(dt,{})]})},[cr.AWAITING_FARCASTER_SIGNER]:()=>{let{lastScreen:n,navigateBack:i,data:a,app:o}=dr(),{requestFarcasterSignerStatus:d,closePrivyModal:c}=O(),[u,h]=s(void 0),[p,f]=s(!1),[g,y]=s(!1),w=l([]),v=a?.farcasterSigner;m((()=>{let e=Date.now(),t=setInterval((async()=>{if(!v?.public_key)return clearInterval(t),void h({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===v.status&&(clearInterval(t),f(!1),y(!0),w.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),pe)));let r=await d(v?.public_key),n=Date.now()-e;"approved"===r.status?(clearInterval(t),f(!1),y(!0),w.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),pe))):n>3e5?(clearInterval(t),h({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),h({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(t),w.current.forEach((e=>clearTimeout(e)))}}),[]);let E="pending_approval"===v?.status?v.signer_approval_url:void 0;return e(r,C||p?{children:[t(Ks,{backFn:n?i:void 0,onClose:c},"header"),t(ic,{}),t(r,b?{children:e(Wh,{children:[t(td,{children:e("div",{children:[t(Ts,{success:g,fail:!!u}),t(Rh,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t(_d,{children:u?u.message:"Add a signer to Farcaster"}),t(Sd,{children:u?u.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),E&&t(Os,{onClick:e=>{e.preventDefault(),window.location.href=E},children:"Open Warpcast app"})]})}:{children:e(Fh,{children:[t(td,{children:e("div",{children:[t(Ts,{success:g,fail:!!u}),t(Rh,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t(_d,{children:u?u.message:"Requesting signer from Farcaster"}),t(Sd,{children:u?u.detail:"This should only take a moment"}),t(Xd,{children:E&&C&&t($h,{text:"Take me to Warpcast",url:E,color:Uh})})]})]})}),t(dt,{})]}:{children:[t(Ks,{backFn:n?i:void 0,onClose:c},"header"),t(ic,{}),t(Fh,{children:e("div",{children:[t(_d,{children:"Add a signer to Farcaster"}),e(Sd,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),t(Jd,{children:"pending_approval"===v?.status?t(Oh,{url:v.signer_approval_url,size:275,squareLogoElement:Rh}):t(_s,{})}),e(Xd,{children:[t(Sd,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),"pending_approval"===v?.status&&t(bh,{text:v.signer_approval_url,itemName:"link",color:Uh})]})]})}),t(dt,{})]})},[cr.AWAITING_PASSKEY_SYSTEM_DIALOGUE]:()=>{let{lastScreen:n,currentScreen:i,navigateBack:a}=dr(),{loginWithPasskey:o,closePrivyModal:d}=O(),[c,u]=s("loading"),[h,p]=s(null),f=l([]);m((()=>()=>{f.current.forEach((e=>clearTimeout(e))),f.current=[]}),[]);let g=async()=>{u("loading");try{await o(),u("success")}catch(e){p(e),u("error")}};return m((()=>{"success"===c&&(e=>{f.current=[e,...f.current]})(setTimeout((()=>{d({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),pe))}),[c]),m((()=>{g()}),[]),e(r,{children:[t(Ks,{backFn:n&&i!==n?a:void 0}),e(cy,{children:[t(td,{children:e("div",{children:[t(Ts,{success:"success"===c,fail:"error"===c}),t(vp,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t("h3",{children:(()=>{switch(c){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})()}),t("p",{style:{whiteSpace:"pre-wrap"},children:(()=>{switch(c){case"loading":return"Please follow prompts to verify your passkey.\nYou will have to sign up with another method first to register a passkey for your account.";case"success":return"You've successfully logged in with your passkey.";case"error":if(h instanceof I){if(h.privyErrorCode===k.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(h.privyErrorCode===k.PASSKEY_NOT_ALLOWED)return"Passkey request timed out or rejected by user.\nYou will have to sign up with another method first to register a passkey for your account."}return"An unknown error occurred.\nYou will have to sign up with another method first to register a passkey for your account."}})()})]}),(()=>{switch(c){case"loading":case"success":return t(Os,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return t(Os,{onClick:g,disabled:!1,children:"Retry"})}})()]}),t(dt,{})]})},[cr.PHANTOM_INTERSTITIAL_SCREEN]:()=>{let{forkSession:n,ready:i,authenticated:a}=he(),{walletConnectionStatus:o}=O(),[l,d]=s(""),[c,u]=s(!1);m((()=>{i&&a&&n().then(d)}),[i,a]);let h=((e,t,r)=>{let n=encodeURIComponent(new URL(window.location.href).href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=${r?"solana_adapter":"injected"}&privy_wallet_client=${r?"phantom_solana":"phantom"}`);if(!rt()&&C)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${n}?ref=${n}`})(l,!c,"solana"===o?.connector?.chainType),p={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return i&&(p.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",p.footnote="Once you're done, you can always return here and refresh to view your updated account."),c&&(p.title="Still here?",p.description="You may need to install the Phantom mobile app.",p.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(cc,{title:p.title,description:p.description}),e(Zd,{children:[t(uy,{children:t(Yl,{style:{width:"72px",height:"72px"}})}),t(Ls,{href:h,onClick:()=>{setTimeout((()=>u(!0)),1e3)},loading:i&&!h,children:c?"Go to App Store":"Continue"}),p.footnote?t("p",{children:p.footnote}):null]}),t(ac,{}),t(lt,{})]})},[cr.LOGIN_FAILED_SCREEN]:()=>{let{closePrivyModal:n}=O(),{navigate:i}=dr();return e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(Wf,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),t(cc,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),e(Zd,{children:[t(Os,{onClick:()=>i(cr.LANDING),children:"Try again"}),t(Us,{onClick:()=>n(),children:"Cancel"})]}),t(ac,{}),t(lt,{})]})},[cr.AWAITING_OAUTH_SCREEN]:()=>{let{authenticated:n,logout:i,ready:a,user:o}=he(),{app:l,setModalData:d,navigate:c,resetNavigation:u}=dr(),{getAuthMeta:h,initLoginWithOAuth:p,loginWithOAuth:f,updateWallets:g,setReadyToTrue:y,closePrivyModal:w,createAnalyticsEvent:v}=O(),[C,b]=s(!1),[E,$]=s(void 0),x=h()?.provider||"google",{name:A,component:T}=Cl(x),_=Mt();m((()=>{f(x).then((e=>{b(!0),y(!0),e&&_("login","onOAuthLoginComplete",e)})).catch((e=>{if(y(!1),e?.privyErrorCode===k.ALLOWLIST_REJECTED)return $(void 0),u(),void c(cr.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===k.USER_LIMIT_REACHED)return console.error(new R(e).toString()),$(void 0),u(),void c(cr.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===k.USER_DOES_NOT_EXIST)return $(void 0),u(),void c(cr.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===k.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return $(void 0),u(),d({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:h()?.provider,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void c(cr.LINK_CONFLICT_SCREEN);let{retryable:t,detail:r}=function(e,t){let r={detail:"",retryable:!1},n=sl(t);if(e?.privyErrorCode===k.LINKED_TO_ANOTHER_USER&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode===k.INVALID_CREDENTIALS&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode===k.OAUTH_USER_DENIED&&(r.detail=`Retry and check ${n} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode===k.TOO_MANY_REQUESTS&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===k.TOO_MANY_REQUESTS&&e.message.includes("provider rate limit")){let e=Cl(t).name;r.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode===k.OAUTH_ACCOUNT_SUSPENDED){let e=Cl(t).name;r.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===k.CANNOT_LINK_MORE_OF_TYPE&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===k.OAUTH_UNEXPECTED&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}(e,x);$({retryable:t,detail:r,message:"Authentication failed"})})).finally((()=>{El()}))}),[A,x]),m((()=>{if(a&&n&&C&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(cr.AFFIRMATIVE_CONSENT_SCREEN)}),pe);return()=>clearTimeout(e)}if(st(o,l?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{d({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:x,screen:"OAuthStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),c(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),pe);return()=>clearTimeout(e)}{let e=setTimeout((()=>w({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe);return g(),()=>clearTimeout(e)}}}),[a,n,C,o]);let S=C?`Successfully connected with ${A}`:E?E.message:`Verifying connection to ${A}`,N="";return N=C?"You’re good to go!":E?E.detail:"Just a few moments more",e(r,{children:[t(Ks,{}),t(ic,{}),e(dy,{children:[t(td,{children:e("div",{children:[t(Ts,{success:C,fail:!!E}),t(T,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t("h3",{children:S}),t("p",{children:N})]}),E&&E?.retryable?t(Ws,{onClick:()=>{El(),p(x),$(void 0)},disabled:!C&&!E?.retryable,children:"Retry"}):null]}),t(ac,{}),t(dt,{})]})},[cr.CROSS_APP_AUTH_SCREEN]:()=>{let n=ue(),{data:i,navigate:a,setModalData:o,onUserCloseViaDialogOrKeybindRef:l}=dr(),{crossAppAuthFlow:c,updateWallets:u,closePrivyModal:h,createAnalyticsEvent:p}=O(),{logout:f}=gt(),[g,y]=s({}),w=i?.crossAppAuth,v={id:w.appId,name:w.name,logoUrl:w.logoUrl},C=new x(`There was an issue connecting your ${v.name} account. Please try again.`),b=new Jo((async e=>{if(w.popup)try{let t=await c({appId:e,popup:w.popup,action:w.action});y({data:t})}catch(e){e instanceof x?y({error:e}):(e instanceof N&&w.popup&&w.popup.close(),y({error:C}))}else y({error:C})})),E=()=>{g.data&&(u(),w.onSuccess(g.data),h({shouldCallAuthOnSuccess:!0,isSuccess:!0})),w.onError(g.error??new x("User canceled flow")),h({shouldCallAuthOnSuccess:!1,isSuccess:!1})};l.current=E,m((()=>{v.id.length&&b.execute(v.id)}),[v.id]),m((()=>{if(!g.data)return;let e=g.data;if(n.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{a(cr.AFFIRMATIVE_CONSENT_SCREEN)}),pe);return()=>clearTimeout(e)}if(st(e,n.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{o({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),p({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${v.id}`,screen:"CrossAppAuthScreen"}}),f()},callAuthOnSuccessOnClose:!0}}),a(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),pe);return()=>clearTimeout(e)}let t=setTimeout(E,pe);return()=>clearTimeout(t)}),[g.data]);let{title:$,subtitle:A}=d((()=>g.data?{title:`Successfully connected with ${v.name}`,subtitle:"You're good to go!"}:g.error?{title:"Authentication failed",subtitle:g.error.message}:{title:`Connecting to ${v.name}`,subtitle:`Please check the pop-up from ${v.name} to continue`}),[g,v.name]);return e(r,{children:[t(Ks,{onClose:E}),t(ic,{}),e(Zc,{children:[t(td,{children:e("div",{children:[t(Ts,{success:!!g.data,fail:!!g.error}),t(Yc,{name:v.name,logoUrl:v.logoUrl})]})}),e(rc,{children:[t("h3",{children:$}),t("p",{children:A})]})]}),t(ac,{}),t(dt,{})]})},[cr.ALLOWLIST_REJECTION_SCREEN]:()=>{let{navigate:n,app:i}=dr(),a=i?.allowlistConfig.errorTitle||"You don't have access to this app",o=i?.allowlistConfig.errorDetail||"Have you been invited?",l=i?.allowlistConfig.errorCtaText||"Try another account";return e(r,{children:[t(Ks,{}),e(Kd,{children:[t(td,{children:e("div",{children:[t(pd,{}),t(Vd,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),e(Yd,{children:[t("string"==typeof a?"h3":r,{children:a}),t("string"==typeof o?"p":r,{children:o})]}),i?.allowlistConfig.errorCtaLink?t(Os,{as:"a",href:i.allowlistConfig.errorCtaLink,children:l}):t(Os,{onClick:()=>{n(cr.LANDING)},children:l})]})]})},[cr.ACCOUNT_NOT_FOUND_SCREEN]:()=>{let{navigate:n,app:i}=dr();return e(r,{children:[t(Ks,{}),e(ud,{children:[t(td,{children:e("div",{children:[t(Hs,{color:"var(--privy-color-warn-light)"}),t(br,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),e(hd,{children:[t("h3",{children:"Account not found"}),e("p",{children:["Please try logging in again or go to ",i.name," to create an account."]})]}),t(rd,{}),t(Os,{onClick:()=>n(cr.LANDING),children:"Try logging in again"})]})]})},[cr.USER_LIMIT_REACHED_SCREEN]:()=>{let{navigate:n}=dr();return e(r,{children:[t(Ks,{}),e(Bw,{children:[t(Gw,{children:t(Ww,{})}),e(Hw,{children:[t("h3",{children:"Unable to sign in"}),t("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),t(Os,{onClick:()=>{n(cr.LANDING)},children:"Go back"})]}),t(lt,{})]})},[cr.INSTALL_PHANTOM_SCREEN]:()=>{let{navigateBack:n}=dr();return e(r,{children:[t(Ks,{backFn:n},"header"),t(ic,{}),t(af,{}),t(ac,{}),e(dt,{children:[t("span",{children:"Still not sure? "}),t("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},[cr.LINK_EMAIL_SCREEN]:()=>{let{app:n}=dr();return e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(uc,{title:"Connect your email",description:`Add your email to your ${n?.name} account`,icon:t(Mr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(Zd,{children:t(hf,{stacked:!0})}),t(ac,{}),t(lt,{})]})},[cr.LINK_PHONE_SCREEN]:()=>{let{app:n,currentScreen:i,data:a,navigate:o,setModalData:l}=dr(),{initLoginWithSms:s}=O();return e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(uc,{title:"Connect your phone",description:`Add your number to your ${n?.name} account`,icon:t(Lr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),t(Zd,{children:t(vf,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:e}){try{await s(e),o(cr.AWAITING_PASSWORDLESS_CODE)}catch(e){l({errorModalData:{error:e,previousScreen:a?.errorModalData?.previousScreen||i||cr.LINK_PHONE_SCREEN}}),o(cr.ERROR_SCREEN)}},hideRecent:!0})}),t(ac,{}),t(lt,{})]})},[cr.LINK_WALLET_SCREEN]:()=>{let{app:n,data:i}=dr(),a=i?.externalConnectWallet?.suggestedAddress,o=a?e("span",{children:["Link the wallet with address ",t(ot,{showCopyIcon:!1,address:a})," ",n?.name?`to ${n.name}.`:"."]}):`Link a wallet to your ${n?.name} account`;return e(r,{children:[t(Ks,{},"header"),t(cc,{title:"Link your wallet",description:o}),t(id,{children:t(Gc,{connectOnly:!1})}),t(lt,{})]})},[cr.LINK_PASSKEY_SCREEN]:()=>{let{user:n,unlinkPasskey:i}=he(),{linkWithPasskey:a,closePrivyModal:o}=O(),l=n?.linkedAccounts.filter((e=>"passkey"===e.type)),[d,c]=s(!1),[u,h]=s(""),[p,f]=s(!1),[g,y]=s(!1);m((()=>{0===l.length&&y(!1)}),[l.length]);let w=async e=>(c(!0),await i(e).then((()=>f(!0))).catch((e=>{e instanceof I&&e.privyErrorCode===k.MISSING_MFA_CREDENTIALS?h("Cannot unlink a passkey enrolled in MFA"):h("Unknown error occurred.")})).finally((()=>{c(!1)})));return e(r,p?{children:[t(Ks,{onClose:()=>o()},"header"),t(Td,{children:t(Hd,{status:"success",children:t(Dr,{})})}),t(Tp,{children:"Passkey added"}),t(_p,{children:"From now on, you can use your passkey to log in."}),t(Rd,{children:t(Os,{onClick:()=>o(),children:"Done"})}),t(dt,{})]}:g?{children:[t(Ks,{backFn:()=>y(!1),onClose:()=>o()},"header"),t(Cp,{passkeys:l,expanded:g,onUnlink:w,onExpand:()=>y(!0)}),t(dt,{})]}:{children:[t(Ks,{onClose:()=>o()},"header"),t(Td,{children:e(Ep,{children:[t(wp,{}),t(vp,{})]})}),t(Tp,{children:"Secure your account with a passkey"}),t(Sp,{}),0===l.length?t(bp,{}):t(Cp,{passkeys:l,expanded:g,onUnlink:w,onExpand:()=>y(!0)}),e(Rd,{style:{marginTop:"12px"},children:[u&&t($p,{$fail:!0,children:u}),t(Os,{onClick:()=>{c(!0),a().then((()=>f(!0))).catch((e=>{if(e instanceof I){if(e.privyErrorCode===k.CANNOT_LINK_MORE_OF_TYPE)return void h("Cannot link more passkeys to account.");if(e.privyErrorCode===k.PASSKEY_NOT_ALLOWED)return void h("Passkey request timed out or rejected by user.")}h("Unknown error occurred.")})).finally((()=>{c(!1)}))},loading:d,children:"Add new passkey"})]}),t(dt,{})]})},[cr.UPDATE_EMAIL_SCREEN]:()=>e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(uc,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:t(Mr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(Zd,{children:t(Dw,{stacked:!0})}),t(ac,{}),t(lt,{})]}),[cr.UPDATE_PHONE_SCREEN]:()=>{let{currentScreen:n,data:i,navigate:a,setModalData:o}=dr(),{user:l}=he(),{initUpdatePhone:s}=O();return e(r,{children:[t(Ks,{},"header"),t(ic,{}),t(uc,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:t(Lr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(Zd,{children:t(vf,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:e}){try{if(!l?.phone?.number)throw Error("User is required to have an phone number to update it.");await s(l?.phone?.number,e),a(cr.AWAITING_PASSWORDLESS_CODE)}catch(e){o({errorModalData:{error:e,previousScreen:i?.errorModalData?.previousScreen||n||cr.LINK_PHONE_SCREEN}}),a(cr.ERROR_SCREEN)}},hideRecent:!0})}),t(ac,{}),t(lt,{})]})},[cr.CONNECT_ONLY_LANDING_SCREEN]:()=>{let{app:n,data:i}=dr(),a=i?.externalConnectWallet?.suggestedAddress,o=a?e("span",{children:["Connect the wallet with address ",t(ot,{showCopyIcon:!1,address:a})," ",n?.name?`to ${n.name}.`:"."]}):`Connect a wallet to your ${n?.name} account`;return e(r,{children:[t(Ks,{},"header"),t(dc,{title:"Connect your wallet",description:o}),t(id,{children:t(Gc,{connectOnly:!0})}),n&&t(mt,{app:n,alwaysShowImplicitConsent:!0}),t(lt,{})]})},[cr.CONNECT_ONLY_AUTHENTICATED_SCREEN]:()=>{let{app:n,data:i}=dr(),a=i?.externalConnectWallet?.suggestedAddress,o=a?`Connect the wallet with address ${pt(a)} ${n?.name?`to ${n.name}.`:"."}`:`Connect a wallet to ${n?.name}`;return e(r,{children:[t(Ks,{},"header"),t(cc,{title:"Connect your wallet",description:o}),t(id,{children:t(Gc,{connectOnly:!0})}),t(lt,{})]})},[cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN]:()=>{let{app:n,setModalData:i,navigate:a,data:o,onUserCloseViaDialogOrKeybindRef:l}=dr(),[d,c]=s(""),{embeddedWallets:u}=ue(),{authenticated:h}=he(),{closePrivyModal:p}=O(),{onSuccess:f,onFailure:g,callAuthOnSuccessOnClose:y}=o.createWallet,w=!0===n?.embeddedWallets.requireUserOwnedRecoveryOnCreate,{createWallet:v}=Au(),[C,b]=s(null),E=new Jo((async()=>{try{let e=await v();if(!e)return;b(e),a(cr.EMBEDDED_WALLET_CREATED_SCREEN)}catch(e){c(e.message)}}));return m((()=>h?w?(i({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}}),a(hu({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:u.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void E.execute():(a(cr.LANDING),void g(Error("User must be authenticated before creating a Privy wallet")))),[w,h]),l.current=()=>null,d?e(r,{children:[t(Ks,{closeable:!1}),e(ec,{children:[t(Ur,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),t(uc,{title:"Something went wrong",description:d})]}),t(Os,{onClick:()=>{C?(f(C),p({shouldCallAuthOnSuccess:y})):(g(new M("User wallet creation failed")),p({shouldCallAuthOnSuccess:!1}))},children:"Close"}),t(ku,{})]}):t(Xc,{})},[cr.EMBEDDED_WALLET_CREATED_SCREEN]:()=>{let{user:n}=he(),{closePrivyModal:i,isNewUserThisSession:a,updateWallets:o}=O(),{app:l,data:s,onUserCloseViaDialogOrKeybindRef:d}=dr(),{onSuccess:c,onFailure:u,callAuthOnSuccessOnClose:h}=s.createWallet,p=()=>{let e=yt(n);e?(o(),c(e)):u(Error("Failed to create wallet")),i({shouldCallAuthOnSuccess:h})};return m((()=>{let e=setTimeout(p,me);return()=>clearTimeout(e)}),[]),d.current=p,e(r,{children:[t(Ks,{onClose:p}),t(ic,{}),e(ec,{children:[t(Dr,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),t(uc,{title:a?"Welcome"+(l?.name?` to ${l?.name}`:""):"All set!",description:a?"You’ve successfully created an account.":"Your account is secured."})]}),t(ac,{}),t(lt,{})]})},[cr.EMBEDDED_WALLET_CONNECTING_SCREEN]:()=>{let{authenticated:n,user:i,getAccessToken:a}=he(),{closePrivyModal:o,createAnalyticsEvent:l,walletProxy:c}=O(),{navigate:u,data:h,setModalData:p,onUserCloseViaDialogOrKeybindRef:f}=dr(),g=d((()=>Date.now()),[]),[y,w]=s(!1),{onCompleteNavigateTo:v,onFailure:C,shouldForceMFA:b,address:E}=h?.connectWallet,$=e=>{y||(w(!0),C("string"==typeof e?Error(e):e))};m((()=>{let e,t=E?i?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===E)):yt(i);return n&&t?c?((async()=>{let r=await a();if(!r)return $("User must be authenticated and have a Privy wallet before it can be connected");let n="ethereum"===t.chainType;try{n?await c.connect({accessToken:r,address:t.address}):await c.connectSolana({accessToken:r,publicKey:t.address}),b&&await c.verifyMfa({accessToken:r});let i=(Date.now()-g)/1e3;v===cr.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&i<1?e=setTimeout((()=>{u(v,!1)}),1e3*(1-i)):u(v,!1)}catch(e){if(au(e)&&"privy"===t.recoveryMethod){let e=await a();if(!e)return $("User must be authenticated and have a Privy wallet before it can be recovered");try{if(l({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:t.address}}),n){let r=await(c?.recover({address:t.address,accessToken:e,recoveryMethod:t.recoveryMethod}));r?.address||$(Error("Unable to recover wallet"))}else{let r=await(c?.recoverSolana({publicKey:t.address,accessToken:e}));r?.publicKey||$(Error("Unable to recover wallet"))}v?u(v):o({shouldCallAuthOnSuccess:!1}),l({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t.address}}),u(v)}catch(e){$("An error has occurred, please try again.")}}else au(e)&&"privy"!==t.recoveryMethod?(p({...h,recoverWallet:{privyWallet:t,onCompleteNavigateTo:v,onFailure:C},recoveryOAuthStatus:{provider:t.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),u(pu(t.recoveryMethod))):$(e)}})(),()=>clearTimeout(e)):void 0:$("User must be authenticated and have a Privy wallet before it can be connected")}),[n,i,c]);let x=()=>{$("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return f.current=x,e(r,{children:[t(Ks,{onClose:x}),y?e(r,{children:[e(ec,{children:[t(Ur,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),t(uc,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),t(Os,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):t(Xc,{}),t(gu,{})]})},[cr.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN]:()=>{let[n,i]=s(!0),{authenticated:a,getAccessToken:o}=he(),{walletProxy:l,closePrivyModal:d,createAnalyticsEvent:c}=O(),{navigate:u,data:h,onUserCloseViaDialogOrKeybindRef:p}=dr(),[f,g]=s(void 0),[y,w]=s(""),[v,C]=s(!1),{privyWallet:b,onCompleteNavigateTo:E,onSuccess:$,onFailure:x}=h.recoverWallet,A=(e="User exited before their wallet could be recovered")=>{d({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?new M(e):e)};p.current=A,m((()=>{if(!a||!b)return A("User must be authenticated and have a Privy wallet before it can be recovered")}),[a]);return e(r,{children:[t(Ks,{onClose:A}),t(ic,{}),e(py,{children:[e(hy,{children:[t(In,{height:48,width:48,stroke:"var(--privy-color-accent)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),e("div",{children:[e(Ru,{children:[t(Pu,{type:n?"password":"text",onChange:e=>(e=>{e&&g(e)})(e.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),t(Fu,{style:{right:"0.75rem"},children:n?t(Bu,{onClick:()=>i(!1)}):t(Gu,{onClick:()=>i(!0)})})]}),!!y&&t(my,{children:y})]}),e("div",{children:[e(nc,{children:[t("h4",{children:"Why is this necessary?"}),t("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),t(fy,{loading:v||!l,disabled:!f,onClick:async()=>{C(!0);let e=await o();if(!e||!b||null===f)return A("User must be authenticated and have a Privy wallet before it can be recovered");try{c({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:b.address}}),await(l?.recover({address:b.address,accessToken:e,recoveryPin:f,recoveryMethod:b.recoveryMethod})),w(""),E?u(E):d({shouldCallAuthOnSuccess:!1}),$?.(b),c({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:b.address}})}catch(e){!function(e){return iu(e)&&("invalid_recovery_pin"===e.type||"invalid_request_arguments"===e.type)}(e)?w("An error has occurred, please try again."):w("Invalid recovery password, please try again.")}finally{C(!1)}},warn:!1,hideAnimations:!b&&v,children:"Recover your account"})]})]}),t(ac,{}),t(lt,{})]})},[cr.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN]:()=>{let[n,i]=s(!1),{navigate:a,lastScreen:o,navigateBack:l,setModalData:d,data:c,onUserCloseViaDialogOrKeybindRef:u}=dr(),{user:h}=he(),{embeddedWallets:p}=ue(),{closePrivyModal:m}=O(),f=yt(h),g=null===f,{isInAccountCreateFlow:y,isResettingPassword:w}=c.recoverySelection,v=f&&"privy"!==f.recoveryMethod,C=v?e("span",{children:["Your account is currently secured using"," ",t("strong",{children:Ey[f?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function b(e){d({recoveryOAuthStatus:{provider:e,action:g?"create-wallet":"set-recovery",isInAccountCreateFlow:y}}),a(cr.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN)}function E(){c?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),m({shouldCallAuthOnSuccess:c?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return u.current=E,e(r,{children:[t(Ks,{onClose:E,backFn:n?()=>i(!1):o?l:void 0,infoFn:o||n?void 0:()=>i(!0)},"header"),n?t($y,{onClose:()=>i(!1)}):e(r,{children:[t(uc,{title:v?"Update backup method":"Secure your account",icon:t(Fn,{width:48}),description:C}),t(wy,{children:p.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(f?.recoveryMethod||"")||e!==f?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":return e(sd,{onClick:()=>b("google-drive"),children:[t(by,{children:t(yy,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":return e(sd,{onClick:()=>b("icloud"),children:[t(by,{children:t(gy,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":return e(sd,{onClick:()=>{a(uu({isCreatingWallet:g,skipSplashScreen:!0}))},children:[t(by,{children:t(Wn,{style:{width:18}})}),w?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),t(lt,{})]})},[cr.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN]:()=>{let{user:n,getAccessToken:i}=he(),a=yt(n),{walletProxy:o,refreshUser:l,closePrivyModal:d}=O(),c=dr(),[u,h]=s(!1),[p,m]=s(null),[f,g]=s(null);function y(){if(!u){if(f)return c.data?.setWalletPassword?.onFailure(f),void d();if(!p)return c.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void d()}}c.onUserCloseViaDialogOrKeybindRef.current=y;let w=!(!u&&!p);return e(r,f?{children:[t(Ks,{onClose:y},"header"),t(xy,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:t(Ar,{height:38,width:38,stroke:"var(--privy-color-error)"})}),t(Cu,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),t(rd,{style:{minHeight:"2rem"}}),t(Rs,{onClick:()=>g(null),children:"Try again"}),t(lt,{})]}:{children:[t(Ks,{onClose:y},"header"),t(Fn,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),t(Cu,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),t(vu,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),t(rd,{style:{minHeight:"2rem"}}),t(Rs,{loading:u,disabled:w,onClick:()=>async function(){h(!0);try{let e=await i();if(!e||!o||!a)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:a.address,accessToken:e})).address)throw Error("Unable to set recovery on wallet");let t=await l();if(!t)throw Error("Unable to set recovery on wallet");let r=yt(t);if(!r)throw Error("Unabled to set recovery on wallet");m(!!t),setTimeout((()=>{c.data?.setWalletPassword?.onSuccess(r),d()}),pe)}catch(e){g(e)}finally{h(!1)}}(),children:p?"Success":"Confirm"}),t(lt,{})]})},[cr.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN]:()=>{let{logout:n}=he(),{navigate:i,setModalData:a,data:o}=dr(),{recoveryOAuthFlow:l,closePrivyModal:d,createAnalyticsEvent:c}=O(),[u,h]=s(!1),{provider:p,action:g,isInAccountCreateFlow:y}=o?.recoveryOAuthStatus,[w,v]=s(void 0),[C,b]=s("create-wallet"===g);if("user-passcode"===p)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let E=Cy[p].name,$=Cy[p].component,x=o?.recoverWallet?.onCompleteNavigateTo,A=new Jo((async(e="create-wallet")=>(b(!0),new Promise(((t,r)=>{setTimeout((async()=>{try{let r=window.open();await l(p,e,r),h(!0),t()}catch(t){v({message:`${"recover"===e?"Recovery":"Back up"} with ${E} unsuccessful`,detail:"recover"===g?`Please verify that you are selecting the ${E} account associated with your backup.`:"",retryable:!0}),r()}}),0)})))));m((()=>{"recover"!==g&&A.execute(y?"create-wallet":"set-recovery")}),[]),m((()=>{if(!u)return;let e=setTimeout((()=>{y?(a({createWallet:{onSuccess:()=>{},onFailure:e=>{c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),i(cr.EMBEDDED_WALLET_CREATED_SCREEN)):d({shouldCallAuthOnSuccess:!1})}),pe);return()=>clearTimeout(e)}),[u]);let k=f((async()=>{await A.execute("recover"),x?i(x):h(!0)}),[]),T="google-drive"===p?"Google Drive":"Apple iCloud",_=u&&`Successfully ${"recover"===g?"recovered":"backed up"} with ${T}.`||w&&w.message||`${"recover"===g?"Recovering":"Backing up"} with ${T}...`,S=w?w.detail:"";return e(r,{children:[t(Ks,{}),C?t(r,{children:e(wy,{children:[t(uc,{title:_,icon:t($,{style:{width:"38px",height:"38px"}}),description:S}),w&&w?.retryable?t(Os,{onClick:()=>{El(),v(void 0),"create-wallet"===g?A.execute("create-wallet"):k()},disabled:!u&&!w?.retryable,children:"Try again"}):null]})}):e(wy,{children:[t(uc,{title:"Confirm it's really you",icon:t($,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${T} where your account is backed up.`}),e(Os,{onClick:k,children:["Confirm with ",T]})]}),t(lt,{})]})},[cr.EMBEDDED_WALLET_KEY_EXPORT_SCREEN]:()=>{let[n,i]=s(null),{authenticated:a,user:o,getAccessToken:l}=he(),{closePrivyModal:d,createAnalyticsEvent:c,clientAnalyticsId:u}=O(),h=ue(),{data:p,onUserCloseViaDialogOrKeybindRef:f}=dr(),{onFailure:g,onSuccess:y,origin:w,appId:v,appClientId:C,wallet:b}=p.keyExport,E=e=>{d({shouldCallAuthOnSuccess:!1}),g("string"==typeof e?Error(e):e)},$=()=>{d({shouldCallAuthOnSuccess:!1}),y(),c({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:b.address}})};return m((()=>{if(!a||!b)return E("User must be authenticated before exporting their wallet");l().then(i,E)}),[a,o]),f.current=$,e(r,{children:[t(Ks,{onClose:$}),e(Eu,{children:[t(Cu,{children:"Transfer wallet"}),e(vu,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",t("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),t(yu,{theme:h.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),t(wt,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:b.address,showIcon:!0}),t("div",{style:{width:"100%"},children:n&&t(bu,{origin:w,appId:v,appClientId:C,accessToken:n,clientAnalyticsId:u,wallet:b,dimensions:{height:"44px"}})})]}),t(lt,{})]})},[cr.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN]:()=>{let{authenticated:n}=he(),{initializeWalletProxy:i,closePrivyModal:a}=O(),{navigate:o,data:l,onUserCloseViaDialogOrKeybindRef:d}=dr(),[c,u]=s(!0),[h,p]=s(""),[f,g]=s(),[y,w]=s(null),[v,C]=s(!1),b=null!==y;m((()=>{n||o(cr.LANDING)}),[n]),m((()=>{i(fe).then((e=>{u(!1),e||(p("An error has occurred, please try again."),g(new rr(new nr(h,ir.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:E,data:$,confirmAndSign:x,onSuccess:A,onFailure:k,uiOptions:T}=l.signMessage,_={title:T.title||"Sign message",description:T.description||"Signing this message will not cost you any fees.",buttonText:T.buttonText||"Sign and continue"},S=e=>{e?A(e):k(f||new rr(new nr("The user rejected the request.",ir.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{w(null),p(""),g(void 0)}),200)};return d.current=()=>{S(y)},e(r,{children:[t(Ks,{onClose:()=>S(y)}),t(ic,{}),T.iconUrl&&"string"==typeof T.iconUrl?t(Rw,{children:t(Aw,{size:"sm",src:T.iconUrl,alt:"app image"})}):null,t(Cu,{children:_.title}),t(vu,{children:_.description}),"personal_sign"===E&&t(Nw,{children:kw($)}),"eth_signTypedData_v4"===E&&t(Sw,{typedData:$}),"solana_signMessage"===E&&t(Nw,{children:$}),t(Mw,{}),t(Pw,{$fail:!0,children:h}),t(Rs,{disabled:v||b||c,loading:v,onClick:async()=>{C(!0),p("");try{let e=await x();w(e),C(!1),setTimeout((()=>{S(e)}),pe)}catch(e){console.error(e),p("An error has occurred, please try again."),g(new rr(new nr(h,ir.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),C(!1)}},children:v?"Signing...":b?e(Ow,{children:[t(Ch,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",t("span",{children:"Success"})]}):_.buttonText}),t(ac,{}),t(lt,{})]})},[cr.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN]:()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=dr(),{rpcConfig:a,chains:o,closePrivyModal:l,walletProxy:c}=O(),{getAccessToken:u,user:h}=he(),p=ue(),[f,g]=s(0),y=(e=>e?.sendTransaction?"transactionRequest"in e.sendTransaction?0:e.sendTransaction.transactionRequests.length-1:0)(e),[w,v]=s(((e,t)=>e?.sendTransaction?"transactionRequest"in e.sendTransaction?e.sendTransaction.transactionRequest:e.sendTransaction.transactionRequests[t]:void 0)(e,f)),[C,b]=s(null),[E,$]=s(),[x,A]=s(!1),[k,T]=s(null),[_,S]=s(null);if(!w||!e?.sendTransaction||!e?.sendTransaction.transactingWallet)return t(yh,{error:Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(xw),l({shouldCallAuthOnSuccess:!1})}});let N=e.sendTransaction.rootWallet,I=e.sendTransaction.transactingWallet,P=d((()=>o.find((e=>Number(e.id)===Number(w.chainId)))),[w.chainId]),R=P?.nativeCurrency.symbol??"ETH",{action:M,amount:L,spender:D,isErc20Ish:U}=d((()=>(e=>{let t=bw(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=Ew(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}})(w.data)),[w.data]);m((()=>{w.to&&P&&U&&pm({address:w.to,chain:P,rpcConfig:p.rpcConfig,privyAppId:p.id}).then(b).catch(console.error)}),[w.to,P]);let{tokenPrice:F,isTokenPriceLoading:W}=Vh(w),B=d((()=>Ve(Number(w.chainId),o,a,{appId:p.id})),[w.chainId,a]),G=$w(w,I,B);m((()=>{e.sendTransaction?.getIsSponsored?e.sendTransaction.getIsSponsored().then($).catch(console.error):$(!1)}),[e.sendTransaction.getIsSponsored]);let H=()=>{if(!x)return k?e?.sendTransaction?.onSuccess(k.response):_||G?.errors[0]?e?.sendTransaction?.onFailure(_??G?.errors[0]??xw):e?.sendTransaction?.onFailure(new rr(new nr("The user rejected the request",ir.E4001_USER_REJECTED_REQUEST.eipCode))),l({shouldCallAuthOnSuccess:!1})};r.current=H;let z=!!(p.fundingConfig&&p.fundingConfig.methods.length>0&&e.funding),j="fiat-currency"===p.embeddedWallets.priceDisplay.primary,q=ze(G?.tx.value??0).add(ze(G?.totalGasEstimate?.toBigInt()??0)).toHexString(),V=Tt(q,R),K=j&&F?It(q,F):void 0,Y=Tt(G?.totalGasEstimate?.toString()??0,R),Z=j&&F?It(G?.totalGasEstimate?.toString()??0,F):void 0,X=Tt(G?.balance?.toString()??0,R,void 0,!0),Q=j&&F?It(G?.balance?.toString()??0,F):void 0,J=e.sendTransaction?.uiOptions?.transactionInfo?.title||("approve"===M?"Confirm address":`Approve ${M}`),ee=e.sendTransaction?.uiOptions?.description||`${p.name} wants your permission to approve the following transaction.`,te=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?t("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,re=!(!G||G.errors[0]||G.hasFunds||!1!==E),ne=re&&z,ie=ne?"Add funds":e.sendTransaction?.uiOptions?.buttonText||(f<y?"Continue":"Approve");return k?.receipt?t(ww,{txn:G?.tx??w,onClose:H,receipt:k.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:F,tokenSymbol:R,l1GasEstimate:G?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):_?t(Dy,{transactionError:_,network:"ethereum",chainId:G?.tx.chainId??w.chainId,onClose:H,onRetry:({resetNonce:e})=>{S(null);let t={...G?.tx??w};e&&(t.nonce=void 0),v(t)}}):t(_y,{transactionIndex:f,onBack:0!==y&&"number"==typeof f&&0!==f?()=>{g(f-1)}:void 0,maxIndex:y,disabled:re&&!z,isSubmitting:x,submitError:_,isPreparing:!G,isTokenPriceLoading:W,isTokenContractInfoLoading:!C,prepareError:G?.errors[0],symbol:C?.symbol,chain:P,img:te,title:J,subtitle:ee,spender:D,total:w.value?K??V:void 0,txValue:w.value,fee:Z??Y,isSponsored:E,to:w.to,network:p.chains.find((e=>e.id===w.chainId))?.name??"",from:I?.address??"",cta:ie,missingFunds:re,action:M,balance:Q??X,amount:L&&C?Yh({amount:L,decimals:C.decimals}):L,onClose:H,onClick:ne?async()=>{if(!I)return;if(!z)throw Error("Funding wallet is not enabled");let t=gw({fundingMethods:p.fundingConfig.methods});n({...e,funding:{...e.funding,methodScreen:t}}),i(t)}:async()=>{if(f<y)g(f+1);else{A(!0);try{let t=await u();if(x||!t||!I||!c||!h)return;let r=e?.sendTransaction?.onConfirm?await e.sendTransaction.onConfirm():(await sw({accessToken:t,transactingWallet:I,rootWallet:N,walletProxy:c,transactionRequest:G?.tx??w,provider:B,requesterAppId:e.sendTransaction?.requesterAppId})).hash,n=await B.getTransaction(r),i=await n.wait();T({receipt:cw(i),response:n})}catch(e){console.warn({transaction:G?.tx??w,error:e}),S(e)}finally{A(!1)}}}})},[cr.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN]:()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:r}=dr(),{closePrivyModal:n,walletProxy:i}=O(),a=ue(),{user:o}=he(),[l,d]=s(e?.sendSolanaTransaction?.transactionRequest),[c,u]=s(),[h,p]=s(),[f,g]=s(0),[y,w]=s(!1),[v,C]=s(),[b,E]=s(null),$=e?.sendSolanaTransaction?.connection,x=e?.sendSolanaTransaction?.transactingWallet,A=c?.instructions.at(f),k=c?.instructions.length??1;if(m((()=>{!async function(){if(l&&$)try{p(void 0);let e=await $g(l,$);u(e),g(0)}catch(e){console.warn("Failed to prepare transaction",e),p(e)}}()}),[l,$]),!(l&&e?.sendSolanaTransaction&&x&&$)){let r=Error("Invalid transaction request");return t(yh,{error:r,onClick:()=>{e?.sendSolanaTransaction?.onFailure(r),n({shouldCallAuthOnSuccess:!1})}})}let{solPrice:T,isSolPriceLoading:_}=(()=>{let{showFiatPrices:e,getUsdPriceForSol:t}=O(),[r,n]=s(!0),[i,a]=s(void 0),[o,l]=s(void 0);return m((()=>{(async()=>{if(e)try{n(!0);let e=await t();e?l(e):a(Error("Unable to fetch SOL price"))}catch(e){a(e)}finally{n(!1)}else n(!1)})()}),[]),{solPrice:o,isSolPriceLoading:r,solPriceError:i}})(),S=()=>{if(!y)return v?e?.sendSolanaTransaction?.onSuccess(v):(e?.sendSolanaTransaction?.onFailure(b??h??Error("User exited the modal before submitting the transaction")),g(0)),n({shouldCallAuthOnSuccess:!1})};r.current=S;let N="fiat-currency"===a.embeddedWallets.priceDisplay.primary,I=e.sendTransaction?.uiOptions?.transactionInfo?.title||("approve"===A?.action?"Confirm address":"Approve transaction"),P=e.sendTransaction?.uiOptions?.description||`${a.name} wants your permission to approve the following transaction.`,R=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?t("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,M=A?.amount||0n,L=0===f&&c?.fees||0n,D=A?.balance||0n,U=A?.from,F=A?.to,W=M+L,B=gg(W),G=N&&T?yg(W,T):void 0,H=L?gg(L):void 0,z=N&&T?yg(L,T):void 0,j=D?gg(D):void 0,q=N&&T?yg(D,T):void 0,V=e.sendTransaction?.uiOptions?.buttonText||"Approve";return v?t(ow,{instructions:c?.instructions.map((({from:e,to:t,amount:r})=>({from:e.toBase58(),to:t.toBase58(),amount:r})))??[],fees:0===f?v.fees:0n,onClose:S,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,solPrice:T,receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription,rpcEndpoint:$.rpcEndpoint}):b?t(Dy,{transactionError:b,connection:$,onClose:S,network:"solana",onRetry:async()=>{E(null);let{blockhash:e}=await $.getLatestBlockhash();Bn(l)?l.message.recentBlockhash=e:l.recentBlockhash=e,d(l)}}):t(_y,{isSubmitting:y,submitError:b,isPreparing:!c,isTokenPriceLoading:_,isTokenContractInfoLoading:!1,symbol:"SOL",chain:void 0,img:R,title:I,subtitle:P,from:U?.toBase58()||"",to:F?.toBase58(),fee:z??H,total:null!=M?G??B:void 0,txValue:M,spender:A?.spender?.toBase58(),network:"Solana",cta:V,missingFunds:!h&&!A?.hasFunds,action:A?.action,balance:q??j,prepareError:h,chainName:"Solana",onClose:S,onClick:async()=>{if(f<(c?.instructions.length??1)-1)g(f+1);else try{w(!0);let t=await Tv();if(y||!t||!x||!i||!o)return;let{signature:r,receipt:n}=await ky({tx:l,accessToken:t,connection:$,walletProxy:i,transactionOptions:e.sendSolanaTransaction?.transactionOptions});C(Eg(r,n))}catch(e){console.warn({transaction:l,error:e}),E(e)}finally{w(!1)}},isSponsored:!1,transactionIndex:f,maxIndex:k-1,disabled:!A?.hasFunds,onBack:f>0&&k>1?()=>g(f-1):void 0})},[cr.FUNDING_METHOD_SELECTION_SCREEN]:()=>{let{wallets:i}=ke(),{navigate:a,data:o,setModalData:d}=dr(),c=ue(),u=o?.funding,h=l(null),[p,f]=s(!1);m((()=>{h.current&&h.current.style.setProperty("--funding-input-length",Math.max(u.amount.length,1).toString())}),[u.amount,h.current]);let g=c.fundingConfig?.methods.slice()??[],{tokenPrice:y}=Vh({chainId:u.chain.id});m((()=>{u.erc20Address&&u.chain&&!u.erc20ContractInfo&&pm({address:u.erc20Address,chain:u.chain,rpcConfig:c.rpcConfig,privyAppId:c.id}).then((e=>d({...o,funding:{...o.funding,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}}))).catch(console.error)}),[u.erc20Address,u.chain]);let w=y?St(u.amount,y):void 0,v=i.find((e=>n(e.address)===n(u.address))),C=v&&"privy"!==v.walletClientType?Ic(v.walletClientType,v.connectorType,v.walletClientType):c.name,b=parseFloat(u.amount),E=!isNaN(b)&&b>0,$=!(!u.erc20Address||u.erc20ContractInfo),x=u.isUSDC?"USDC":u.erc20Address?void 0:"native-currency",A=x&&((e,t)=>{switch(t){case"native-currency":return gm.has(e);case"USDC":return ym.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}})(Number(u.chain.id),x),k=x&&((e,t)=>{switch(t){case"native-currency":return nm.has(e);case"USDC":return im.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}})(Number(u.chain.id),x),T=u.erc20Address||!u.erc20Address&&!u.isUSDC;return e(r,{children:[t(Bh,{}),e("h3",{children:["Add funds to your"," ",C?.toLowerCase().endsWith("wallet")?C:C+" wallet"]}),t(tc,{style:{marginTop:"32px"},children:t(Up,{children:$?t(Gh,{size:"50px"}):e(r,{children:[e(Fp,{onClick:()=>h.current?.focus(),children:[t(Bp,{ref:h,value:u.amount,onFocus:()=>f(!0),onBlur:()=>f(!1),onChange:e=>{let t=e.target.value;/^[0-9.]*$/.test(t)&&t.split(".").length-1<=1&&d({...o,funding:{...u,amount:t}})}}),t(Hp,{children:u.erc20Address?u.erc20ContractInfo?.symbol:u.chain.nativeCurrency.symbol}),!p&&t(Gp,{children:t(gn,{width:12,height:12})})]}),!u.erc20Address&&t(zp,{children:w&&E?w:""})]})})}),e(Lp,{children:[u.errorMessage&&t(um,{children:u.errorMessage}),g.sort().map((r=>{switch(r){case"moonpay":return A?e(sd,{disabled:!E||$,onClick:()=>{a(cr.MOONPAY_PROMPT_SCREEN)},children:[t(Dp,{children:t($m,{style:{width:24}})}),"Moonpay"]},r):null;case"coinbase-onramp":return k?e(sd,{disabled:!E||$,onClick:()=>{a(cr.COINBASE_ONRAMP_STATUS_SCREEN)},children:[t(Dp,{children:t(Pl,{style:{width:24}})}),"Coinbase Onramp"]},r):null;case"external":return T?e(sd,{disabled:!E||$,onClick:()=>{a(cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN)},children:[t(Dp,{children:t(kr,{style:{width:24}})}),"Transfer from wallet"]},r):null}})),t(qp,{disabled:!E,onClick:()=>a(cr.FUNDING_MANUAL_TRANSFER_SCREEN),children:"Send funds manually"})]}),t(lt,{})]})},[cr.MOONPAY_PROMPT_SCREEN]:()=>{let{app:n,data:i,navigate:a,setModalData:o}=dr(),{createAnalyticsEvent:l,getMoonpaySignedUrl:d}=O(),[c,u]=s(null),h=i?.funding,p=h.isUSDC?"USDC":"native-currency";return m((()=>{!c&&h&&async function(){if(!n.fundingConfig)return;let{signedUrl:e,externalTransactionId:t}=await d(h.address,{...n.fundingMethodConfig.moonpay,...h.moonpayConfigOverride,currencyCode:h.moonpayConfigOverride?.currencyCode??wm(h.chain.id,p),quoteCurrencyAmount:h.moonpayConfigOverride?.quoteCurrencyAmount??vm(h.amount)});u(e),o({moonpayStatus:{externalTransactionId:t},funding:i?.funding})}()}),[c,h]),e(r,{children:[t(Bh,{}),t(Om,{app:n,signedUrl:c,onContinue:()=>{l({eventName:"sdk_fiat_on_ramp_started",payload:{provider:fm}}),a(cr.MOONPAY_STATUS_SCREEN)}}),t(lt,{})]})},[cr.MOONPAY_STATUS_SCREEN]:()=>{let{app:n,data:i}=dr(),{closePrivyModal:a}=O(),{externalTransactionId:o}=i?.moonpayStatus,l=Em(o||null,n.fundingMethodConfig.moonpay.useSandbox??!1);return e(r,{children:[t(Ks,{title:"Fund account"},"header"),t(zm,{status:l,onClickCta:a}),t(lt,{})]})},[cr.COINBASE_ONRAMP_STATUS_SCREEN]:()=>{let{data:n,setModalData:i,navigate:a}=dr(),{closePrivyModal:o,createAnalyticsEvent:l,initCoinbaseOnRamp:d,getCoinbaseOnRampStatus:c}=O(),u=n?.funding,h=u.isUSDC?"USDC":"ETH",[p,f]=s(!1),[g,y]=s(!1);return m((()=>{if(p)return;f(!0);let e=async()=>{try{l({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:u.amount,chainId:u.chain.id}});let e=window.open(void 0,void 0,rm({w:440,h:680})),t=function(e){let t=am[e];if(!t)throw new x(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}(u.chain.id),r=await d({addresses:[{address:u.address,blockchains:[t]}],assets:[h]}),{url:n}=(({input:e,amount:t,blockchain:r})=>{let n=new URL("https://pay.coinbase.com/buy/select-asset");return n.searchParams.set("appId",e.app_id),n.searchParams.set("sessionToken",e.session_token),n.searchParams.set("defaultExperience","buy"),n.searchParams.set("presetCryptoAmount",t.startsWith(".")?`0${t}`:t),n.searchParams.set("defaultNetwork",r),n.searchParams.set("partnerUserId",e.partner_user_id),{url:n}})({input:r,amount:u.amount,blockchain:t});if(!e)throw Error("Unable to initiate Coinbase Onramp flow.");e.location=n.toString();let i=0,a=!1;for(;i<om;){i++;let{status:t}=await c({partnerUserId:r.partner_user_id});if("success"===t){a=!0;break}if("failure"===t)throw Error("There was an error completing Coinbase Onramp flow.");if(e.closed)throw Error("User exited Coinbase Onramp flow before transaction response.");await new Promise((e=>setTimeout(e,1500)))}if(!a)throw Error("Timed out waiting for transaction response from Coinbase Onramp.");y(!0)}catch(e){console.error(e),l({eventName:Zh,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...u,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),a(cr.FUNDING_METHOD_SELECTION_SCREEN)}finally{f(!1)}},t=setTimeout((()=>{e()}),500);return()=>clearTimeout(t)}),[]),e(r,{children:[t(Ks,{title:"Fund account"},"header"),t(lm,{isSucccess:g,onClickCta:o}),t(lt,{})]})},[cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN]:()=>{let{connectors:n}=O(),{app:i,setModalData:a,data:o,navigate:l}=dr(),[d,c]=s("default"),u=Hc(i.appearance.walletList,"ethereum-only",n,!0,i.appearance.walletList,i.externalWallets.walletConnect.enabled),h=t(Xm,{text:"More wallets",onClick:()=>c("overflow")});return m((()=>{a({...o,externalConnectWallet:{onCompleteNavigateTo:cr.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN}})}),[]),e(r,"overflow"===d?{children:[t(Ks,{backFn:()=>c("default")},"header"),e(id,{children:[t(vu,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),u]}),t(lt,{})]}:{children:[t(Bh,{}),t(uc,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),e(id,{children:[...u.length>3?u.slice(0,2):u,u.length>3&&h,t(Zm,{onClick:()=>l(cr.FUNDING_MANUAL_TRANSFER_SCREEN),children:"Send funds manually"})]}),t(lt,{})]})},[cr.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN]:()=>{let{rpcConfig:n,appId:i,closePrivyModal:a,createAnalyticsEvent:o}=O(),{navigate:l,setModalData:d,app:c,data:u}=dr(),{wallets:h}=ke(),[p,f]=s(!1),[g,y]=s(0n),[w,v]=s(!1),[C,b]=s(null),[E,$]=s(null),[A,T]=s([]),[_,S]=s(0),[N,I]=s(!1),[P,R]=s(!1),[M,L]=s(!1),[D,U]=s(!1),{erc20ContractInfo:F,erc20Address:W,address:B,chain:G,amount:H}=u.funding;m((()=>{W&&!F&&b(Error("Unable to fetch token details"))}),[]);let z=!!W&&!!F,j=z?BigInt(parseFloat(H)*10**F.decimals):tn(H),q=h[0],[V,K]=s(null);m((()=>{(async()=>{if(!q)return;let e=await q.getEthereumProvider();K(rn({account:q.address,transport:nn(e)}).extend(an))})().catch(console.error)}),[q]);let[Y,Z]=s(0n);m((()=>{Jr({chain:G,transport:en($t(G,n,i))}).getBalance({address:B}).then(Z).catch(console.error)}),[]);let[X,Q]=s(0n);m((()=>{z&&(async({chain:e,address:t,appId:r,rpcConfig:n,erc20Address:i})=>{let a=Jr({chain:e,transport:en($t(e,n,r))});return{balance:await a.readContract({address:i,abi:tp,functionName:"balanceOf",args:[t]}).catch((()=>0n)),chain:e}})({chain:G,address:B,appId:i,rpcConfig:n,erc20Address:W}).then((e=>Q(e.balance))).catch(console.error)}),[]);let{tokenPrice:J}=Vh({chainId:G.id}),[ee,te]=s({to:B,chain:G,value:j,data:void 0});m((()=>{(async()=>{let e,t;if(!V||!q||N||M)return;I(!0);let r=Jr({chain:ee.chain,transport:en($t(ee.chain,n,i))});if(z&&!ee.data)return await r.simulateContract({address:W,chain:ee.chain,abi:Kh,functionName:"transfer",args:[B,j],account:q.address}).catch((e=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",e)}))?(I(!1),void te({to:W,chain:ee.chain,data:on({abi:Kh,functionName:"transfer",args:[B,j]}),value:"0x0"})):(I(!1),void v(!0));try{e=await r.prepareTransactionRequest({account:q.address,to:ee.to,chain:ee.chain,data:ee.data,value:BigInt(ee.value??0)})}catch(e){console.error(e),A.length>1&&$(e.shortMessage??"Something went wrong")}if(!e)return I(!1),void v(!0);I(!1),L(!0),f(!0),y(e.gas);try{await V.switchChain({id:ee.chain.id})}catch(e){await V.addChain({chain:ee.chain}),await V.switchChain({id:ee.chain.id})}try{t=await V.sendTransaction(e),o({eventName:Zh,payload:{provider:"external",status:"success",address:q.address,chainId:ee.chain.id,value:ee.value?.toString(),txHash:t}})}catch(e){console.error(e),"TransactionExecutionError"===e.name&&(A.length<1?b(new x(e.shortMessage,void 0,k.TRANSACTION_FAILURE)):$(e.shortMessage??"Something went wrong"))}t?(await V.waitForTransactionReceipt({hash:t}),L(!1),U(!0)):L(!1)})().catch(console.error)}),[V,ee]),m((()=>{(async()=>{if(!w||!V||!q)return;let e=ur(c.chains).filter((e=>e.id!==u.funding.chain.id&&!!e.testnet==!!u.funding.chain.testnet));z&&e.unshift(u.funding.chain);let t=await(({chains:e,appId:t,address:r,rpcConfig:n})=>Promise.all(e.map((async e=>{let i=Jr({chain:e,transport:en($t(e,n,t))});return{balance:await i.getBalance({address:r}).catch((()=>0n)),chain:e}}))))({chains:e,address:q.address,appId:i,rpcConfig:n}),r=z?t.filter((e=>e.balance>0n)):t.filter((e=>e.balance>j));if(r.length<1)return void b(new x(`Wallet ${pt(q.address)} does not have enough funds.`,void 0,k.INSUFFICIENT_BALANCE));r.sort(((e,t)=>Number(t.balance-e.balance)));let a=(await Promise.allSettled(r.map((async e=>({quote:await Jh({isTestnet:!!u.funding?.chain.testnet,input:Qh({amount:j.toString(),user:q.address,recipient:B,destinationChainId:G.id,destinationCurrency:W,originChainId:e.chain.id})}),...e}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(a.length<1)return void b(new x(`Wallet ${pt(q.address)} does not have enough funds.`,void 0,k.INSUFFICIENT_BALANCE));let o=a.map((e=>({bridgeTx:ep(e.quote),balance:e.balance,chain:e.chain}))).filter((e=>!!e.bridgeTx));if(o.length>1)return void T(o);let l=o[0];l?(R(!0),te({data:l.bridgeTx.data,to:l.bridgeTx.to,value:l.bridgeTx.value,chain:l.chain})):b(new x(`Wallet ${pt(q.address)} does not have enough funds.`,void 0,k.INSUFFICIENT_BALANCE))})().catch(console.error)}),[w]),m((()=>{if(!C)return;let e={error:C,previousScreen:cr.FUNDING_TRANSFER_FROM_WALLET_SCREEN};d({funding:u?.funding,sendTransaction:u?.sendTransaction,errorModalData:e}),l(cr.ERROR_SCREEN,!1)}),[C]);let re=q?Ic(q.walletClientType,q.connectorType,q.walletClientType)||"wallet":null,ne=!z&&J?St(u?.funding?.amount??"0",J):void 0,ie=z?g:Nt([g,j]),ae=ie&&J?It(ie,J):void 0,oe=ie?Tt(ie,"ETH"):void 0,le=g&&J?It(g,J):void 0,se=g?Tt(g,"ETH"):void 0;if(m((()=>{if(!D)return;let e=setTimeout(a,Te);return()=>clearTimeout(e)}),[D]),D)return e(r,{children:[t(Bh,{}),t(ic,{}),e(ec,{children:[t(Qr,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),t(uc,{title:"Success!",description:`You’ve successfully added ${H} ${z?F.symbol:G.nativeCurrency.symbol} to your ${c.name} wallet. It may take a minute before the funds are available to use.`})]}),t(ac,{}),t(lt,{})]});let de=z?`${Yh({amount:X,decimals:F.decimals})} ${F.symbol}`:Tt(Y,G.nativeCurrency.symbol,3,!0),ce=A[_];return A.length>1&&ce?t(Yp,{displayName:re,configuredFundingChain:G,formattedBalance:de,fundingAmount:H,fundingCurrency:z?F.symbol:G.nativeCurrency.symbol,fundingAmountInUsd:ne,options:A,selectedOption:ce,isPreparing:N,isSubmitting:M,errorMessage:E,onSubmit:()=>{te({to:ce.bridgeTx.to,data:ce.bridgeTx.data,value:ce.bridgeTx.value,chain:ce.chain})},onSelect:e=>{e!==_&&($(null),S(e))}}):p&&g&&q&&u?.funding?t(Zp,{wallet:q,displayName:re,addressToFund:B,isBridging:P,isErc20Flow:z,totalPriceInUsd:ae,totalPriceInNativeCurrency:oe,gasPriceInUsd:le,gasPriceInNativeCurrency:se,chain:u.funding.chain}):e(r,{children:[t(Bh,{}),t(Gh,{}),t("div",{style:{marginTop:"1rem"}}),t(lt,{})]})},[cr.FUNDING_MANUAL_TRANSFER_SCREEN]:()=>{let{wallets:n}=ke(),{app:i,data:a,setModalData:o,navigate:l,lastScreen:c}=dr(),{chains:u,rpcConfig:h,appId:p,closePrivyModal:f,createAnalyticsEvent:g}=O(),[y,w]=s("default"),[v,C]=s(void 0),b=a?.funding,{tokenPrice:E}=Vh({chainId:b.chain.id}),$=E?St(b.amount,E):void 0,x=n.find((e=>pt(e.address)===pt(b.address))),A=x&&"privy"!==x.walletClientType?Ic(x.walletClientType,x.connectorType,x.walletClientType):i.name;if(!b)return o({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:c||cr.FUNDING_METHOD_SELECTION_SCREEN},funding:a?.funding,sendTransaction:a?.sendTransaction}),l(cr.ERROR_SCREEN),t(r,{});m((()=>{let e=Ve(b.chain.id,u,h,{appId:p});function t(){e.getBalance(b.address).then((e=>{let t=parseFloat(wn(e,"ether"));C((e=>(e&&t>e&&g({eventName:Zh,payload:{provider:"manual",status:"success",address:x?.address,value:(t-e).toString()}}),t)))})).catch((()=>C(void 0)))}let r=setInterval(t,2e3);return t(),()=>clearInterval(r)}),[]);let k=d((()=>void 0!==v&&v>=parseFloat(b.amount)),[v,b.amount]),T=e(r,{children:[t(wt,{title:"Your wallet",errMsg:void 0,isLoading:!b||void 0===v,isPulsing:!k,balance:`${void 0!==v?v.toPrecision(2):""} ETH`,address:b.address,statusColor:k?"green":"gray"}),k&&t(Kp,{onClick:()=>f(),children:"Close"})]});return e(r,"qr-code"===y?{children:[t(Ks,{backFn:()=>w("default")}),e(tc,{style:{gap:"24px",marginBottom:"24px"},children:[e("div",{children:[t(_d,{children:"Scan QR code"}),e(Sd,{children:["Scan this code using your mobile wallet to send funds to your ",A," ","wallet."]})]}),t(Oh,{url:b.address,size:200,squareLogoElement:xm}),T]}),t(lt,{})]}:{children:[t(Bh,{}),t(uc,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),e(tc,{style:{gap:"16px"},children:[e(Tm,{children:[t(vn,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),e(_m,{children:["Make sure to send on ",b.chain.name,"."]})]}),e(Sm,{children:[t(lc,{height:16}),e(Up,{children:[e(Fp,{children:[t(Wp,{children:b.amount}),t(Hp,{children:b.chain.nativeCurrency.symbol})]}),t(zp,{children:$?`${$} USD`:"..."}),e(jp,{children:[t(lp,{chainId:b.chain.id,height:16,width:16})," ",b.chain.name]})]}),t(lc,{height:8}),e(km,{children:[t(Am,{text:b.address}),t(Im,{onClick:()=>w("qr-code"),children:e(Nm,{children:[t(Cn,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),T]}),t(lc,{height:16}),t(lt,{})]})},[cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN]:()=>{let{closePrivyModal:n}=O(),{data:i,setModalData:a,navigate:o,onUserCloseViaDialogOrKeybindRef:l}=dr(),{onSuccess:s,onFailure:d}=i.setWalletPassword,c=()=>{d(new M("Exited before password was added to wallet")),n({shouldCallAuthOnSuccess:!1})};return l.current=c,e(r,{children:[t(Ks,{onClose:c}),t(ic,{}),e(ec,{children:[e(oc,{children:[t(Yr,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),t(sc,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:t(Zr,{width:"12px",height:"12px",fill:"white"})})]}),e(uc,{title:"Secure Your Account",children:["Please set a password to secure your account.",t("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),t(Os,{onClick:()=>{a({createWallet:{onFailure:d,onSuccess:s,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o(cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),t(ac,{}),t(lt,{})]})},[cr.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN]:()=>{let[e,r]=s(null),[n,i]=s(!1),[a,o]=s(null),[l,d]=s(""),{authenticated:c,getAccessToken:u,user:h}=he(),{walletProxy:p,refreshUser:f,closePrivyModal:g,createAnalyticsEvent:y}=O(),{app:w,navigate:v,data:C,onUserCloseViaDialogOrKeybindRef:b}=dr(),{onSuccess:E,onFailure:$}=C.createWallet,x=yt(h),A="user-passcode"===e?.recoveryMethod,k="user-passcode"===x?.recoveryMethod;m((()=>{c||(v(cr.LANDING),$(new L("User must be authenticated before setting a password on a Privy wallet")))}),[c]);let T=()=>a?($(a),void g({shouldCallAuthOnSuccess:!1})):A?(E(e),void g({shouldCallAuthOnSuccess:!1})):($(new M("Exited before password was added to wallet")),void g({shouldCallAuthOnSuccess:!1}));b.current=T;return t(gh,{appName:w?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:a?"An error has occurred, please try again.":void 0,buttonLoading:n,buttonHideAnimations:!1,password:l,isResettingPassword:k,onPasswordGenerate:()=>d(oh()),onPasswordChange:d,onSubmit:async()=>{A?(E(e),g({shouldCallAuthOnSuccess:!1})):(i(!0),o(null),await(async()=>{let e=await u();if(e&&x?.address&&l&&p)try{if(y({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:k}}),!(await p.setRecovery({accessToken:e,address:x.address,recoveryPassword:l,recoveryMethod:"user-passcode"})).address)return o(new M("Error setting password on privy wallet")),void y({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:k,reason:"error setting password"}});let t=await f(),n=yt(t);if(!n)return o(new M("Error setting password on privy wallet")),void y({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:k,reason:"wallet disconnected"}});r(n),y({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:k}})}catch(e){console.warn(e),o(e instanceof Error?e:Error("Error setting password on privy wallet")),y({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:x.address,reason:e}})}})(),i(!1))},onClose:T})},[cr.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN]:()=>{let{app:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=dr(),[a,o]=s(""),[l,d]=s(!1),[c,u]=s(),[h,p]=s(null),{authenticated:f}=he(),{closePrivyModal:g,isNewUserThisSession:y,initializeWalletProxy:w}=O(),{onSuccess:v,onFailure:C,callAuthOnSuccessOnClose:b}=n.createWallet,{createWallet:E}=Au(),[$,x]=s(null),A=new Jo((async()=>{try{let e=await E(c);if(!e)return;x(e),y?r(cr.EMBEDDED_WALLET_CREATED_SCREEN):(v(e),g({shouldCallAuthOnSuccess:b}))}catch(e){o(e.message)}}));m((()=>{h||w(3e4).then((e=>p(e)))}),[h]),m((()=>{if(!f)return r(cr.LANDING),void C(Error("User must be authenticated before creating a Privy wallet"))}),[f]),i.current=()=>null;return t(gh,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!h,buttonLoading:l,buttonHideAnimations:!$&&l,isResettingPassword:!1,error:a,password:c||"",onClose:()=>{$&&"user-passcode"!==$?.recoveryMethod?(C(new M("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):$?(v($),g({shouldCallAuthOnSuccess:b})):(C(new M("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))},onPasswordChange:u,onPasswordGenerate:()=>u(oh()),onSubmit:async()=>(d(!0),A.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>d(!1))))})},[cr.MFA_ENROLLMENT_FLOW_SCREEN]:()=>{let{user:n,enrollInMfa:i}=he(),[a,o]=s(null),{unenrollWithSms:l,unenrollWithTotp:d,unenrollWithPasskey:c}=Gf(),{app:u,ready:h,data:p,onUserCloseViaDialogOrKeybindRef:f}=dr(),{closePrivyModal:g}=O(),{promptMfa:y}=Bf(),{initEnrollmentWithTotp:w}=Gf(),[v,C]=s(!1),[b,E]=s(null),[$,x]=s(null),A=()=>{g({shouldCallAuthOnSuccess:!0}),i(!1),setTimeout((()=>{o(null),E(null)}),500)},{initEnrollmentWithPasskey:k,submitEnrollmentWithPasskey:T}=Gf(),[_,S]=s(!1),[N,I]=s(null);f.current=A;let P=n?.mfaMethods.includes("sms"),R=!!n?.phone,M=n?.mfaMethods.includes("totp"),L=n?.mfaMethods.includes("passkey"),D=P||M||L,U=n?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function F(){o(null),E(null)}if(m((()=>{D&&C(!0)}),[D]),!h||!n||!u)return e(r,{children:[t(Ks,{onClose:A},"header"),t(Td,{children:t(Hf,{})}),t(Nd,{children:t(_s,{})}),t(dt,{})]});if("sms"===a)return e(r,{children:[t(Ks,{backFn:F,onClose:A},"header"),t(Td,{children:t(Hd,{children:t(An,{})})}),t(_d,{children:"Remove SMS verification?"}),e(Sd,{children:["MFA adds an extra layer of security to your ",u?.name," account. Make sure you have other methods to secure your account."]}),t(Rd,{children:t(Os,{warn:!0,onClick:async function(){o(null);try{await l()}catch(e){o(null)}},children:"Remove SMS for MFA"})}),t(dt,{})]});if("totp"===a)return e(r,{children:[t(Ks,{backFn:F,onClose:A},"header"),t(Td,{children:t(Hd,{children:t($n,{})})}),t(_d,{children:"Remove Authenticator App verification?"}),e(Sd,{children:["MFA adds an extra layer of security to your ",u?.name," account. Make sure you have other methods to secure your account."]}),t(Rd,{children:t(Os,{warn:!0,onClick:async function(){o(null);try{await d()}catch(e){o(null)}},children:"Remove Authenticator App for MFA"})}),t(dt,{})]});if("passkey"===a)return e(r,{children:[t(Ks,{backFn:F,onClose:A},"header"),t(Td,{children:t(Hd,{children:t(kn,{})})}),t(_d,{children:"Are you sure you want to remove passkey verification?"}),t(Sd,{children:"This will disable any passkeys you have set up for verification. You’ll still be able to login with your passkeys if you’ve set up passkey login."}),t(Rd,{children:t(Os,{warn:!0,onClick:async function(){o(null);try{await y(),await c()}catch(e){o(null)}},children:"Yes, remove"})}),t(dt,{})]});if(0===p.mfaEnrollmentFlow.mfaMethods.length&&!D)return e(r,{children:[t(Ks,{onClose:A},"header"),t(Td,{children:t(Hd,{children:t(Tn,{})})}),t(_d,{children:"Add more security"}),e(Sd,{children:[u?.name," does not have any verification methods enabled."]}),t(Rd,{children:t(Os,{onClick:A,children:"Close"})}),t(dt,{})]});let W=!D&&!v;return W?e(r,{children:[t(Ks,{onClose:A},"header"),t(Td,{children:t(Hd,{children:t(Tn,{})})}),t(_d,{children:"Transaction Protection"}),t(Sd,{children:"Set up transaction protection to add an extra layer of security to your account"}),e(Id,{children:[e(Od,{children:[t(Pd,{children:t(mn,{})}),"Enable 2-Step verification for your ",u?.name," wallet."]}),e(Od,{children:[t(Pd,{children:t(xn,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),e(Rd,{children:[t(Os,{onClick:()=>C(!0),children:"Continue"}),t(Us,{onClick:A,children:"Not now"})]}),t(dt,{})]}):"sms"===b?t(dg,{onComplete:A,onReset:F,onClose:A}):"totp"===b&&$?t(ug,{onComplete:A,onClose:A,onReset:F,totpInfo:$}):"passkey"===b?t(qf,{onComplete:A,onReset:F,onClose:A}):t(jf,{showIntro:W,userMfaMethods:n.mfaMethods,appMfaMethods:u.mfa.methods,userHasAuthSms:R,onBackToIntro:function(){C(!1)},handleSelectMethod:async function(e){return await y().catch(I),"totp"===e?(E(e),x(null),void w().then((e=>{x(e)})).catch((()=>{x(null),F()}))):"passkey"===e&&1===U.length?await async function(){S(!0);try{await k(),await T({credentialIds:U})}catch(e){I(e)}finally{S(!1)}}():void E(e)},isTotpLoading:"totp"===b&&!$,isPasskeyLoading:_,error:N,onClose:A,setRemovingMfaMethod:o})},[cr.CAPTCHA_SCREEN]:()=>{let{lastScreen:n,currentScreen:i,data:a,navigateBack:o,navigate:d,setModalData:c}=dr(),{status:u,token:h,waitForResult:p,reset:f,execute:g}=xs(),y=l([]),w=e=>{y.current=[e,...y.current]},[v,C]=s(!0);m((()=>(w(setTimeout(C,1e3,!1)),()=>{y.current.forEach((e=>clearTimeout(e))),y.current=[]})),[]);let[b,E]=s(""),[$,x]=s("Checking that you are a human..."),[A,k]=s(t(Os,{onClick:()=>{},disabled:!0,children:"Continue"})),[T,_]=s(!1),[S,N]=s(3),I=a?.captchaModalData,P=async e=>{try{await(I?.callback(e)),I?.onSuccessNavigateTo&&d(I?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof Es)return;c({errorModalData:{error:e,previousScreen:n||cr.LANDING}}),d(I?.onErrorNavigateTo||cr.ERROR_SCREEN,!1)}};m((()=>{"success"===u?w(setTimeout((async()=>{let e=await p();!e||I?.userIntentRequired||P(e)}),1e3)):"ready"===u&&w(setTimeout((()=>{"ready"===u&&g()}),500))}),[u]),m((()=>{if(!v)switch(u){case"success":E("Success!"),x("CAPTCHA passed successfully."),k(t(Os,{onClick:()=>{_(!0),P(h)},disabled:!I?.userIntentRequired,loading:T,children:I?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":E(""),x("Checking that you are a human..."),k(t(Os,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),S<=0?(x("If you use an adblocker or VPN, try disabling and re-attempting."),k(null)):(x("You did not pass CAPTCHA. Please try again."),k(t(Os,{onClick:O,children:"Retry"})))}}),[u,v,T]);let O=async()=>{if(S<=0)return;N((e=>e-1)),f(),g();let e=await p();!e||I?.userIntentRequired||P(e)};return e(r,{children:[t(Ks,{backFn:n&&i!==n?o:void 0}),e(_c,{children:["success"===u?t(Dr,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):"error"===u?t(Ur,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):t(kc,{}),e(rc,{children:[b?t("h3",{children:b}):null,t("p",{children:$})]}),A]}),t(dt,{})]})},[cr.ERROR_SCREEN]:()=>{let{navigate:e,navigateBack:r,data:n,lastScreen:i,currentScreen:a}=dr(),o=n?.errorModalData?.previousScreen||(i===a?void 0:i);return t(yh,{error:n?.errorModalData?.error||Error(),backFn:()=>o?e(o,!1):r(),onClick:()=>e(o||cr.LANDING,!1)})},[cr.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE]:()=>{let{closePrivyModal:n}=O();return e(r,{children:[t(Ks,{},"header"),t(Qm,{children:t(Pr,{style:{width:32,height:32}})}),t(cc,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),t(Zd,{children:t(Os,{onClick:()=>n(),children:"Close"})}),t(ac,{}),t(lt,{})]})},[cr.AFFIRMATIVE_CONSENT_SCREEN]:()=>{let{user:e,logout:r}=he(),{app:n,onUserCloseViaDialogOrKeybindRef:i,setModalData:a,navigate:o}=dr(),{acceptTerms:l,closePrivyModal:s,createAnalyticsEvent:d}=O(),c=e=>{e?.preventDefault(),s({shouldCallAuthOnSuccess:!1}),r()};i.current=c;return t(jd,{termsAndConditionsUrl:n?.legal.termsAndConditionsUrl,privacyPolicyUrl:n?.legal.privacyPolicyUrl,onAccept:async t=>{t.preventDefault(),await l(),e&&st(e,n?.embeddedWallets?.createOnLogin)?(a({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),d({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),o(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):s()},onDecline:c})},[cr.TELEGRAM_AUTH_SCREEN]:()=>{let{authenticated:n,logout:i,ready:a,user:o}=he(),{app:l,setModalData:d,navigate:c,resetNavigation:u,data:h}=dr(),{initLoginWithTelegram:p,loginWithTelegram:f,updateWallets:g,setReadyToTrue:y,closePrivyModal:w,createAnalyticsEvent:v,getAuthMeta:C}=O(),[b,E]=s(!1),[$,x]=s(void 0);async function A(){try{await f(),E(!0),y(!0)}catch(e){if(e?.privyErrorCode===k.ALLOWLIST_REJECTED)return x(void 0),u(),void c(cr.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===k.USER_LIMIT_REACHED)return console.error(new R(e).toString()),x(void 0),u(),void c(cr.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===k.USER_DOES_NOT_EXIST)return x(void 0),u(),void c(cr.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===k.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),u(),d({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:C()?.telegramAuthResult,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void c(cr.LINK_CONFLICT_SCREEN);let{retryable:t,detail:r}=Nl(e);x({retryable:t,detail:r,message:"Authentication failed"})}}m((()=>{A()}),[]),m((()=>{if(!(a&&n&&b&&o))return;if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(cr.AFFIRMATIVE_CONSENT_SCREEN)}),pe);return()=>clearTimeout(e)}if(st(o,l?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{d({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),c(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),pe);return()=>clearTimeout(e)}g();let e=setTimeout((()=>w({shouldCallAuthOnSuccess:!0,isSuccess:!0})),pe);return()=>clearTimeout(e)}),[a,n,b,o]);let T=b?"Successfully connected with Telegram":$?$.message:"Verifying connection to Telegram",_="";return _=b?"You’re good to go!":$?$.detail:"Just a few moments more",e(r,{children:[t(Ks,{}),t(ic,{}),e(Lw,{children:[t(td,{children:e("div",{children:[t(Ts,{success:b,fail:!!$}),t(kf,{style:{width:"38px",height:"38px"}})]})}),e(rc,{children:[t("h3",{children:T}),t("p",{children:_})]}),$&&$?.retryable?t(Ws,{onClick:()=>{p(void 0,h?.login?.disableSignup).then((async()=>A())).catch((e=>{let{retryable:t,detail:r}=Nl(e);x({retryable:t,detail:r,message:"Authentication failed"})})),x(void 0)},disabled:!b&&!$?.retryable,children:"Retry"}):null]}),t(ac,{}),t(dt,{})]})},[cr.LINK_CONFLICT_SCREEN]:()=>{let{initiateAccountTransfer:e,closePrivyModal:r}=O(),{data:n,navigate:i,lastScreen:a,setModalData:o}=dr(),[l,d]=s(void 0),[c,u]=s(!1),[h,p]=s(!1),m=async()=>{try{if(!n?.accountTransfer?.nonce||!n?.accountTransfer?.account)throw Error("missing account transfer inputs");p(!0),await e({nonce:n?.accountTransfer?.nonce,account:n?.accountTransfer?.account,accountType:n?.accountTransfer?.linkMethod,externalWalletMetadata:n?.accountTransfer?.externalWalletMetadata,telegramAuthResult:n?.accountTransfer?.telegramAuthResult,farcasterEmbeddedAddress:n?.accountTransfer?.farcasterEmbeddedAddress,oAuthUserInfo:n?.accountTransfer?.oAuthUserInfo}),u(!0),p(!1),setTimeout(r,1e3)}catch(e){o({errorModalData:{error:e,previousScreen:a||cr.LINK_CONFLICT_SCREEN}}),i(cr.ERROR_SCREEN,!0)}};return l?t(xd,{address:l,onClose:r,onRetry:()=>d(void 0),onTransfer:m,isTransferring:h,transferSuccess:c}):t(Ad,{onClose:r,onInfo:()=>d(n?.accountTransfer?.embeddedWalletAddress),onContinue:()=>d(n?.accountTransfer?.embeddedWalletAddress),onTransfer:m,isTransferring:h,transferSuccess:c,data:n})}},Jw=[cr.LANDING,cr.AWAITING_CONNECTION],ev=({isMfaVerifying:n,onMfaVerificationComplete:i})=>{let{ready:a,isModalOpen:o}=he(),{headless:l}=ue(),{ready:s,currentScreen:d}=dr(),{status:c,execute:u,reset:h,enabled:p}=xs(),f=o&&d&&Jw.includes(d)&&!l&&"ready"===c;return m((()=>{f&&u()}),[f]),m((()=>{!o&&p&&h()}),[o,p]),a&&s||d===cr.AWAITING_OAUTH_SCREEN||d===cr.CROSS_APP_AUTH_SCREEN||d===cr.TELEGRAM_AUTH_SCREEN?!d&&n?t(ly,{open:n,onClose:i}):d?e(r,{children:[t(cd,{$if:!!n,children:t(Qw[d],{})}),t(cd,{$if:!n,children:t(ly,{open:n,onClose:i})})]}):null:e(r,{children:[t(Ks,{}),t(ic,{}),t(Xw,{children:t(_s,{})}),t(ac,{}),t(dt,{})]})},tv=({isMfaVerifying:e,onMfaVerificationComplete:r})=>{let n=l(null);return t(iv,{style:{height:Lt(n)},id:"privy-modal-content",children:t("div",{ref:n,children:t(ev,{isMfaVerifying:e,onMfaVerificationComplete:r})})})};const rv=({open:e})=>{let{app:r}=dr(),{gracefulClosePrivyModal:n}=(()=>{let{closePrivyModal:e}=O(),{onUserCloseViaDialogOrKeybindRef:t}=dr();return{gracefulClosePrivyModal:f((()=>{if(!t?.current)return e({shouldCallAuthOnSuccess:!1});t.current()}),[e])}})(),[i,a]=s(!1);ks({onMfaRequired:()=>{r?.mfa.noPromptOnMfaRequired||a(!0)}});let o=e||i;return r.render.standalone?t(jw,{children:t(nv,{id:"privy-modal-content",children:t(ev,{isMfaVerifying:i,onMfaVerificationComplete:()=>a(!1)})})}):t(qw,{open:o,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>n(),children:t(jw,{children:t(tv,{isMfaVerifying:i,onMfaVerificationComplete:()=>a(!1)})})})};let nv=yr.div`
|
|
3091
3091
|
display: flex;
|
|
3092
3092
|
flex-direction: column;
|
|
3093
3093
|
text-align: center;
|
|
@@ -3110,4 +3110,4 @@ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddres
|
|
|
3110
3110
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
3111
3111
|
border-radius: var(--privy-border-radius-lg);
|
|
3112
3112
|
}
|
|
3113
|
-
`;function av(e){let r=l(null),n=l();return m((()=>{n.current?.remove(),n.current=function({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:n}=new URL(t);return r.async=!0,r.src=`${n}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}(e),r.current?.after(n.current)}),[e]),t("div",{ref:r,hidden:!0})}async function ov(e,t,r,n,i,a=!1){let o=a,l=async l=>{if(o&&t&&t.length>0){l===(a?0:1)?i("configureMfa","onMfaRequired",t):n.current?.reject(new nu("missing_or_invalid_mfa","MFA verification failed, retry."));let o=await new Promise(((e,t)=>{r.current={resolve:e,reject:t},setTimeout((()=>{let e=new nu("mfa_timeout","Timed out waiting for MFA code");n.current?.reject(e),t(e)}),3e5)}));return await e(o)}return await e()},s=null;for(let e=0;e<4;e++)try{s=await l(e),n.current?.resolve(void 0);break}catch(e){if("missing_or_invalid_mfa"!==e.type)throw n.current?.resolve(void 0),e;o=!0}if(null===s){let e=new nu("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw n.current?.reject(e),e}return s}var lv;let sv=(lv=0,()=>"id-"+lv++);function dv(e){return void 0!==e.error}let cv=new class{enqueue(e,t){this.callbacks[e]=t}dequeue(e,t){let r=this.callbacks[t];if(!r)throw Error(`cannot dequeue ${e} event: no event found for id ${t}`);switch(delete this.callbacks[t],e){case"privy:iframe:ready":case"privy:wallet:create":case"privy:wallet:create-additional":case"privy:wallet:import":case"privy:wallet:connect":case"privy:wallet:recover":case"privy:wallet:rpc":case"privy:wallet:set-recovery":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:solana-wallet:connect":case"privy:solana-wallet:recover":case"privy:solana-wallet:rpc":return r;default:throw Error(`invalid wallet event type ${e}`)}}constructor(){this.callbacks={}}},uv=new Map,hv=(e,t)=>"bigint"==typeof t?t.toString():t,pv=(e,t)=>`${e}${JSON.stringify(t,hv)}`;function mv(e,t,r,n){let i=r.contentWindow;if(!i)throw Error("iframe not initialized");let a=pv(e,t);if("privy:wallet:create"===e){let e=uv.get(a);if(e)return e}let o=new Promise(((r,a)=>{let o=sv();cv.enqueue(o,{resolve:r,reject:a}),i.postMessage({id:o,event:e,data:t},n)})).finally((()=>{uv.delete(a)}));return uv.set(a,o),o}function fv(e){let r=l(null),n=l(e.mfaMethods),i=Mt(),[a,o]=s(!1);return m((()=>{n.current=e.mfaMethods}),[e.mfaMethods]),m((()=>{if(!a)return;let t=r.current;if(!t)return;function o(t){var r;t&&t.origin===e.origin&&"string"==typeof(r=t.data).event&&/^privy:.+/.test(r.event)&&function(e){switch(e.event){case"privy:iframe:ready":let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=cv.dequeue(e.event,e.id);return dv(e)?r.reject(new nu(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:create-additional":let n=cv.dequeue(e.event,e.id);return dv(e)?n.reject(new nu(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:import":let i=cv.dequeue(e.event,e.id);return dv(e)?i.reject(new nu(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:connect":let a=cv.dequeue(e.event,e.id);return dv(e)?a.reject(new nu(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:recover":let o=cv.dequeue(e.event,e.id);return dv(e)?o.reject(new nu(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:rpc":let l=cv.dequeue(e.event,e.id);return dv(e)?l.reject(new nu(e.error.type,e.error.message)):l.resolve(e.data);case"privy:wallet:set-recovery":let s=cv.dequeue(e.event,e.id);return dv(e)?s.reject(new nu(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let d=cv.dequeue(e.event,e.id);return dv(e)?d.reject(new nu(e.error.type,e.error.message)):d.resolve(e.data);case"privy:mfa:init-enrollment":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:submit-enrollment":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:unenroll":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:clear":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:farcaster:init-signer":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:farcaster:sign":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:solana-wallet:create":let c=cv.dequeue(e.event,e.id);return dv(e)?c.reject(new nu(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let u=cv.dequeue(e.event,e.id);return dv(e)?u.reject(new nu(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:recover":let h=cv.dequeue(e.event,e.id);return dv(e)?h.reject(new nu(e.error.type,e.error.message)):h.resolve(e.data);case"privy:solana-wallet:rpc":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}(t.data)}let l={create:r=>mv("privy:wallet:create",r,t,e.origin),createAdditional:r=>mv("privy:wallet:create-additional",r,t,e.origin),import:r=>mv("privy:wallet:import",r,t,e.origin),connect:r=>mv("privy:wallet:connect",r,t,e.origin),recover:r=>ov((n=>mv("privy:wallet:recover",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i,!r.recoveryMethod||"privy"===r.recoveryMethod),rpc:r=>ov((n=>mv("privy:wallet:rpc",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i),createSolana:r=>mv("privy:solana-wallet:create",r,t,e.origin),connectSolana:r=>mv("privy:solana-wallet:connect",r,t,e.origin),recoverSolana:r=>mv("privy:solana-wallet:recover",r,t,e.origin),rpcSolana:r=>mv("privy:solana-wallet:rpc",r,t,e.origin),setRecovery:r=>ov((n=>mv("privy:wallet:set-recovery",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i),verifyMfa:r=>ov((n=>mv("privy:mfa:verify",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i,!0),initEnrollMfa:r=>ov((n=>mv("privy:mfa:init-enrollment",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i),submitEnrollMfa:r=>ov((n=>mv("privy:mfa:submit-enrollment",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i),unenrollMfa:r=>ov((n=>mv("privy:mfa:unenroll",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i,!0),clearMfa:r=>mv("privy:mfa:clear",r,t,e.origin),initFarcasterSigner:r=>mv("privy:farcaster:init-signer",r,t,e.origin),signFarcasterMessage:r=>mv("privy:farcaster:sign",r,t,e.origin)};window.addEventListener("message",o);let s=new AbortController;return Xe((()=>mv("privy:iframe:ready",{},t,e.origin)),{abortSignal:s.signal}).then((()=>e.onLoad(l)),((...t)=>{console.warn("Privy iframe failed to load: ",...t),e.onLoadFailed()})),()=>{window.removeEventListener("message",o),s.abort()}}),[a]),t("iframe",{ref:r,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>o(!0),src:vt(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}class gv{async handleSignMessage(e){if(!e.params||"string"!=typeof e.params.message)throw Error("Message must be provided as a string for Solana signMessage RPC");return await Ov({message:e.params.message})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await Tv())throw Error("User must be authenticated to use embedded Solana wallet");if(!await Pv())throw new x("Unable to connect to Solana embedded wallet");if("signMessage"===e.method)return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}constructor(e,t){this.walletProxy=e,this.address=t}}const yv="popup-privy-oauth",wv="PRIVY_OAUTH_USE_BROADCAST_CHANNEL";async function vv({url:e,popup:t,provider:r}){return t.location=e,new Promise(((e,r)=>{function n(){t?.close(),window.removeEventListener("message",i)}function i(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),n()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),n()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),n()))}window.addEventListener("message",i)}))}let Cv,bv,Ev,$v,xv,kv,Av;function Tv(){return Cv?Cv.getAccessToken():Promise.resolve(qe.get(Q)||null)}const _v=(e,t,r)=>bv(e,t,r),Sv=(e,t,r)=>Ev(e,t,r),Nv=(e,t,r,n)=>$v(e,t,r,n),Iv=()=>xv(),Pv=()=>kv(),Ov=({message:e})=>Av({message:e});const Rv=({config:e,...r})=>{var n;if("undefined"!=typeof window&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&"https:"!==window.location.protocol)throw new x("Embedded wallet is only available over HTTPS");if("string"!=typeof(n=r.appId)||25!==n.length)throw new x("Cannot initialize the Privy provider with an invalid Privy app ID");Cv||(Cv=new vs({appId:r.appId,appClientId:r.clientId,apiUrl:r.apiUrl}));let i=Object.assign({},e);return void 0!==r.createPrivyWalletOnLogin&&void 0===i.embeddedWallets?.createOnLogin&&(i.embeddedWallets||(i.embeddedWallets={}),i.embeddedWallets.createOnLogin=r.createPrivyWalletOnLogin?"users-without-wallets":"off"),void 0!==r.createPrivyWalletOnLogin&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),t(Ue,{client:Cv,clientConfig:i,legacyCreateEmbeddedWalletFlag:r.createPrivyWalletOnLogin,children:t(Mv,{...r,client:Cv})})};let Mv=r=>{let o=r.client,[c,u]=s(!1),[h,p]=s(!1),[f,g]=s(!1),[y,w]=s(null),[v,C]=s([]),[b,E]=s([]),[_,S]=s(null),N=l(v),[O,R]=s(!1),[M,L]=s(null),[U,W]=s(!1),[G,q]=s({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[V,K]=s({status:"initial"}),[Y,Z]=s({status:"initial"}),[X,Q]=s({status:"initial"}),[J,te]=s({status:"initial"}),[re,ne]=s({status:"initial"}),[ie,ae]=s(null),oe=ue(),le=We(),[de,he]=s(!0),[pe,me]=s({}),[ge,ye]=s(null),[we,ve]=s(null),[Ce,be]=s(!1),[Ee,$e]=s(!1),[xe,ke]=s(oe.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),Ae=l(null),Te=l(null),_e=l(Dt),[Se,Ne]=s(!1);o.onStoreToken=e=>{e&&Ft(_e,"accessToken","onAccessTokenGranted",e)},o.onDeleteToken=()=>{w(null),g(!1),Ft(_e,"accessToken","onAccessTokenRemoved")};let Ie=l(null),Oe=l(null),Re=l(!1),Me=e=>{L(e),setTimeout((()=>{u(!0)}),15),o.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:e}})},Le=e=>{"off"!==oe.embeddedWallets.createOnLogin&&he(!0),Me(e)};m((()=>{let e=Ut(y);if(!e||!ie)return void S(null);let t={type:"solana",imported:!1,address:e.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund:()=>{throw new x("Funding is not supported for Solana embedded wallets.")},unlink:()=>{throw new x("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new gv(ie,e.address),signMessage:async e=>{let r=await Tv();if(!r||!ie)throw new x("Must have valid access token and Privy wallet to send transaction",A.MUST_BE_AUTHENTICATED);let{response:n}=await ie.rpcSolana({accessToken:r,publicKey:t.address,request:{method:"signMessage",params:{message:Buffer.from(e).toString("base64")}}});return Buffer.from(n.data.signature,"base64")},async sendTransaction(e,t,r){let{signature:n}=await ot({transaction:e,connection:t,transactionOptions:r,wallet:this});return n},signTransaction:async e=>{let t=await Tv();if(!t||!ie)throw new x("Must have valid access token and Privy wallet to send transaction",A.MUST_BE_AUTHENTICATED);return await ky({tx:e,accessToken:t,walletProxy:ie}),e},loginOrLink:async()=>{throw new x("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{S(null)},isConnected:async()=>!0};S(t)}),[ie,y]),m((()=>{if(!y)return void o.connectors?.removeEmbeddedWalletConnectors();let e=yt(y),t=Wt(y),n=Bt(y);e&&t.length||o.connectors?.removeEmbeddedWalletConnectors(),n||o.connectors?.removeImportedWalletConnector(),o.connectors?ie?(e&&o.connectors.addEmbeddedWalletConnectors({walletProxy:ie,rootWallet:e,embeddedWallets:t,defaultChain:oe.defaultChain,appId:r.appId}),n&&o.connectors.addImportedWalletConnector(ie,n.address,oe.defaultChain,r.appId)):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")}),[ie,y]),m((()=>{ie&&we?.(ie)}),[ie]),m((()=>{(async()=>{if(!oe.customAuth?.enabled)return void ke({status:"not-enabled"});he(!0),ke({status:"loading"});let{getCustomAccessToken:e,isLoading:t}=oe.customAuth;if(h&&!t)try{let t=await e();if(!t&&f)return await pt.logout(),ke({status:"done"}),void Ft(_e,"customAuth","onUnauthenticated");if(!t||f)return void ke({status:"done"});o.startAuthFlow(new Go(t));let{user:r,isNewUser:n}=await o.authenticate();if(!r)return await pt.logout(),ke({status:"error",error:new x("Failed to sync with custom auth provider")}),void Ft(_e,"customAuth","onUnauthenticated");void 0!==n&&Ft(_e,"login","onComplete",r,n,!1,"custom",null),Ft(_e,"customAuth","onAuthenticated",{user:r}),ke({status:"done"}),w(r||null),R(n||!1),g(!0),$e(!0)}catch(e){throw console.warn(e),f&&(await pt.logout(),Ft(_e,"customAuth","onUnauthenticated")),Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR),ke({status:"error",error:e}),e}})()}),[oe.customAuth?.enabled,oe.customAuth?.getCustomAccessToken,oe.customAuth?.isLoading,h,f]),m((()=>{Ee&&ie&&y&&st(y,oe.embeddedWallets.createOnLogin)&&($e(!1),it(y,fe).catch(console.error))}),[Ee&&ie&&y]),m((()=>{if(oe.externalWallets.solana.connectors)return oe.externalWallets.solana.connectors.onMount(),()=>oe.externalWallets.solana.connectors?.onUnmount()}),[oe.externalWallets.solana.connectors]),m((()=>{!h&&le&&async function(){let e,t=De(),r=Fe();(()=>{let e=new URLSearchParams(window.location.search).get("privy_token");if(!e)return;qe.put(ee,e);let t=new URL(window.location.href);t.searchParams.delete("privy_token"),window.history.pushState({},"",t)})();let n=a();o.initializeConnectorManager({walletConnectCloudProjectId:oe.walletConnectCloudProjectId,rpcConfig:oe.rpcConfig,chains:oe.chains,defaultChain:oe.defaultChain,store:n,walletList:oe.appearance.walletList,shouldEnforceDefaultChainOnConnect:oe.shouldEnforceDefaultChainOnConnect,externalWalletConfig:oe.externalWallets,appName:oe.name??"Privy"}),o.connectors?.on("connectorInitialized",(()=>{e&&clearTimeout(e);let t=o.connectors.walletConnectors.length,r=o.connectors.walletConnectors.reduce(((e,t)=>e+(t.initialized?1:0)),0);r===t?Ne(!0):e=setTimeout((()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:r,expected:t}),Ne(!0)}),1500)})),o.connectors?.initialize().then((()=>{Xe()}));let i=await o.getAuthenticatedUser(),l=!!i;if(oe.customAuth?.enabled||(g(!!i),i&&Ft(_e,"login","onComplete",i,!1,!0,null,null),w(i)),!t)return r&&!l?(Oe.current="login",void Le(cr.TELEGRAM_AUTH_SCREEN)):void mt.setReadyToTrue(!!i);Oe.current=l?"link":"login"}()}),[o,ge,h,le]),m((()=>{if(h){if(!y||!y.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType)))return void be(!0);be(!!v.find((e=>"privy"===e.walletClientType)))}}),[h,y,v]);let De=()=>{let e=bl();return e.inProgress&&e.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):"error"===e.authorizationCode?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}):(e.inProgress&&function(e){return e.startsWith("privy:")}(e.provider)&&!e.popupFlow&&(new BroadcastChannel(yv).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}),window.close()),!!e.inProgress&&!e.headless&&(o.startAuthFlow(new ll(e)),Le(cr.AWAITING_OAUTH_SCREEN),!0))},Fe=()=>{let e=function(){let e;return(e=function(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),n=Number(e.get("auth_date")||""),i=e.get("first_name"),a=e.get("last_name")||void 0,o=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(t&&i&&n&&r)return{id:t,first_name:i,last_name:a,username:o,photo_url:l,auth_date:n,hash:r}}())?(Il(),{...e,flowType:"login-url"}):(e=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,n=t.get("user"),i=Number(t.get("auth_date")||""),a=t.get("hash"),o=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0,s=t.get("start_param")||void 0;return n&&i&&a?{query_id:r,user:n,auth_date:i,hash:a,chat_instance:o,chat_type:l,start_param:s}:void 0}())?(Il(),{...e,flowType:"web-app"}):void 0}();if(!e||!oe.loginMethods.telegram||!oe.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let t=new Sl;return o.startAuthFlow(t),"login-url"===e.flowType&&(t.meta.telegramWebAppData=void 0,t.meta.telegramAuthResult={id:e.id,first_name:e.first_name,last_name:e.last_name,auth_date:e.auth_date,username:e.username,photo_url:e.photo_url,hash:e.hash}),"web-app"===e.flowType&&(t.meta.telegramAuthResult=void 0,t.meta.telegramWebAppData={query_id:e.query_id,user:e.user,auth_date:e.auth_date,hash:e.hash,chat_instance:e.chat_instance,chat_type:e.chat_type,start_param:e.start_param}),!0},Ue=async(e,t,r,n)=>{Ge(await(o.connectors?.createEthereumWalletConnector(e,t))||null,t,r,n)};async function Ge(e,t,r,n){if(!e)return q({status:"disconnected",connectedWallet:null,connectError:new T("Unable to connect to wallet."),connector:null,connectRetry:P}),n?.(null,r);q({status:"disconnected",connectedWallet:null,connectError:null,connector:e,connectRetry:P}),e instanceof as&&t&&await e.resetConnection(t),q({connector:e,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ge(e,t,r,n)});try{let t=await e.connect({showPrompt:!0});if((!t||Bl(t))&&oe.shouldEnforceDefaultChainOnConnect&&!oe.chains.find((e=>e.id===Number(t?.chainId.replace("eip155:",""))))&&("wallet_connect_v2"!==t?.connectorType||"metamask"!==t?.walletClientType)){q((t=>({...t,connector:e,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P})));try{await(t?.switchChain(oe.defaultChain.id)),t&&(t.chainId=Ze(Ye(oe.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${oe.defaultChain.id}`)}}return q((e=>({...e,status:"connected",connectedWallet:t,connectError:null,connectRetry:P}))),t&&Ft(_e,"connectWallet","onSuccess",t),n?.(t,r)}catch(e){return e instanceof I?(console.warn(e.cause?e.cause:e.message),Ft(_e,"connectWallet","onError",e.privyErrorCode||A.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),Ft(_e,"connectWallet","onError",A.UNKNOWN_CONNECT_WALLET_ERROR)),q((t=>({...t,status:"disconnected",connectedWallet:null,connectError:e}))),n?.(null,r)}}let He=async(e,t,r)=>{if(null===e||!Bl(e))return;let n=new kl(e,o,t,r);o.startAuthFlow(n)},ze=async(e,t)=>{if(null===e||!ar(e))return;let r=new Al(e,o,t);o.startAuthFlow(r)},Xe=()=>{let e=new URLSearchParams(window.location.search),t=e.get("privy_connector"),r=e.get("privy_wallet_client");if(!t||!r)return;if("phantom"!==r||rt()||Le(cr.LOGIN_FAILED_SCREEN),!o.connectors)throw new x("Connector not initialized");Me(cr.AWAITING_CONNECTION);let n=new URL(window.location.href);n.searchParams.delete("privy_connector"),n.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",n),Ue(t,r,void 0,He)};m((()=>{h&&f&&null===y&&o.getAuthenticatedUser().then(w)}),[h,f,y,o]);let Qe=e=>{if(!f)throw Ft(_e,"linkAccount","onError",A.MUST_BE_AUTHENTICATED,{linkMethod:e}),new x("User must be authenticated before linking an account.")},Je=()=>{Qe("siwe"),Ie.current="siwe",Oe.current="link",Me(cr.LINK_WALLET_SCREEN)},et=e=>{if(!f||!y)return!1;if("privy"===e.walletClientType)return!0;for(let t of y.linkedAccounts)if("wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType)return!0;return!1},tt=async e=>{let t;if(!o.connectors)throw new x("Connector not initialized");t="ethereum"===e.type?o.connectors.findWalletConnector(e.connectorType,e.walletClientType)||null:o.connectors.findSolanaWalletConnector(e.connectorType,e.walletClientType)||null,q((r=>({...r,connector:t,status:"connected",connectedWallet:e,connectError:null,connectRetry:P}))),oe.captchaEnabled&&!f?(me({captchaModalData:{callback:t=>Bl(e)?He(e,t):ze(e,t),userIntentRequired:!1,onSuccessNavigateTo:cr.AWAITING_CONNECTION,onErrorNavigateTo:cr.ERROR_SCREEN}}),Le(cr.CAPTCHA_SCREEN)):(Bl(e)?await He(e):await ze(e),Le(cr.AWAITING_CONNECTION))},nt=()=>{C((e=>{let t=o.connectors?.wallets.filter(Bl).map((e=>({...e,linked:et(e),loginOrLink:async()=>{if(!await e.isConnected())throw new x("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new x("Cannot link or login with embedded wallet");tt(e)},fund:async t=>{await mt.fundWallet(e.address,t)},unlink:async()=>{if(!f)throw new x("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new x("Cannot unlink an embedded wallet");w(await o.unlinkEthereumWallet(e.address))}})))||[];return ds(e,t)?e:t})),E((e=>{let t=o.connectors?.wallets.filter(ar).map((e=>({...e,linked:et(e),loginOrLink:async()=>{if(!await e.isConnected())throw new x("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new x("Cannot link or login with embedded wallet");tt(e)},fund:async e=>{throw new x("Funding not supported for Solana wallets")},unlink:async()=>{if(!f)throw new x("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new x("Cannot unlink an embedded wallet");w(await o.unlinkSolanaWallet(e.address))}})))||[];return ds(e,t)?e:t}))};m((()=>{nt()}),[y?.linkedAccounts,f,h]),m((()=>{if(h){if(!o.connectors)throw new x("Connector not initialized");nt(),o.connectors.on("walletsUpdated",nt)}}),[h]),m((()=>{let e;if(!v[0])return;let t=v[0],r=N.current.find((e=>e.address===t.address));if(e="privy"===t.walletClientType?y?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"===e.walletClientType)):y?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"!==e.walletClientType)),!r&&e){let t=Object.assign({},y);t.wallet=e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,imported:e.imported,walletIndex:e.walletIndex},w(t)}N.current=v}),[v]);let it=async(e,t,r)=>{let n=yt(e);if(n&&!r?.createAdditional)throw Ft(_e,"createWallet","onError",A.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");let[i,a]=await Promise.all([mt.initializeWalletProxy(t),Tv()]);if(!i&&oe.customAuth?.enabled)throw Ft(_e,"createWallet","onError",A.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!i||!a||oe.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise(((e,t)=>{he(!0),me({createWallet:{onSuccess:t=>{Ft(_e,"createWallet","onSuccess",t),e(t)},onFailure:e=>{Ft(_e,"createWallet","onError",A.UNKNOWN_EMBEDDED_WALLET_ERROR),t(e)},callAuthOnSuccessOnClose:!1}}),Me(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}));{if(n){let t=Wt(e),r=t?.length?Math.max(...t.map((e=>e.walletIndex))):n.walletIndex;await mt.recoverEmbeddedEthereumWallet(),await i.createAdditional({accessToken:a,primaryWalletAddress:n?.address,hdWalletIndex:r+1})}else await i.create({accessToken:a});let t=yt(await mt.refreshUser());if(!t)throw Ft(_e,"createWallet","onError",A.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");return Ft(_e,"createWallet","onSuccess",t),t}},at=(e,t,i,a)=>new Promise((async(o,l)=>{let{requesterAppId:s}=t||{};if(!f||!y)return Ft(_e,"sendTransaction","onError",A.MUST_BE_AUTHENTICATED),void l(Error("User must be authenticated before signing with a Privy wallet"));let d=a??yt(y)?.address;if(!d)throw new x("User must have an embedded wallet to send a transaction.");let{signingWallet:c,rootWallet:u}=Gt(y,d);if(!u||!c)return Ft(_e,"sendTransaction","onError",A.EMBEDDED_WALLET_NOT_FOUND),void l(Error("Must have a Privy wallet before signing"));he(!0);let h=ft.wallets.find((e=>"privy"===e.walletClientType&&n(e.address)===n(c.address))),p=await(h?.getEthereumProvider());if(!h||!p)throw new x(`Cannot sendTransaction before embedded wallet ${c.address} is connected`);let m=e.chainId?Number(e.chainId):hr(h.chainId);(e=>{if(!oe.chains.map((e=>e.id)).includes(e))throw new T(`Chain ID ${e} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,A.UNSUPPORTED_CHAIN_ID)})(m);let g=Object.assign({},e,{chainId:m});if(oe.embeddedWallets.noPromptOnSignature||Re.current)t&&oe.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),(async()=>{let e=await Tv();if(!e||!ie)return Ft(_e,"sendTransaction","onError",A.EMBEDDED_WALLET_NOT_FOUND),void l(Error("Must have valid access token and Privy wallet to send transaction"));try{if(!await mt.recoverEmbeddedEthereumWallet())return Ft(_e,"sendTransaction","onError",A.UNKNOWN_CONNECT_WALLET_ERROR),void l(Error("Unable to connect to wallet"));let t=Ve(g.chainId,oe.chains,oe.rpcConfig,{appId:r.appId}),n=await wi(c.address,g,t);if(oe.embeddedWallets.noPromptOnSignature||Re.current){let{totalGasEstimate:e}=await gi(n,t),{hasSufficientFunds:r}=await dw(c.address,n,e,t);if(!r)throw new rr(new nr("Wallet has insufficient funds for this transaction.",ir.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let i=await sw({accessToken:e,rootWallet:u,transactingWallet:c,walletProxy:ie,transactionRequest:n,provider:t,requesterAppId:s});Ft(_e,"sendTransaction","onSuccess",i),o(i)}catch(e){Ft(_e,"sendTransaction","onError",A.TRANSACTION_FAILURE),l(e)}})();else{let e={address:u.address,onCompleteNavigateTo:cr.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:e=>{Ft(_e,"sendTransaction","onError",A.UNKNOWN_CONNECT_WALLET_ERROR),l(e)}},r=hw({address:c.address,appConfig:oe,fundWalletConfig:i,chainIdOverride:g.chainId,comingFromSendTransactionScreen:!0});me({connectWallet:e,sendTransaction:{transactionRequest:g,transactingWallet:c,rootWallet:u,onSuccess:e=>{Ft(_e,"sendTransaction","onSuccess",e),o(e)},onFailure:e=>{Ft(_e,"sendTransaction","onError",A.TRANSACTION_FAILURE),l(e)},uiOptions:t||{},fundWalletConfig:i,requesterAppId:s},funding:r}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),ot=({transaction:e,connection:t,transactionOptions:r,uiOptions:n,wallet:i})=>new Promise((async(a,o)=>{let{requesterAppId:l}=n||{};if(!f||!y)return Ft(_e,"sendSolanaTransaction","onError",A.MUST_BE_AUTHENTICATED),void o(new x("User must be authenticated before signing with a Privy wallet",A.MUST_BE_AUTHENTICATED));let s=i?y.linkedAccounts.find((e=>"wallet"===e.type&&e.address===i.address)):Ut(y);if(!s)return Ft(_e,"sendSolanaTransaction","onError",A.EMBEDDED_WALLET_NOT_FOUND),void o(new x("Must have a Privy wallet before signing",A.EMBEDDED_WALLET_NOT_FOUND));he(!0);let d=i??_,c=await(d?.isConnected());if(!d||!c)throw Ft(_e,"sendSolanaTransaction","onError",A.EMBEDDED_WALLET_NOT_FOUND),new x(`Cannot sendSolanaTransaction before embedded wallet ${s.address} is connected`,A.EMBEDDED_WALLET_NOT_FOUND);oe.embeddedWallets.noPromptOnSignature?(n&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),(async()=>{let n=await Tv();if(!n||!ie)return Ft(_e,"sendSolanaTransaction","onError",A.EMBEDDED_WALLET_NOT_FOUND),void o(new x("Must have valid access token and Privy wallet to send transaction",A.EMBEDDED_WALLET_NOT_FOUND));try{if(!await mt.recoverEmbeddedSolanaWallet())return Ft(_e,"sendSolanaTransaction","onError",A.UNKNOWN_CONNECT_WALLET_ERROR),void o(new x("Unable to connect to wallet",A.UNKNOWN_CONNECT_WALLET_ERROR));if(oe.embeddedWallets.noPromptOnSignature){let{instructions:r}=await $g(e,t);r.every((e=>e.hasFunds))||(Ft(_e,"sendSolanaTransaction","onError",A.INSUFFICIENT_BALANCE),o(new x("Solana wallet has insufficient funds for this transaction.",A.INSUFFICIENT_BALANCE)))}let{signature:i,receipt:l}=await Ay({accessToken:n,tx:e,connection:t,walletProxy:ie,transactionOptions:r}),s=Eg(i,l);Ft(_e,"sendSolanaTransaction","onSuccess",s),a(s)}catch(e){Ft(_e,"sendSolanaTransaction","onError",A.TRANSACTION_FAILURE),o(e)}})()):(me({connectWallet:{address:s.address,onCompleteNavigateTo:cr.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN,onFailure:e=>{Ft(_e,"sendSolanaTransaction","onError",A.UNKNOWN_CONNECT_WALLET_ERROR),o(e)}},sendSolanaTransaction:{transactionRequest:e,connection:t,transactionOptions:r,transactingWallet:s,onSuccess:e=>{Ft(_e,"sendSolanaTransaction","onSuccess",e),a(e)},onFailure:e=>{Ft(_e,"sendSolanaTransaction","onError",A.TRANSACTION_FAILURE),o(e)},uiOptions:n||{},requesterAppId:l},funding:void 0}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN))}));function lt(){return new Promise((async(e,t)=>{let r=await Tv();if(!r||!ie)throw Error("Must have valid access token to enroll in MFA");try{await ie.verifyMfa({accessToken:r}),e()}catch(e){t(e)}}))}let dt=e=>e?.linkedAccounts.filter((e=>null!==e.latestVerifiedAt&&!("wallet"===e.type&&"privy"===e.walletClientType))).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0],ct=e=>{let t=y?.linkedAccounts.filter((t=>t.type===e)).length??0,{displayName:r,loginMethod:n}=sf(e);if("passkey"===e&&t>=5||"passkey"!==e&&t>=1)throw Ft(_e,"linkAccount","onError",A.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:n}),new x(`User already has an account of type ${r} linked.`)};async function ut({showAutomaticRecovery:e=!1,legacySetWalletPasswordFlow:t=!1}){L(null);let r=t?"setWalletPassword":"setWalletRecovery";if(!f||!y)throw Ft(_e,r,"onError",A.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let n=yt(y);if(!n||!ie)throw Ft(_e,r,"onError",A.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");if(Ut(y))throw Error("Cannot set user-controlled recovery for user with Solana.");try{await lt()}catch(e){throw Ft(_e,r,"onError",A.MISSING_MFA_CREDENTIALS),e}return new Promise(((i,a)=>{he(!0);let o={onSuccess:e=>{Ft(_e,r,"onSuccess","user-passcode",e),i(e)},onFailure:e=>{Ft(_e,r,"onError",A.USER_EXITED_SET_PASSWORD_FLOW),a(e)},callAuthOnSuccessOnClose:!1},l="user-passcode"===n.recoveryMethod;me({setWalletPassword:o,createWallet:o,connectWallet:{onCompleteNavigateTo:hu({walletAction:"update",availableRecoveryMethods:oe.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:t,isResettingPassword:l,showAutomaticRecovery:e}),shouldForceMFA:!1,onFailure:e=>{Ft(_e,r,"onError",A.UNKNOWN_CONNECT_WALLET_ERROR),a(e)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:l}}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)}))}async function ht({appId:e,action:t}){let r=await Tv();if("link"===t&&!r)throw Ft(_e,"linkAccount","onError",A.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${e}`}),new x("User must be authenticated before linking an account.");if("login"===t&&r)throw Ft(_e,"login","onError",A.UNKNOWN_AUTH_ERROR),new x("Attempted to log in, but user is already logged in. Use a `link` helper instead.");Ie.current=`privy:${e}`,Oe.current=t;let n=window.open(void 0,void 0,rm({w:440,h:680}));return o.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:e}}),new Promise((async(r,i)=>{let{name:a,logoUrl:l}=await Jp({api:o.api,providerAppId:e,requesterAppId:oe.id});me({crossAppAuth:{appId:e,name:a,logoUrl:l,action:t,popup:n,onSuccess:r,onError:i}}),Le(cr.CROSS_APP_AUTH_SCREEN)}))}let pt={ready:h,authenticated:f,user:y,walletConnectors:o.connectors||null,connectWallet:e=>{e&&"target"in e&&e&&(e=void 0),me({externalConnectWallet:{walletList:e?.walletList&&e?.walletList.length>0?e.walletList:void 0,suggestedAddress:e?.suggestedAddress}}),Me(f?cr.CONNECT_ONLY_AUTHENTICATED_SCREEN:cr.CONNECT_ONLY_LANDING_SCREEN)},importWallet:async({privateKey:e})=>{Qe("siwe");let[t,r]=await Promise.all([mt.initializeWalletProxy(15e3),Tv()]);if(t&&r){await t.import({privateKey:e,accessToken:r});let n=Bt(await mt.refreshUser());if(!n)throw Ft(_e,"createWallet","onError",A.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return Ft(_e,"createWallet","onSuccess",n),n}throw new x("User is not authenticated")},linkWallet:Je,startCrossAppAuthFlow:ht,linkEmail:()=>{Qe("email"),ct("email"),Ie.current="email",Oe.current="link",Me(cr.LINK_EMAIL_SCREEN)},linkPhone:()=>{Qe("sms"),ct("phone"),Ie.current="sms",Oe.current="link",Me(cr.LINK_PHONE_SCREEN)},linkGoogle:async()=>{Qe("google"),ct("google_oauth"),Oe.current="link",await mt.initLoginWithOAuth("google")},linkTwitter:async()=>{Qe("twitter"),ct("twitter_oauth"),Oe.current="link",await mt.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Qe("discord"),ct("discord_oauth"),Oe.current="link",await mt.initLoginWithOAuth("discord")},linkGithub:async()=>{Qe("github"),ct("github_oauth"),Oe.current="link",await mt.initLoginWithOAuth("github")},linkSpotify:async()=>{Qe("spotify"),ct("spotify_oauth"),Oe.current="link",await mt.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Qe("instagram"),ct("instagram_oauth"),Oe.current="link",await mt.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Qe("tiktok"),ct("tiktok_oauth"),Oe.current="link",await mt.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Qe("linkedin"),ct("linkedin_oauth"),Oe.current="link",await mt.initLoginWithOAuth("linkedin")},linkApple:async()=>{Qe("apple"),ct("apple_oauth"),Oe.current="link",await mt.initLoginWithOAuth("apple")},linkPasskey:async()=>{Qe("passkey"),ct("passkey"),await mt.initLinkWithPasskey(),Me(cr.LINK_PASSKEY_SCREEN)},linkTelegram:async()=>{Qe("telegram"),ct("telegram"),Oe.current="link",Ie.current="telegram",await mt.initLoginWithTelegram(),Me(cr.TELEGRAM_AUTH_SCREEN)},linkFarcaster:async()=>{Qe("farcaster"),ct("farcaster"),await mt.initLoginWithFarcaster(),Oe.current="link",Ie.current="farcaster",Me(cr.AWAITING_FARCASTER_CONNECTION)},updateEmail:()=>{if(Qe("email"),!y?.email)throw new x("User does not have an email linked to their account.");Oe.current="link",Ie.current="email",Me(cr.UPDATE_EMAIL_SCREEN)},updatePhone:()=>{if(Qe("sms"),!y?.phone)throw new x("User does not have a phone number linked to their account.");Oe.current="link",Ie.current="sms",Me(cr.UPDATE_PHONE_SCREEN)},login:async e=>{e&&"target"in e&&e&&(e=void 0);let t="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!h){let e=await new Promise((e=>{ye((t=>e.bind(t)))}));if(ye(null),e)return void console.warn(t)}!y||y.isGuest?(Oe.current="login",me({login:e}),Le(cr.LANDING)):console.warn(t)},connectOrCreateWallet:async()=>{h||(await new Promise((e=>{ye((()=>e))})),ye(null)),f?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):Le(cr.CONNECT_OR_CREATE)},logout:async()=>{if(y&&o.clearProviderAcccessTokens(y),L(null),await o.logout(),y&&ie)try{await ie.clearMfa({userId:y.id})}catch(e){}w(null),g(!1),Ft(_e,"logout","onSuccess"),Oe.current=null,Ie.current=null,u(!1),qe.del(ce),qe.del(B(oe.id))},getAccessToken:()=>o.getAccessToken(),getEthereumProvider:()=>{if(!y||!y.wallet)return new Rl;let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=o.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new Rl},getEthersProvider:()=>{if(!y||!y.wallet)return new i(new Dl(new Rl));let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=o.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new i(new Dl(e&&t?t.proxyProvider:new Rl))},getWeb3jsProvider:()=>{if(!y||!y.wallet)return new Fl(new Rl);let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=o.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new Fl(e&&t?t.proxyProvider:new Rl)},unlinkWallet:async e=>{let t;return w(t=e.startsWith("0x")?await o.unlinkEthereumWallet(e):await o.unlinkSolanaWallet(e)),t},unlinkEmail:async e=>{let t=await o.unlinkEmail(e);return w(t),t},unlinkPhone:async e=>{let t=await o.unlinkPhone(e);return w(t),t},unlinkGoogle:async e=>{let t=await o.unlinkOAuth("google",e);return w(t),t},unlinkTwitter:async e=>{let t=await o.unlinkOAuth("twitter",e);return w(t),t},unlinkDiscord:async e=>{let t=await o.unlinkOAuth("discord",e);return w(t),t},unlinkGithub:async e=>{let t=await o.unlinkOAuth("github",e);return w(t),t},unlinkSpotify:async e=>{let t=await o.unlinkOAuth("spotify",e);return w(t),t},unlinkInstagram:async e=>{let t=await o.unlinkOAuth("instagram",e);return w(t),t},unlinkTiktok:async e=>{let t=await o.unlinkOAuth("tiktok",e);return w(t),t},unlinkLinkedIn:async e=>{let t=await o.unlinkOAuth("linkedin",e);return w(t),t},unlinkApple:async e=>{let t=await o.unlinkOAuth("apple",e);return w(t),t},unlinkFarcaster:async e=>{let t=await o.unlinkFarcaster(e);return w(t),t},unlinkTelegram:async e=>{let t=await o.unlinkTelegram(e);return w(t),t},unlinkPasskey:async e=>{let t=await o.unlinkPasskey(e);return w(t),t},unlinkCrossAppAccount:async({subject:e})=>{let t=y?.linkedAccounts.find((t=>"cross_app"===t.type&&t.subject===e))?.providerApp;if(!t)throw new x("Invalid subject");o.storeProviderAccessToken(t.id,null);let r=await o.unlinkOAuth(`privy:${t.id}`,e);return w(r),r},setActiveWallet:async e=>{let t=v.find((t=>n(t.address)===n(e))),r=y?.linkedAccounts.find((t=>"wallet"===t.type&&n(t.address)===n(e)));if(t&&await t.isConnected())if(t.linked){let e=Object.assign({},y);e.wallet=r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,imported:r.imported,walletIndex:r.walletIndex},w(e)}else t.loginOrLink();else me({externalConnectWallet:{suggestedAddress:e}}),Je()},forkSession:()=>o.forkSession(),createWallet:async e=>{if(e&&"target"in e&&e&&(e=void 0),!f||!y)throw Ft(_e,"createWallet","onError",A.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return it(y,15e3,e)},setWalletRecovery:async e=>ut({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:e?.showAutomaticRecovery??!1}),setWalletPassword:async()=>ut({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(e,t,r)=>new Promise((async(n,i)=>{let{requesterAppId:a}=t||{};if(!f||!y)return Ft(_e,"signMessage","onError",A.MUST_BE_AUTHENTICATED),void i(Error("User must be authenticated before signing with a Privy wallet"));let l=r??yt(y)?.address;if(!l)throw new x("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:d}=Gt(y,l);if(!s||!d)return Ft(_e,"signMessage","onError",A.EMBEDDED_WALLET_NOT_FOUND),void i(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return Ft(_e,"signMessage","onError",A.INVALID_MESSAGE),void i(Error("Message must be a non-empty string"));he(!0);let c=async()=>{if(!f)throw Error("User must be authenticated before signing with a Privy wallet");let t=await Tv();if(!ie||!t||!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");o.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:s.address,requesterAppId:a}});let{response:r}=await ie.rpc({accessToken:t,address:d.address,hdWalletIndex:s.walletIndex??void 0,requesterAppId:a,request:{method:"personal_sign",params:[e,s.address]}}),n=r.data;return o.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:s.address,requesterAppId:a}}),n};if(oe.embeddedWallets.noPromptOnSignature||Re.current){t&&oe.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let e=await c();Ft(_e,"signMessage","onSuccess",e),n(e)}catch(e){Ft(_e,"signMessage","onError",A.UNABLE_TO_SIGN),i(e??new rr("Unable to sign message"))}}else me({signMessage:{method:"personal_sign",data:e,confirmAndSign:c,onSuccess:e=>{Ft(_e,"signMessage","onSuccess",e),n(e)},onFailure:e=>{Ft(_e,"signMessage","onError",A.UNABLE_TO_SIGN),i(e)},uiOptions:t||{}},connectWallet:{onCompleteNavigateTo:cr.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{Ft(_e,"signMessage","onError",A.UNKNOWN_CONNECT_WALLET_ERROR),i(e)},address:d.address}}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)})),signTypedData:(e,t,r)=>new Promise((async(n,i)=>{let{requesterAppId:a}=t||{};if(!f||!y)return Ft(_e,"signTypedData","onError",A.MUST_BE_AUTHENTICATED),void i(Error("User must be authenticated before signing with a Privy wallet"));let l=r??yt(y)?.address;if(!l)throw new x("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:d}=Gt(y,l);if(!d||!s)return Ft(_e,"signTypedData","onError",A.EMBEDDED_WALLET_NOT_FOUND),void i(Error("Must have a Privy wallet before signing"));he(!0);let c=Ke(e),u=async()=>{if(!f)throw Error("User must be authenticated before signing with a Privy wallet");let e=await Tv();if(!ie||!e||!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");o.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:s.address,requesterAppId:a}});let{response:t}=await ie.rpc({accessToken:e,address:d.address,hdWalletIndex:s.walletIndex??void 0,requesterAppId:a,request:{method:"eth_signTypedData_v4",params:[s.address,c]}}),r=t.data;return o.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:s.address,requesterAppId:a}}),r};if(Re.current||oe.embeddedWallets.noPromptOnSignature||oe.legacyWalletUiConfig){t&&oe.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let e=await u();Ft(_e,"signTypedData","onSuccess",e),n(e)}catch(e){Ft(_e,"signTypedData","onError",A.UNABLE_TO_SIGN),i(e??new rr("Unable to sign message"))}}else me({signMessage:{method:"eth_signTypedData_v4",data:c,confirmAndSign:u,onSuccess:e=>{Ft(_e,"signTypedData","onSuccess",e),n(e)},onFailure:e=>{Ft(_e,"signTypedData","onError",A.UNABLE_TO_SIGN),i(e)},uiOptions:t||{}},connectWallet:{onCompleteNavigateTo:cr.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{Ft(_e,"signMessage","onError",A.UNKNOWN_CONNECT_WALLET_ERROR),i(e)}}}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)})),sendTransaction:async(e,t,r,n)=>{let i=await at(e,t,r,n);return cw(await i.wait())},sendSolanaTransaction:async(e,t,r,n)=>await ot({transaction:e,connection:t,transactionOptions:n,uiOptions:r,wallet:_??void 0}),exportWallet:e=>new Promise((async(t,i)=>{if(!f||!y)return void i(Error("User must be authenticated before exporting their Privy wallet"));e&&"target"in e&&e&&(e=void 0);let a=e?.address,l=y.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"ethereum"===e.chainType)),s=a?l.find((e=>e.address===n(a))):l.find((e=>!e.imported))||l[0];if(!s)return void i(Error("Must have a Privy wallet before exporting"));he(!0);let d={onCompleteNavigateTo:cr.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:i,address:s.address,shouldForceMFA:!0};me(pe),await Tv()&&ie?ie?(me({keyExport:{appId:r.appId,appClientId:r.clientId,origin:o.apiUrl,wallet:s,onSuccess:t,onFailure:i},connectWallet:d}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)):i(Error("Must have a Privy wallet before exporting")):i(Error("Must have valid access token to enroll in MFA"))})),promptMfa:lt,async init(e){switch(e){case"sms":return void await o.initMfaSmsVerification();case"passkey":return await o.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${e}`)}},async submit(e,t){switch(e){case"totp":case"sms":if("string"!=typeof t)throw new x("Invalid MFA code");Ae.current?.resolve({mfaMethod:e,mfaCode:t,relyingParty:window.origin}),await new Promise(((e,t)=>{Te.current={resolve:e,reject:t}}));break;case"passkey":if("string"==typeof t)throw new x("Invalid authenticator response");let r=await import("@simplewebauthn/browser"),n=(e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}))(await r.startAuthentication(t));Ae.current?.resolve({mfaMethod:e,mfaCode:n,relyingParty:window.origin}),await new Promise(((e,t)=>{Te.current={resolve:e,reject:t}}));break;default:throw Ae.current?.reject(new x("Unsupported MFA method")),new x(`Unsupported MFA method: ${e}`)}},cancel(){Ae.current?.reject(new x("MFA canceled"))},async initEnrollmentWithSms(e){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to enroll in MFA");await ie.initEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber})},enrollInMfa:e=>new Promise(((t,r)=>{if(!e)return mt.closePrivyModal(),void t();oe.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),me({mfaEnrollmentFlow:{mfaMethods:oe.mfa.methods,onSuccess:t,onFailure:r}}),Me(cr.MFA_ENROLLMENT_FLOW_SCREEN)})),async initEnrollmentWithTotp(){let e=await Tv();if(!e||!ie)throw Error("Must have valid access token to enroll in MFA");let t=await ie.initEnrollMfa({method:"totp",accessToken:e});return{secret:t.secret,authUrl:t.authUrl}},async submitEnrollmentWithSms(e){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to enroll in MFA");await ie.submitEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber,code:e.mfaCode}),w(await o.getAuthenticatedUser())},async submitEnrollmentWithTotp(e){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to enroll in MFA");await ie.submitEnrollMfa({method:"totp",accessToken:t,code:e.mfaCode}),w(await o.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:e}){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to enroll in MFA");await ie.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:e}),w(await o.getAuthenticatedUser())},async unenroll(e){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to remove MFA");"passkey"===e?await ie.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:[]}):await ie.unenrollMfa({method:e,accessToken:t}),w(await o.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{let e=await Tv(),t=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!e)throw Error("Must have valid access token to connect with Farcaster");if(!ie||!t)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");let r=await ie.initFarcasterSigner({address:t.address,hdWalletIndex:null,accessToken:e,mfaCode:null,mfaMethod:null,relyingParty:window.origin});"approved"===r.status&&w(await o.getAuthenticatedUser()||y||null),me({farcasterSigner:r}),Me(cr.AWAITING_FARCASTER_SIGNER)},getFarcasterSignerPublicKey:async()=>{let e,t=await Tv(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!ie||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");if(!y.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");return e=y.farcaster.signerPublicKey.slice(2),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},signFarcasterMessage:async e=>{let t=await Tv(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!ie||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");if(!y.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");let n=await import("@simplewebauthn/browser"),i=await ie.signFarcasterMessage({address:r.address,hdWalletIndex:null,accessToken:t,mfaCode:null,mfaMethod:null,payload:{hash:n.bufferToBase64URLString(e)},fid:BigInt(y.farcaster.fid),relyingParty:window.origin});return new Uint8Array(n.base64URLStringToBuffer(i.signature))},createGuestAccount:async()=>{if(y&&!y.isGuest)throw Error("User cannot already be authenticated to create a guest account");return y?.isGuest?y:mt.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:U,loginWithCode:e=>mt.loginWithCode(e),initLoginWithEmail:e=>mt.initLoginWithEmail(e),initLoginWithSms:e=>mt.initLoginWithSms(e),otpState:X,fundWallet:(e,t)=>mt.fundWallet(e,t),initLoginWithHeadlessOAuth:(e,t)=>mt.initLoginWithHeadlessOAuth(e,t),loginWithHeadlessOAuth:e=>mt.loginWithHeadlessOAuth(e),generateSiweMessage:({address:e,chainId:t})=>mt.generateSiweMessage({address:e,chainId:t}),linkWithSiwe:({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})=>(Qe("siwe"),mt.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})),signMessageWithCrossAppWallet:(e,{address:t})=>em({user:y,client:o,address:t,requesterAppId:oe.id,request:{method:"personal_sign",params:[e,t]},reconnect:ht}),signTypedDataWithCrossAppWallet(e,{address:t}){let r=Ke(e);return em({user:y,client:o,address:t,requesterAppId:oe.id,request:{method:"eth_signTypedData_v4",params:[t,r]},reconnect:ht})},sendTransactionWithCrossAppWallet:(e,{address:t})=>em({user:y,client:o,address:t,requesterAppId:oe.id,request:{method:"eth_sendTransaction",params:[e]},reconnect:ht}),isModalOpen:c,mfaMethods:oe.mfa.methods};bv=pt.signMessage,Ev=pt.signTypedData,$v=async(...e)=>{let t=await at(...e);return oe.embeddedWallets.waitForTransactionConfirmation&&await t.wait(),t};let mt={isNewUserThisSession:O,pendingTransaction:null,walletConnectionStatus:G,connectors:o.connectors?.walletConnectors??[],solanaWallets:b,rpcConfig:oe.rpcConfig,chains:oe.chains,appId:r.appId,showFiatPrices:"native-token"!==oe.embeddedWallets.priceDisplay.primary,clientAnalyticsId:o.clientAnalyticsId,customAuthStatus:xe,noPromptOnSignature:Re,emailOtpState:Y,setEmailOtpState:Z,smsOtpState:X,setSmsOtpState:Q,oAuthState:re,setOAuthState:ne,siweState:J,setSiweState:te,nativeTokenSymbolForChainId:e=>oe.chains.find((t=>t.id===Number(e)))?.nativeCurrency.symbol,initializeWalletProxy:async e=>{if(ie)return ie;let t=new Promise((e=>{ve((()=>t=>e(t)))})),r=new Promise((t=>setTimeout((()=>t(null)),e))),n=await Promise.race([t,r]);return ve(null),n},getAuthFlow:()=>o.authFlow,getAuthMeta:()=>o.authFlow?.meta,client:o,closePrivyModal:async(e={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let t,n=h&&f&&y;n&&Ie.current&&(t=dt(y)),"login"===Oe.current?e.shouldCallAuthOnSuccess&&n&&Ie.current?(Ft(_e,"login","onComplete",y,O,!1,Ie.current,t??null),r.onSuccess?.(y,O)):Ft(_e,"login","onError",A.USER_EXITED_AUTH_FLOW):"link"===Oe.current&&t&&(e.isSuccess&&n&&Ie.current?Ft(_e,"linkAccount","onSuccess",y,Ie.current,t):Ie.current&&Ft(_e,"linkAccount","onError",A.USER_EXITED_LINK_FLOW,{linkMethod:Ie.current}));let i=M&&pw.includes(M),a=M===cr.ERROR_SCREEN&&pe.errorModalData&&pw.includes(pe.errorModalData.previousScreen);if((i||a)&&pe.funding){let e,t=mw[M]??null,n=Ve(pe.funding.chain.id,oe.chains,oe.rpcConfig,{appId:r.appId});try{e=(await n.getBalance(pe.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}Ft(_e,"fundWallet","onUserExited",{address:pe.funding.address,chain:pe.funding.chain,fundingMethod:t,balance:e})}me({...pe,externalConnectWallet:{suggestedAddress:void 0}}),Oe.current=null,Ie.current=null,R(!1),u(!1),setTimeout((()=>{o.authFlow=void 0}),200),o.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:e})=>new Promise((async(t,r)=>{let n=async()=>{let t=await o.getAccessToken();if(!t)throw Error("User must be authenticated to use their embedded wallet.");if(!_)throw Error("User must have an embedded Solana wallet to sign messages for Solana.");let r=mt.walletProxy??await mt.initializeWalletProxy(15e3);if(!r)throw Error("Failed to initialize embedded wallet proxy.");let{response:n}=await r.rpcSolana({accessToken:t,publicKey:_.address,request:{method:"signMessage",params:{message:e}}});return n.data.signature};if(oe.embeddedWallets.noPromptOnSignature||Re.current)try{let e=await n();t({signature:e})}catch(e){r(e)}else me({signMessage:{method:"solana_signMessage",data:e,confirmAndSign:n,onSuccess:e=>{t({signature:e})},onFailure:e=>{r(e)},uiOptions:{}}}),Le(cr.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN)})),openPrivyModal:Me,connectWallet:Ge,initLoginWithWallet:async(e,t,r)=>{Bl(e)?(Ie.current="siwe",He(e,t,r)):(Ie.current="siws",ze(e,t))},loginWithWallet:async()=>{let e,t,r;if(!h)throw new D;if(o.authFlow instanceof kl?e="siwe":o.authFlow instanceof Al&&(e="siws"),!e)throw new x("Must initialize SIWE/SIWS flow first.");if(null!==await o.getAccessToken())try{({user:t}=await o.link()),Ie.current=e}catch(t){throw Ft(_e,"linkAccount","onError",t.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{({user:t,isNewUser:r}=await o.authenticate()),Ie.current=e}catch(e){throw Ft(_e,"login","onError",e.privyErrorCode||A.GENERIC_CONNECT_WALLET_ERROR),e}w(t||y||null),R(r||!1),g(!0)},initLoginWithFarcaster:async(e,t)=>{let r=new el(e,t);o.startAuthFlow(r);try{Ie.current="farcaster",await r.initializeFarcasterConnect()}catch(e){throw"login"===Oe.current?Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR):"link"===Oe.current&&Ft(_e,"linkAccount","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),e}},loginWithFarcaster:async()=>{let e,t;if(!h)throw new D;if(!(o.authFlow instanceof el))throw new x("Must initialize Farcaster flow first.");if(null!==await o.getAccessToken())try{({user:e}=await o.link()),Ie.current="farcaster"}catch(e){throw Ft(_e,"linkAccount","onError",e.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),e}else try{({user:e,isNewUser:t}=await o.authenticate()),Ie.current="farcaster"}catch(e){throw Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR),e}w(e||null),R(t||!1),g(!0)},async loginWithGuestAccountFlow(){let e=new rl(this.appId);o.startAuthFlow(e);try{Oe.current="login",Ie.current="guest";let{user:e,isNewUser:t}=await o.authenticate();if(t=t||!1,!e)throw new x("Unable to authenticate guest account");if(st(e,oe.embeddedWallets.createOnLogin))try{await it(e,15e3),e=await mt.refreshUser()}catch(t){w(e),console.warn("Unable to create embedded wallet for guest account")}else w(e);return R(t),g(!0),Ft(_e,"login","onComplete",e,t,!1,"guest",null),e}catch(e){throw Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR),e}},async crossAppAuthFlow({appId:e,popup:t,action:r}){let n=`privy:${e}`;Ie.current=n;let{url:i,stateCode:a,codeVerifier:l}=await async function({api:e,appId:t}){let r=nl(),n=il(),i=await al(r);try{let{url:a}=await e.post(Fo,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:i,state_code:n});return{url:a,stateCode:n,codeVerifier:r}}catch(e){throw k(e)}}({api:o.api,appId:e});if(!i)throw o.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:e}}),new x("No authorization URL returned for cross-app auth.");try{let s=await async function({url:e,popup:t}){return t.location=e,new Promise(((e,r)=>{let n,i=setTimeout((()=>{r(new x("Authorization request timed out after 2 minutes.")),a()}),12e4);function a(){t?.close(),window.removeEventListener("message",l)}let o=setInterval((()=>{t?.closed&&!n&&(a(),clearInterval(o),clearTimeout(i),r(new x("User rejected request")))}),300);function l(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(clearTimeout(i),e(t.data),a()),"PRIVY_OAUTH_ERROR"===t.data.type&&(clearTimeout(i),r(new x(t.data.error)),a()),t.data.type===wv&&((n=new BroadcastChannel(yv)).onmessage=l))}window.addEventListener("message",l)}))}({url:i,popup:t,provider:n}),d=s.stateCode,c=s.authorizationCode;if(d!==a)throw o.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:n,storedStateCode:a??"",returnedStateCode:d??""}}),new x("Unexpected auth flow. This may be a phishing attempt.",void 0,A.OAUTH_UNEXPECTED);let u=await async function({appId:e,stateCode:t,codeVerifier:r,authorizationCode:n,action:i,client:a}){if(!n||!t)throw new x("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===n)throw new x("User denied confirmation during cross-app auth flow");try{let o=new Qp({authorizationCode:n,stateCode:t,codeVerifier:r,provider:`privy:${e}`});a.startAuthFlow(o);let l="link"===i?await a.link():await a.authenticate(),s=l.oAuthTokens?.accessToken;return console.debug(),s}catch(e){let t=k(e);if(t.privyErrorCode)throw new x(t.message||"Invalid code during cross-app auth flow.",void 0,t.privyErrorCode);if("User denied confirmation during cross-app auth flow"===t.message)throw new x("Invalid code during cross-app auth flow.",void 0,A.OAUTH_USER_DENIED);throw new x("Invalid code during cross-app auth flow.",void 0,A.UNKNOWN_AUTH_ERROR)}}({appId:e,codeVerifier:l,stateCode:d,authorizationCode:c,action:r,client:o});u&&o.storeProviderAccessToken(e,u);let h=await mt.refreshUser();if(!h)throw new x("Unable to update user");return o.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:e}}),h}catch(e){throw o.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:e.toString(),provider:n}}),e}},async initLoginWithOAuth(e,t,r){if(Ie.current=e,!je())return void Le(cr.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);if("google"===e&&Oc(window.navigator.userAgent))return void Le(cr.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);"twitter"===e&&window.opener&&window.opener.postMessage({type:wv},"*"),qe.del(H),qe.del(z);let n=new ll({provider:e,disableSignup:!!r});t&&n.addCaptchaToken(t),o.startAuthFlow(n);let i=await o.authFlow.getAuthorizationUrl();i&&i.url&&("twitter"===e&&$&&(i.url=i.url.replace("x.com","twitter.com")),window.location.assign(i.url))},async initLoginWithTelegram(e,t){if(!h)throw new D;Ie.current="telegram";let r=new Sl(e,t);o.startAuthFlow(r),r.meta.telegramWebAppData=void 0,r.meta.telegramAuthResult=await new Promise(((e,t)=>oe.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:oe.loginConfig.telegramAuthConfiguration.botId,request_access:!0},(r=>r?e(r):t(new x("Telegram auth failed or was canceled by the client")))):t(new x("Telegram was not initialized")):t(new x("Telegram Auth configuration is not loaded"))))},async loginWithTelegram(){let e,t;if(!(o.authFlow instanceof Sl))throw new x("Must initialize Telegram flow before calling loginWithTelegram");if("login"===Oe.current)try{let r=await o.authenticate();e=r.user,t=r.isNewUser,Ie.current="telegram"}catch(e){throw Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR),e}else{if("link"!==Oe.current)throw new x("Unknown auth intent");try{e=(await o.link()).user,Ie.current="telegram"}catch(e){throw Ft(_e,"linkAccount","onError",e.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),e}}w(e),R(t||!1),g(!0)},async recoveryOAuthFlow(e,t,r){let n,i;function a(t){if(!t)throw o.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:e}}),new x("Recovery OAuth failed")}switch(e){case"google-drive":{let t,l,{url:s,codeVerifier:d,stateCode:c}=await mu({api:Cv.api,provider:e});a(s);try{let n=await vv({url:s,popup:r,provider:e});if(t=n.stateCode,l=n.authorizationCode,t!==c)throw o.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:c??"",returnedStateCode:t??""}}),new x("Unexpected auth flow. This may be a phishing attempt.",void 0,A.OAUTH_UNEXPECTED)}catch(t){throw o.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:e}}),new x("Recovery OAuth failed")}[n,i]=await Promise.all([Tv(),fu({api:Cv.api,provider:e,codeVerifier:d,stateCode:t,authorizationCode:l})]);break}case"icloud":{let{url:t}=await mu({api:Cv.api,provider:e});a(t);let{ckWebAuthToken:o}=await vv({url:t,popup:r,provider:e});i=o,n=await Tv()}}if(!ie)throw new x("Cannot connect to wallet proxy");if(!n)throw new x("Unable to authorize user");switch(t){case"recover":let t=pe.recoverWallet?.privyWallet?.address;if(!t)throw new x("Recovery OAuth failed");o.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:t,recoveryMethod:e}}),await ie.recover({address:t,accessToken:n,recoveryAccessToken:i,recoveryMethod:e}),o.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t,recoveryMethod:e}});break;case"create-wallet":o.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await ie.create({accessToken:n,recoveryAccessToken:i,recoveryMethod:e});let r=yt(await mt.refreshUser());if(!r)throw Ft(_e,"createWallet","onError",A.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");o.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:r.address}}),Ft(_e,"createWallet","onSuccess",r);break;case"set-recovery":let a=yt(y);if(!a)throw Ft(_e,"setWalletRecovery","onError",A.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");o.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:a.address,existingRecoveryMethod:a.recoveryMethod,targetRecoveryMethod:e}}),await ie.setRecovery({address:a.address,accessToken:n,recoveryAccessToken:i,recoveryMethod:e});let l=yt(await mt.refreshUser());if(!l)throw Ft(_e,"createWallet","onError",A.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");o.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:a.address,existingRecoveryMethod:a.recoveryMethod,targetRecoveryMethod:e}}),Ft(_e,"setWalletRecovery","onSuccess",e,l);break;default:throw new x("Unsupported recovery action")}},async loginWithOAuth(e){let t,r,n;if(!(o.authFlow instanceof ll))throw new x("Must initialize OAuth flow before calling loginWithOAuth");let i=qe.get(j),a=o.authFlow.meta.stateCode;if(i!==a)throw o.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:i??"",returnedStateCode:a??""}}),new x("Unexpected auth flow. This may be a phishing attempt.",void 0,A.OAUTH_UNEXPECTED);if(null!==await o.getAccessToken())try{let r=await o.link();t=r.user,n=r.oAuthTokens,Ie.current=e}catch(t){throw Ft(_e,"linkAccount","onError",t.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{let i=await o.authenticate();t=i.user,r=i.isNewUser,n=i.oAuthTokens,Ie.current=e}catch(t){throw"login"===Oe.current?Ft(_e,"login","onError",t.privyErrorCode||A.UNKNOWN_AUTH_ERROR):"link"===Oe.current&&Ft(_e,"linkAccount","onError",t.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}return w(t),R(r||!1),g(!0),n&&t&&Ft(_e,"oAuthAuthorization","onOAuthTokenGrant",n,{user:t}),n},passkeyAuthState:V,setPasskeyAuthState:K,async initLoginWithPasskey(e){let t=new $l(e,K);o.startAuthFlow(t),Oe.current="login";try{Ie.current="passkey",K({status:"generating-challenge"}),await t.initAuthenticationFlow(),K({status:"awaiting-passkey"})}catch(e){throw K({status:"error",error:e}),Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR),e}},async loginWithPasskey(){let e,t;if(!h)throw new D;if(!(o.authFlow instanceof $l))throw new x("Must initialize Passkey flow first.");if("passkey"!==Ie.current){let e=new x("Must init login with Passkey flow first.");throw K({status:"error",error:e}),e}let r=await Tv();try{Ie.current="passkey",K({status:"awaiting-passkey"}),({user:e,isNewUser:t}=await o.authenticate())}catch(e){throw K({status:"error",error:e}),Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR),e}w(e),R(t||!1),g(!0),K({status:"done"});let n=e?.linkedAccounts.find((({type:e})=>"passkey"===e))||null;return{user:e,isNewUser:t||!1,wasAlreadyAuthenticated:!!r,loginAccount:n}},async initLinkWithPasskey(e){let t=new $l(e);o.startAuthFlow(t),Oe.current="link",Ie.current="passkey";try{await t.initLinkFlow()}catch(e){throw Ft(_e,"linkAccount","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),e}},async linkWithPasskey(){let e;if(!h)throw new D;if(!(o.authFlow instanceof $l))throw new x("Must initialize Passkey flow first.");if("passkey"!==Ie.current)throw new x("Must init login with Passkey flow first.");try{Ie.current="passkey",({user:e}=await o.link())}catch(e){throw Ft(_e,"linkAccount","onError",e.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),e}return w(e||y||null),e},async initLoginWithHeadlessOAuth(e,t){if(!je())throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");if("google"===e&&Oc(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let r=new ll({provider:e,headless:!0,disableSignup:!1});t&&r.addCaptchaToken(t),ne({status:"loading"});let n=await o.startAuthFlow(r).getAuthorizationUrl();n?.url&&window.location.assign(n.url)},async loginWithHeadlessOAuth(e){let t,r,n;W(!0),ne({status:"loading"}),o.startAuthFlow(new ll(e));let i=qe.get(j),a=e.stateCode;if(i!==a)throw o.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e.provider,storedStateCode:i??"",returnedStateCode:a??""}}),W(!1),new x("Unexpected auth flow. This may be a phishing attempt.",void 0,A.OAUTH_UNEXPECTED);if(null!==await o.getAccessToken())try{({user:t,oAuthTokens:n}=await o.link()),Ie.current=e.provider;let r=dt(t);t&&r&&Ft(_e,"linkAccount","onSuccess",t,Ie.current,r)}catch(t){throw W(!1),Ft(_e,"linkAccount","onError",t.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:e.provider}),t}else try{({user:t,isNewUser:r,oAuthTokens:n}=await o.authenticate()),Ie.current=e.provider;let i=dt(t);t&&i&&void 0!==r&&"login"===Oe.current&&Ft(_e,"login","onComplete",t,r,!1,Ie.current,i)}catch(e){throw W(!1),ne({status:"error",error:e}),Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR),e}return w(t),R(r||!1),g(!0),W(!1),ne({status:"done"}),n&&t&&Ft(_e,"oAuthAuthorization","onOAuthTokenGrant",n,{user:t}),t??void 0},initLoginWithEmail:async(e,t,r)=>{let n=new Ho(e,t,r);o.startAuthFlow(n);try{Ie.current="email",Z({status:"sending-code"}),await n.sendCodeEmail(),Z({status:"awaiting-code-input"})}catch(e){throw Z({status:"error",error:e}),"login"===Oe.current?Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR):"link"===Oe.current&&Ft(_e,"linkAccount","onError",e.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),e}},initUpdateEmail:async(e,t,r)=>{let n=new zo(e,t,r);o.startAuthFlow(n),await n.sendCodeEmail()},initUpdatePhone:async(e,t,r)=>{let n=new _l(e,t,r);o.startAuthFlow(n),await n.sendSmsCode()},initLoginWithSms:async(e,t,r)=>{Q({status:"sending-code"});let n=new Tl(e,t,r);o.startAuthFlow(n);try{Ie.current="sms",await n.sendSmsCode(),Q({status:"awaiting-code-input"})}catch(e){throw Q({status:"error",error:e}),"login"===Oe.current?Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR):"link"===Oe.current&&Ft(_e,"linkAccount","onError",e.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),e}},resendEmailCode:async()=>{await(o.authFlow?.sendCodeEmail())},resendSmsCode:async()=>{await(o.authFlow?.sendSmsCode())},loginWithCode:async e=>{let t,r;function n(e){o.authFlow instanceof Ho?Z(e):o.authFlow instanceof Tl&&Q(e)}if(n({status:"submitting-code"}),!h){let e=new D;throw n({status:"error",error:e}),e}if(o.authFlow instanceof Ho)o.authFlow.meta.emailCode=e.trim();else{if(!(o.authFlow instanceof Tl)){let e=new x("Must initialize a passwordless code flow first");throw n({status:"error",error:e}),e}o.authFlow.meta.smsCode=e.trim()}if(await Tv(),"link"===Oe.current)try{({user:t}=await o.link())}catch(e){throw n({status:"error",error:e}),Ft(_e,"linkAccount","onError",e.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:Ie.current}),e}else try{({user:t,isNewUser:r}=await o.authenticate())}catch(e){throw n({status:"error",error:e}),Ft(_e,"login","onError",e.privyErrorCode||A.UNKNOWN_AUTH_ERROR),e}w(t||y||null),R(r||!1),g(!0),n({status:"done"})},generateSiweMessage:async({address:e,chainId:t,captchaToken:r})=>{Oe.current="link",Ie.current="siwe",te({status:"generating-message"});let n=await o.generateSiweNonce({address:e,captchaToken:r});return te({status:"awaiting-signature"}),xl({address:e,chainId:t.replace("eip155:",""),nonce:n})},linkSmartWallet:async({message:e,signature:t,smartWalletType:r})=>{let n;Oe.current=null,Ie.current=null;try{n=await o.linkSmartWallet({message:e,signature:t,smartWalletType:r}),n=await mt.refreshUser()??n}catch(e){throw e}w(n||y||null)},linkWithSiwe:async({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})=>{let a;try{te({status:"submitting-signature"}),a=await o.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}),a=await mt.refreshUser()??a,te({status:"done"});let l=dt(a);l&&Ft(_e,"linkAccount","onSuccess",a,"siwe",l)}catch(e){throw Ft(_e,"linkAccount","onError",e.privyErrorCode||A.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Oe.current=null,Ie.current=null,te({status:"error",error:e}),e}w(a||y||null),Oe.current=null,Ie.current=null},refreshUser:async()=>{let e=await o.getAuthenticatedUser();return g(!!e),w(e),e},walletProxy:ie,createAnalyticsEvent:({eventName:e,payload:t,timestamp:r})=>o.createAnalyticsEvent({eventName:e,payload:t,timestamp:r}),acceptTerms:async()=>{let e=await o.acceptTerms();return w(e),e},getUsdTokenPrice:e=>o.getUsdTokenPrice(e),getUsdPriceForSol:()=>o.getUsdPriceForSol(),recoverEmbeddedEthereumWallet:async e=>new Promise((async(t,r)=>{let n=yt(e?.user??y)||Bt(e?.user??y),i=await Tv();if(i&&ie&&n){he(!0);try{await ie.connect({accessToken:i,address:n.address}),t(!0)}catch(e){au(e)&&"privy"===n.recoveryMethod?(o.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:n.address}}),(await ie.recover({address:n.address,accessToken:i,recoveryMethod:n.recoveryMethod})).address||r(Error("Unable to recover wallet")),o.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:n.address}}),t(!0)):au(e)&&"privy"!==n.recoveryMethod?(me({recoverWallet:{privyWallet:n,onFailure:r,onSuccess:()=>t(!0)},recoveryOAuthStatus:{provider:n.recoveryMethod,action:"recover"}}),Me(pu(n.recoveryMethod))):r(e)}}else r(Error("Must have valid access token and Privy wallet to recover wallet"))})),embeddedSolanaWallet:_,createEmbeddedSolanaWallet:async()=>{he(!0);let e=await Tv(),t=await mt.refreshUser(),r=Ut(t),n=yt(t);if(!t||!e)throw new x("User must be logged in to create a Solana wallet");if(r)throw new x("User already has an embedded Solana wallet.");if(n){if("privy"!==n.recoveryMethod)throw new x("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");await mt.recoverEmbeddedEthereumWallet({user:t})}let i=await mt.initializeWalletProxy(15e3);if(!i)throw new x("Unable to initialize wallet proxy");o.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await i.createSolana({accessToken:e,ethereumAddress:n?.address});let t=await mt.refreshUser(),r=Ut(t);if(!r)throw new x("Could not get Solana wallet for user");return o.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:r.address}}),r}catch(e){throw o.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new x("Failed to create Solana embedded wallet with error ",e)}},exportSolanaWallet:e=>new Promise((async(t,n)=>{if(!f||!y)return void n(Error("User must be authenticated before exporting their Privy wallet"));let i=e?.address,a=y.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"solana"===e.chainType)),l=i?a.find((e=>e.address.toLowerCase()===i.toLowerCase())):a.find((e=>!e.imported))||a[0];l?(he(!0),await Tv()&&ie?ie?(await mt.recoverEmbeddedSolanaWallet(),me({keyExport:{appId:r.appId,appClientId:r.clientId,origin:o.apiUrl,wallet:l,onSuccess:t,onFailure:n}}),Me(cr.EMBEDDED_WALLET_KEY_EXPORT_SCREEN)):n(Error("Must have a Privy wallet before exporting")):n(Error("Must have valid access token to enroll in MFA"))):n(Error("Must have a Privy wallet before exporting"))})),recoverEmbeddedSolanaWallet:async()=>new Promise((async(e,t)=>{let r=Ut(y),n=await Tv();if(n&&ie&&r){he(!0);try{await ie.connectSolana({accessToken:n,publicKey:r.address}),e(!0)}catch(i){au(i)&&"privy"===r.recoveryMethod?(o.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:r.address}}),(await ie.recoverSolana({publicKey:r.address,accessToken:n})).publicKey||t(Error("Unable to recover wallet")),o.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:r.address}}),e(!0)):t(i)}}else t(Error("Must have valid access token and Privy wallet to recover wallet"))})),getMoonpaySignedUrl:async(e,t)=>{let{signedUrl:r,externalTransactionId:n}=await async function(e,t,r,n,i=!1){let a=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},o=r.uiConfig||{accentColor:n.accent,theme:n.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:i,config:{...r,...a,...o}})}(o,e,t??{},oe.appearance.palette,oe.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:r,externalTransactionId:n}},initCoinbaseOnRamp:o.initCoinbaseOnRamp.bind(o),getCoinbaseOnRampStatus:o.getCoinbaseOnRampStatus.bind(o),setReadyToTrue:e=>{p(!0),ge?.(e)},updateWallets:()=>nt(),fundWallet:async(e,t)=>{if(!oe.fundingConfig||0===oe.fundingConfig.methods.length)throw Error("Wallet funding is not enabled");let r=gw({fundingMethods:oe.fundingConfig.methods});me({funding:hw({address:e,appConfig:oe,fundWalletConfig:t,methodScreen:r})}),Me(r)},requestFarcasterSignerStatus:async e=>{let t=await Tv(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!ie||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");let n=await o.requestFarcasterSignerStatus(e);return"approved"===n.status&&w(await o.getAuthenticatedUser()||y||null),n},connectCoinbaseSmartWallet:async()=>{oe.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let e=o.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||o.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(e)return e.updateConnectionPreference("smartWalletOnly"),Ge(e);await Ue("coinbase_wallet","coinbase_smart_wallet")},initiateAccountTransfer:async({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,farcasterEmbeddedAddress:a,oAuthUserInfo:l})=>{try{let s=await o.sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,farcasterEmbeddedAddress:a,oAuthUserInfo:l});return w(s),s}catch(e){throw e}}};xv=mt.recoverEmbeddedEthereumWallet,kv=mt.recoverEmbeddedSolanaWallet,Av=mt.solanaSignMessage;let ft=d((()=>({wallets:v,ready:Ce&&Se})),[v,Ce,Se]);return t(Pe.Provider,{value:pt,children:t(Ht.Provider,{value:_e,children:t(Be.Provider,{value:ft,children:t($s,{...oe,children:e(F.Provider,{value:mt,children:[t(zt,{children:e(pr,{data:pe,setModalData:me,setInitialScreen:L,initialScreen:M,authenticated:f,open:c,children:[r.children,!oe.headless&&oe.captchaEnabled&&h&&!f&&t(ks,{delayedExecution:!1}),t(zw,{theme:{...oe.appearance.palette||{}}}),!oe.render.standalone&&t(rv,{open:c})]})}),de&&le?t(fv,{appId:r.appId,appClientId:r.clientId,clientAnalyticsId:o.clientAnalyticsId,origin:o.apiUrl,mfaMethods:y?.mfaMethods,mfaPromise:Ae,mfaSubmitPromise:Te,onLoad:ae,onLoadFailed:()=>null}):null,oe.loginConfig.telegramAuthConfiguration&&t(cd,{$if:!0,children:t(av,{scriptHost:r.apiUrl||se,botUsername:oe.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};const Lv=e=>{at("login",e);let t=xs(),r=We(),{initLoginWithHeadlessOAuth:n,loginWithHeadlessOAuth:i,isHeadlessOAuthLoading:a,ready:o,user:l}=he(),{oAuthState:s,setOAuthState:d}=O(),c=f((async e=>{try{if(t.enabled&&"success"!==t.status)throw new Es(t.error,null,A.CAPTCHA_FAILURE);return await n(e.provider,t.token)}catch(e){throw d({status:"error",error:e}),e}}),[n,t]),u=f((async()=>{let e=bl();try{if(l)return console.warn("Cannot login with OAuth when already logged in"),l;if(!e.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(e.popupFlow)return}catch(e){throw d({status:"error",error:e}),e}try{return await i(e)}catch(e){throw d({status:"error",error:e}),e}finally{El()}}),[i]);return m((()=>{let e=bl();o&&r&&e.inProgress&&e.headless&&!e.popupFlow&&u()}),[o,r]),{initOAuth:c,loginWithOAuth:u,loading:a,state:s}},Dv=()=>{let e=xs(),{initLoginWithEmail:t,loginWithCode:r}=O(),{emailOtpState:n,setEmailOtpState:i}=O();return{sendCode:f((async({email:r})=>{try{let n;if(!r)throw Error("Email required to send OTP code");if(e.enabled&&"error"===e.status)throw new Es(e.error,null,A.CAPTCHA_FAILURE);return e.enabled&&"success"!==e.status&&(e.execute(),n=await e.waitForResult()),await t(r,n)}catch(r){throw i({status:"error",error:r}),r}}),[t]),loginWithCode:f((async({code:t})=>{try{if(e.enabled&&"error"===e.status)throw new Es(e.error,null,A.CAPTCHA_FAILURE);return await r(t)}catch(t){throw i({status:"error",error:t}),t}}),[r,e.status]),state:n}},Fv=e=>{let t=xs(),{initLoginWithPasskey:r,loginWithPasskey:n,passkeyAuthState:i,setPasskeyAuthState:a}=O();return{loginWithPasskey:f((async()=>{try{let i;if(t.enabled&&"error"===t.status)throw new Es(t.error,null,A.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),i=await t.waitForResult()),await r(i);let{user:a,isNewUser:o,wasAlreadyAuthenticated:l,loginAccount:s}=await n();e?.onComplete?.(a,o,l,"passkey",s)}catch(t){throw a({status:"error",error:t}),e?.onError?.(t),t}}),[n,t.status]),state:i}},Uv=()=>{let e=xs(),{loginWithCode:t}=he(),{smsOtpState:r,setSmsOtpState:n,initLoginWithSms:i}=O();return{sendCode:f((async({phoneNumber:t})=>{try{let r;if(!t)throw Error("SMS required to send OTP code");if(e.enabled&&"error"===e.status)throw new Es(e.error,null,A.CAPTCHA_FAILURE);return e.enabled&&"success"!==e.status&&(e.execute(),r=await e.waitForResult()),await i(t,r)}catch(t){throw n({status:"error",error:t}),t}}),[i]),loginWithCode:f((async({code:r})=>{try{if(e.enabled&&"success"!==e.status)throw new Es(e.error,null,A.CAPTCHA_FAILURE);return await t(r)}catch(r){throw n({status:"error",error:r}),r}}),[t,e.status]),state:r}},Wv=()=>{let e=xs(),{generateSiweMessage:t,linkWithSiwe:r}=he(),{siweState:n,setSiweState:i}=O();return{generateSiweMessage:f((async({address:e,chainId:r})=>{try{if(!e||!r)throw Error("wallet address and chainId required to generate nonce");return await t({address:e,chainId:r}).then((e=>e))}catch(e){throw i({status:"error",error:e}),e}}),[t]),linkWithSiwe:f((async({signature:t,message:n,chainId:a,walletClientType:o,connectorType:l})=>{try{if(e.enabled&&"success"!==e.status)throw new Es(e.error,null,A.CAPTCHA_FAILURE);return await r({message:n,signature:t,chainId:a,walletClientType:o,connectorType:l})}catch(t){throw i({status:"error",error:t}),t}}),[r,e.status]),state:n}};function Bv(e){let{linkEmail:t,linkPhone:r,linkWallet:n,linkGoogle:i,linkApple:a,linkTwitter:o,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:c,linkSpotify:u,linkInstagram:p,linkTelegram:m,linkFarcaster:f}=h(Pe);return at("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:n,linkGoogle:i,linkApple:a,linkTwitter:o,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:c,linkSpotify:u,linkInstagram:p,linkFarcaster:f,linkTelegram:m}}function Gv(e){let{createWallet:t}=h(Pe);return at("createWallet",e),{createWallet:t}}const Hv=()=>{let{connectCoinbaseSmartWallet:e}=O();return{connectCoinbaseSmartWallet:e}},zv=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:n,sendTransactionWithCrossAppWallet:i}=he();return{loginWithCrossAppAccount:({appId:t})=>e({appId:t,action:"login"}),linkCrossAppAccount:({appId:t})=>e({appId:t,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:n,sendTransaction:i}};function jv(e){let{sendTransaction:t}=h(Pe);return at("sendTransaction",e),{sendTransaction:t}}function qv(e){let{sendSolanaTransaction:t}=h(Pe);return at("sendSolanaTransaction",e),{sendSolanaTransaction:t}}function Vv(e){let{setWalletPassword:t}=h(Pe);return at("setWalletPassword",e),{setWalletPassword:t}}function Kv(){let{createGuestAccount:e}=h(Pe);return{createGuestAccount:e}}function Yv(e){let{setWalletRecovery:t}=h(Pe);return at("setWalletRecovery",e),{setWalletRecovery:t}}function Zv(e){let{signMessage:t}=h(Pe);return at("signMessage",e),{signMessage:t}}function Xv(e){let{signTypedData:t}=h(Pe);return at("signTypedData",e),{signTypedData:t}}const Qv=()=>{let{isModalOpen:e}=h(Pe);return{isOpen:e}};function Jv(e){let{getAccessToken:t}=h(Pe);return at("accessToken",e),{getAccessToken:t}}function eC(e){let{authenticated:t,user:r}=he(),{initLoginWithOAuth:n}=O(),i=Mt();return at("oAuthAuthorization",e),{reauthorize:e=>tC(t,r,n,i,e.provider)}}let tC=async(e,t,r,n,i)=>{if(!e)throw n("linkAccount","onError",A.MUST_BE_AUTHENTICATED,{linkMethod:i}),new x("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(i))))throw new x(`OAuth account of type ${i} not linked to the account.`);await r(i)};const rC=e=>{let{customAuthStatus:t}=O();return at("customAuth",e),{status:t}},nC=iC;function iC(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=he();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}export{Dl as AsExternalProvider,ks as Captcha,ss as ConnectorManager,Gl as EthereumWalletConnector,rv as LoginModal,vs as PrivyClient,Rv as PrivyProvider,Rl as PrivyProxyProvider,X as VERSION,Qt as WalletConnector,su as errorIndicatesMaxMfaRetries,ou as errorIndicatesMfaTimeout,lu as errorIndicatesMfaVerificationFailed,Tv as getAccessToken,Hv as useConnectCoinbaseSmartWallet,Gv as useCreateWallet,zv as useCrossAppAccounts,rC as useCustomAuth,nC as useExperimentalFarcasterSigner,iC as useFarcasterSigner,Kv as useGuestAccounts,Bv as useLinkAccount,Wv as useLinkWithSiwe,Dv as useLoginWithEmail,Lv as useLoginWithOAuth,Fv as useLoginWithPasskey,Uv as useLoginWithSms,gt as useLogout,Bf as useMfa,Gf as useMfaEnrollment,Qv as useModalStatus,eC as useOAuthTokens,he as usePrivy,As as useRegisterMfaListener,qv as useSendSolanaTransaction,jv as useSendTransaction,Vv as useSetWalletPassword,Yv as useSetWalletRecovery,Zv as useSignMessage,Xv as useSignTypedData,Jv as useToken,Ae as useWallets};
|
|
3113
|
+
`;function av(e){let r=l(null),n=l();return m((()=>{n.current?.remove(),n.current=function({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:n}=new URL(t);return r.async=!0,r.src=`${n}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}(e),r.current?.after(n.current)}),[e]),t("div",{ref:r,hidden:!0})}async function ov(e,t,r,n,i,a=!1){let o=a,l=async l=>{if(o&&t&&t.length>0){l===(a?0:1)?i("configureMfa","onMfaRequired",t):n.current?.reject(new nu("missing_or_invalid_mfa","MFA verification failed, retry."));let o=await new Promise(((e,t)=>{r.current={resolve:e,reject:t},setTimeout((()=>{let e=new nu("mfa_timeout","Timed out waiting for MFA code");n.current?.reject(e),t(e)}),3e5)}));return await e(o)}return await e()},s=null;for(let e=0;e<4;e++)try{s=await l(e),n.current?.resolve(void 0);break}catch(e){if("missing_or_invalid_mfa"!==e.type)throw n.current?.resolve(void 0),e;o=!0}if(null===s){let e=new nu("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw n.current?.reject(e),e}return s}var lv;let sv=(lv=0,()=>"id-"+lv++);function dv(e){return void 0!==e.error}let cv=new class{enqueue(e,t){this.callbacks[e]=t}dequeue(e,t){let r=this.callbacks[t];if(!r)throw Error(`cannot dequeue ${e} event: no event found for id ${t}`);switch(delete this.callbacks[t],e){case"privy:iframe:ready":case"privy:wallet:create":case"privy:wallet:create-additional":case"privy:wallet:import":case"privy:wallet:connect":case"privy:wallet:recover":case"privy:wallet:rpc":case"privy:wallet:set-recovery":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:solana-wallet:connect":case"privy:solana-wallet:recover":case"privy:solana-wallet:rpc":return r;default:throw Error(`invalid wallet event type ${e}`)}}constructor(){this.callbacks={}}},uv=new Map,hv=(e,t)=>"bigint"==typeof t?t.toString():t,pv=(e,t)=>`${e}${JSON.stringify(t,hv)}`;function mv(e,t,r,n){let i=r.contentWindow;if(!i)throw Error("iframe not initialized");let a=pv(e,t);if("privy:wallet:create"===e){let e=uv.get(a);if(e)return e}let o=new Promise(((r,a)=>{let o=sv();cv.enqueue(o,{resolve:r,reject:a}),i.postMessage({id:o,event:e,data:t},n)})).finally((()=>{uv.delete(a)}));return uv.set(a,o),o}function fv(e){let r=l(null),n=l(e.mfaMethods),i=Mt(),[a,o]=s(!1);return m((()=>{n.current=e.mfaMethods}),[e.mfaMethods]),m((()=>{if(!a)return;let t=r.current;if(!t)return;function o(t){var r;t&&t.origin===e.origin&&"string"==typeof(r=t.data).event&&/^privy:.+/.test(r.event)&&function(e){switch(e.event){case"privy:iframe:ready":let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=cv.dequeue(e.event,e.id);return dv(e)?r.reject(new nu(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:create-additional":let n=cv.dequeue(e.event,e.id);return dv(e)?n.reject(new nu(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:import":let i=cv.dequeue(e.event,e.id);return dv(e)?i.reject(new nu(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:connect":let a=cv.dequeue(e.event,e.id);return dv(e)?a.reject(new nu(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:recover":let o=cv.dequeue(e.event,e.id);return dv(e)?o.reject(new nu(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:rpc":let l=cv.dequeue(e.event,e.id);return dv(e)?l.reject(new nu(e.error.type,e.error.message)):l.resolve(e.data);case"privy:wallet:set-recovery":let s=cv.dequeue(e.event,e.id);return dv(e)?s.reject(new nu(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let d=cv.dequeue(e.event,e.id);return dv(e)?d.reject(new nu(e.error.type,e.error.message)):d.resolve(e.data);case"privy:mfa:init-enrollment":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:submit-enrollment":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:unenroll":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:clear":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:farcaster:init-signer":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:farcaster:sign":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:solana-wallet:create":let c=cv.dequeue(e.event,e.id);return dv(e)?c.reject(new nu(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let u=cv.dequeue(e.event,e.id);return dv(e)?u.reject(new nu(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:recover":let h=cv.dequeue(e.event,e.id);return dv(e)?h.reject(new nu(e.error.type,e.error.message)):h.resolve(e.data);case"privy:solana-wallet:rpc":{let t=cv.dequeue(e.event,e.id);return dv(e)?t.reject(new nu(e.error.type,e.error.message)):t.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}(t.data)}let l={create:r=>mv("privy:wallet:create",r,t,e.origin),createAdditional:r=>mv("privy:wallet:create-additional",r,t,e.origin),import:r=>mv("privy:wallet:import",r,t,e.origin),connect:r=>mv("privy:wallet:connect",r,t,e.origin),recover:r=>ov((n=>mv("privy:wallet:recover",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i,!r.recoveryMethod||"privy"===r.recoveryMethod),rpc:r=>ov((n=>mv("privy:wallet:rpc",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i),createSolana:r=>mv("privy:solana-wallet:create",r,t,e.origin),connectSolana:r=>mv("privy:solana-wallet:connect",r,t,e.origin),recoverSolana:r=>mv("privy:solana-wallet:recover",r,t,e.origin),rpcSolana:r=>mv("privy:solana-wallet:rpc",r,t,e.origin),setRecovery:r=>ov((n=>mv("privy:wallet:set-recovery",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i),verifyMfa:r=>ov((n=>mv("privy:mfa:verify",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i,!0),initEnrollMfa:r=>ov((n=>mv("privy:mfa:init-enrollment",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i),submitEnrollMfa:r=>ov((n=>mv("privy:mfa:submit-enrollment",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i),unenrollMfa:r=>ov((n=>mv("privy:mfa:unenroll",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,i,!0),clearMfa:r=>mv("privy:mfa:clear",r,t,e.origin),initFarcasterSigner:r=>mv("privy:farcaster:init-signer",r,t,e.origin),signFarcasterMessage:r=>mv("privy:farcaster:sign",r,t,e.origin)};window.addEventListener("message",o);let s=new AbortController;return Xe((()=>mv("privy:iframe:ready",{},t,e.origin)),{abortSignal:s.signal}).then((()=>e.onLoad(l)),((...t)=>{console.warn("Privy iframe failed to load: ",...t),e.onLoadFailed()})),()=>{window.removeEventListener("message",o),s.abort()}}),[a]),t("iframe",{ref:r,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>o(!0),src:vt(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}class gv{async handleSignMessage(e){if(!e.params||"string"!=typeof e.params.message)throw Error("Message must be provided as a string for Solana signMessage RPC");return await Ov({message:e.params.message})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await Tv())throw Error("User must be authenticated to use embedded Solana wallet");if(!await Pv())throw new x("Unable to connect to Solana embedded wallet");if("signMessage"===e.method)return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}constructor(e,t){this.walletProxy=e,this.address=t}}const yv="popup-privy-oauth",wv="PRIVY_OAUTH_USE_BROADCAST_CHANNEL";async function vv({url:e,popup:t,provider:r}){return t.location=e,new Promise(((e,r)=>{function n(){t?.close(),window.removeEventListener("message",i)}function i(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),n()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),n()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),n()))}window.addEventListener("message",i)}))}let Cv,bv,Ev,$v,xv,Av,kv;function Tv(){return Cv?Cv.getAccessToken():Promise.resolve(qe.get(Q)||null)}const _v=(e,t,r)=>bv(e,t,r),Sv=(e,t,r)=>Ev(e,t,r),Nv=(e,t,r,n)=>$v(e,t,r,n),Iv=()=>xv(),Pv=()=>Av(),Ov=({message:e})=>kv({message:e});const Rv=({config:e,...r})=>{var n;if("undefined"!=typeof window&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&"https:"!==window.location.protocol)throw new x("Embedded wallet is only available over HTTPS");if("string"!=typeof(n=r.appId)||25!==n.length)throw new x("Cannot initialize the Privy provider with an invalid Privy app ID");Cv||(Cv=new vs({appId:r.appId,appClientId:r.clientId,apiUrl:r.apiUrl}));let i=Object.assign({},e);return void 0!==r.createPrivyWalletOnLogin&&void 0===i.embeddedWallets?.createOnLogin&&(i.embeddedWallets||(i.embeddedWallets={}),i.embeddedWallets.createOnLogin=r.createPrivyWalletOnLogin?"users-without-wallets":"off"),void 0!==r.createPrivyWalletOnLogin&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),t(Fe,{client:Cv,clientConfig:i,legacyCreateEmbeddedWalletFlag:r.createPrivyWalletOnLogin,children:t(Mv,{...r,client:Cv})})};let Mv=r=>{let o=r.client,[c,u]=s(!1),[h,p]=s(!1),[f,g]=s(!1),[y,w]=s(null),[v,C]=s([]),[b,E]=s([]),[_,S]=s(null),N=l(v),[O,R]=s(!1),[M,L]=s(null),[F,W]=s(!1),[G,q]=s({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:P}),[V,K]=s({status:"initial"}),[Y,Z]=s({status:"initial"}),[X,Q]=s({status:"initial"}),[J,te]=s({status:"initial"}),[re,ne]=s({status:"initial"}),[ie,ae]=s(null),oe=ue(),le=We(),[de,he]=s(!0),[pe,me]=s({}),[ge,ye]=s(null),[we,ve]=s(null),[Ce,be]=s(!1),[Ee,$e]=s(!1),[xe,Ae]=s(oe.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),ke=l(null),Te=l(null),_e=l(Dt),[Se,Ne]=s(!1);o.onStoreToken=e=>{e&&Ut(_e,"accessToken","onAccessTokenGranted",e)},o.onDeleteToken=()=>{w(null),g(!1),Ut(_e,"accessToken","onAccessTokenRemoved")};let Ie=l(null),Oe=l(null),Re=l(!1),Me=e=>{L(e),setTimeout((()=>{u(!0)}),15),o.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:e}})},Le=e=>{"off"!==oe.embeddedWallets.createOnLogin&&he(!0),Me(e)};m((()=>{let e=Ft(y);if(!e||!ie)return void S(null);let t={type:"solana",imported:!1,address:e.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund:()=>{throw new x("Funding is not supported for Solana embedded wallets.")},unlink:()=>{throw new x("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new gv(ie,e.address),signMessage:async e=>{let r=await Tv();if(!r||!ie)throw new x("Must have valid access token and Privy wallet to send transaction",k.MUST_BE_AUTHENTICATED);let{response:n}=await ie.rpcSolana({accessToken:r,publicKey:t.address,request:{method:"signMessage",params:{message:Buffer.from(e).toString("base64")}}});return Buffer.from(n.data.signature,"base64")},async sendTransaction(e,t,r){let{signature:n}=await ot({transaction:e,connection:t,transactionOptions:r,wallet:this});return n},signTransaction:async e=>{let t=await Tv();if(!t||!ie)throw new x("Must have valid access token and Privy wallet to send transaction",k.MUST_BE_AUTHENTICATED);return await Ay({tx:e,accessToken:t,walletProxy:ie}),e},loginOrLink:async()=>{throw new x("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{S(null)},isConnected:async()=>!0};S(t)}),[ie,y]),m((()=>{if(!y)return void o.connectors?.removeEmbeddedWalletConnectors();let e=yt(y),t=Wt(y),n=Bt(y);e&&t.length||o.connectors?.removeEmbeddedWalletConnectors(),n||o.connectors?.removeImportedWalletConnector(),o.connectors?ie?(e&&o.connectors.addEmbeddedWalletConnectors({walletProxy:ie,rootWallet:e,embeddedWallets:t,defaultChain:oe.defaultChain,appId:r.appId}),n&&o.connectors.addImportedWalletConnector(ie,n.address,oe.defaultChain,r.appId)):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")}),[ie,y]),m((()=>{ie&&we?.(ie)}),[ie]),m((()=>{(async()=>{if(!oe.customAuth?.enabled)return void Ae({status:"not-enabled"});he(!0),Ae({status:"loading"});let{getCustomAccessToken:e,isLoading:t}=oe.customAuth;if(h&&!t)try{let t=await e();if(!t&&f)return await pt.logout(),Ae({status:"done"}),void Ut(_e,"customAuth","onUnauthenticated");if(!t||f)return void Ae({status:"done"});o.startAuthFlow(new Go(t));let{user:r,isNewUser:n}=await o.authenticate();if(!r)return await pt.logout(),Ae({status:"error",error:new x("Failed to sync with custom auth provider")}),void Ut(_e,"customAuth","onUnauthenticated");void 0!==n&&Ut(_e,"login","onComplete",r,n,!1,"custom",null),Ut(_e,"customAuth","onAuthenticated",{user:r}),Ae({status:"done"}),w(r||null),R(n||!1),g(!0),$e(!0)}catch(e){throw console.warn(e),f&&(await pt.logout(),Ut(_e,"customAuth","onUnauthenticated")),Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR),Ae({status:"error",error:e}),e}})()}),[oe.customAuth?.enabled,oe.customAuth?.getCustomAccessToken,oe.customAuth?.isLoading,h,f]),m((()=>{Ee&&ie&&y&&st(y,oe.embeddedWallets.createOnLogin)&&($e(!1),it(y,fe).catch(console.error))}),[Ee&&ie&&y]),m((()=>{if(oe.externalWallets.solana.connectors)return oe.externalWallets.solana.connectors.onMount(),()=>oe.externalWallets.solana.connectors?.onUnmount()}),[oe.externalWallets.solana.connectors]),m((()=>{!h&&le&&async function(){let e,t=De(),r=Ue();(()=>{let e=new URLSearchParams(window.location.search).get("privy_token");if(!e)return;qe.put(ee,e);let t=new URL(window.location.href);t.searchParams.delete("privy_token"),window.history.pushState({},"",t)})();let n=a();o.initializeConnectorManager({walletConnectCloudProjectId:oe.walletConnectCloudProjectId,rpcConfig:oe.rpcConfig,chains:oe.chains,defaultChain:oe.defaultChain,store:n,walletList:oe.appearance.walletList,shouldEnforceDefaultChainOnConnect:oe.shouldEnforceDefaultChainOnConnect,externalWalletConfig:oe.externalWallets,appName:oe.name??"Privy"}),o.connectors?.on("connectorInitialized",(()=>{e&&clearTimeout(e);let t=o.connectors.walletConnectors.length,r=o.connectors.walletConnectors.reduce(((e,t)=>e+(t.initialized?1:0)),0);r===t?Ne(!0):e=setTimeout((()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:r,expected:t}),Ne(!0)}),1500)})),o.connectors?.initialize().then((()=>{Xe()}));let i=await o.getAuthenticatedUser(),l=!!i;if(oe.customAuth?.enabled||(g(!!i),i&&Ut(_e,"login","onComplete",i,!1,!0,null,null),w(i)),!t)return r&&!l?(Oe.current="login",void Le(cr.TELEGRAM_AUTH_SCREEN)):void mt.setReadyToTrue(!!i);Oe.current=l?"link":"login"}()}),[o,ge,h,le]),m((()=>{if(h){if(!y||!y.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType)))return void be(!0);be(!!v.find((e=>"privy"===e.walletClientType)))}}),[h,y,v]);let De=()=>{let e=bl();return e.inProgress&&e.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):"error"===e.authorizationCode?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}):(e.inProgress&&function(e){return e.startsWith("privy:")}(e.provider)&&!e.popupFlow&&(new BroadcastChannel(yv).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}),window.close()),!!e.inProgress&&!e.headless&&(o.startAuthFlow(new ll(e)),Le(cr.AWAITING_OAUTH_SCREEN),!0))},Ue=()=>{let e=function(){let e;return(e=function(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),n=Number(e.get("auth_date")||""),i=e.get("first_name"),a=e.get("last_name")||void 0,o=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(t&&i&&n&&r)return{id:t,first_name:i,last_name:a,username:o,photo_url:l,auth_date:n,hash:r}}())?(Il(),{...e,flowType:"login-url"}):(e=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,n=t.get("user"),i=Number(t.get("auth_date")||""),a=t.get("hash"),o=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0,s=t.get("start_param")||void 0;return n&&i&&a?{query_id:r,user:n,auth_date:i,hash:a,chat_instance:o,chat_type:l,start_param:s}:void 0}())?(Il(),{...e,flowType:"web-app"}):void 0}();if(!e||!oe.loginMethods.telegram||!oe.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let t=new Sl;return o.startAuthFlow(t),"login-url"===e.flowType&&(t.meta.telegramWebAppData=void 0,t.meta.telegramAuthResult={id:e.id,first_name:e.first_name,last_name:e.last_name,auth_date:e.auth_date,username:e.username,photo_url:e.photo_url,hash:e.hash}),"web-app"===e.flowType&&(t.meta.telegramAuthResult=void 0,t.meta.telegramWebAppData={query_id:e.query_id,user:e.user,auth_date:e.auth_date,hash:e.hash,chat_instance:e.chat_instance,chat_type:e.chat_type,start_param:e.start_param}),!0},Fe=async(e,t,r,n)=>{Ge(await(o.connectors?.createEthereumWalletConnector(e,t))||null,t,r,n)};async function Ge(e,t,r,n){if(!e)return q({status:"disconnected",connectedWallet:null,connectError:new T("Unable to connect to wallet."),connector:null,connectRetry:P}),n?.(null,r);q({status:"disconnected",connectedWallet:null,connectError:null,connector:e,connectRetry:P}),e instanceof as&&t&&await e.resetConnection(t),q({connector:e,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ge(e,t,r,n)});try{let t=await e.connect({showPrompt:!0});if((!t||Bl(t))&&oe.shouldEnforceDefaultChainOnConnect&&!oe.chains.find((e=>e.id===Number(t?.chainId.replace("eip155:",""))))&&("wallet_connect_v2"!==t?.connectorType||"metamask"!==t?.walletClientType)){q((t=>({...t,connector:e,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:P})));try{await(t?.switchChain(oe.defaultChain.id)),t&&(t.chainId=Ze(Ye(oe.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${oe.defaultChain.id}`)}}return q((e=>({...e,status:"connected",connectedWallet:t,connectError:null,connectRetry:P}))),t&&Ut(_e,"connectWallet","onSuccess",t),n?.(t,r)}catch(e){return e instanceof I?(console.warn(e.cause?e.cause:e.message),Ut(_e,"connectWallet","onError",e.privyErrorCode||k.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),Ut(_e,"connectWallet","onError",k.UNKNOWN_CONNECT_WALLET_ERROR)),q((t=>({...t,status:"disconnected",connectedWallet:null,connectError:e}))),n?.(null,r)}}let He=async(e,t,r)=>{if(null===e||!Bl(e))return;let n=new Al(e,o,t,r);o.startAuthFlow(n)},ze=async(e,t)=>{if(null===e||!ar(e))return;let r=new kl(e,o,t);o.startAuthFlow(r)},Xe=()=>{let e=new URLSearchParams(window.location.search),t=e.get("privy_connector"),r=e.get("privy_wallet_client");if(!t||!r)return;if("phantom"!==r||rt()||Le(cr.LOGIN_FAILED_SCREEN),!o.connectors)throw new x("Connector not initialized");Me(cr.AWAITING_CONNECTION);let n=new URL(window.location.href);n.searchParams.delete("privy_connector"),n.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",n),Fe(t,r,void 0,He)};m((()=>{h&&f&&null===y&&o.getAuthenticatedUser().then(w)}),[h,f,y,o]);let Qe=e=>{if(!f)throw Ut(_e,"linkAccount","onError",k.MUST_BE_AUTHENTICATED,{linkMethod:e}),new x("User must be authenticated before linking an account.")},Je=()=>{Qe("siwe"),Ie.current="siwe",Oe.current="link",Me(cr.LINK_WALLET_SCREEN)},et=e=>{if(!f||!y)return!1;if("privy"===e.walletClientType)return!0;for(let t of y.linkedAccounts)if("wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType)return!0;return!1},tt=async e=>{let t;if(!o.connectors)throw new x("Connector not initialized");t="ethereum"===e.type?o.connectors.findWalletConnector(e.connectorType,e.walletClientType)||null:o.connectors.findSolanaWalletConnector(e.connectorType,e.walletClientType)||null,q((r=>({...r,connector:t,status:"connected",connectedWallet:e,connectError:null,connectRetry:P}))),oe.captchaEnabled&&!f?(me({captchaModalData:{callback:t=>Bl(e)?He(e,t):ze(e,t),userIntentRequired:!1,onSuccessNavigateTo:cr.AWAITING_CONNECTION,onErrorNavigateTo:cr.ERROR_SCREEN}}),Le(cr.CAPTCHA_SCREEN)):(Bl(e)?await He(e):await ze(e),Le(cr.AWAITING_CONNECTION))},nt=()=>{C((e=>{let t=o.connectors?.wallets.filter(Bl).map((e=>({...e,linked:et(e),loginOrLink:async()=>{if(!await e.isConnected())throw new x("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new x("Cannot link or login with embedded wallet");tt(e)},fund:async t=>{await mt.fundWallet(e.address,t)},unlink:async()=>{if(!f)throw new x("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new x("Cannot unlink an embedded wallet");w(await o.unlinkEthereumWallet(e.address))}})))||[];return ds(e,t)?e:t})),E((e=>{let t=o.connectors?.wallets.filter(ar).map((e=>({...e,linked:et(e),loginOrLink:async()=>{if(!await e.isConnected())throw new x("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new x("Cannot link or login with embedded wallet");tt(e)},fund:async e=>{throw new x("Funding not supported for Solana wallets")},unlink:async()=>{if(!f)throw new x("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new x("Cannot unlink an embedded wallet");w(await o.unlinkSolanaWallet(e.address))}})))||[];return ds(e,t)?e:t}))};m((()=>{nt()}),[y?.linkedAccounts,f,h]),m((()=>{if(h){if(!o.connectors)throw new x("Connector not initialized");nt(),o.connectors.on("walletsUpdated",nt)}}),[h]),m((()=>{let e;if(!v[0])return;let t=v[0],r=N.current.find((e=>e.address===t.address));if(e="privy"===t.walletClientType?y?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"===e.walletClientType)):y?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"!==e.walletClientType)),!r&&e){let t=Object.assign({},y);t.wallet=e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,imported:e.imported,walletIndex:e.walletIndex},w(t)}N.current=v}),[v]);let it=async(e,t,r)=>{let n=yt(e);if(n&&!r?.createAdditional)throw Ut(_e,"createWallet","onError",k.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");let[i,a]=await Promise.all([mt.initializeWalletProxy(t),Tv()]);if(!i&&oe.customAuth?.enabled)throw Ut(_e,"createWallet","onError",k.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!i||!a||oe.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise(((e,t)=>{he(!0),me({createWallet:{onSuccess:t=>{Ut(_e,"createWallet","onSuccess",t),e(t)},onFailure:e=>{Ut(_e,"createWallet","onError",k.UNKNOWN_EMBEDDED_WALLET_ERROR),t(e)},callAuthOnSuccessOnClose:!1}}),Me(cr.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}));{if(n){let t=Wt(e),r=t?.length?Math.max(...t.map((e=>e.walletIndex))):n.walletIndex;await mt.recoverEmbeddedEthereumWallet(),await i.createAdditional({accessToken:a,primaryWalletAddress:n?.address,hdWalletIndex:r+1})}else await i.create({accessToken:a});let t=yt(await mt.refreshUser());if(!t)throw Ut(_e,"createWallet","onError",k.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");return Ut(_e,"createWallet","onSuccess",t),t}},at=(e,t,i,a)=>new Promise((async(o,l)=>{let{requesterAppId:s}=t||{};if(!f||!y)return Ut(_e,"sendTransaction","onError",k.MUST_BE_AUTHENTICATED),void l(Error("User must be authenticated before signing with a Privy wallet"));let d=a??yt(y)?.address;if(!d)throw new x("User must have an embedded wallet to send a transaction.");let{signingWallet:c,rootWallet:u}=Gt(y,d);if(!u||!c)return Ut(_e,"sendTransaction","onError",k.EMBEDDED_WALLET_NOT_FOUND),void l(Error("Must have a Privy wallet before signing"));he(!0);let h=ft.wallets.find((e=>"privy"===e.walletClientType&&n(e.address)===n(c.address))),p=await(h?.getEthereumProvider());if(!h||!p)throw new x(`Cannot sendTransaction before embedded wallet ${c.address} is connected`);let m=e.chainId?Number(e.chainId):hr(h.chainId);(e=>{if(!oe.chains.map((e=>e.id)).includes(e))throw new T(`Chain ID ${e} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,k.UNSUPPORTED_CHAIN_ID)})(m);let g=Object.assign({},e,{chainId:m});if(oe.embeddedWallets.noPromptOnSignature||Re.current)t&&oe.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),(async()=>{let e=await Tv();if(!e||!ie)return Ut(_e,"sendTransaction","onError",k.EMBEDDED_WALLET_NOT_FOUND),void l(Error("Must have valid access token and Privy wallet to send transaction"));try{if(!await mt.recoverEmbeddedEthereumWallet())return Ut(_e,"sendTransaction","onError",k.UNKNOWN_CONNECT_WALLET_ERROR),void l(Error("Unable to connect to wallet"));let t=Ve(g.chainId,oe.chains,oe.rpcConfig,{appId:r.appId}),n=await wi(c.address,g,t);if(oe.embeddedWallets.noPromptOnSignature||Re.current){let{totalGasEstimate:e}=await gi(n,t),{hasSufficientFunds:r}=await dw(c.address,n,e,t);if(!r)throw new rr(new nr("Wallet has insufficient funds for this transaction.",ir.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let i=await sw({accessToken:e,rootWallet:u,transactingWallet:c,walletProxy:ie,transactionRequest:n,provider:t,requesterAppId:s});Ut(_e,"sendTransaction","onSuccess",i),o(i)}catch(e){Ut(_e,"sendTransaction","onError",k.TRANSACTION_FAILURE),l(e)}})();else{let e={address:u.address,onCompleteNavigateTo:cr.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:e=>{Ut(_e,"sendTransaction","onError",k.UNKNOWN_CONNECT_WALLET_ERROR),l(e)}},r=hw({address:c.address,appConfig:oe,fundWalletConfig:i,chainIdOverride:g.chainId,comingFromSendTransactionScreen:!0});me({connectWallet:e,sendTransaction:{transactionRequest:g,transactingWallet:c,rootWallet:u,onSuccess:e=>{Ut(_e,"sendTransaction","onSuccess",e),o(e)},onFailure:e=>{Ut(_e,"sendTransaction","onError",k.TRANSACTION_FAILURE),l(e)},uiOptions:t||{},fundWalletConfig:i,requesterAppId:s},funding:r}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),ot=({transaction:e,connection:t,transactionOptions:r,uiOptions:n,wallet:i})=>new Promise((async(a,o)=>{let{requesterAppId:l}=n||{};if(!f||!y)return Ut(_e,"sendSolanaTransaction","onError",k.MUST_BE_AUTHENTICATED),void o(new x("User must be authenticated before signing with a Privy wallet",k.MUST_BE_AUTHENTICATED));let s=i?y.linkedAccounts.find((e=>"wallet"===e.type&&e.address===i.address)):Ft(y);if(!s)return Ut(_e,"sendSolanaTransaction","onError",k.EMBEDDED_WALLET_NOT_FOUND),void o(new x("Must have a Privy wallet before signing",k.EMBEDDED_WALLET_NOT_FOUND));he(!0);let d=i??_,c=await(d?.isConnected());if(!d||!c)throw Ut(_e,"sendSolanaTransaction","onError",k.EMBEDDED_WALLET_NOT_FOUND),new x(`Cannot sendSolanaTransaction before embedded wallet ${s.address} is connected`,k.EMBEDDED_WALLET_NOT_FOUND);oe.embeddedWallets.noPromptOnSignature?(n&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),(async()=>{let n=await Tv();if(!n||!ie)return Ut(_e,"sendSolanaTransaction","onError",k.EMBEDDED_WALLET_NOT_FOUND),void o(new x("Must have valid access token and Privy wallet to send transaction",k.EMBEDDED_WALLET_NOT_FOUND));try{if(!await mt.recoverEmbeddedSolanaWallet())return Ut(_e,"sendSolanaTransaction","onError",k.UNKNOWN_CONNECT_WALLET_ERROR),void o(new x("Unable to connect to wallet",k.UNKNOWN_CONNECT_WALLET_ERROR));if(oe.embeddedWallets.noPromptOnSignature){let{instructions:r}=await $g(e,t);r.every((e=>e.hasFunds))||(Ut(_e,"sendSolanaTransaction","onError",k.INSUFFICIENT_BALANCE),o(new x("Solana wallet has insufficient funds for this transaction.",k.INSUFFICIENT_BALANCE)))}let{signature:i,receipt:l}=await ky({accessToken:n,tx:e,connection:t,walletProxy:ie,transactionOptions:r}),s=Eg(i,l);Ut(_e,"sendSolanaTransaction","onSuccess",s),a(s)}catch(e){Ut(_e,"sendSolanaTransaction","onError",k.TRANSACTION_FAILURE),o(e)}})()):(me({connectWallet:{address:s.address,onCompleteNavigateTo:cr.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN,onFailure:e=>{Ut(_e,"sendSolanaTransaction","onError",k.UNKNOWN_CONNECT_WALLET_ERROR),o(e)}},sendSolanaTransaction:{transactionRequest:e,connection:t,transactionOptions:r,transactingWallet:s,onSuccess:e=>{Ut(_e,"sendSolanaTransaction","onSuccess",e),a(e)},onFailure:e=>{Ut(_e,"sendSolanaTransaction","onError",k.TRANSACTION_FAILURE),o(e)},uiOptions:n||{},requesterAppId:l},funding:void 0}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN))}));function lt(){return new Promise((async(e,t)=>{let r=await Tv();if(!r||!ie)throw Error("Must have valid access token to enroll in MFA");try{await ie.verifyMfa({accessToken:r}),e()}catch(e){t(e)}}))}let dt=e=>e?.linkedAccounts.filter((e=>null!==e.latestVerifiedAt&&!("wallet"===e.type&&"privy"===e.walletClientType))).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0],ct=e=>{let t=y?.linkedAccounts.filter((t=>t.type===e)).length??0,{displayName:r,loginMethod:n}=sf(e);if("passkey"===e&&t>=5||"passkey"!==e&&t>=1)throw Ut(_e,"linkAccount","onError",k.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:n}),new x(`User already has an account of type ${r} linked.`)};async function ut({showAutomaticRecovery:e=!1,legacySetWalletPasswordFlow:t=!1}){L(null);let r=t?"setWalletPassword":"setWalletRecovery";if(!f||!y)throw Ut(_e,r,"onError",k.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let n=yt(y);if(!n||!ie)throw Ut(_e,r,"onError",k.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");if(Ft(y))throw Error("Cannot set user-controlled recovery for user with Solana.");try{await lt()}catch(e){throw Ut(_e,r,"onError",k.MISSING_MFA_CREDENTIALS),e}return new Promise(((i,a)=>{he(!0);let o={onSuccess:e=>{Ut(_e,r,"onSuccess","user-passcode",e),i(e)},onFailure:e=>{Ut(_e,r,"onError",k.USER_EXITED_SET_PASSWORD_FLOW),a(e)},callAuthOnSuccessOnClose:!1},l="user-passcode"===n.recoveryMethod;me({setWalletPassword:o,createWallet:o,connectWallet:{onCompleteNavigateTo:hu({walletAction:"update",availableRecoveryMethods:oe.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:t,isResettingPassword:l,showAutomaticRecovery:e}),shouldForceMFA:!1,onFailure:e=>{Ut(_e,r,"onError",k.UNKNOWN_CONNECT_WALLET_ERROR),a(e)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:l}}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)}))}async function ht({appId:e,action:t}){let r=await Tv();if("link"===t&&!r)throw Ut(_e,"linkAccount","onError",k.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${e}`}),new x("User must be authenticated before linking an account.");if("login"===t&&r)throw Ut(_e,"login","onError",k.UNKNOWN_AUTH_ERROR),new x("Attempted to log in, but user is already logged in. Use a `link` helper instead.");Ie.current=`privy:${e}`,Oe.current=t;let n=window.open(void 0,void 0,rm({w:440,h:680}));return o.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:e}}),new Promise((async(r,i)=>{let{name:a,logoUrl:l}=await Jp({api:o.api,providerAppId:e,requesterAppId:oe.id});me({crossAppAuth:{appId:e,name:a,logoUrl:l,action:t,popup:n,onSuccess:r,onError:i}}),Le(cr.CROSS_APP_AUTH_SCREEN)}))}let pt={ready:h,authenticated:f,user:y,walletConnectors:o.connectors||null,connectWallet:e=>{e&&"target"in e&&e&&(e=void 0),me({externalConnectWallet:{walletList:e?.walletList&&e?.walletList.length>0?e.walletList:void 0,suggestedAddress:e?.suggestedAddress}}),Me(f?cr.CONNECT_ONLY_AUTHENTICATED_SCREEN:cr.CONNECT_ONLY_LANDING_SCREEN)},importWallet:async({privateKey:e})=>{Qe("siwe");let[t,r]=await Promise.all([mt.initializeWalletProxy(15e3),Tv()]);if(t&&r){await t.import({privateKey:e,accessToken:r});let n=Bt(await mt.refreshUser());if(!n)throw Ut(_e,"createWallet","onError",k.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return Ut(_e,"createWallet","onSuccess",n),n}throw new x("User is not authenticated")},linkWallet:Je,startCrossAppAuthFlow:ht,linkEmail:()=>{Qe("email"),ct("email"),Ie.current="email",Oe.current="link",Me(cr.LINK_EMAIL_SCREEN)},linkPhone:()=>{Qe("sms"),ct("phone"),Ie.current="sms",Oe.current="link",Me(cr.LINK_PHONE_SCREEN)},linkGoogle:async()=>{Qe("google"),ct("google_oauth"),Oe.current="link",await mt.initLoginWithOAuth("google")},linkTwitter:async()=>{Qe("twitter"),ct("twitter_oauth"),Oe.current="link",await mt.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Qe("discord"),ct("discord_oauth"),Oe.current="link",await mt.initLoginWithOAuth("discord")},linkGithub:async()=>{Qe("github"),ct("github_oauth"),Oe.current="link",await mt.initLoginWithOAuth("github")},linkSpotify:async()=>{Qe("spotify"),ct("spotify_oauth"),Oe.current="link",await mt.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Qe("instagram"),ct("instagram_oauth"),Oe.current="link",await mt.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Qe("tiktok"),ct("tiktok_oauth"),Oe.current="link",await mt.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Qe("linkedin"),ct("linkedin_oauth"),Oe.current="link",await mt.initLoginWithOAuth("linkedin")},linkApple:async()=>{Qe("apple"),ct("apple_oauth"),Oe.current="link",await mt.initLoginWithOAuth("apple")},linkPasskey:async()=>{Qe("passkey"),ct("passkey"),await mt.initLinkWithPasskey(),Me(cr.LINK_PASSKEY_SCREEN)},linkTelegram:async()=>{Qe("telegram"),ct("telegram"),Oe.current="link",Ie.current="telegram",await mt.initLoginWithTelegram(),Me(cr.TELEGRAM_AUTH_SCREEN)},linkFarcaster:async()=>{Qe("farcaster"),ct("farcaster"),await mt.initLoginWithFarcaster(),Oe.current="link",Ie.current="farcaster",Me(cr.AWAITING_FARCASTER_CONNECTION)},updateEmail:()=>{if(Qe("email"),!y?.email)throw new x("User does not have an email linked to their account.");Oe.current="link",Ie.current="email",Me(cr.UPDATE_EMAIL_SCREEN)},updatePhone:()=>{if(Qe("sms"),!y?.phone)throw new x("User does not have a phone number linked to their account.");Oe.current="link",Ie.current="sms",Me(cr.UPDATE_PHONE_SCREEN)},login:async e=>{e&&"target"in e&&e&&(e=void 0);let t="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!h){let e=await new Promise((e=>{ye((t=>e.bind(t)))}));if(ye(null),e)return void console.warn(t)}!y||y.isGuest?(Oe.current="login",me({login:e}),Le(cr.LANDING)):console.warn(t)},connectOrCreateWallet:async()=>{h||(await new Promise((e=>{ye((()=>e))})),ye(null)),f?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):Le(cr.CONNECT_OR_CREATE)},logout:async()=>{if(y&&o.clearProviderAcccessTokens(y),L(null),await o.logout(),y&&ie)try{await ie.clearMfa({userId:y.id})}catch(e){}w(null),g(!1),Ut(_e,"logout","onSuccess"),Oe.current=null,Ie.current=null,u(!1),qe.del(ce),qe.del(B(oe.id))},getAccessToken:()=>o.getAccessToken(),getEthereumProvider:()=>{if(!y||!y.wallet)return new Rl;let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=o.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new Rl},getEthersProvider:()=>{if(!y||!y.wallet)return new i(new Dl(new Rl));let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=o.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new i(new Dl(e&&t?t.proxyProvider:new Rl))},getWeb3jsProvider:()=>{if(!y||!y.wallet)return new Ul(new Rl);let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=o.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new Ul(e&&t?t.proxyProvider:new Rl)},unlinkWallet:async e=>{let t;return w(t=e.startsWith("0x")?await o.unlinkEthereumWallet(e):await o.unlinkSolanaWallet(e)),t},unlinkEmail:async e=>{let t=await o.unlinkEmail(e);return w(t),t},unlinkPhone:async e=>{let t=await o.unlinkPhone(e);return w(t),t},unlinkGoogle:async e=>{let t=await o.unlinkOAuth("google",e);return w(t),t},unlinkTwitter:async e=>{let t=await o.unlinkOAuth("twitter",e);return w(t),t},unlinkDiscord:async e=>{let t=await o.unlinkOAuth("discord",e);return w(t),t},unlinkGithub:async e=>{let t=await o.unlinkOAuth("github",e);return w(t),t},unlinkSpotify:async e=>{let t=await o.unlinkOAuth("spotify",e);return w(t),t},unlinkInstagram:async e=>{let t=await o.unlinkOAuth("instagram",e);return w(t),t},unlinkTiktok:async e=>{let t=await o.unlinkOAuth("tiktok",e);return w(t),t},unlinkLinkedIn:async e=>{let t=await o.unlinkOAuth("linkedin",e);return w(t),t},unlinkApple:async e=>{let t=await o.unlinkOAuth("apple",e);return w(t),t},unlinkFarcaster:async e=>{let t=await o.unlinkFarcaster(e);return w(t),t},unlinkTelegram:async e=>{let t=await o.unlinkTelegram(e);return w(t),t},unlinkPasskey:async e=>{let t=await o.unlinkPasskey(e);return w(t),t},unlinkCrossAppAccount:async({subject:e})=>{let t=y?.linkedAccounts.find((t=>"cross_app"===t.type&&t.subject===e))?.providerApp;if(!t)throw new x("Invalid subject");o.storeProviderAccessToken(t.id,null);let r=await o.unlinkOAuth(`privy:${t.id}`,e);return w(r),r},setActiveWallet:async e=>{let t=v.find((t=>n(t.address)===n(e))),r=y?.linkedAccounts.find((t=>"wallet"===t.type&&n(t.address)===n(e)));if(t&&await t.isConnected())if(t.linked){let e=Object.assign({},y);e.wallet=r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,imported:r.imported,walletIndex:r.walletIndex},w(e)}else t.loginOrLink();else me({externalConnectWallet:{suggestedAddress:e}}),Je()},forkSession:()=>o.forkSession(),createWallet:async e=>{if(e&&"target"in e&&e&&(e=void 0),!f||!y)throw Ut(_e,"createWallet","onError",k.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return it(y,15e3,e)},setWalletRecovery:async e=>ut({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:e?.showAutomaticRecovery??!1}),setWalletPassword:async()=>ut({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(e,t,r)=>new Promise((async(n,i)=>{let{requesterAppId:a}=t||{};if(!f||!y)return Ut(_e,"signMessage","onError",k.MUST_BE_AUTHENTICATED),void i(Error("User must be authenticated before signing with a Privy wallet"));let l=r??yt(y)?.address;if(!l)throw new x("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:d}=Gt(y,l);if(!s||!d)return Ut(_e,"signMessage","onError",k.EMBEDDED_WALLET_NOT_FOUND),void i(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return Ut(_e,"signMessage","onError",k.INVALID_MESSAGE),void i(Error("Message must be a non-empty string"));he(!0);let c=async()=>{if(!f)throw Error("User must be authenticated before signing with a Privy wallet");let t=await Tv();if(!ie||!t||!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");o.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:s.address,requesterAppId:a}});let{response:r}=await ie.rpc({accessToken:t,address:d.address,hdWalletIndex:s.walletIndex??void 0,requesterAppId:a,request:{method:"personal_sign",params:[e,s.address]}}),n=r.data;return o.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:s.address,requesterAppId:a}}),n};if(oe.embeddedWallets.noPromptOnSignature||Re.current){t&&oe.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let e=await c();Ut(_e,"signMessage","onSuccess",e),n(e)}catch(e){Ut(_e,"signMessage","onError",k.UNABLE_TO_SIGN),i(e??new rr("Unable to sign message"))}}else me({signMessage:{method:"personal_sign",data:e,confirmAndSign:c,onSuccess:e=>{Ut(_e,"signMessage","onSuccess",e),n(e)},onFailure:e=>{Ut(_e,"signMessage","onError",k.UNABLE_TO_SIGN),i(e)},uiOptions:t||{}},connectWallet:{onCompleteNavigateTo:cr.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{Ut(_e,"signMessage","onError",k.UNKNOWN_CONNECT_WALLET_ERROR),i(e)},address:d.address}}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)})),signTypedData:(e,t,r)=>new Promise((async(n,i)=>{let{requesterAppId:a}=t||{};if(!f||!y)return Ut(_e,"signTypedData","onError",k.MUST_BE_AUTHENTICATED),void i(Error("User must be authenticated before signing with a Privy wallet"));let l=r??yt(y)?.address;if(!l)throw new x("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:d}=Gt(y,l);if(!d||!s)return Ut(_e,"signTypedData","onError",k.EMBEDDED_WALLET_NOT_FOUND),void i(Error("Must have a Privy wallet before signing"));he(!0);let c=Ke(e),u=async()=>{if(!f)throw Error("User must be authenticated before signing with a Privy wallet");let e=await Tv();if(!ie||!e||!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");o.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:s.address,requesterAppId:a}});let{response:t}=await ie.rpc({accessToken:e,address:d.address,hdWalletIndex:s.walletIndex??void 0,requesterAppId:a,request:{method:"eth_signTypedData_v4",params:[s.address,c]}}),r=t.data;return o.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:s.address,requesterAppId:a}}),r};if(Re.current||oe.embeddedWallets.noPromptOnSignature||oe.legacyWalletUiConfig){t&&oe.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let e=await u();Ut(_e,"signTypedData","onSuccess",e),n(e)}catch(e){Ut(_e,"signTypedData","onError",k.UNABLE_TO_SIGN),i(e??new rr("Unable to sign message"))}}else me({signMessage:{method:"eth_signTypedData_v4",data:c,confirmAndSign:u,onSuccess:e=>{Ut(_e,"signTypedData","onSuccess",e),n(e)},onFailure:e=>{Ut(_e,"signTypedData","onError",k.UNABLE_TO_SIGN),i(e)},uiOptions:t||{}},connectWallet:{onCompleteNavigateTo:cr.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{Ut(_e,"signMessage","onError",k.UNKNOWN_CONNECT_WALLET_ERROR),i(e)}}}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)})),sendTransaction:async(e,t,r,n)=>{let i=await at(e,t,r,n);return cw(await i.wait())},sendSolanaTransaction:async(e,t,r,n)=>await ot({transaction:e,connection:t,transactionOptions:n,uiOptions:r,wallet:_??void 0}),exportWallet:e=>new Promise((async(t,i)=>{if(!f||!y)return void i(Error("User must be authenticated before exporting their Privy wallet"));e&&"target"in e&&e&&(e=void 0);let a=e?.address,l=y.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"ethereum"===e.chainType)),s=a?l.find((e=>e.address===n(a))):l.find((e=>!e.imported))||l[0];if(!s)return void i(Error("Must have a Privy wallet before exporting"));he(!0);let d={onCompleteNavigateTo:cr.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:i,address:s.address,shouldForceMFA:!0};me(pe),await Tv()&&ie?ie?(me({keyExport:{appId:r.appId,appClientId:r.clientId,origin:o.apiUrl,wallet:s,onSuccess:t,onFailure:i},connectWallet:d}),Me(cr.EMBEDDED_WALLET_CONNECTING_SCREEN)):i(Error("Must have a Privy wallet before exporting")):i(Error("Must have valid access token to enroll in MFA"))})),promptMfa:lt,async init(e){switch(e){case"sms":return void await o.initMfaSmsVerification();case"passkey":return await o.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${e}`)}},async submit(e,t){switch(e){case"totp":case"sms":if("string"!=typeof t)throw new x("Invalid MFA code");ke.current?.resolve({mfaMethod:e,mfaCode:t,relyingParty:window.origin}),await new Promise(((e,t)=>{Te.current={resolve:e,reject:t}}));break;case"passkey":if("string"==typeof t)throw new x("Invalid authenticator response");let r=await import("@simplewebauthn/browser"),n=(e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}))(await r.startAuthentication(t));ke.current?.resolve({mfaMethod:e,mfaCode:n,relyingParty:window.origin}),await new Promise(((e,t)=>{Te.current={resolve:e,reject:t}}));break;default:throw ke.current?.reject(new x("Unsupported MFA method")),new x(`Unsupported MFA method: ${e}`)}},cancel(){ke.current?.reject(new x("MFA canceled"))},async initEnrollmentWithSms(e){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to enroll in MFA");await ie.initEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber})},enrollInMfa:e=>new Promise(((t,r)=>{if(!e)return mt.closePrivyModal(),void t();oe.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),me({mfaEnrollmentFlow:{mfaMethods:oe.mfa.methods,onSuccess:t,onFailure:r}}),Me(cr.MFA_ENROLLMENT_FLOW_SCREEN)})),async initEnrollmentWithTotp(){let e=await Tv();if(!e||!ie)throw Error("Must have valid access token to enroll in MFA");let t=await ie.initEnrollMfa({method:"totp",accessToken:e});return{secret:t.secret,authUrl:t.authUrl}},async submitEnrollmentWithSms(e){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to enroll in MFA");await ie.submitEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber,code:e.mfaCode}),w(await o.getAuthenticatedUser())},async submitEnrollmentWithTotp(e){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to enroll in MFA");await ie.submitEnrollMfa({method:"totp",accessToken:t,code:e.mfaCode}),w(await o.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:e}){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to enroll in MFA");await ie.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:e}),w(await o.getAuthenticatedUser())},async unenroll(e){let t=await Tv();if(!t||!ie)throw Error("Must have valid access token to remove MFA");"passkey"===e?await ie.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:[]}):await ie.unenrollMfa({method:e,accessToken:t}),w(await o.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{let e=await Tv(),t=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!e)throw Error("Must have valid access token to connect with Farcaster");if(!ie||!t)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");let r=await ie.initFarcasterSigner({address:t.address,hdWalletIndex:null,accessToken:e,mfaCode:null,mfaMethod:null,relyingParty:window.origin});"approved"===r.status&&w(await o.getAuthenticatedUser()||y||null),me({farcasterSigner:r}),Me(cr.AWAITING_FARCASTER_SIGNER)},getFarcasterSignerPublicKey:async()=>{let e,t=await Tv(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!ie||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");if(!y.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");return e=y.farcaster.signerPublicKey.slice(2),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},signFarcasterMessage:async e=>{let t=await Tv(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!ie||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await mt.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");if(!y.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");let n=await import("@simplewebauthn/browser"),i=await ie.signFarcasterMessage({address:r.address,hdWalletIndex:null,accessToken:t,mfaCode:null,mfaMethod:null,payload:{hash:n.bufferToBase64URLString(e)},fid:BigInt(y.farcaster.fid),relyingParty:window.origin});return new Uint8Array(n.base64URLStringToBuffer(i.signature))},createGuestAccount:async()=>{if(y&&!y.isGuest)throw Error("User cannot already be authenticated to create a guest account");return y?.isGuest?y:mt.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:F,async loginWithCode(e){await mt.loginWithCode(e)},initLoginWithEmail:e=>mt.initLoginWithEmail(e),initLoginWithSms:e=>mt.initLoginWithSms(e),otpState:X,fundWallet:(e,t)=>mt.fundWallet(e,t),initLoginWithHeadlessOAuth:(e,t)=>mt.initLoginWithHeadlessOAuth(e,t),loginWithHeadlessOAuth:e=>mt.loginWithHeadlessOAuth(e),generateSiweMessage:({address:e,chainId:t})=>mt.generateSiweMessage({address:e,chainId:t}),async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){Qe("siwe"),await mt.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})},signMessageWithCrossAppWallet:(e,{address:t})=>em({user:y,client:o,address:t,requesterAppId:oe.id,request:{method:"personal_sign",params:[e,t]},reconnect:ht}),signTypedDataWithCrossAppWallet(e,{address:t}){let r=Ke(e);return em({user:y,client:o,address:t,requesterAppId:oe.id,request:{method:"eth_signTypedData_v4",params:[t,r]},reconnect:ht})},sendTransactionWithCrossAppWallet:(e,{address:t})=>em({user:y,client:o,address:t,requesterAppId:oe.id,request:{method:"eth_sendTransaction",params:[e]},reconnect:ht}),isModalOpen:c,mfaMethods:oe.mfa.methods};bv=pt.signMessage,Ev=pt.signTypedData,$v=async(...e)=>{let t=await at(...e);return oe.embeddedWallets.waitForTransactionConfirmation&&await t.wait(),t};let mt={isNewUserThisSession:O,pendingTransaction:null,walletConnectionStatus:G,connectors:o.connectors?.walletConnectors??[],solanaWallets:b,rpcConfig:oe.rpcConfig,chains:oe.chains,appId:r.appId,showFiatPrices:"native-token"!==oe.embeddedWallets.priceDisplay.primary,clientAnalyticsId:o.clientAnalyticsId,customAuthStatus:xe,noPromptOnSignature:Re,emailOtpState:Y,setEmailOtpState:Z,smsOtpState:X,setSmsOtpState:Q,oAuthState:re,setOAuthState:ne,siweState:J,setSiweState:te,nativeTokenSymbolForChainId:e=>oe.chains.find((t=>t.id===Number(e)))?.nativeCurrency.symbol,initializeWalletProxy:async e=>{if(ie)return ie;let t=new Promise((e=>{ve((()=>t=>e(t)))})),r=new Promise((t=>setTimeout((()=>t(null)),e))),n=await Promise.race([t,r]);return ve(null),n},getAuthFlow:()=>o.authFlow,getAuthMeta:()=>o.authFlow?.meta,client:o,closePrivyModal:async(e={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let t,n=h&&f&&y;n&&Ie.current&&(t=dt(y)),"login"===Oe.current?e.shouldCallAuthOnSuccess&&n&&Ie.current?(Ut(_e,"login","onComplete",y,O,!1,Ie.current,t??null),r.onSuccess?.(y,O)):Ut(_e,"login","onError",k.USER_EXITED_AUTH_FLOW):"link"===Oe.current&&t&&(e.isSuccess&&n&&Ie.current?Ut(_e,"linkAccount","onSuccess",y,Ie.current,t):Ie.current&&Ut(_e,"linkAccount","onError",k.USER_EXITED_LINK_FLOW,{linkMethod:Ie.current}));let i=M&&pw.includes(M),a=M===cr.ERROR_SCREEN&&pe.errorModalData&&pw.includes(pe.errorModalData.previousScreen);if((i||a)&&pe.funding){let e,t=mw[M]??null,n=Ve(pe.funding.chain.id,oe.chains,oe.rpcConfig,{appId:r.appId});try{e=(await n.getBalance(pe.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}Ut(_e,"fundWallet","onUserExited",{address:pe.funding.address,chain:pe.funding.chain,fundingMethod:t,balance:e})}me({...pe,externalConnectWallet:{suggestedAddress:void 0}}),Oe.current=null,Ie.current=null,R(!1),u(!1),setTimeout((()=>{o.authFlow=void 0}),200),o.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:e})=>new Promise((async(t,r)=>{let n=async()=>{let t=await o.getAccessToken();if(!t)throw Error("User must be authenticated to use their embedded wallet.");if(!_)throw Error("User must have an embedded Solana wallet to sign messages for Solana.");let r=mt.walletProxy??await mt.initializeWalletProxy(15e3);if(!r)throw Error("Failed to initialize embedded wallet proxy.");let{response:n}=await r.rpcSolana({accessToken:t,publicKey:_.address,request:{method:"signMessage",params:{message:e}}});return n.data.signature};if(oe.embeddedWallets.noPromptOnSignature||Re.current)try{let e=await n();t({signature:e})}catch(e){r(e)}else me({signMessage:{method:"solana_signMessage",data:e,confirmAndSign:n,onSuccess:e=>{t({signature:e})},onFailure:e=>{r(e)},uiOptions:{}}}),Le(cr.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN)})),openPrivyModal:Me,connectWallet:Ge,initLoginWithWallet:async(e,t,r)=>{Bl(e)?(Ie.current="siwe",He(e,t,r)):(Ie.current="siws",ze(e,t))},loginWithWallet:async()=>{let e,t,r;if(!h)throw new D;if(o.authFlow instanceof Al?e="siwe":o.authFlow instanceof kl&&(e="siws"),!e)throw new x("Must initialize SIWE/SIWS flow first.");if(null!==await o.getAccessToken())try{({user:t}=await o.link()),Ie.current=e}catch(t){throw Ut(_e,"linkAccount","onError",t.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{({user:t,isNewUser:r}=await o.authenticate()),Ie.current=e}catch(e){throw Ut(_e,"login","onError",e.privyErrorCode||k.GENERIC_CONNECT_WALLET_ERROR),e}w(t||y||null),R(r||!1),g(!0)},initLoginWithFarcaster:async(e,t)=>{let r=new el(e,t);o.startAuthFlow(r);try{Ie.current="farcaster",await r.initializeFarcasterConnect()}catch(e){throw"login"===Oe.current?Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR):"link"===Oe.current&&Ut(_e,"linkAccount","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),e}},loginWithFarcaster:async()=>{let e,t;if(!h)throw new D;if(!(o.authFlow instanceof el))throw new x("Must initialize Farcaster flow first.");if(null!==await o.getAccessToken())try{({user:e}=await o.link()),Ie.current="farcaster"}catch(e){throw Ut(_e,"linkAccount","onError",e.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),e}else try{({user:e,isNewUser:t}=await o.authenticate()),Ie.current="farcaster"}catch(e){throw Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR),e}w(e||null),R(t||!1),g(!0)},async loginWithGuestAccountFlow(){let e=new rl(this.appId);o.startAuthFlow(e);try{Oe.current="login",Ie.current="guest";let{user:e,isNewUser:t}=await o.authenticate();if(t=t||!1,!e)throw new x("Unable to authenticate guest account");if(st(e,oe.embeddedWallets.createOnLogin))try{await it(e,15e3),e=await mt.refreshUser()}catch(t){w(e),console.warn("Unable to create embedded wallet for guest account")}else w(e);return R(t),g(!0),Ut(_e,"login","onComplete",e,t,!1,"guest",null),e}catch(e){throw Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR),e}},async crossAppAuthFlow({appId:e,popup:t,action:r}){let n=`privy:${e}`;Ie.current=n;let{url:i,stateCode:a,codeVerifier:l}=await async function({api:e,appId:t}){let r=nl(),n=il(),i=await al(r);try{let{url:a}=await e.post(Uo,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:i,state_code:n});return{url:a,stateCode:n,codeVerifier:r}}catch(e){throw A(e)}}({api:o.api,appId:e});if(!i)throw o.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:e}}),new x("No authorization URL returned for cross-app auth.");try{let s=await async function({url:e,popup:t}){return t.location=e,new Promise(((e,r)=>{let n,i=setTimeout((()=>{r(new x("Authorization request timed out after 2 minutes.")),a()}),12e4);function a(){t?.close(),window.removeEventListener("message",l)}let o=setInterval((()=>{t?.closed&&!n&&(a(),clearInterval(o),clearTimeout(i),r(new x("User rejected request")))}),300);function l(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(clearTimeout(i),e(t.data),a()),"PRIVY_OAUTH_ERROR"===t.data.type&&(clearTimeout(i),r(new x(t.data.error)),a()),t.data.type===wv&&((n=new BroadcastChannel(yv)).onmessage=l))}window.addEventListener("message",l)}))}({url:i,popup:t,provider:n}),d=s.stateCode,c=s.authorizationCode;if(d!==a)throw o.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:n,storedStateCode:a??"",returnedStateCode:d??""}}),new x("Unexpected auth flow. This may be a phishing attempt.",void 0,k.OAUTH_UNEXPECTED);let u=await async function({appId:e,stateCode:t,codeVerifier:r,authorizationCode:n,action:i,client:a}){if(!n||!t)throw new x("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===n)throw new x("User denied confirmation during cross-app auth flow");try{let o=new Qp({authorizationCode:n,stateCode:t,codeVerifier:r,provider:`privy:${e}`});a.startAuthFlow(o);let l="link"===i?await a.link():await a.authenticate(),s=l.oAuthTokens?.accessToken;return console.debug(),s}catch(e){let t=A(e);if(t.privyErrorCode)throw new x(t.message||"Invalid code during cross-app auth flow.",void 0,t.privyErrorCode);if("User denied confirmation during cross-app auth flow"===t.message)throw new x("Invalid code during cross-app auth flow.",void 0,k.OAUTH_USER_DENIED);throw new x("Invalid code during cross-app auth flow.",void 0,k.UNKNOWN_AUTH_ERROR)}}({appId:e,codeVerifier:l,stateCode:d,authorizationCode:c,action:r,client:o});u&&o.storeProviderAccessToken(e,u);let h=await mt.refreshUser();if(!h)throw new x("Unable to update user");return o.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:e}}),h}catch(e){throw o.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:e.toString(),provider:n}}),e}},async initLoginWithOAuth(e,t,r){if(Ie.current=e,!je())return void Le(cr.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);if("google"===e&&Oc(window.navigator.userAgent))return void Le(cr.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);"twitter"===e&&window.opener&&window.opener.postMessage({type:wv},"*"),qe.del(H),qe.del(z);let n=new ll({provider:e,disableSignup:!!r});t&&n.addCaptchaToken(t),o.startAuthFlow(n);let i=await o.authFlow.getAuthorizationUrl();i&&i.url&&("twitter"===e&&$&&(i.url=i.url.replace("x.com","twitter.com")),window.location.assign(i.url))},async initLoginWithTelegram(e,t){if(!h)throw new D;Ie.current="telegram";let r=new Sl(e,t);o.startAuthFlow(r),r.meta.telegramWebAppData=void 0,r.meta.telegramAuthResult=await new Promise(((e,t)=>oe.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:oe.loginConfig.telegramAuthConfiguration.botId,request_access:!0},(r=>r?e(r):t(new x("Telegram auth failed or was canceled by the client")))):t(new x("Telegram was not initialized")):t(new x("Telegram Auth configuration is not loaded"))))},async loginWithTelegram(){let e,t;if(!(o.authFlow instanceof Sl))throw new x("Must initialize Telegram flow before calling loginWithTelegram");if("login"===Oe.current)try{let r=await o.authenticate();e=r.user,t=r.isNewUser,Ie.current="telegram"}catch(e){throw Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR),e}else{if("link"!==Oe.current)throw new x("Unknown auth intent");try{e=(await o.link()).user,Ie.current="telegram"}catch(e){throw Ut(_e,"linkAccount","onError",e.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),e}}w(e),R(t||!1),g(!0)},async recoveryOAuthFlow(e,t,r){let n,i;function a(t){if(!t)throw o.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:e}}),new x("Recovery OAuth failed")}switch(e){case"google-drive":{let t,l,{url:s,codeVerifier:d,stateCode:c}=await mu({api:Cv.api,provider:e});a(s);try{let n=await vv({url:s,popup:r,provider:e});if(t=n.stateCode,l=n.authorizationCode,t!==c)throw o.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:c??"",returnedStateCode:t??""}}),new x("Unexpected auth flow. This may be a phishing attempt.",void 0,k.OAUTH_UNEXPECTED)}catch(t){throw o.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:e}}),new x("Recovery OAuth failed")}[n,i]=await Promise.all([Tv(),fu({api:Cv.api,provider:e,codeVerifier:d,stateCode:t,authorizationCode:l})]);break}case"icloud":{let{url:t}=await mu({api:Cv.api,provider:e});a(t);let{ckWebAuthToken:o}=await vv({url:t,popup:r,provider:e});i=o,n=await Tv()}}if(!ie)throw new x("Cannot connect to wallet proxy");if(!n)throw new x("Unable to authorize user");switch(t){case"recover":let t=pe.recoverWallet?.privyWallet?.address;if(!t)throw new x("Recovery OAuth failed");o.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:t,recoveryMethod:e}}),await ie.recover({address:t,accessToken:n,recoveryAccessToken:i,recoveryMethod:e}),o.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t,recoveryMethod:e}});break;case"create-wallet":o.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await ie.create({accessToken:n,recoveryAccessToken:i,recoveryMethod:e});let r=yt(await mt.refreshUser());if(!r)throw Ut(_e,"createWallet","onError",k.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");o.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:r.address}}),Ut(_e,"createWallet","onSuccess",r);break;case"set-recovery":let a=yt(y);if(!a)throw Ut(_e,"setWalletRecovery","onError",k.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");o.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:a.address,existingRecoveryMethod:a.recoveryMethod,targetRecoveryMethod:e}}),await ie.setRecovery({address:a.address,accessToken:n,recoveryAccessToken:i,recoveryMethod:e});let l=yt(await mt.refreshUser());if(!l)throw Ut(_e,"createWallet","onError",k.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");o.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:a.address,existingRecoveryMethod:a.recoveryMethod,targetRecoveryMethod:e}}),Ut(_e,"setWalletRecovery","onSuccess",e,l);break;default:throw new x("Unsupported recovery action")}},async loginWithOAuth(e){let t,r,n;if(!(o.authFlow instanceof ll))throw new x("Must initialize OAuth flow before calling loginWithOAuth");let i=qe.get(j),a=o.authFlow.meta.stateCode;if(i!==a)throw o.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:i??"",returnedStateCode:a??""}}),new x("Unexpected auth flow. This may be a phishing attempt.",void 0,k.OAUTH_UNEXPECTED);if(null!==await o.getAccessToken())try{let r=await o.link();t=r.user,n=r.oAuthTokens,Ie.current=e}catch(t){throw Ut(_e,"linkAccount","onError",t.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{let i=await o.authenticate();t=i.user,r=i.isNewUser,n=i.oAuthTokens,Ie.current=e}catch(t){throw"login"===Oe.current?Ut(_e,"login","onError",t.privyErrorCode||k.UNKNOWN_AUTH_ERROR):"link"===Oe.current&&Ut(_e,"linkAccount","onError",t.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}return w(t),R(r||!1),g(!0),n&&t&&Ut(_e,"oAuthAuthorization","onOAuthTokenGrant",n,{user:t}),n},passkeyAuthState:V,setPasskeyAuthState:K,async initLoginWithPasskey(e){let t=new $l(e,K);o.startAuthFlow(t),Oe.current="login";try{Ie.current="passkey",K({status:"generating-challenge"}),await t.initAuthenticationFlow(),K({status:"awaiting-passkey"})}catch(e){throw K({status:"error",error:e}),Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR),e}},async loginWithPasskey(){let e,t;if(!h)throw new D;if(!(o.authFlow instanceof $l))throw new x("Must initialize Passkey flow first.");if("passkey"!==Ie.current){let e=new x("Must init login with Passkey flow first.");throw K({status:"error",error:e}),e}let r=await Tv();try{Ie.current="passkey",K({status:"awaiting-passkey"}),({user:e,isNewUser:t}=await o.authenticate())}catch(e){throw K({status:"error",error:e}),Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR),e}w(e),R(t||!1),g(!0),K({status:"done"});let n=e?.linkedAccounts.find((({type:e})=>"passkey"===e))||null;return{user:e,isNewUser:t||!1,wasAlreadyAuthenticated:!!r,loginAccount:n}},async initLinkWithPasskey(e){let t=new $l(e);o.startAuthFlow(t),Oe.current="link",Ie.current="passkey";try{await t.initLinkFlow()}catch(e){throw Ut(_e,"linkAccount","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),e}},async linkWithPasskey(){let e;if(!h)throw new D;if(!(o.authFlow instanceof $l))throw new x("Must initialize Passkey flow first.");if("passkey"!==Ie.current)throw new x("Must init login with Passkey flow first.");try{Ie.current="passkey",({user:e}=await o.link())}catch(e){throw Ut(_e,"linkAccount","onError",e.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),e}return w(e||y||null),e},async initLoginWithHeadlessOAuth(e,t){if(!je())throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");if("google"===e&&Oc(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let r=new ll({provider:e,headless:!0,disableSignup:!1});t&&r.addCaptchaToken(t),ne({status:"loading"});let n=await o.startAuthFlow(r).getAuthorizationUrl();n?.url&&window.location.assign(n.url)},async loginWithHeadlessOAuth(e){let t,r,n;W(!0),ne({status:"loading"}),o.startAuthFlow(new ll(e));let i=qe.get(j),a=e.stateCode;if(i!==a)throw o.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e.provider,storedStateCode:i??"",returnedStateCode:a??""}}),W(!1),new x("Unexpected auth flow. This may be a phishing attempt.",void 0,k.OAUTH_UNEXPECTED);if(null!==await o.getAccessToken())try{({user:t,oAuthTokens:n}=await o.link()),Ie.current=e.provider;let r=dt(t);t&&r&&Ut(_e,"linkAccount","onSuccess",t,Ie.current,r)}catch(t){throw W(!1),Ut(_e,"linkAccount","onError",t.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:e.provider}),t}else try{({user:t,isNewUser:r,oAuthTokens:n}=await o.authenticate()),Ie.current=e.provider;let i=dt(t);t&&i&&void 0!==r&&"login"===Oe.current&&Ut(_e,"login","onComplete",t,r,!1,Ie.current,i)}catch(e){throw W(!1),ne({status:"error",error:e}),Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR),e}return w(t),R(r||!1),g(!0),W(!1),ne({status:"done"}),n&&t&&Ut(_e,"oAuthAuthorization","onOAuthTokenGrant",n,{user:t}),t??void 0},initLoginWithEmail:async(e,t,r)=>{let n=new Ho(e,t,r);o.startAuthFlow(n);try{Ie.current="email",Z({status:"sending-code"}),await n.sendCodeEmail(),Z({status:"awaiting-code-input"})}catch(e){throw Z({status:"error",error:e}),"login"===Oe.current?Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR):"link"===Oe.current&&Ut(_e,"linkAccount","onError",e.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),e}},initUpdateEmail:async(e,t,r)=>{let n=new zo(e,t,r);o.startAuthFlow(n),await n.sendCodeEmail()},initUpdatePhone:async(e,t,r)=>{let n=new _l(e,t,r);o.startAuthFlow(n),await n.sendSmsCode()},initLoginWithSms:async(e,t,r)=>{Q({status:"sending-code"});let n=new Tl(e,t,r);o.startAuthFlow(n);try{Ie.current="sms",await n.sendSmsCode(),Q({status:"awaiting-code-input"})}catch(e){throw Q({status:"error",error:e}),"login"===Oe.current?Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR):"link"===Oe.current&&Ut(_e,"linkAccount","onError",e.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),e}},resendEmailCode:async()=>{await(o.authFlow?.sendCodeEmail())},resendSmsCode:async()=>{await(o.authFlow?.sendSmsCode())},loginWithCode:async e=>{let t,r;function n(e){o.authFlow instanceof Ho?Z(e):o.authFlow instanceof Tl&&Q(e)}if(n({status:"submitting-code"}),!h){let e=new D;throw n({status:"error",error:e}),e}if(o.authFlow instanceof Ho)o.authFlow.meta.emailCode=e.trim();else{if(!(o.authFlow instanceof Tl)){let e=new x("Must initialize a passwordless code flow first");throw n({status:"error",error:e}),e}o.authFlow.meta.smsCode=e.trim()}let i=await Tv();if("link"===Oe.current)try{({user:t}=await o.link())}catch(e){throw n({status:"error",error:e}),Ut(_e,"linkAccount","onError",e.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:Ie.current}),e}else try{({user:t,isNewUser:r}=await o.authenticate())}catch(e){throw n({status:"error",error:e}),Ut(_e,"login","onError",e.privyErrorCode||k.UNKNOWN_AUTH_ERROR),e}let a=t||y;w(a||null),R(r||!1),g(!0),n({status:"done"});let l=null;return o.authFlow instanceof Ho?l=a?.linkedAccounts.find((({type:e})=>"email"===e))||null:o.authFlow instanceof Tl&&(l=a?.linkedAccounts.find((({type:e})=>"phone"===e))||null),{user:a,isNewUser:r||!1,wasAlreadyAuthenticated:!!i,linkedAccount:l}},generateSiweMessage:async({address:e,chainId:t,captchaToken:r})=>{Oe.current="link",Ie.current="siwe",te({status:"generating-message"});let n=await o.generateSiweNonce({address:e,captchaToken:r});return te({status:"awaiting-signature"}),xl({address:e,chainId:t.replace("eip155:",""),nonce:n})},linkSmartWallet:async({message:e,signature:t,smartWalletType:r})=>{let n;Oe.current=null,Ie.current=null;try{n=await o.linkSmartWallet({message:e,signature:t,smartWalletType:r}),n=await mt.refreshUser()??n}catch(e){throw e}w(n||y||null)},linkWithSiwe:async({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})=>{let a,l=null;try{te({status:"submitting-signature"}),a=await o.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}),a=await mt.refreshUser()??a,te({status:"done"}),(l=dt(a)||null)&&Ut(_e,"linkAccount","onSuccess",a,"siwe",l)}catch(e){throw Ut(_e,"linkAccount","onError",e.privyErrorCode||k.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Oe.current=null,Ie.current=null,te({status:"error",error:e}),e}let s=a||y;return w(s||null),Oe.current=null,Ie.current=null,{user:s,linkedAccount:l}},refreshUser:async()=>{let e=await o.getAuthenticatedUser();return g(!!e),w(e),e},walletProxy:ie,createAnalyticsEvent:({eventName:e,payload:t,timestamp:r})=>o.createAnalyticsEvent({eventName:e,payload:t,timestamp:r}),acceptTerms:async()=>{let e=await o.acceptTerms();return w(e),e},getUsdTokenPrice:e=>o.getUsdTokenPrice(e),getUsdPriceForSol:()=>o.getUsdPriceForSol(),recoverEmbeddedEthereumWallet:async e=>new Promise((async(t,r)=>{let n=yt(e?.user??y)||Bt(e?.user??y),i=await Tv();if(i&&ie&&n){he(!0);try{await ie.connect({accessToken:i,address:n.address}),t(!0)}catch(e){au(e)&&"privy"===n.recoveryMethod?(o.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:n.address}}),(await ie.recover({address:n.address,accessToken:i,recoveryMethod:n.recoveryMethod})).address||r(Error("Unable to recover wallet")),o.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:n.address}}),t(!0)):au(e)&&"privy"!==n.recoveryMethod?(me({recoverWallet:{privyWallet:n,onFailure:r,onSuccess:()=>t(!0)},recoveryOAuthStatus:{provider:n.recoveryMethod,action:"recover"}}),Me(pu(n.recoveryMethod))):r(e)}}else r(Error("Must have valid access token and Privy wallet to recover wallet"))})),embeddedSolanaWallet:_,createEmbeddedSolanaWallet:async()=>{he(!0);let e=await Tv(),t=await mt.refreshUser(),r=Ft(t),n=yt(t);if(!t||!e)throw new x("User must be logged in to create a Solana wallet");if(r)throw new x("User already has an embedded Solana wallet.");if(n){if("privy"!==n.recoveryMethod)throw new x("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");await mt.recoverEmbeddedEthereumWallet({user:t})}let i=await mt.initializeWalletProxy(15e3);if(!i)throw new x("Unable to initialize wallet proxy");o.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await i.createSolana({accessToken:e,ethereumAddress:n?.address});let t=await mt.refreshUser(),r=Ft(t);if(!r)throw new x("Could not get Solana wallet for user");return o.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:r.address}}),r}catch(e){throw o.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new x("Failed to create Solana embedded wallet with error ",e)}},exportSolanaWallet:e=>new Promise((async(t,n)=>{if(!f||!y)return void n(Error("User must be authenticated before exporting their Privy wallet"));let i=e?.address,a=y.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"solana"===e.chainType)),l=i?a.find((e=>e.address.toLowerCase()===i.toLowerCase())):a.find((e=>!e.imported))||a[0];l?(he(!0),await Tv()&&ie?ie?(await mt.recoverEmbeddedSolanaWallet(),me({keyExport:{appId:r.appId,appClientId:r.clientId,origin:o.apiUrl,wallet:l,onSuccess:t,onFailure:n}}),Me(cr.EMBEDDED_WALLET_KEY_EXPORT_SCREEN)):n(Error("Must have a Privy wallet before exporting")):n(Error("Must have valid access token to enroll in MFA"))):n(Error("Must have a Privy wallet before exporting"))})),recoverEmbeddedSolanaWallet:async()=>new Promise((async(e,t)=>{let r=Ft(y),n=await Tv();if(n&&ie&&r){he(!0);try{await ie.connectSolana({accessToken:n,publicKey:r.address}),e(!0)}catch(i){au(i)&&"privy"===r.recoveryMethod?(o.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:r.address}}),(await ie.recoverSolana({publicKey:r.address,accessToken:n})).publicKey||t(Error("Unable to recover wallet")),o.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:r.address}}),e(!0)):t(i)}}else t(Error("Must have valid access token and Privy wallet to recover wallet"))})),getMoonpaySignedUrl:async(e,t)=>{let{signedUrl:r,externalTransactionId:n}=await async function(e,t,r,n,i=!1){let a=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},o=r.uiConfig||{accentColor:n.accent,theme:n.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:i,config:{...r,...a,...o}})}(o,e,t??{},oe.appearance.palette,oe.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:r,externalTransactionId:n}},initCoinbaseOnRamp:o.initCoinbaseOnRamp.bind(o),getCoinbaseOnRampStatus:o.getCoinbaseOnRampStatus.bind(o),setReadyToTrue:e=>{p(!0),ge?.(e)},updateWallets:()=>nt(),fundWallet:async(e,t)=>{if(!oe.fundingConfig||0===oe.fundingConfig.methods.length)throw Error("Wallet funding is not enabled");let r=gw({fundingMethods:oe.fundingConfig.methods});me({funding:hw({address:e,appConfig:oe,fundWalletConfig:t,methodScreen:r})}),Me(r)},requestFarcasterSignerStatus:async e=>{let t=await Tv(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!ie||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");let n=await o.requestFarcasterSignerStatus(e);return"approved"===n.status&&w(await o.getAuthenticatedUser()||y||null),n},connectCoinbaseSmartWallet:async()=>{oe.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let e=o.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||o.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(e)return e.updateConnectionPreference("smartWalletOnly"),Ge(e);await Fe("coinbase_wallet","coinbase_smart_wallet")},initiateAccountTransfer:async({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,farcasterEmbeddedAddress:a,oAuthUserInfo:l})=>{try{let s=await o.sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,farcasterEmbeddedAddress:a,oAuthUserInfo:l});return w(s),s}catch(e){throw e}}};xv=mt.recoverEmbeddedEthereumWallet,Av=mt.recoverEmbeddedSolanaWallet,kv=mt.solanaSignMessage;let ft=d((()=>({wallets:v,ready:Ce&&Se})),[v,Ce,Se]);return t(Pe.Provider,{value:pt,children:t(Ht.Provider,{value:_e,children:t(Be.Provider,{value:ft,children:t($s,{...oe,children:e(U.Provider,{value:mt,children:[t(zt,{children:e(pr,{data:pe,setModalData:me,setInitialScreen:L,initialScreen:M,authenticated:f,open:c,children:[r.children,!oe.headless&&oe.captchaEnabled&&h&&!f&&t(As,{delayedExecution:!1}),t(zw,{theme:{...oe.appearance.palette||{}}}),!oe.render.standalone&&t(rv,{open:c})]})}),de&&le?t(fv,{appId:r.appId,appClientId:r.clientId,clientAnalyticsId:o.clientAnalyticsId,origin:o.apiUrl,mfaMethods:y?.mfaMethods,mfaPromise:ke,mfaSubmitPromise:Te,onLoad:ae,onLoadFailed:()=>null}):null,oe.loginConfig.telegramAuthConfiguration&&t(cd,{$if:!0,children:t(av,{scriptHost:r.apiUrl||se,botUsername:oe.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};const Lv=e=>{at("login",e);let t=xs(),r=We(),{initLoginWithHeadlessOAuth:n,loginWithHeadlessOAuth:i,isHeadlessOAuthLoading:a,ready:o,user:l}=he(),{oAuthState:s,setOAuthState:d}=O(),c=f((async e=>{try{if(t.enabled&&"success"!==t.status)throw new Es(t.error,null,k.CAPTCHA_FAILURE);return await n(e.provider,t.token)}catch(e){throw d({status:"error",error:e}),e}}),[n,t]),u=f((async()=>{let e=bl();try{if(l)return console.warn("Cannot login with OAuth when already logged in"),l;if(!e.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(e.popupFlow)return}catch(e){throw d({status:"error",error:e}),e}try{return await i(e)}catch(e){throw d({status:"error",error:e}),e}finally{El()}}),[i]);return m((()=>{let e=bl();o&&r&&e.inProgress&&e.headless&&!e.popupFlow&&u()}),[o,r]),{initOAuth:c,loginWithOAuth:u,loading:a,state:s}},Dv=e=>{let t=xs(),{emailOtpState:r,setEmailOtpState:n,initLoginWithEmail:i,loginWithCode:a}=O();return{sendCode:f((async({email:r})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new Es(t.error,null,k.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await i(r,e)}catch(r){throw n({status:"error",error:r}),e?.onError?.(r.privyErrorCode||k.UNKNOWN_AUTH_ERROR),r}}),[i]),loginWithCode:f((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new Es(t.error,null,k.CAPTCHA_FAILURE);let{user:n,isNewUser:i,wasAlreadyAuthenticated:o,linkedAccount:l}=await a(r);e?.onComplete?.(n,i,o,"email",l)}catch(r){throw n({status:"error",error:r}),e?.onError?.(r.privyErrorCode||k.UNKNOWN_AUTH_ERROR),r}}),[a,t.status]),state:r}},Uv=e=>{let t=xs(),{initLoginWithPasskey:r,loginWithPasskey:n,passkeyAuthState:i,setPasskeyAuthState:a}=O();return{loginWithPasskey:f((async()=>{try{let i;if(t.enabled&&"error"===t.status)throw new Es(t.error,null,k.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),i=await t.waitForResult()),await r(i);let{user:a,isNewUser:o,wasAlreadyAuthenticated:l,loginAccount:s}=await n();e?.onComplete?.(a,o,l,"passkey",s)}catch(t){throw a({status:"error",error:t}),e?.onError?.(t),t}}),[n,t.status]),state:i}},Fv=e=>{let t=xs(),{smsOtpState:r,setSmsOtpState:n,initLoginWithSms:i,loginWithCode:a}=O();return{sendCode:f((async({phoneNumber:r})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new Es(t.error,null,k.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await i(r,e)}catch(r){throw n({status:"error",error:r}),e?.onError?.(r.privyErrorCode||k.UNKNOWN_AUTH_ERROR),r}}),[i]),loginWithCode:f((async({code:r})=>{try{if(t.enabled&&"success"!==t.status)throw new Es(t.error,null,k.CAPTCHA_FAILURE);let{user:n,isNewUser:i,wasAlreadyAuthenticated:o,linkedAccount:l}=await a(r);e?.onComplete?.(n,i,o,"sms",l)}catch(r){throw n({status:"error",error:r}),e?.onError?.(r.privyErrorCode||k.UNKNOWN_AUTH_ERROR),r}}),[a,t.status]),state:r}},Wv=e=>{let t=xs(),{generateSiweMessage:r}=he(),{siweState:n,setSiweState:i,linkWithSiwe:a}=O();return{generateSiweMessage:f((async({address:t,chainId:n})=>{try{if(!t||!n)throw Error("wallet address and chainId required to generate nonce");return await r({address:t,chainId:n}).then((e=>e))}catch(t){throw i({status:"error",error:t}),e?.onError?.(t.privyErrorCode||k.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[r]),linkWithSiwe:f((async({signature:r,message:n,chainId:o,walletClientType:l,connectorType:s})=>{try{if(t.enabled&&"success"!==t.status)throw new Es(t.error,null,k.CAPTCHA_FAILURE);let{user:i,linkedAccount:d}=await a({message:n,signature:r,chainId:o,walletClientType:l,connectorType:s});d&&e?.onSuccess?.(i,"siwe",d)}catch(r){throw i({status:"error",error:r}),e?.onError?.(r.privyErrorCode||k.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[a,t.status]),state:n}};function Bv(e){let{linkEmail:t,linkPhone:r,linkWallet:n,linkGoogle:i,linkApple:a,linkTwitter:o,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:c,linkSpotify:u,linkInstagram:p,linkTelegram:m,linkFarcaster:f}=h(Pe);return at("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:n,linkGoogle:i,linkApple:a,linkTwitter:o,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:c,linkSpotify:u,linkInstagram:p,linkFarcaster:f,linkTelegram:m}}function Gv(e){let{createWallet:t}=h(Pe);return at("createWallet",e),{createWallet:t}}const Hv=()=>{let{connectCoinbaseSmartWallet:e}=O();return{connectCoinbaseSmartWallet:e}},zv=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:n,sendTransactionWithCrossAppWallet:i}=he();return{loginWithCrossAppAccount:({appId:t})=>e({appId:t,action:"login"}),linkCrossAppAccount:({appId:t})=>e({appId:t,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:n,sendTransaction:i}};function jv(e){let{sendTransaction:t}=h(Pe);return at("sendTransaction",e),{sendTransaction:t}}function qv(e){let{sendSolanaTransaction:t}=h(Pe);return at("sendSolanaTransaction",e),{sendSolanaTransaction:t}}function Vv(e){let{setWalletPassword:t}=h(Pe);return at("setWalletPassword",e),{setWalletPassword:t}}function Kv(){let{createGuestAccount:e}=h(Pe);return{createGuestAccount:e}}function Yv(e){let{setWalletRecovery:t}=h(Pe);return at("setWalletRecovery",e),{setWalletRecovery:t}}function Zv(e){let{signMessage:t}=h(Pe);return at("signMessage",e),{signMessage:t}}function Xv(e){let{signTypedData:t}=h(Pe);return at("signTypedData",e),{signTypedData:t}}const Qv=()=>{let{isModalOpen:e}=h(Pe);return{isOpen:e}};function Jv(e){let{getAccessToken:t}=h(Pe);return at("accessToken",e),{getAccessToken:t}}function eC(e){let{authenticated:t,user:r}=he(),{initLoginWithOAuth:n}=O(),i=Mt();return at("oAuthAuthorization",e),{reauthorize:e=>tC(t,r,n,i,e.provider)}}let tC=async(e,t,r,n,i)=>{if(!e)throw n("linkAccount","onError",k.MUST_BE_AUTHENTICATED,{linkMethod:i}),new x("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(i))))throw new x(`OAuth account of type ${i} not linked to the account.`);await r(i)};const rC=e=>{let{customAuthStatus:t}=O();return at("customAuth",e),{status:t}},nC=iC;function iC(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=he();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}export{Dl as AsExternalProvider,As as Captcha,ss as ConnectorManager,Gl as EthereumWalletConnector,rv as LoginModal,vs as PrivyClient,Rv as PrivyProvider,Rl as PrivyProxyProvider,X as VERSION,Qt as WalletConnector,su as errorIndicatesMaxMfaRetries,ou as errorIndicatesMfaTimeout,lu as errorIndicatesMfaVerificationFailed,Tv as getAccessToken,Hv as useConnectCoinbaseSmartWallet,Gv as useCreateWallet,zv as useCrossAppAccounts,rC as useCustomAuth,nC as useExperimentalFarcasterSigner,iC as useFarcasterSigner,Kv as useGuestAccounts,Bv as useLinkAccount,Wv as useLinkWithSiwe,Dv as useLoginWithEmail,Lv as useLoginWithOAuth,Uv as useLoginWithPasskey,Fv as useLoginWithSms,gt as useLogout,Bf as useMfa,Gf as useMfaEnrollment,Qv as useModalStatus,eC as useOAuthTokens,he as usePrivy,ks as useRegisterMfaListener,qv as useSendSolanaTransaction,jv as useSendTransaction,Vv as useSetWalletPassword,Yv as useSetWalletRecovery,Zv as useSignMessage,Xv as useSignTypedData,Jv as useToken,ke as useWallets};
|