PageSourceSearch

https://proofable.me/_next/static/chunks/21403-4bb37dfa11fa1e54.js

js proofable.me collected 2026-10-09 21:43:37 UTC 1,316,463 bytes, 7,095 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[21403,73636],{383:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},549:(e,t)=>{function i(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw Error("Invalid hex color: "+e);(3===t.length||4===t.length)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");let i=parseInt(t.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:255&i,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});let t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:r,scale:r?4:n,margin:t,color:{dark:i(e.color.dark||"#000000ff"),light:i(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,i){let r=t.getScale(e,i);return Math.floor((e+2*i.margin)*r)},t.qrToImageData=function(e,i,r){let n=i.modules.size,s=i.modules.data,a=t.getScale(n,r),o=Math.floor((n+2*r.margin)*a),l=r.margin*a,c=[r.color.light,r.color.dark];for(let t=0;t<o;t++)for(let i=0;i<o;i++){let d=(t*o+i)*4,h=r.color.light;t>=l&&i>=l&&t<o-l&&i<o-l&&(h=c[+!!s[Math.floor((t-l)/a)*n+Math.floor((i-l)/a)]]),e[d++]=h.r,e[d++]=h.g,e[d++]=h.b,e[d]=h.a}}},768:(e,t,i)=>{let r=i(62690),n=i(32338),s=i(88120),a=i(83215);function o(e,t,i,s,a){let o=[].slice.call(arguments,1),l=o.length,c="function"==typeof o[l-1];if(!c&&!r())throw Error("Callback required as last argument");if(c){if(l<2)throw Error("Too few arguments provided");2===l?(a=i,i=t,t=s=void 0):3===l&&(t.getContext&&void 0===a?(a=s,s=void 0):(a=s,s=i,i=t,t=void 0))}else{if(l<1)throw Error("Too few arguments provided");return 1===l?(i=t,t=s=void 0):2!==l||t.getContext||(s=i,i=t,t=void 0),new Promise(function(r,a){try{let a=n.create(i,s);r(e(a,t,s))}catch(e){a(e)}})}try{let r=n.create(i,s);a(null,e(r,t,s))}catch(e){a(e)}}t.create=n.create,t.toCanvas=o.bind(null,s.render),t.toDataURL=o.bind(null,s.renderToDataURL),t.toString=o.bind(null,function(e,t,i){return a.render(e,i)})},1024:(e,t,i)=>{"use strict";i.d(t,{W:()=>k});var r=i(92679),n=i(3125),s=i(30840),a=i(34386),o=i(37633),l=i(72550),c=i(67066),d=i(74714),h=i(29400),u=i(37056),p=i(5820),f=i(51369),g=i(47653),m=i(60319),w=i(11446),y=i(43242),b=i(24568),v=i(11403),C=i(79954),E=i(83931),x=i(16025),A=i(44963);let _={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,user:void 0,preferredAccountType:void 0},I={caipNetwork:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},S=(0,r.BX)({chains:(0,n.zC)(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{connectionControllerClient:void 0},isSwitchingNamespace:!1}),N={state:S,subscribe:e=>(0,r.B1)(S,()=>{e(S)}),subscribeKey:(e,t)=>(0,n.u$)(S,e,t),subscribeAccountStateProp(e,t,i){let r=i||S.activeChain;return r?(0,n.u$)(S.chains.get(r)?.accountState||{},e,t):()=>void 0},subscribeChainProp(e,t,i){let n;return(0,r.B1)(S.chains,()=>{let r=i||S.activeChain;if(r){let i=S.chains.get(r)?.[e];n!==i&&(n=i,t(i))}})},initialize(e,t,i){let{chainId:n,namespace:s}=p.i.getActiveNetworkProps(),a=t?.find(e=>e.id.toString()===n?.toString()),o=e.find(e=>e?.namespace===s)||e?.[0],l=e.map(e=>e.namespace).filter(e=>void 0!==e),c=new Set(v.H.state.enableEmbedded?[...l]:[...t?.map(e=>e.chainNamespace)??[]]);e?.length!==0&&o||(S.noAdapters=!0),!S.noAdapters&&(S.activeChain=o?.namespace,S.activeCaipNetwork=a,k.setChainNetworkData(o?.namespace,{caipNetwork:a}),S.activeChain&&E.z.set({activeChain:o?.namespace})),c.forEach(e=>{let n=t?.filter(t=>t.chainNamespace===e),s=p.i.getPreferredAccountTypes()||{},a={...v.H.state.defaultAccountTypes,...s};k.state.chains.set(e,{namespace:e,networkState:(0,r.BX)({...I,caipNetwork:n?.[0]}),accountState:(0,r.BX)({..._,preferredAccountType:a[e]}),caipNetworks:n??[],...i}),k.setRequestedCaipNetworks(n??[],e)})},removeAdapter(e){if(S.activeChain===e){let t=Array.from(S.chains.entries()).find(([t])=>t!==e);if(t){let e=t[1]?.caipNetworks?.[0];
1e&&k.setActiveCaipNetwork(e)}}S.chains.delete(e)},addAdapter(e,{connectionControllerClient:t},i){if(!e.namespace)throw Error("ChainController:addAdapter - adapter must have a namespace");S.chains.set(e.namespace,{namespace:e.namespace,networkState:{...I,caipNetwork:i[0]},accountState:{..._},caipNetworks:i,connectionControllerClient:t}),k.setRequestedCaipNetworks(i?.filter(t=>t.chainNamespace===e.namespace)??[],e.namespace)},addNetwork(e){let t=S.chains.get(e.chainNamespace);if(t){let i=[...t.caipNetworks||[]];t.caipNetworks?.find(t=>t.id===e.id)||i.push(e),S.chains.set(e.chainNamespace,{...t,caipNetworks:i}),k.setRequestedCaipNetworks(i,e.chainNamespace),w.a.filterByNamespace(e.chainNamespace,!0)}},removeNetwork(e,t){let i=S.chains.get(e);if(i){let r=S.activeCaipNetwork?.id===t,n=[...i.caipNetworks?.filter(e=>e.id!==t)||[]];r&&i?.caipNetworks?.[0]&&k.setActiveCaipNetwork(i.caipNetworks[0]),S.chains.set(e,{...i,caipNetworks:n}),k.setRequestedCaipNetworks(n||[],e),0===n.length&&w.a.filterByNamespace(e,!1)}},setAdapterNetworkState(e,t){let i=S.chains.get(e);i&&(i.networkState={...i.networkState||I,...t},S.chains.set(e,i))},setChainAccountData(e,t,i=!0){if(!e)throw Error("Chain is required to update chain account data");let r=S.chains.get(e);if(r){let i={...r.accountState||_,...t};S.chains.set(e,{...r,accountState:i}),(1===S.chains.size||S.activeChain===e)&&t.caipAddress&&(S.activeCaipAddress=t.caipAddress)}},setChainNetworkData(e,t){if(!e)return;let i=S.chains.get(e);if(i){let r={...i.networkState||I,...t};S.chains.set(e,{...i,networkState:r})}},setAccountProp(e,t,i,r=!0){k.setChainAccountData(i,{[e]:t},r)},setActiveNamespace(e){S.activeChain=e;let t=e?S.chains.get(e):void 0,i=t?.networkState?.caipNetwork;i?.id&&e&&(S.activeCaipAddress=t?.accountState?.caipAddress,S.activeCaipNetwork=i,k.setChainNetworkData(e,{caipNetwork:i}),p.i.setActiveCaipNetworkId(i?.caipNetworkId),E.z.set({activeChain:e,selectedNetworkId:i?.caipNetworkId}))},setActiveCaipNetwork(e){if(!e)return;let t=S.activeChain===e.chainNamespace;t||k.setIsSwitchingNamespace(!0);let i=S.chains.get(e.chainNamespace);S.activeChain=e.chainNamespace,S.activeCaipNetwork=e,k.setChainNetworkData(e.chainNamespace,{caipNetwork:e});let r=i?.accountState?.address;if(r)S.activeCaipAddress=`${e.chainNamespace}:${e.id}:${r}`;else if(t&&S.activeCaipAddress){let{address:t}=s.C.parseCaipAddress(S.activeCaipAddress);r=t,S.activeCaipAddress=`${e.caipNetworkId}:${r}`}else S.activeCaipAddress=void 0;k.setChainAccountData(e.chainNamespace,{address:r,caipAddress:S.activeCaipAddress}),x.R.resetSend(),E.z.set({activeChain:S.activeChain,selectedNetworkId:S.activeCaipNetwork?.caipNetworkId}),p.i.setActiveCaipNetworkId(e.caipNetworkId),k.checkIfSupportedNetwork(e.chainNamespace)||!v.H.state.enableNetworkSwitch||v.H.state.allowUnsupportedChain||m.x.state.wcBasic||k.showUnsupportedChainUI()},addCaipNetwork(e){if(!e)return;let t=S.chains.get(e.chainNamespace);t&&t?.caipNetworks?.push(e)},async switchActiveNamespace(e){if(!e)return;let t=e!==k.state.activeChain,i=k.getNetworkData(e)?.caipNetwork,r=k.getCaipNetworkByNamespace(e,i?.id);t&&r&&await k.switchActiveNetwork(r)},async switchActiveNetwork(e,{throwOnFailure:t=!1}={}){let i=k.state.activeChain;if(!i)throw Error("ChainController:switchActiveNetwork - namespace is required");let r="AUTH"===C.G.getProviderId(S.activeChain),n=k.getAccountData(i)?.address,s=a.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(e.chainNamespace);try{if(n&&e.chainNamespace===i||r&&s){let t=g.q.get(e.chainNamespace);if(!t)throw Error("Adapter not found");await t.switchNetwork({caipNetwork:e})}k.setActiveCaipNetwork(e)}catch(e){if(t)throw e}y.E.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:e.caipNetworkId}})},getConnectionControllerClient(e){let t=e||S.activeChain;if(!t)throw Error("Chain is required to get connection controller client");let i=S.chains.get(t);if(!i?.connectionControllerClient)throw Error("ConnectionController client not set");return i.connectionControllerClient},getNetworkProp(e,t){let i=S.chains.get(t)?.networkState;if(i)return i[e]},getRequestedCaipNetworks(e){let t=S.chains.get(e),{approvedCaipNetworkIds:i=[],requestedCaipNetworks:r=[]}=t?.networkState||{};return u.w.sortRequestedNetworks(i,r).filter(e=>e?.id)},getAllRequestedCaipNetworks(){let e=[];return S.chains.forEach(t=>{if(!t.namespace)throw Error("ChainController:getAllRequestedCaipNetworks - chainAdapter must have a namespace");let i=k.getRequestedCaipNetworks(t.namespace);e.push(...i)}),e},setRequestedCaipNetworks(e,t){k.setAdapterNetworkState(t,{requestedCaipNetworks:e});let i=Array.from(new Set(k.getAllRequestedCaipNetworks().map(e=>e.chainNamespace)));w.a.filterByNamespaces(i)},getAllApprovedCaipNetworkIds(){let e=[];return S.chains.forEach(t=>{if(!t.namespace)throw Error("ChainController:getAllApprovedCaipNetworkIds - chainAdapter must have a namespace");let i=k.getApprovedCaipNetworkIds(t.namespace);e.push(...i)}),e},getActiveCaipNetwork:e=>e?S.chains.get(e)?.networkState?.caipNetwork:S.activeCaipNetwork,getActiveCaipAddress:()=>S.activeCaipAddress,getApprovedCaipNetworkIds(e){let t=S.chains.get(e);return t?.networkState?.approvedCaipNetworkIds||[]},setApprovedCaipNetworksData(e,t){k.setAdapterNetworkState(e,t)},checkIfSupportedNetwork(e,t){let i=t||S.activeCaipNetwork?.caipNetworkId,r=k.getRequestedCaipNetworks(e);return!r.length||r?.some(e=>e.caipNetworkId===i)},checkIfSupportedChainId(e){if(!S.activeChain)return!0;let t=k.getRequestedCaipNetworks(S.activeChain);return t?.some(t=>t.id===e)},checkIfSmartAccountEnabled(){let e=o.L.caipNetworkIdToNumber(S.activeCaipNetwork?.caipNetworkId);if(!S.activeChain||!e)return!1;let t=l.o.get(c.s1.SMART_ACCOUNT_ENABLED_NETWORKS)?.split(",")||[];return!!t?.includes(e.toString())},showUnsupportedChainUI(){b.W.open({view:"UnsupportedChain"})},checkIfNamesSupported(){let e=S.activeCaipNetwork;return!!(e?.chainNamespace&&h.oU.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(e.chainNamespace))},resetNetwork(e){k.setAdapterNetworkState(e,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})},resetAccount(e){if(!e)throw Error("Chain is required to set account prop");let t=k.state.chains.get(e)?.accountState?.preferredAccountType,i=v.H.state.defaultAccountTypes[e];S.activeCaipAddress=void 0,k.setChainAccountData(e,{smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol
1:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:i||t,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,user:void 0,status:"disconnected"}),w.a.removeConnectorId(e)},setIsSwitchingNamespace(e){S.isSwitchingNamespace=e},getFirstCaipNetworkSupportsAuthConnector(){let e=[];if(S.chains.forEach(t=>{a.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>e===t.namespace)&&t.namespace&&e.push(t.namespace)}),e.length>0){let t=e[0];return t?S.chains.get(t)?.caipNetworks?.[0]:void 0}},getAccountData(e){let t=e||S.activeChain;if(t)return k.state.chains.get(t)?.accountState},getNetworkData(e){let t=e||S.activeChain;if(t)return k.state.chains.get(t)?.networkState},getCaipNetworkByNamespace(e,t){if(!e)return;let i=k.state.chains.get(e),r=i?.caipNetworks?.find(e=>e.id.toString()===t?.toString());return r||i?.networkState?.caipNetwork||i?.caipNetworks?.[0]},getRequestedCaipNetworkIds(){let e=w.a.state.filterByNamespace;return(e?[S.chains.get(e)]:Array.from(S.chains.values())).flatMap(e=>e?.caipNetworks||[]).map(e=>e.caipNetworkId)},getCaipNetworks:e=>e?k.getRequestedCaipNetworks(e):k.getAllRequestedCaipNetworks(),getCaipNetworkById:(e,t)=>N.getCaipNetworks(t).find(t=>t.id.toString()===e.toString()||t.caipNetworkId.toString()===e.toString()),setLastConnectedSIWECaipNetwork(e){S.lastConnectedSIWECaipNetwork=e},getLastConnectedSIWECaipNetwork:()=>S.lastConnectedSIWECaipNetwork,async fetchTokenBalance(e){let t=k.getAccountData();if(!t)return[];let i=k.state.activeCaipNetwork?.caipNetworkId,r=k.state.activeCaipNetwork?.chainNamespace,n=k.state.activeCaipAddress,s=n?u.w.getPlainAddress(n):void 0;if(k.setAccountProp("balanceLoading",!0,r),t.lastRetry&&!u.w.isAllowedRetry(t.lastRetry,30*h.oU.ONE_SEC_MS))return k.setAccountProp("balanceLoading",!1,r),[];try{if(s&&i&&r){let e=await d.Z.getMyTokensWithBalance();return k.setAccountProp("tokenBalance",e,r),k.setAccountProp("lastRetry",void 0,r),k.setAccountProp("balanceLoading",!1,r),e}}catch(t){k.setAccountProp("lastRetry",Date.now(),r),e?.(t),A.P.showError("Token Balance Unavailable")}finally{k.setAccountProp("balanceLoading",!1,r)}return[]},isCaipNetworkDisabled(e){let t=e.chainNamespace,i=!!k.getAccountData(t)?.caipAddress,r=k.getAllApprovedCaipNetworkIds(),n=!1!==k.getNetworkProp("supportsAllNetworks",t),s=w.a.getConnectorId(t),o=w.a.getAuthConnector(),l=s===a.o.CONNECTOR_ID.AUTH&&o;return!!i&&!n&&!l&&!r?.includes(e.caipNetworkId)}},k=(0,f.X)(N)},1756:(e,t,i)=>{"use strict";i.d(t,{LU:()=>r,R7:()=>n});let r={core:{backgroundAccentPrimary:"#0988F0",backgroundAccentCertified:"#C7B994",backgroundWalletKit:"#FFB800",backgroundAppKit:"#FF573B",backgroundCloud:"#0988F0",backgroundDocumentation:"#008847",backgroundSuccess:"rgba(48, 164, 107, 0.20)",backgroundError:"rgba(223, 74, 52, 0.20)",backgroundWarning:"rgba(243, 161, 63, 0.20)",textAccentPrimary:"#0988F0",textAccentCertified:"#C7B994",textWalletKit:"#FFB800",textAppKit:"#FF573B",textCloud:"#0988F0",textDocumentation:"#008847",textSuccess:"#30A46B",textError:"#DF4A34",textWarning:"#F3A13F",borderAccentPrimary:"#0988F0",borderSecondary:"#C7B994",borderSuccess:"#30A46B",borderError:"#DF4A34",borderWarning:"#F3A13F",foregroundAccent010:"rgba(9, 136, 240, 0.1)",foregroundAccent020:"rgba(9, 136, 240, 0.2)",foregroundAccent040:"rgba(9, 136, 240, 0.4)",foregroundAccent060:"rgba(9, 136, 240, 0.6)",foregroundSecondary020:"rgba(199, 185, 148, 0.2)",foregroundSecondary040:"rgba(199, 185, 148, 0.4)",foregroundSecondary060:"rgba(199, 185, 148, 0.6)",iconAccentPrimary:"#0988F0",iconAccentCertified:"#C7B994",iconSuccess:"#30A46B",iconError:"#DF4A34",iconWarning:"#F3A13F",glass010:"rgba(255, 255, 255, 0.1)",zIndex:"9999"},dark:{overlay:"rgba(0, 0, 0, 0.50)",backgroundPrimary:"#202020",backgroundInvert:"#FFFFFF",textPrimary:"#FFFFFF",textSecondary:"#9A9A9A",textTertiary:"#BBBBBB",textInvert:"#202020",borderPrimary:"#2A2A2A",borderPrimaryDark:"#363636",borderSecondary:"#4F4F4F",foregroundPrimary:"#252525",foregroundSecondary:"#2A2A2A",foregroundTertiary:"#363636",iconDefault:"#9A9A9A",iconInverse:"#FFFFFF"},light:{overlay:"rgba(230 , 230, 230, 0.5)",backgroundPrimary:"#FFFFFF",borderPrimaryDark:"#E9E9E9",backgroundInvert:"#202020",textPrimary:"#202020",textSecondary:"#9A9A9A",textTertiary:"#6C6C6C",textInvert:"#FFFFFF",borderPrimary:"#E9E9E9",borderSecondary:"#D0D0D0",foregroundPrimary:"#F3F3F3",foregroundSecondary:"#E9E9E9",foregroundTertiary:"#D0D0D0",iconDefault:"#9A9A9A",iconInverse:"#202020"}},n={colors:{black:"#202020",white:"#FFFFFF",white010:"rgba(255, 255, 255, 0.1)",accent010:"rgba(9, 136, 240, 0.1)",accent020:"rgba(9, 136, 240, 0.2)",accent030:"rgba(9, 136, 240, 0.3)",accent040:"rgba(9, 136, 240, 0.4)",accent050:"rgba(9, 136, 240, 0.5)",accent060:"rgba(9, 136, 240, 0.6)",accent070:"rgba(9, 136, 240, 0.7)",accent080:"rgba(9, 136, 240, 0.8)",accent090:"rgba(9, 136, 240, 0.9)",accent100:"rgba(9, 136, 240, 1.0)",accentSecondary010:"rgba(199, 185, 148, 0.1)",accentSecondary020:"rgba(199, 185, 148, 0.2)",accentSecondary030:"rgba(199, 185, 148, 0.3)",accentSecondary040:"rgba(199, 185, 148, 0.4)",accentSecondary050:"rgba(199, 185, 148, 0.5)",accentSecondary060:"rgba(199, 185, 148, 0.6)",accentSecondary070:"rgba(199, 185, 148, 0.7)",accentSecondary080:"rgba(199, 185, 148, 0.8)",accentSecondary090:"rgba(199, 185, 148, 0.9)",accentSecondary100:"rgba(199, 185, 148, 1.0)",productWalletKit:"#FFB800",productAppKit:"#FF573B",productCloud:"#0988F0",productDocumentation:"#008847",neutrals050:"#F6F6F6",neutrals100:"#F3F3F3",neutrals200:"#E9E9E9",neutrals300:"#D0D0D0",neutrals400:"#BBB",neutrals500:"#9A9A9A",neutrals600:"#6C6C6C",neutrals700:"#4F4F4F",neutrals800:"#363636",neutrals900:"#2A2A2A",neutrals1000:"#252525",semanticSuccess010:"rgba(48, 164, 107, 0.1)",semanticSuccess020:"rgba(48, 164, 107, 0.2)",semanticSuccess030:"rgba(48, 164, 107, 0.3)",semanticSuccess040:"rgba(48, 164, 107, 0.4)",semanticSuccess050:"rgba(48, 164, 107, 0.5)",semanticSuccess060:"rgba(48, 164, 107, 0.6)",semanticSuccess070:"rgba(48, 164, 107, 0.7)",semanticSuccess080:"rgba(48, 164, 107, 0.8)",semanticSuccess090:"rgba(48, 164, 107, 0.9)",semanticSuccess100:"rgba(48, 164, 107, 1.0)",semanticError010:"rgba(223, 74, 52, 0.1)",semanticError020:"rgba(223, 74, 52, 0.2)",semanticError030:"rgba(223, 74, 52, 0.3)",semanticError040:"rgba(223, 74, 52, 0.4)",semanticError050:"rgba(223, 74, 52, 0.5)",semanticError060:"rgba(223, 74, 52, 0.6)",semanticError070:"rgba(223, 74, 52, 0.7)",semanticError080:"rgba(223, 74, 52, 0.8)",semanticError090:"rgba(223, 74, 52, 0.9)",semanticError100:"rgba(223, 74, 52, 1.0)",semanticWarning010:"rgba(243, 161, 63, 0.1)",semanticWarning020:"rgba(243, 161, 63, 0.2)",semanticWarning030:"rgba(243, 161, 63, 0.3)",semanticWarning040:"rgba(243, 161, 63, 0.4)",semanticWarning050:"rgba(243, 161, 63, 0.5)",semanticWarning060:"rgba(243, 161, 63, 0.6)",semanticWarning070:"rgba(243, 161, 63, 0.7)",semanticWarning080:"rgba(243, 161, 63, 0.8)",semanticWarning090:"rgba(243, 161, 63, 0.9)",semanticWarning100:"rgba(243, 161, 63, 1.0)"},fontFamily:{regular:"KHTeka",mono:"KHTekaMono"},fontWeight:{regular:"400",medium:"500"},textSize:{h1:"50px",h2:"44px",h3:"38px",h4:"32px",h5:"26px",h6:"20px",large:"16px",medium:"14px",small:"12px"},typography:{"h1-regular-mono":{lineHeight:"50px",letterSpacing:"-3px"},"h1-regular":{lineHeight:"50px",letterSpacing:"-1px"},"h1-medium":{lineHeight:"50px",letterSpacing:"-0.84px"},"h2-regular-mono":{lineHeight:"44px",letterSpacing:"-2.64px"},"h2-regular":{lineHeight:"44px",letterSpacing:"-0.88px"},"h2-medium":{lineHeight:"44px",letterSpacing:"-0.88px"},"h3-regular-mono":{lineHeight:"38px",letterSpacing:"-2.28px"},"h3-regular":{lineHeight:"38px",letterSpacing:"-0.76px"},"h3-medium":{lineHeight:"38px",letterSpacing:"-0.76px"},"h4-regular-mono":{lineHeight:"32px",letterSpacing:"-1.92px"},"h4-regular":{lineHeight:"32px",letterSpacing:"-0.32px"},"h4-medium":{lineHeight:"32px",letterSpacing:"-0.32px"},"h5-regular-mono":{lineHeight:"26px",letterSpacing:"-1.56px"},"h5-regular":{lineHeight:"26px",letterSpacing:"-0.26px"},"h5-medium":{lineHeight:"26px",letterSpacing:"-0.26px"},"h6-regular-mono":{lineHeight:"20px",letterSpacing:"-1.2px"},"h6-regular":{lineHeight:"20px",letterSpacing:"-0.6px"},"h6-medium":{lineHeight:"20px",letterSpacing:"-0.6px"},"lg-regular-mono":{lineHeight:"16px",letterSpacing:"-0.96px"},"lg-regular":{lineHeight:"18px",letterSpacing:"-0.16px"},"lg-medium":{lineHeight:"18px",letterSpacing:"-0.16px"},"md-regular-mono":{lineHeight:"14px",letterSpacing:"-0.84px"},"md-regular":{lineHeight:"16px",letterSpacing:"-0.14px"},"md-medium":{lineHeight:"16px",letterSpacing:"-0.14px"},"sm-regular-mono":{lineHeight:"12px",letterSpacing:"-0.72px"},"sm-regular":{lineHeight:"14px",letterSpacing:"-0.12px"},"sm-medium":{lineHeight:"14px",letterSpacing:"-0.12px"}},tokens:{core:r.core,theme:r.dark},borderRadius:{1:"4px",2:"8px",10:"10px",3:"12px",4:"16px",6:"24px",5:"20px",8:"32px",16:"64px",20:"80px",32:"128px",64:"256px",128:"512px",round:"9999px"},spacing:{0:"0px","01":"2px",1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",12:"48px",14:"56px",16:"64px",20:"80px",32:"128px",64:"256px"},durations:{xl:"400ms",lg:"200ms",md:"125ms",sm:"75ms"}
1,easings:{"ease-out-power-2":"cubic-bezier(0.23, 0.09, 0.08, 1.13)","ease-out-power-1":"cubic-bezier(0.12, 0.04, 0.2, 1.06)","ease-in-power-2":"cubic-bezier(0.92, -0.13, 0.77, 0.91)","ease-in-power-1":"cubic-bezier(0.88, -0.06, 0.8, 0.96)","ease-inout-power-2":"cubic-bezier(0.77, 0.09, 0.23, 1.13)","ease-inout-power-1":"cubic-bezier(0.88, 0.04, 0.12, 1.06)"}}},3125:(e,t,i)=>{"use strict";i.d(t,{u$:()=>n,zC:()=>o});var r=i(92679);function n(e,t,i,n){let s=e[t];return(0,r.B1)(e,()=>{let r=e[t];Object.is(s,r)||i(s=r)},n)}Symbol();let{proxyStateMap:s,snapCache:a}=(0,r.h2)();function o(e){let t=[],i=0,n=new Map,o=new WeakMap,l=e=>o.get(e)||n;if(e){if("function"!=typeof e[Symbol.iterator])throw TypeError("proxyMap:\n	initial state must be iterable\n		tip: structure should be [[key, value]]");for(let[r,s]of e)n.set(r,i),t[i++]=s}let c={data:t,index:i,epoch:0,get size(){return s.has(this)||(()=>{let e=a.get(c),t=null==e?void 0:e[1];if(t&&!o.has(t)){let e=new Map(n);o.set(t,e)}})(),l(this).size},get(e){let t=l(this).get(e);return void 0===t?void this.epoch:this.data[t]},has(e){let t=l(this);return this.epoch,t.has(e)},set(e,t){if(!s.has(this))throw Error("Cannot perform mutations on a snapshot");let i=n.get(e);return void 0===i?(n.set(e,this.index),this.data[this.index++]=t):this.data[i]=t,this.epoch++,this},delete(e){if(!s.has(this))throw Error("Cannot perform mutations on a snapshot");let t=n.get(e);return void 0!==t&&(delete this.data[t],n.delete(e),this.epoch++,!0)},clear(){if(!s.has(this))throw Error("Cannot perform mutations on a snapshot");this.data.length=0,this.index=0,this.epoch++,n.clear()},forEach(e){this.epoch,l(this).forEach((t,i)=>{e(this.data[t],i,this)})},*entries(){for(let[e,t]of(this.epoch,l(this)))yield[e,this.data[t]]},*keys(){for(let e of(this.epoch,l(this).keys()))yield e},*values(){for(let e of(this.epoch,l(this).values()))yield this.data[e]},[Symbol.iterator](){return this.entries()},get[Symbol.toStringTag](){return"Map"},toJSON(){return new Map(this.entries())}},d=(0,r.BX)(c);return Object.defineProperties(d,{size:{enumerable:!1},index:{enumerable:!1},epoch:{enumerable:!1},data:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(d),d}let{proxyStateMap:l,snapCache:c}=(0,r.h2)()},3356:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(17008);i(82016),i(88364),i(12936),i(47002);var a=i(94895),o=i(69428),l=i(34175);let c=(0,l.AH)`
2  :host {
3    width: 100%;
4  }
5
6  button {
7    padding: ${({spacing:e})=>e[3]};
8    display: flex;
9    gap: ${({spacing:e})=>e[3]};
10    justify-content: space-between;
11    width: 100%;
12    border-radius: ${({borderRadius:e})=>e[4]};
13    background-color: transparent;
14  }
15
16  @media (hover: hover) {
17    button:hover:enabled {
18      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
19    }
20  }
21
22  button:focus-visible:enabled {
23    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
24    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
25  }
26
27  button[data-clickable='false'] {
28    pointer-events: none;
29    background-color: transparent;
30  }
31
32  wui-image,
33  wui-icon {
34    width: ${({spacing:e})=>e[10]};
35    height: ${({spacing:e})=>e[10]};
36  }
37
38  wui-image {
39    border-radius: ${({borderRadius:e})=>e[16]};
40  }
41
42  .token-name-container {
43    flex: 1;
44  }
45`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return(0,r.qy)`
46      <button data-clickable=${String(this.clickable)}>
47        <wui-flex gap="2" alignItems="center">
48          ${this.visualTemplate()}
49          <wui-flex
50            flexDirection="column"
51            justifyContent="space-between"
52            gap="1"
53            class="token-name-container"
54          >
55            <wui-text variant="md-regular" color="primary" lineClamp="1">
56              ${this.tokenName}
57            </wui-text>
58            <wui-text variant="sm-regular-mono" color="secondary">
59              ${s.S.formatNumberToLocalString(this.tokenAmount,4)} ${this.tokenCurrency}
60            </wui-text>
61          </wui-flex>
62        </wui-flex>
63        <wui-flex
64          flexDirection="column"
65          justifyContent="space-between"
66          gap="1"
67          alignItems="flex-end"
68          width="auto"
69        >
70          <wui-text variant="md-regular-mono" color="primary"
71            >$${this.tokenValue.toFixed(2)}</wui-text
72          >
73          <wui-text variant="sm-regular-mono" color="secondary">
74            ${s.S.formatNumberToLocalString(this.tokenAmount,4)}
75          </wui-text>
76        </wui-flex>
77      </button>
78    `}visualTemplate(){return this.tokenName&&this.tokenImageUrl?(0,r.qy)`<wui-image alt=${this.tokenName} src=${this.tokenImageUrl}></wui-image>`:(0,r.qy)`<wui-icon name="coinPlaceholder" color="default"></wui-icon>`}};h.styles=[a.W5,a.fD,c],d([(0,n.MZ)()],h.prototype,"tokenName",void 0),d([(0,n.MZ)()],h.prototype,"tokenImageUrl",void 0),d([(0,n.MZ)({type:Number})],h.prototype,"tokenValue",void 0),d([(0,n.MZ)()],h.prototype,"tokenAmount",void 0),d([(0,n.MZ)()],h.prototype,"tokenCurrency",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"clickable",void 0),h=d([(0,o.E)("wui-list-token")],h)},3536:(e,t,i)=>{"use strict";t.g=void 0;let r=i(57247);t.g=function(){let e,t,i;try{e=r.getDocumentOrThrow(),t=r.getLocationOrThrow()}catch(e){return null}function n(...t){let i=e.getElementsByTagName("meta");for(let e=0;e<i.length;e++){let r=i[e],n=["itemprop","property","name"].map(e=>r.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(n.length&&n){let e=r.getAttribute("content");
78if(e)return e}}return""}let s=((i=n("name","og:site_name","og:title","twitter:title"))||(i=e.title),i),a=n("description","og:description","twitter:description","keywords"),o=t.origin;return{description:a,url:o,icons:function(){let i=e.getElementsByTagName("link"),r=[];for(let e=0;e<i.length;e++){let n=i[e],s=n.getAttribute("rel");if(s&&s.toLowerCase().indexOf("icon")>-1){let e=n.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let i=t.protocol+"//"+t.host;if(0===e.indexOf("/"))i+=e;else{let r=t.pathname.split("/");r.pop(),i+=r.join("/")+"/"+e}r.push(i)}else if(0===e.indexOf("//")){let i=t.protocol+e;r.push(i)}else r.push(e)}}return r}(),name:s}}},3658:(e,t,i)=>{"use strict";i(12936)},3685:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=i(83227);r.__exportStar(i(5498),t),r.__exportStar(i(34298),t)},4693:(e,t,i)=>{"use strict";i.d(t,{r:()=>c});var r=i(27866),n=i(88893),s=i(8532),a=i(11194);r.extend(s),r.extend(a);let o={...n,name:"en-web3-modal",relativeTime:{future:"in %s",past:"%s ago",s:"%d sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}},l=["January","February","March","April","May","June","July","August","September","October","November","December"];r.locale("en-web3-modal",o);let c={getMonthNameByIndex:e=>l[e],getYear:(e=new Date().toISOString())=>r(e).year(),getRelativeDateFromNow:e=>r(e).locale("en-web3-modal").fromNow(!0),formatDate:(e,t="DD MMM")=>r(e).format(t)}},5498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},5820:(e,t,i)=>{"use strict";i.d(t,{i:()=>s});var r=i(65972),n=i(34386);let s={cacheExpiry:{portfolio:3e4,nativeBalance:3e4,ens:3e5,identity:3e5,transactionsHistory:15e3,tokenPrice:15e3,latestAppKitVersion:6048e5,tonWallets:864e5},isCacheExpired:(e,t)=>Date.now()-e>t,getActiveNetworkProps(){let e=s.getActiveNamespace(),t=s.getActiveCaipNetworkId(),i=t?t.split(":")[1]:void 0;return{namespace:e,caipNetworkId:t,chainId:i?isNaN(Number(i))?i:Number(i):void 0}},setWalletConnectDeepLink({name:e,href:t}){try{r.Ud.setItem(r.Ws.DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{let e=r.Ud.getItem(r.Ws.DEEPLINK_CHOICE);if(e)return JSON.parse(e)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{r.Ud.removeItem(r.Ws.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setActiveNamespace(e){try{r.Ud.setItem(r.Ws.ACTIVE_NAMESPACE,e)}catch{console.info("Unable to set active namespace")}},setActiveCaipNetworkId(e){try{r.Ud.setItem(r.Ws.ACTIVE_CAIP_NETWORK_ID,e),s.setActiveNamespace(e.split(":")[0])}catch{console.info("Unable to set active caip network id")}},getActiveCaipNetworkId(){try{return r.Ud.getItem(r.Ws.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to get active caip network id");return}},deleteActiveCaipNetworkId(){try{r.Ud.removeItem(r.Ws.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to delete active caip network id")}},deleteConnectedConnectorId(e){try{let t=(0,r.T8)(e);r.Ud.removeItem(t)}catch{console.info("Unable to delete connected connector id")}},setAppKitRecent(e){try{let t=s.getRecentWallets();t.find(t=>t.id===e.id)||(t.unshift(e),t.length>2&&t.pop(),r.Ud.setItem(r.Ws.RECENT_WALLETS,JSON.stringify(t)),r.Ud.setItem(r.Ws.RECENT_WALLET,JSON.stringify(e)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{let e=r.Ud.getItem(r.Ws.RECENT_WALLETS);return e?JSON.parse(e):[]}catch{console.info("Unable to get AppKit recent")}return[]},getRecentWallet(){try{let e=r.Ud.getItem(r.Ws.RECENT_WALLET);return e?JSON.parse(e):null}catch{console.info("Unable to get AppKit recent")}return null},deleteRecentWallet(){try{r.Ud.removeItem(r.Ws.RECENT_WALLET)}catch{console.info("Unable to delete AppKit recent")}},setConnectedConnectorId(e,t){try{let i=(0,r.T8)(e);r.Ud.setItem(i,t)}catch{console.info("Unable to set Connected Connector Id")}},getActiveNamespace(){try{return r.Ud.getItem(r.Ws.ACTIVE_NAMESPACE)}catch{console.info("Unable to get active namespace")}},getConnectedConnectorId(e){if(e)try{let t=(0,r.T8)(e);return r.Ud.getItem(t)}catch(t){console.info("Unable to get connected connector id in namespace",e)}},setConnectedSocialProvider(e){try{r.Ud.setItem(r.Ws.CONNECTED_SOCIAL,e)}catch{console.info("Unable to set connected social provider")}},getConnectedSocialProvider(){try{return r.Ud.getItem(r.Ws.CONNECTED_SOCIAL)}catch{console.info("Unable to get connected social provider")}},deleteConnectedSocialProvider(){try{r.Ud.removeItem(r.Ws.CONNECTED_SOCIAL)}catch{console.info("Unable to delete connected social provider")}},getConnectedSocialUsername(){try{return r.Ud.getItem(r.Ws.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get connected social username")}},getStoredActiveCaipNetworkId(){let e=r.Ud.getItem(r.Ws.ACTIVE_CAIP_NETWORK_ID);return e?.split(":")?.[1]},setConnectionStatus(e){try{r.Ud.setItem(r.Ws.CONNECTION_STATUS,e)}catch{console.info("Unable to set connection status")}},getConnectionStatus(){try{return r.Ud.getItem(r.Ws.CONNECTION_STATUS)}catch{return}},getConnectedNamespaces(){try{let e=r.Ud.getItem(r.Ws.CONNECTED_NAMESPACES);if(!e?.length)return[];return e.split(",")}catch{return[]}},setConnectedNamespaces(e){try{let t=Array.from(new Set(e));r.Ud.setItem(r.Ws.CONNECTED_NAMESPACES,t.join(","))}catch{console.info("Unable to set namespaces in storage")}},addConnectedNamespace(e){try{let t=s.getConnectedNamespaces();t.includes(e)||(t.push(e),s.setConnectedNamespaces(t))}catch{console.info("Unable to add connected namespace")}},removeConnectedNamespace(e){try{let t=s.getConnectedNamespaces(),i=t.indexOf(e);i>-1&&(t.splice(i,1),s.setConnectedNamespaces(t))}catch{console.info("Unable to remove connected namespace")}},getTelegramSocialProvider(){try{return r.Ud.getItem(r.Ws.TELEGRAM_SOCIAL_PROVIDER)}catch{return console.info("Unable to get telegram social provider"),null}},setTelegramSocialProvider(e){try{r.Ud.setItem(r.Ws.TELEGRAM_SOCIAL_PROVIDER,e)}catch{console.info("Unable to set telegram social provider")}},removeTelegramSocialProvider(){try{r.Ud.removeItem(r.Ws.TELEGRAM_SOCIAL_PROVIDER)}catch{console.info("Unable to remove telegram social provider")}},getBalanceCache(){let e={};try{let t=r.Ud.getItem(r.Ws.PORTFOLIO_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get balance cache")}return e},removeAddressFromBalanceCache(e){try{let t=s.getBalanceCache();r.Ud.setItem(r.Ws.PORTFOLIO_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove address from balance cache",e)}},getBalanceCacheForCaipAddress(e){try{let t=s.getBalanceCache()[e];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.portfolio))return t.balance;s.removeAddressFromBalanceCache(e)}catch{console.info("Unable to get balance cache for address",e)}},updateBalanceCache(e){try{let t=s.getBalanceCache();t[e.caipAddress]=e,r.Ud.setItem(r.Ws.PORTFOLIO_CACHE,JSON.stringify(t))}catch{console.info("Unable to update balance cache",e)}},getNativeBalanceCache(){let e={};try{let t=r.Ud.getItem(r.Ws.NATIVE_BALANCE_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get balance cache")}return e},removeAddressFromNativeBalanceCache(e){try{let t=s.getBalanceCache();r.Ud.setItem(r.Ws.NATIVE_BALANCE_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove address from balance cache",e)}},getNativeBalanceCacheForCaipAddress(e){try{let t=s.getNativeBalanceCache()[e];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.nativeBalance))return t;console.info("Discarding cache for address",e),s.removeAddressFromBalanceCache(e)}catch{console.info("Unable to get balance cache for address",e)}},updateNativeBalanceCache(e){try{let t=s.getNativeBalanceCache();t[e.caipAddress]=e,r.Ud.setItem(r.Ws.NATIVE_BALANCE_CACHE,JSON.stringify(t))}catch{console.info("Unable to update balance cache",e)}},getEnsCache(){let e={};try{let t=r.Ud.getItem(r.Ws.ENS_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get ens name cache")}return e}
78,getEnsFromCacheForAddress(e){try{let t=s.getEnsCache()[e];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.ens))return t.ens;s.removeEnsFromCache(e)}catch{console.info("Unable to get ens name from cache",e)}},updateEnsCache(e){try{let t=s.getEnsCache();t[e.address]=e,r.Ud.setItem(r.Ws.ENS_CACHE,JSON.stringify(t))}catch{console.info("Unable to update ens name cache",e)}},removeEnsFromCache(e){try{let t=s.getEnsCache();r.Ud.setItem(r.Ws.ENS_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove ens name from cache",e)}},getIdentityCache(){let e={};try{let t=r.Ud.getItem(r.Ws.IDENTITY_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get identity cache")}return e},getIdentityFromCacheForAddress(e){try{let t=s.getIdentityCache()[e];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.identity))return t.identity;s.removeIdentityFromCache(e)}catch{console.info("Unable to get identity from cache",e)}},updateIdentityCache(e){try{let t=s.getIdentityCache();t[e.address]={identity:e.identity,timestamp:e.timestamp},r.Ud.setItem(r.Ws.IDENTITY_CACHE,JSON.stringify(t))}catch{console.info("Unable to update identity cache",e)}},removeIdentityFromCache(e){try{let t=s.getIdentityCache();r.Ud.setItem(r.Ws.IDENTITY_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove identity from cache",e)}},getTonWalletsCache(){try{let e=r.Ud.getItem(r.Ws.TON_WALLETS_CACHE),t=e?JSON.parse(e):void 0;if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.tonWallets))return t;s.removeTonWalletsCache()}catch{console.info("Unable to get ton wallets cache")}},updateTonWalletsCache(e){try{let t=s.getTonWalletsCache()||{timestamp:0,wallets:[]};t.timestamp=new Date().getTime(),t.wallets=e,r.Ud.setItem(r.Ws.TON_WALLETS_CACHE,JSON.stringify(t))}catch{console.info("Unable to update ton wallets cache",e)}},removeTonWalletsCache(){try{r.Ud.removeItem(r.Ws.TON_WALLETS_CACHE)}catch{console.info("Unable to remove ton wallets cache")}},clearAddressCache(){try{r.Ud.removeItem(r.Ws.PORTFOLIO_CACHE),r.Ud.removeItem(r.Ws.NATIVE_BALANCE_CACHE),r.Ud.removeItem(r.Ws.ENS_CACHE),r.Ud.removeItem(r.Ws.IDENTITY_CACHE),r.Ud.removeItem(r.Ws.HISTORY_TRANSACTIONS_CACHE)}catch{console.info("Unable to clear address cache")}},setPreferredAccountTypes(e){try{r.Ud.setItem(r.Ws.PREFERRED_ACCOUNT_TYPES,JSON.stringify(e))}catch{console.info("Unable to set preferred account types",e)}},getPreferredAccountTypes(){try{let e=r.Ud.getItem(r.Ws.PREFERRED_ACCOUNT_TYPES);if(!e)return{};return JSON.parse(e)}catch{console.info("Unable to get preferred account types")}return{}},setConnections(e,t){try{let i=s.getConnections(),a=i[t]??[],o=new Map;for(let e of a)o.set(e.connectorId,{...e});for(let t of e){let e=o.get(t.connectorId),i=t.connectorId===n.o.CONNECTOR_ID.AUTH;if(e&&!i){let i=new Set(e.accounts.map(e=>e.address.toLowerCase())),r=t.accounts.filter(e=>!i.has(e.address.toLowerCase()));e.accounts.push(...r)}else o.set(t.connectorId,{...t})}let l={...i,[t]:Array.from(o.values())};r.Ud.setItem(r.Ws.CONNECTIONS,JSON.stringify(l))}catch(e){console.error("Unable to sync connections to storage",e)}},getConnections(){try{let e=r.Ud.getItem(r.Ws.CONNECTIONS);if(!e)return{};return JSON.parse(e)}catch(e){return console.error("Unable to get connections from storage",e),{}}},deleteAddressFromConnection({connectorId:e,address:t,namespace:i}){try{let n=s.getConnections(),a=n[i]??[],o=new Map(a.map(e=>[e.connectorId,e])),l=o.get(e);if(l){let i=l.accounts.filter(e=>e.address.toLowerCase()!==t.toLowerCase());0===i.length?o.delete(e):o.set(e,{...l,accounts:l.accounts.filter(e=>e.address.toLowerCase()!==t.toLowerCase())})}r.Ud.setItem(r.Ws.CONNECTIONS,JSON.stringify({...n,[i]:Array.from(o.values())}))}catch{console.error(`Unable to remove address "${t}" from connector "${e}" in namespace "${i}"`)}},getDisconnectedConnectorIds(){try{let e=r.Ud.getItem(r.Ws.DISCONNECTED_CONNECTOR_IDS);if(!e)return{};return JSON.parse(e)}catch{console.info("Unable to get disconnected connector ids")}return{}},addDisconnectedConnectorId(e,t){try{let i=s.getDisconnectedConnectorIds(),n=i[t]??[];n.push(e),r.Ud.setItem(r.Ws.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...i,[t]:Array.from(new Set(n))}))}catch{console.error(`Unable to set disconnected connector id "${e}" for namespace "${t}"`)}},removeDisconnectedConnectorId(e,t){try{let i=s.getDisconnectedConnectorIds(),n=i[t]??[];n=n.filter(t=>t.toLowerCase()!==e.toLowerCase()),r.Ud.setItem(r.Ws.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...i,[t]:Array.from(new Set(n))}))}catch{console.error(`Unable to remove disconnected connector id "${e}" for namespace "${t}"`)}},isConnectorDisconnected(e,t){try{return(s.getDisconnectedConnectorIds()[t]??[]).some(t=>t.toLowerCase()===e.toLowerCase())}catch{console.info(`Unable to get disconnected connector id "${e}" for namespace "${t}"`)}return!1},getTransactionsCache(){try{let e=r.Ud.getItem(r.Ws.HISTORY_TRANSACTIONS_CACHE);return e?JSON.parse(e):{}}catch{console.info("Unable to get transactions cache")}return{}},getTransactionsCacheForAddress({address:e,chainId:t=""}){try{let i=s.getTransactionsCache(),r=i[e]?.[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.transactionsHistory)
78)return r.transactions;s.removeTransactionsCache({address:e,chainId:t})}catch{console.info("Unable to get transactions cache")}},updateTransactionsCache({address:e,chainId:t="",timestamp:i,transactions:n}){try{let a=s.getTransactionsCache();a[e]={...a[e],[t]:{timestamp:i,transactions:n}},r.Ud.setItem(r.Ws.HISTORY_TRANSACTIONS_CACHE,JSON.stringify(a))}catch{console.info("Unable to update transactions cache",{address:e,chainId:t,timestamp:i,transactions:n})}},removeTransactionsCache({address:e,chainId:t}){try{let i=s.getTransactionsCache(),{[t]:n,...a}=i?.[e]||{};r.Ud.setItem(r.Ws.HISTORY_TRANSACTIONS_CACHE,JSON.stringify({...i,[e]:a}))}catch{console.info("Unable to remove transactions cache",{address:e,chainId:t})}},getTokenPriceCache(){try{let e=r.Ud.getItem(r.Ws.TOKEN_PRICE_CACHE);return e?JSON.parse(e):{}}catch{console.info("Unable to get token price cache")}return{}},getTokenPriceCacheForAddresses(e){try{let t=s.getTokenPriceCache()[e.join(",")];if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.tokenPrice))return t.tokenPrice;s.removeTokenPriceCache(e)}catch{console.info("Unable to get token price cache for addresses",e)}},updateTokenPriceCache(e){try{let t=s.getTokenPriceCache();t[e.addresses.join(",")]={timestamp:e.timestamp,tokenPrice:e.tokenPrice},r.Ud.setItem(r.Ws.TOKEN_PRICE_CACHE,JSON.stringify(t))}catch{console.info("Unable to update token price cache",e)}},removeTokenPriceCache(e){try{let t=s.getTokenPriceCache();r.Ud.setItem(r.Ws.TOKEN_PRICE_CACHE,JSON.stringify({...t,[e.join(",")]:void 0}))}catch{console.info("Unable to remove token price cache",e)}},getLatestAppKitVersion(){try{let e=this.getLatestAppKitVersionCache(),t=e?.version;if(t&&!this.isCacheExpired(e.timestamp,this.cacheExpiry.latestAppKitVersion))return t}catch{console.info("Unable to get latest AppKit version")}},getLatestAppKitVersionCache(){try{let e=r.Ud.getItem(r.Ws.LATEST_APPKIT_VERSION);return e?JSON.parse(e):{}}catch{console.info("Unable to get latest AppKit version cache")}return{}},updateLatestAppKitVersion(e){try{let t=s.getLatestAppKitVersionCache();t.timestamp=e.timestamp,t.version=e.version,r.Ud.setItem(r.Ws.LATEST_APPKIT_VERSION,JSON.stringify(t))}catch{console.info("Unable to update latest AppKit version on local storage",e)}}}},5873:(e,t,i)=>{"use strict";i.d(t,{D5:()=>V,U5:()=>z,iP:()=>H,oI:()=>q});var r={exports:{}};function n(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}let s=function(e,t,i){var r=i&&i.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var a=Array(s);a[0]=r(e);for(var o=1;o<s;o++)a[o]=r(t[o]);return a.join(" ")}if("string"!=typeof e)return e;var l=t.length;if(0===l)return e;for(var c="",d=0,h=-1,u=e&&e.length||0,p=0;p<u;){if(37===e.charCodeAt(p)&&p+1<u){switch(h=h>-1?h:0,e.charCodeAt(p+1)){case 100:case 102:if(d>=l||null==t[d])break;h<p&&(c+=e.slice(h,p)),c+=Number(t[d]),h=p+2,p++;break;case 105:if(d>=l||null==t[d])break;h<p&&(c+=e.slice(h,p)),c+=Math.floor(Number(t[d])),h=p+2,p++;break;case 79:case 111:case 106:if(d>=l||void 0===t[d])break;h<p&&(c+=e.slice(h,p));var f=typeof t[d];if("string"===f){c+="'"+t[d]+"'",h=p+2,p++;break}if("function"===f){c+=t[d].name||"<anonymous>",h=p+2,p++;break}c+=r(t[d]),h=p+2,p++;break;case 115:if(d>=l)break;h<p&&(c+=e.slice(h,p)),c+=String(t[d]),h=p+2,p++;break;case 37:h<p&&(c+=e.slice(h,p)),c+="%",h=p+2,p++,d--}++d}++p}return -1===h?e:(h<u&&(c+=e.slice(h)),c)};r.exports=u;let a=function(){function e(e){return"u">typeof e&&e}try{return"u">typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}().console||{};function o(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),c=Symbol("pino.hierarchy"),d={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function h(e,t){let i={logger:t,parent:e[c]};t[c]=i}function u(e){var t,i,r;let n,s,c;(e=e||{}).browser=e.browser||{};let m=e.browser.transmit;if(m&&"function"!=typeof m.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||a;e.browser.write&&(e.browser.asObject=!0);let y=e.serializers||{},E=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(y)),x=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(x=!1);let A=Object.keys(e.customLevels||{}),_=["error","fatal","warn","info","debug","trace"].concat(A);"function"==typeof w&&_.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let I=e.level||"info",S=Object.create(w);S.log||(S.log=b),n={}
78,_.forEach(e=>{n[e]=w[e]?w[e]:a[e]||a[d[e]||"log"]||b}),S[l]=n,h({},S),Object.defineProperty(S,"levelVal",{get:function(){return o(this.level,this)}}),Object.defineProperty(S,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,p(this,N,S,"error"),p(this,N,S,"fatal"),p(this,N,S,"warn"),p(this,N,S,"info"),p(this,N,S,"debug"),p(this,N,S,"trace"),A.forEach(e=>{p(this,N,S,e)})}});let N={transmit:m,serialize:E,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:_,timestamp:"function"==typeof(i=e).timestamp?i.timestamp:!1===i.timestamp?v:C,messageKey:e.messageKey||"msg",onChild:e.onChild||b};function k(t,i,r){if(!i)throw Error("missing bindings for child Pino");r=r||{},E&&i.serializers&&(r.serializers=i.serializers);let n=r.serializers;if(E&&n){var s=Object.assign({},y,n),a=!0===e.browser.serialize?Object.keys(s):E;delete i.serializers,f([i],a,s,this._stdErrSerialize)}function o(e){this._childLevel=(0|e._childLevel)+1,this.bindings=i,s&&(this.serializers=s,this._serialize=a),m&&(this._logEvent=g([].concat(e._logEvent.bindings,i)))}o.prototype=this;let l=new o(this);return h(this,l),l.child=function(...e){return k.call(this,t,...e)},l.level=r.level||this.level,t.onChild(l),l}return s=e.customLevels||{},S.levels={values:Object.assign({},u.levels.values,s),labels:Object.assign({},u.levels.labels,(c={},Object.keys(r=s).forEach(function(e){c[r[e]]=e}),c))},S.level=I,S.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},S.setMaxListeners=S.getMaxListeners=S.emit=S.addListener=S.on=S.prependListener=S.once=S.prependOnceListener=S.removeListener=S.removeAllListeners=S.listeners=S.listenerCount=S.eventNames=S.write=S.flush=b,S.serializers=y,S._serialize=E,S._stdErrSerialize=x,S.child=function(...e){return k.call(this,N,...e)},m&&(S._logEvent=g()),S}function p(e,t,i,r){var n,d,h,u,p,m,w;if(Object.defineProperty(e,r,{value:o(e.level,i)>o(r,i)?b:i[l][r],writable:!0,enumerable:!0,configurable:!0}),e[r]===b){if(!t.transmit)return;let n=o(t.transmit.level||e.level,i);if(o(r,i)<n)return}e[r]=(n=e,d=t,h=i,u=r,p=n[l][u],function(){let e=d.timestamp(),t=Array(arguments.length),i=Object.getPrototypeOf&&Object.getPrototypeOf(this)===a?a:this;for(var r=0;r<t.length;r++)t[r]=arguments[r];var l=!1;if(d.serialize&&(f(t,this._serialize,this.serializers,this._stdErrSerialize),l=!0),d.asObject||d.formatters?p.call(i,...function(e,t,i,r,n){let{level:a,log:o=e=>e}=n.formatters||{},l=i.slice(),c=l[0],d={},h=(0|e._childLevel)+1;if((h<1&&(h=1),r&&(d.time=r),a)?Object.assign(d,a(t,e.levels.values[t])):d.level=e.levels.values[t],n.asObjectBindingsOnly){if(null!==c&&"object"==typeof c)for(;h--&&"object"==typeof l[0];)Object.assign(d,l.shift());return[o(d),...l]}if(null!==c&&"object"==typeof c){for(;h--&&"object"==typeof l[0];)Object.assign(d,l.shift());c=l.length?s(l.shift(),l):void 0}else"string"==typeof c&&(c=s(l.shift(),l));return void 0!==c&&(d[n.messageKey]=c),[o(d)]}(this,u,t,e,d)):p.apply(i,t),d.transmit){let i=d.transmit.level||n._level,r=o(i,h),s=o(u,h);if(s<r)return;!function(e,t,i,r=!1){let n=t.send,s=t.ts,a=t.methodLevel,o=t.methodValue,l=t.val,c=e._logEvent.bindings;r||f(i,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=i.filter(function(e){return -1===c.indexOf(e)}),e._logEvent.level.label=a,e._logEvent.level.value=o,n(a,e._logEvent,l),e._logEvent=g(c)}(this,{ts:e,methodLevel:u,methodValue:s,transmitLevel:i,transmitValue:h.levels.values[d.transmit.level||n._level],send:d.transmit.send,val:o(n._level,h)},t,l)}});let y=function(e){let t=[];e.bindings&&t.push(e.bindings);let i=e[c];for(;i.parent;)(i=i.parent).logger.bindings&&t.push(i.logger.bindings);return t.reverse()}(e);0!==y.length&&(e[r]=(m=y,w=e[r],function(){return w.apply(this,[...m,...arguments])}))}function f(e,t,i,r){for(let n in e)if(r&&e[n]instanceof Error)e[n]=u.stdSerializers.err(e[n]);else if("object"==typeof e[n]&&!Array.isArray(e[n])&&t)for(let r in e[n])t.indexOf(r)>-1&&r in i&&(e[n][r]=i[r](e[n][r]))}function g(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function m(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let i in e)void 0===t[i]&&(t[i]=e[i]);return t}function w(){return{}}function y(e){return e}function b(){}function v(){return!1}function C(){return Date.now()}u.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},u.stdSerializers={mapHttpRequest:w,mapHttpResponse:w,wrapRequestSerializer:y,wrapResponseSerializer:y,wrapErrorSerializer:y,req:w,res:w,err:m,errWithCause:m},u.stdTimeFunctions=Object.assign({},{nullTime:v,epochTime:C,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),r.exports.default=u,r.exports.pino=u;let E="custom_context";var x=Object.defineProperty,A=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?x(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};
78class _{constructor(e){A(this,"nodeValue"),A(this,"sizeInBytes"),A(this,"next"),this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class I{constructor(e){A(this,"lengthInNodes"),A(this,"sizeInBytes"),A(this,"head"),A(this,"tail"),A(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new _(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?this.tail&&(this.tail.next=t):this.head=t,this.tail=t,this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}}function S(e){return"string"==typeof e?e:JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t)||""}var N=Object.defineProperty,k=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?N(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class T{constructor(e,t=1024e3){k(this,"logs"),k(this,"level"),k(this,"levelValue"),k(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=e??"error",this.levelValue=r.exports.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new I(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===r.exports.levels.values.error?console.error(e):t===r.exports.levels.values.warn?console.warn(e):t===r.exports.levels.values.debug?console.debug(e):t===r.exports.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(S({timestamp:new Date().toISOString(),log:e}));let t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new I(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push(S({extraMetadata:e})),new Blob(t,{type:"application/json"})}}var O=Object.defineProperty;class R{constructor(e,t=1024e3){((e,t)=>{let i,r;return r=void 0,(i="symbol"!=typeof t?t+"":t)in e?O(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r})(this,"baseChunkLogger"),this.baseChunkLogger=new T(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=t,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}}var P=Object.defineProperty;class ${constructor(e,t=1024e3){((e,t)=>{let i,r;return r=void 0,(i="symbol"!=typeof t?t+"":t)in e?P(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r})(this,"baseChunkLogger"),this.baseChunkLogger=new T(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var U=Object.defineProperty,M=Object.defineProperties,D=Object.getOwnPropertyDescriptors,L=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,j=(e,t,i)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,F=(e,t)=>{for(var i in t||(t={}))W.call(t,i)&&j(e,i,t[i]);if(L)for(var i of L(t))B.call(t,i)&&j(e,i,t[i]);return e};function H(e){return M(F({},e),D({level:e?.level||"info"}))}function q(e,t=E){return e[t]||""}function z(e,t,i=E){let r=function(e,t,i=E){let r=q(e,i);return r.trim()?`${r}/${t}`:t}(e,t,i);return function(e,t,i=E){return e[i]=t,e}(e.child({context:r}),r,i)}function V(e){var t,i,n,s,a,o,l;
78let c,d,h,u,p,f;if("u">typeof e.loggerOverride&&"string"!=typeof e.loggerOverride)return{logger:e.loggerOverride,chunkLoggerController:null};let g=M(F({},e.opts),D({level:"string"==typeof e.loggerOverride?e.loggerOverride:null==(t=e.opts)?void 0:t.level}));return"u">typeof window?(h=new R(null==(n=(i=M(F({},e),D({opts:g}))).opts)?void 0:n.level,i.maxSizeInBytes),{logger:r.exports((c=F({},i.opts),d={level:"trace",browser:M(F({},null==(s=i.opts)?void 0:s.browser),D({write:e=>h.write(e)}))},M(c,D(d)))),chunkLoggerController:h}):(f=new $(null==(o=(a=M(F({},e),D({opts:g}))).opts)?void 0:o.level,a.maxSizeInBytes),{logger:r.exports((u=F({},a.opts),p={level:"trace",browser:M(F({},null==(l=a.opts)?void 0:l.browser),D({write:e=>f.write(e)}))},M(u,D(p))),f),chunkLoggerController:f})}},7046:(e,t,i)=>{"use strict";i.d(t,{A:()=>u});var r=i(72594),n=i(92929),s=i(60319),a=i(11446),o=i(11403),l=i(88570),c=i(29400),d=i(37056),h=i(5820);let u={filterOutDuplicatesByRDNS(e){let t=o.H.state.enableEIP6963?a.a.state.connectors:[],i=h.i.getRecentWallets(),r=t.map(e=>e.info?.rdns).filter(Boolean),n=i.map(e=>e.rdns).filter(Boolean),s=r.concat(n);if(s.includes("io.metamask.mobile")&&d.w.isMobile()){let e=s.indexOf("io.metamask.mobile");s[e]="io.metamask"}return e.filter(e=>!(e?.rdns&&s.includes(String(e.rdns))||!e?.rdns&&t.some(t=>t.name===e.name))&&!0)},filterOutDuplicatesByIds(e){let t=a.a.state.connectors.filter(e=>"ANNOUNCED"===e.type||"INJECTED"===e.type||"MULTI_CHAIN"===e.type),i=h.i.getRecentWallets(),r=t.map(e=>e.explorerId||e.explorerWallet?.id||e.id),n=i.map(e=>e.id),s=r.concat(n);return e.filter(e=>!s.includes(e?.id))},filterOutDuplicateWallets(e){let t=this.filterOutDuplicatesByRDNS(e);return this.filterOutDuplicatesByIds(t)},markWalletsAsInstalled(e){let{connectors:t}=a.a.state,{featuredWalletIds:i}=o.H.state,r=t.filter(e=>"ANNOUNCED"===e.type).reduce((e,t)=>(t.info?.rdns&&(e[t.info.rdns]=!0),e),{});return e.map(e=>({...e,installed:!!e.rdns&&!!r[e.rdns??""]})).sort((e,t)=>{let r=Number(t.installed)-Number(e.installed);if(0!==r)return r;if(i?.length){let r=i.indexOf(e.id),n=i.indexOf(t.id);if(-1!==r&&-1!==n)return r-n;if(-1!==r)return -1;if(-1!==n)return 1}return 0})},getConnectOrderMethod(e,t){let i=e?.connectMethodsOrder||o.H.state.features?.connectMethodsOrder,r=t||a.a.state.connectors;if(i)return i;let{injected:s,announced:d}=l.g.getConnectorsByType(r,n.N.state.recommended,n.N.state.featured),h=s.filter(l.g.showConnector),u=d.filter(l.g.showConnector);return h.length||u.length?["wallet","email","social"]:c.oU.DEFAULT_CONNECT_METHOD_ORDER},isExcluded(e){let t=!!e.rdns&&n.N.state.excludedWallets.some(t=>t.rdns===e.rdns),i=!!e.name&&n.N.state.excludedWallets.some(t=>r.y.isLowerCaseMatch(t.name,e.name));return t||i},markWalletsWithDisplayIndex:e=>e.map((e,t)=>({...e,display_index:t})),filterWalletsByWcSupport:e=>s.x.state.wcBasic?e.filter(e=>e.supports_wc):d.w.isMobile()?e.filter(e=>e.supports_wc||c.oU.MANDATORY_WALLET_IDS_ON_MOBILE.includes(e.id)):e,getWalletConnectWallets(e){let t=[...n.N.state.featured,...n.N.state.recommended];n.N.state.filteredWallets?.length>0?t.push(...n.N.state.filteredWallets):t.push(...e);let i=d.w.uniqueBy(t,"id"),r=u.markWalletsAsInstalled(i),s=u.filterWalletsByWcSupport(r);return u.markWalletsWithDisplayIndex(s)}}},8452:(e,t)=>
78{let i=new Uint8Array(512),r=new Uint8Array(256),n=1;for(let e=0;e<255;e++)i[e]=n,r[n]=e,256&(n<<=1)&&(n^=285);for(let e=255;e<512;e++)i[e]=i[e-255];t.log=function(e){if(e<1)throw Error("log("+e+")");return r[e]},t.exp=function(e){return i[e]},t.mul=function(e,t){return 0===e||0===t?0:i[r[e]+r[t]]}},8532:function(e){e.exports=function(e,t,i){e=e||{};var r=t.prototype,n={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(e,t,i,n){return r.fromToBase(e,t,i,n)}i.en.relativeTime=n,r.fromToBase=function(t,r,s,a,o){for(var l,c,d,h=s.$locale().relativeTime||n,u=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=u.length,f=0;f<p;f+=1){var g=u[f];g.d&&(l=a?i(t).diff(s,g.d,!0):s.diff(t,g.d,!0));var m=(e.rounding||Math.round)(Math.abs(l));if(d=l>0,m<=g.r||!g.r){m<=1&&f>0&&(g=u[f-1]);var w=h[g.l];o&&(m=o(""+m)),c="string"==typeof w?w.replace("%d",m):w(m,r,g.l,d);break}}if(r)return c;var y=d?h.future:h.past;return"function"==typeof y?y(c):y.replace("%s",c)},r.to=function(e,t){return s(e,t,this,!0)},r.from=function(e,t){return s(e,t,this)};var a=function(e){return e.$u?i.utc():i()};r.toNow=function(e){return this.to(a(this),e)},r.fromNow=function(e){return this.from(a(this),e)}}},8586:(e,t,i)=>{"use strict";i.d(t,{$f:()=>p,V1:()=>h,cz:()=>d,lZ:()=>u,nj:()=>m,ro:()=>c,sP:()=>f});var r=i(30840),n=i(11403);let s={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}},a={56:"714",204:"714"};class o extends Error{}async function l(e,t){let i=function(){let{sdkType:e,sdkVersion:t,projectId:i}=n.H.getSnapshot(),r=new URL("https://rpc.walletconnect.org/v1/json-rpc");return r.searchParams.set("projectId",i),r.searchParams.set("st",e),r.searchParams.set("sv",t),r.searchParams.set("source","fund-wallet"),r.toString()}(),{projectId:r}=n.H.getSnapshot(),s={jsonrpc:"2.0",id:1,method:e,params:{...t||{},projectId:r}},a=await fetch(i,{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}}),l=await a.json();if(l.error)throw new o(l.error.message);return l}async function c(e){return(await l("reown_getExchanges",e)).result}async function d(e){return(await l("reown_getExchangePayUrl",e)).result}async function h(e){return(await l("reown_getExchangeBuyStatus",e)).result}function u(e,t){let{chainNamespace:i,chainId:n}=r.C.parseCaipNetworkId(e),o=s[i];if(!o)throw Error(`Unsupported chain namespace for CAIP-19 formatting: ${i}`);let l=o.native.assetNamespace,c=o.native.assetReference;"native"!==t?(l=o.defaultTokenNamespace,c=t):"eip155"===i&&a[n]&&(c=a[n]);let d=`${i}:${n}`;return`${d}/${l}
78:${c}`}let p={network:"eip155:8453",asset:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},f={network:"eip155:84532",asset:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},g={ethereumETH:{network:"eip155:1",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},baseETH:{network:"eip155:8453",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},baseUSDC:p,baseSepoliaETH:{network:"eip155:84532",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},ethereumUSDC:{network:"eip155:1",asset:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},arbitrumUSDC:{network:"eip155:42161",asset:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},polygonUSDC:{network:"eip155:137",asset:"0x2791bca1f2de4661ed88a30c99a7a9449aa84174",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},solanaUSDC:{network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},ethereumUSDT:{network:"eip155:1",asset:"0xdAC17F958D2ee523a2206206994597C13D831ec7",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},optimismUSDT:{network:"eip155:10",asset:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},arbitrumUSDT:{network:"eip155:42161",asset:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},polygonUSDT:{network:"eip155:137",asset:"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},solanaUSDT:{network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},solanaSOL:{network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"native",metadata:{name:"Solana",symbol:"SOL",decimals:9}}};function m(e){return Object.values(g).filter(t=>t.network===e)}},11194:function(e){e.exports=function(e,t,i){i.updateLocale=function(e,t){var r=i.Ls[e];if(r)return(t?Object.keys(t):[]).forEach(function(e){r[e]=t[e]}),r}}},11282:(e,t,i)=>{"use strict";i.d(t,{g:()=>m});var r=i(30840),n=i(34386),s=i(67066),a=i(1024),o=i(60319),l=i(11446),c=i(43242),d=i(24568),h=i(44458),u=i(33452),p=i(29400),f=i(37056),g=i(5820);let m={checkNamespaceConnectorId:(e,t)=>l.a.getConnectorId(e)===t,isSocialProvider:e=>p.oU.DEFAULT_REMOTE_FEATURES.socials.includes(e),connectWalletConnect:({walletConnect:e,connector:t,closeModalOnConnect:i=!0,redirectViewOnModalClose:n="Connect",onOpen:s,onConnect:o})=>new Promise((c,u)=>{if(e&&l.a.setActiveConnector(t),s?.(f.w.isMobile()&&e),n){let e=d.W.subscribeKey("open",t=>{t||(h.I.state.view!==n&&h.I.replace(n),e(),u(Error("Modal closed")))})}let p=a.W.subscribeKey("activeCaipAddress",e=>{e&&(o?.(),i&&d.W.close(),p(),c(r.C.parseCaipAddress(e)))})}),connectExternal:e=>new Promise((t,i)=>{let n=a.W.subscribeKey("activeCaipAddress",e=>{e&&(d.W.close(),n(),t(r.C.parseCaipAddress(e)))});o.x.connectExternal(e,e.chain).catch(()=>{n(),i(Error("Connection rejected"))})}),connectSocial({social:e,namespace:t,closeModalOnConnect:i=!0,onOpenFarcaster:s,onConnect:h}){let u,p=!1,m=null,w=t||a.W.state.activeChain,y=a.W.subscribeKey("activeCaipAddress",e=>{e&&(i&&d.W.close(),y())});return new Promise((t,i)=>{async function y(s){if(s.data?.resultUri)if(s.origin===n.o.SECURE_SITE_SDK_ORIGIN){window.removeEventListener("message",y,!1);try{let n=l.a.getAuthConnector(w);if(n&&!p){u&&u.close(),p=!0;let l=s.data.resultUri;c.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:e}}),g.i.setConnectedSocialProvider(e),await o.x.connectExternal({id:n.id,type:n.type,socialUri:l},n.chain);let d=a.W.state.activeCaipAddress;if(!d)return void i(Error("Failed to connect"));t(r.C.parseCaipAddress(d)),c.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:e}})}}catch(t){c.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:f.w.parseError(t)}}),i(Error("Failed to connect"))}}else c.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:"Untrusted Origin"}})}!async function(){if(c.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}
78),"farcaster"===e){s?.();let t=d.W.subscribeKey("open",r=>{r||"farcaster"!==e||(i(Error("Popup closed")),h?.(),t())}),r=l.a.getAuthConnector();if(r){let e=a.W.getAccountData(w);if(!e?.farcasterUrl)try{let{url:e}=await r.provider.getFarcasterUri();a.W.setAccountProp("farcasterUrl",e,w)}catch{i(Error("Failed to connect to farcaster"))}}}else{let t=l.a.getAuthConnector();m=f.w.returnOpenHref(`${n.o.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes");try{if(t){let{uri:r}=await t.provider.getSocialRedirectUri({provider:e});if(m&&r){m.location.href=r,u=m;let e=setInterval(()=>{u?.closed&&!p&&(i(Error("Popup closed")),clearInterval(e))},1e3);window.addEventListener("message",y,!1)}else m?.close(),i(Error("Failed to initiate social connection"))}}catch{i(Error("Failed to initiate social connection")),m?.close()}}}()})},connectEmail:({closeModalOnConnect:e=!0,redirectViewOnModalClose:t="Connect",onOpen:i,onConnect:n})=>new Promise((s,o)=>{if(i?.(),t){let e=d.W.subscribeKey("open",i=>{i||(h.I.state.view!==t&&h.I.replace(t),e(),o(Error("Modal closed")))})}let l=a.W.subscribeKey("activeCaipAddress",t=>{t&&(n?.(),e&&d.W.close(),l(),s(r.C.parseCaipAddress(t)))})}),async updateEmail(){let e=g.i.getConnectedConnectorId(a.W.state.activeChain),t=l.a.getAuthConnector();if(!t)throw Error("No auth connector found");if(e!==n.o.CONNECTOR_ID.AUTH)throw Error("Not connected to email or social");let i=t.provider.getEmail()??"";return await d.W.open({view:"UpdateEmailWallet",data:{email:i,redirectView:void 0}}),new Promise((e,r)=>{let n=setInterval(()=>{let r=t.provider.getEmail()??"";r!==i&&(d.W.close(),clearInterval(n),s(),e({email:r}))},1e3),s=d.W.subscribeKey("open",e=>{e||("Connect"!==h.I.state.view&&h.I.push("Connect"),clearInterval(n),s(),r(Error("Modal closed")))})})},canSwitchToSmartAccount:e=>a.W.checkIfSmartAccountEnabled()&&(0,u.lj)(e)===s.Vl.ACCOUNT_TYPES.EOA}},11403:(e,t,i)=>{"use strict";i.d(t,{H:()=>c});var r=i(92679),n=i(3125),s=i(29400),a=i(37056),o=i(66395);let l=(0,r.BX)({features:s.oU.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined",defaultAccountTypes:s.oU.DEFAULT_ACCOUNT_TYPES,enableNetworkSwitch:!0,experimental_preferUniversalLinks:!1,remoteFeatures:{},enableMobileFullScreen:!1,coinbasePreference:"all"}),c={state:l,subscribeKey:(e,t)=>(0,n.u$)(l,e,t),setOptions(e){Object.assign(l,e)},setRemoteFeatures(e){if(!e)return;let t={...l.remoteFeatures,...e};l.remoteFeatures=t,l.remoteFeatures?.socials&&(l.remoteFeatures.socials=o.D.filterSocialsByPlatform(l.remoteFeatures.socials)),l.features?.pay&&(l.remoteFeatures.email=!1,l.remoteFeatures.socials=!1)},setFeatures(e){if(!e)return;l.features||(l.features=s.oU.DEFAULT_FEATURES);let t={...l.features,...e};l.features=t,l.features?.pay&&l.remoteFeatures&&(l.remoteFeatures.email=!1,l.remoteFeatures.socials=!1)},setProjectId(e){l.projectId=e},setCustomRpcUrls(e){l.customRpcUrls=e},setAllWallets(e){l.allWallets=e},setIncludeWalletIds(e){l.includeWalletIds=e},setExcludeWalletIds(e){l.excludeWalletIds=e},setFeaturedWalletIds(e){l.featuredWalletIds=e},setTokens(e){l.tokens=e},setTermsConditionsUrl(e){l.termsConditionsUrl=e},setPrivacyPolicyUrl(e){l.privacyPolicyUrl=e},setCustomWallets(e){l.customWallets=e},setIsSiweEnabled(e){l.isSiweEnabled=e},setIsUniversalProvider(e){l.isUniversalProvider=e},setSdkVersion(e){l.sdkVersion=e},setMetadata(e){l.metadata=e},setDisableAppend(e){l.disableAppend=e},setEIP6963Enabled(e){l.enableEIP6963=e},setEnableCoinbase(e){l.enableCoinbase=e},setDebug(e){l.debug=e},setEnableWalletGuide(e){l.enableWalletGuide=e},setEnableAuthLogger(e){l.enableAuthLogger=e},setEnableWallets(e){l.enableWallets=e},setPreferUniversalLinks(e){l.experimental_preferUniversalLinks=e},setSIWX(e){if(e)for(let[t,i]of Object.entries(s.oU.SIWX_DEFAULTS))e[t]??=i;l.siwx=e},setConnectMethodsOrder(e){l.features={...l.features,connectMethodsOrder:e}},setWalletFeaturesOrder(e){l.features={...l.features,walletFeaturesOrder:e}},setSocialsOrder(e){l.remoteFeatures={...l.remoteFeatures,socials:e}},setCollapseWallets(e){l.features={...l.features,collapseWallets:e}},setEnableEmbedded(e){l.enableEmbedded=e},setAllowUnsupportedChain(e){l.allowUnsupportedChain=e},setManualWCControl(e){l.manualWCControl=e},setEnableNetworkSwitch(e){l.enableNetworkSwitch=e},setEnableMobileFullScreen(e){l.enableMobileFullScreen=a.w.isMobile()&&e},setEnableReconnect(e){l.enableReconnect=e},setCoinbasePreference(e){l.coinbasePreference=e},setDefaultAccountTypes(e={}){Object.entries(e).forEach(([e,t])=>{t&&(l.defaultAccountTypes[e]=t)})},setUniversalProviderConfigOverride(e){l.universalProviderConfigOverride=e},getUniversalProviderConfigOverride:()=>l.universalProviderConfigOverride,getSnapshot:()=>(0,r.P9)(l)}},11446:(e,t,i)=>{"use strict";i.d(t,{a:()=>x});var r=i(92679),n=i(3125),s=i(37633),a=i(34386),o=i(19626),l=i(67066),c=i(33452),d=i(885
7870),h=i(39564),u=i(5820),p=i(51369),f=i(92929),g=i(1024),m=i(24568),w=i(11403),y=i(44458),b=i(69148);let v=Object.fromEntries(s.P.map(e=>[e,void 0])),C=Object.fromEntries(s.P.map(e=>[e,!0])),E=(0,r.BX)({allConnectors:[],connectors:[],activeConnector:void 0,filterByNamespace:void 0,activeConnectorIds:v,filterByNamespaceMap:C}),x=(0,p.X)({state:E,subscribe:e=>(0,r.B1)(E,()=>{e(E)}),subscribeKey:(e,t)=>(0,n.u$)(E,e,t),initialize(e){e.forEach(e=>{let t=u.i.getConnectedConnectorId(e);t&&x.setConnectorId(t,e)})},setActiveConnector(e){e&&(E.activeConnector=(0,r.KR)(e))},setConnectors(e){e.filter(e=>!E.allConnectors.some(t=>t.id===e.id&&x.getConnectorName(t.name)===x.getConnectorName(e.name)&&t.chain===e.chain)).forEach(e=>{"MULTI_CHAIN"!==e.type&&E.allConnectors.push((0,r.KR)(e))});let t=x.getEnabledNamespaces(),i=x.getEnabledConnectors(t);E.connectors=x.mergeMultiChainConnectors(i)},filterByNamespaces(e){Object.keys(E.filterByNamespaceMap).forEach(e=>{E.filterByNamespaceMap[e]=!1}),e.forEach(e=>{E.filterByNamespaceMap[e]=!0}),x.updateConnectorsForEnabledNamespaces()},filterByNamespace(e,t){E.filterByNamespaceMap[e]=t,x.updateConnectorsForEnabledNamespaces()},updateConnectorsForEnabledNamespaces(){let e=x.getEnabledNamespaces(),t=x.getEnabledConnectors(e),i=x.areAllNamespacesEnabled();E.connectors=x.mergeMultiChainConnectors(t),i?f.N.clearFilterByNamespaces():f.N.filterByNamespaces(e)},getEnabledNamespaces:()=>Object.entries(E.filterByNamespaceMap).filter(([e,t])=>t).map(([e])=>e),getEnabledConnectors:e=>E.allConnectors.filter(t=>e.includes(t.chain)),areAllNamespacesEnabled:()=>Object.values(E.filterByNamespaceMap).every(e=>e),mergeMultiChainConnectors(e){let t=x.generateConnectorMapByName(e),i=[];return t.forEach(e=>{let t=e[0],r=t?.id===a.o.CONNECTOR_ID.AUTH;e.length>1&&t?i.push({name:t.name,imageUrl:t.imageUrl,imageId:t.imageId,connectors:[...e],type:r?"AUTH":"MULTI_CHAIN",chain:"eip155",id:t?.id||""}):t&&i.push(t)}),i},generateConnectorMapByName(e){let t=new Map;return e.forEach(e=>{let{name:i}=e,r=x.getConnectorName(i);if(!r)return;let n=t.get(r)||[];n.find(t=>t.chain===e.chain)||n.push(e),t.set(r,n)}),t},getConnectorName:e=>e&&({"Trust Wallet":"Trust"})[e]||e,getUniqueConnectorsByName(e){let t=[];return e.forEach(e=>{t.find(t=>t.chain===e.chain)||t.push(e)}),t},addConnector(e){if(e.id===a.o.CONNECTOR_ID.AUTH){let t=(0,r.P9)(w.H.state),i=b.W.getSnapshot().themeMode,n=b.W.getSnapshot().themeVariables;e?.provider?.syncDappData?.({metadata:t.metadata,sdkVersion:t.sdkVersion,projectId:t.projectId,sdkType:t.sdkType}),e?.provider?.syncTheme({themeMode:i,themeVariables:n,w3mThemeVariables:(0,o.o)(n,i)}),x.setConnectors([e])}else x.setConnectors([e])},getAuthConnector(e){let t=e||g.W.state.activeChain,i=E.connectors.find(e=>e.id===a.o.CONNECTOR_ID.AUTH);
78if(i)return i?.connectors?.length?i.connectors.find(e=>e.chain===t):i},getAnnouncedConnectorRdns:()=>E.connectors.filter(e=>"ANNOUNCED"===e.type).map(e=>e.info?.rdns),getConnectorById:e=>d.g.sortConnectorsByPriority(E.allConnectors).find(t=>t.id===e),getConnector({id:e,namespace:t}){let i=t||g.W.state.activeChain,r=E.allConnectors.filter(e=>e.chain===i);return d.g.sortConnectorsByPriority(r).find(t=>t.id===e||t.explorerId===e)},syncIfAuthConnector(e){if("AUTH"!==e.id)return;let t=(0,r.P9)(w.H.state),i=b.W.getSnapshot().themeMode,n=b.W.getSnapshot().themeVariables;e?.provider?.syncDappData?.({metadata:t.metadata,sdkVersion:t.sdkVersion,sdkType:t.sdkType,projectId:t.projectId}),e.provider.syncTheme({themeMode:i,themeVariables:n,w3mThemeVariables:(0,o.o)(n,i)})},getConnectorsByNamespace(e){let t=E.allConnectors.filter(t=>t.chain===e);return x.mergeMultiChainConnectors(t)},canSwitchToSmartAccount:e=>g.W.checkIfSmartAccountEnabled()&&(0,c.lj)(e)===l.Vl.ACCOUNT_TYPES.EOA,selectWalletConnector(e){let t=y.I.state.data?.redirectView,i=g.W.state.activeChain,r=i?x.getConnector({id:e.id,namespace:i}):void 0;h.W.handleMobileDeeplinkRedirect(r?.explorerId||e.id,g.W.state.activeChain,{isCoinbaseDisabled:!1===w.H.state.enableCoinbase}),r?y.I.push("ConnectingExternal",{connector:r,wallet:e,redirectView:t}):y.I.push("ConnectingWalletConnect",{wallet:e,redirectView:t})},getConnectors:e=>e?x.getConnectorsByNamespace(e):x.mergeMultiChainConnectors(E.allConnectors),setFilterByNamespace(e){E.filterByNamespace=e,E.connectors=x.getConnectors(e),f.N.setFilterByNamespace(e)},setConnectorId(e,t){e&&(E.activeConnectorIds={...E.activeConnectorIds,[t]:e},u.i.setConnectedConnectorId(t,e))},removeConnectorId(e){E.activeConnectorIds={...E.activeConnectorIds,[e]:void 0},u.i.deleteConnectedConnectorId(e)},getConnectorId(e){if(e)return E.activeConnectorIds[e]},isConnected:e=>e?!!E.activeConnectorIds[e]:Object.values(E.activeConnectorIds).some(e=>!!e),resetConnectorIds(){E.activeConnectorIds={...v}},extendConnectorsWithExplorerWallets(e){E.allConnectors.forEach(t=>{let i=e.find(e=>e.id===t.id||e.rdns&&e.rdns===t.info?.rdns);i&&(t.explorerWallet=i)});let t=x.getEnabledNamespaces(),i=x.getEnabledConnectors(t);E.connectors=x.mergeMultiChainConnectors(i)},async connect(e={}){let{namespace:t}=e;return x.setFilterByNamespace(t),y.I.push("Connect",{addWalletForNamespace:t}),new Promise((e,i)=>{if(t){let r=g.W.subscribeChainProp("accountState",t=>{t?.caipAddress&&(e({caipAddress:t?.caipAddress}),r())},t),n=m.W.subscribeKey("open",e=>{e||(i(Error("Modal closed")),n())})}else{let t=g.W.subscribeKey("activeCaipAddress",i=>{i&&(e({caipAddress:i}),t())}),r=m.W.subscribeKey("open",e=>{e||(i(Error("Modal closed")),r())})}})}})},12936:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(74897),a=i(34175),o=i(94895),l=i(69428);let c=(0,a.AH)`
79  slot {
80    width: 100%;
81    display: inline-block;
82    font-style: normal;
83    overflow: inherit;
84    text-overflow: inherit;
85    text-align: var(--local-align);
86    color: var(--local-color);
87  }
88
89  .wui-line-clamp-1 {
90    overflow: hidden;
91    display: -webkit-box;
92    -webkit-box-orient: vertical;
93    -webkit-line-clamp: 1;
94  }
95
96  .wui-line-clamp-2 {
97    overflow: hidden;
98    display: -webkit-box;
99    -webkit-box-orient: vertical;
100    -webkit-line-clamp: 2;
101  }
102
103  /* -- Headings --------------------------------------------------- */
104  .wui-font-h1-regular-mono {
105    font-size: ${({textSize:e})=>e.h1};
106    line-height: ${({typography:e})=>e["h1-regular-mono"].lineHeight};
107    letter-spacing: ${({typography:e})=>e["h1-regular-mono"].letterSpacing};
108    font-weight: ${({fontWeight:e})=>e.regular};
109    font-family: ${({fontFamily:e})=>e.mono};
110  }
111
112  .wui-font-h1-regular {
113    font-size: ${({textSize:e})=>e.h1};
114    line-height: ${({typography:e})=>e["h1-regular"].lineHeight};
115    letter-spacing: ${({typography:e})=>e["h1-regular"].letterSpacing};
116    font-weight: ${({fontWeight:e})=>e.regular};
117    font-family: ${({fontFamily:e})=>e.regular};
118    font-feature-settings:
119      'liga' off,
120      'clig' off;
121  }
122
123  .wui-font-h1-medium {
124    font-size: ${({textSize:e})=>e.h1};
125    line-height: ${({typography:e})=>e["h1-medium"].lineHeight};
126    letter-spacing: ${({typography:e})=>e["h1-medium"].letterSpacing};
127    font-weight: ${({fontWeight:e})=>e.medium};
128    font-family: ${({fontFamily:e})=>e.regular};
129    font-feature-settings:
130      'liga' off,
131      'clig' off;
132  }
133
134  .wui-font-h2-regular-mono {
135    font-size: ${({textSize:e})=>e.h2};
136    line-height: ${({typography:e})=>e["h2-regular-mono"].lineHeight};
137    letter-spacing: ${({typography:e})=>e["h2-regular-mono"].letterSpacing};
138    font-weight: ${({fontWeight:e})=>e.regular};
139    font-family: ${({fontFamily:e})=>e.mono};
140  }
141
142  .wui-font-h2-regular {
143    font-size: ${({textSize:e})=>e.h2};
144    line-height: ${({typography:e})=>e["h2-regular"].lineHeight};
145    letter-spacing: ${({typography:e})=>e["h2-regular"].letterSpacing};
146    font-weight: ${({fontWeight:e})=>e.regular};
147    font-family: ${({fontFamily:e})=>e.regular};
148    font-feature-settings:
149      'liga' off,
150      'clig' off;
151  }
152
153  .wui-font-h2-medium {
154    font-size: ${({textSize:e})=>e.h2};
155    line-height: ${({typography:e})=>e["h2-medium"].lineHeight};
156    letter-spacing: ${({typography:e})=>e["h2-medium"].letterSpacing};
157    font-weight: ${({fontWeight:e})=>e.medium};
158    font-family: ${({fontFamily:e})=>e.regular};
159    font-feature-settings:
160      'liga' off,
161      'clig' off;
162  }
163
164  .wui-font-h3-regular-mono {
165    font-size: ${({textSize:e})=>e.h3};
166    line-height: ${({typography:e})=>e["h3-regular-mono"].lineHeight};
167    letter-spacing: ${({typography:e})=>e["h3-regular-mono"].letterSpacing};
168    font-weight: ${({fontWeight:e})=>e.regular};
169    font-family: ${({fontFamily:e})=>e.mono};
170  }
171
172  .wui-font-h3-regular {
173    font-size: ${({textSize:e})=>e.h3};
174    line-height: ${({typography:e})=>e["h3-regular"].lineHeight};
175    letter-spacing: ${({typography:e})=>e["h3-regular"].letterSpacing};
176    font-weight: ${({fontWeight:e})=>e.regular};
177    font-family: ${({fontFamily:e})=>e.regular};
178    font-feature-settings:
179      'liga' off,
180      'clig' off;
181  }
182
183  .wui-font-h3-medium {
184    font-size: ${({textSize:e})=>e.h3};
185    line-height: ${({typography:e})=>e["h3-medium"].lineHeight};
186    letter-spacing: ${({typography:e})=>e["h3-medium"].letterSpacing};
187    font-weight: ${({fontWeight:e})=>e.medium};
188    font-family: ${({fontFamily:e})=>e.regular};
189    font-feature-settings:
190      'liga' off,
191      'clig' off;
192  }
193
194  .wui-font-h4-regular-mono {
195    font-size: ${({textSize:e})=>e.h4};
196    line-height: ${({typography:e})=>e["h4-regular-mono"].lineHeight};
197    letter-spacing: ${({typography:e})=>e["h4-regular-mono"].letterSpacing};
198    font-weight: ${({fontWeight:e})=>e.regular};
199    font-family: ${({fontFamily:e})=>e.mono};
200  }
201
202  .wui-font-h4-regular {
203    font-size: ${({textSize:e})=>e.h4};
204    line-height: ${({typography:e})=>e["h4-regular"].lineHeight};
205    letter-spacing: ${({typography:e})=>e["h4-regular"].letterSpacing};
206    font-weight: ${({fontWeight:e})=>e.regular};
207    font-family: ${({fontFamily:e})=>e.regular};
208    font-feature-settings:
209      'liga' off,
210      'clig' off;
211  }
212
213  .wui-font-h4-medium {
214    font-size: ${({textSize:e})=>e.h4};
215    line-height: ${({typography:e})=>e["h4-medium"].lineHeight};
216    letter-spacing: ${({typography:e})=>e["h4-medium"].letterSpacing};
217    font-weight: ${({fontWeight:e})=>e.medium};
218    font-family: ${({fontFamily:e})=>e.regular};
219    font-feature-settings:
220      'liga' off,
221      'clig' off;
222  }
223
224  .wui-font-h5-regular-mono {
225    font-size: ${({textSize:e})=>e.h5};
226    line-height: ${({typography:e})=>e["h5-regular-mono"].lineHeight};
227    letter-spacing: ${({typography:e})=>e["h5-regular-mono"].letterSpacing};
228    font-weight: ${({fontWeight:e})=>e.regular};
229    font-family: ${({fontFamily:e})=>e.mono};
230  }
231
232  .wui-font-h5-regular {
233    font-size: ${({textSize:e})=>e.h5};
234    line-height: ${({typography:e})=>e["h5-regular"].lineHeight};
235    letter-spacing: ${({typography:e})=>e["h5-regular"].letterSpacing};
236    font-weight: ${({fontWeight:e})=>e.regular};
237    font-family: ${({fontFamily:e})=>e.regular};
238    font-feature-settings:
239      'liga' off,
240      'clig' off;
241  }
242
243  .wui-font-h5-medium {
244    font-size: ${({textSize:e})=>e.h5};
245    line-height: ${({typography:e})=>e["h5-medium"].lineHeight};
246    letter-spacing: ${({typography:e})=>e["h5-medium"].letterSpacing};
247    font-weight: ${({fontWeight:e})=>e.medium};
248    font-family: ${({fontFamily:e})=>e.regular};
249    font-feature-settings:
250      'liga' off,
251      'clig' off;
252  }
253
254  .wui-font-h6-regular-mono {
255    font-size: ${({textSize:e})=>e.h6};
256    line-height: ${({typography:e})=>e["h6-regular-mono"].lineHeight};
257    letter-spacing: ${({typography:e})=>e["h6-regular-mono"].letterSpacing};
258    font-weight: ${({fontWeight:e})=>e.regular};
259    font-family: ${({fontFamily:e})=>e.mono};
260  }
261
262  .wui-font-h6-regular {
263    font-size: ${({textSize:e})=>e.h6};
264    line-height: ${({typography:e})=>e["h6-regular"].lineHeight};
265    letter-spacing: ${({typography:e})=>e["h6-regular"].letterSpacing};
266    font-weight: ${({fontWeight:e})=>e.regular};
267    font-family: ${({fontFamily:e})=>e.regular};
268    font-feature-settings:
269      'liga' off,
270      'clig' off;
271  }
272
273  .wui-font-h6-medium {
274    font-size: ${({textSize:e})=>e.h6};
275    line-height: ${({typography:e})=>e["h6-medium"].lineHeight};
276    letter-spacing: ${({typography:e})=>e["h6-medium"].letterSpacing};
277    font-weight: ${({fontWeight:e})=>e.medium};
278    font-family: ${({fontFamily:e})=>e.regular};
279    font-feature-settings:
280      'liga' off,
281      'clig' off;
282  }
283
284  .wui-font-lg-regular-mono {
285    font-size: ${({textSize:e})=>e.large};
286    line-height: ${({typography:e})=>e["lg-regular-mono"].lineHeight};
287    letter-spacing: ${({typography:e})=>e["lg-regular-mono"].letterSpacing};
288    font-weight: ${({fontWeight:e})=>e.regular};
289    font-family: ${({fontFamily:e})=>e.mono};
290  }
291
292  .wui-font-lg-regular {
293    font-size: ${({textSize:e})=>e.large};
294    line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
295    letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
296    font-weight: ${({fontWeight:e})=>e.regular};
297    font-family: ${({fontFamily:e})=>e.regular};
298    font-feature-settings:
299      'liga' off,
300      'clig' off;
301  }
302
303  .wui-font-lg-medium {
304    font-size: ${({textSize:e})=>e.large};
305    line-height: ${({typography:e})=>e["lg-medium"].lineHeight};
306    letter-spacing: ${({typography:e})=>e["lg-medium"].letterSpacing};
307    font-weight: ${({fontWeight:e})=>e.medium};
308    font-family: ${({fontFamily:e})=>e.regular};
309    font-feature-settings:
310      'liga' off,
311      'clig' off;
312  }
313
314  .wui-font-md-regular-mono {
315    font-size: ${({textSize:e})=>e.medium};
316    line-height: ${({typography:e})=>e["md-regular-mono"].lineHeight};
317    letter-spacing: ${({typography:e})=>e["md-regular-mono"].letterSpacing};
318    font-weight: ${({fontWeight:e})=>e.regular};
319    font-family: ${({fontFamily:e})=>e.mono};
320  }
321
322  .wui-font-md-regular {
323    font-size: ${({textSize:e})=>e.medium};
324    line-height: ${({typography:e})=>e["md-regular"].lineHeight};
325    letter-spacing: ${({typography:e})=>e["md-regular"].letterSpacing};
326    font-weight: ${({fontWeight:e})=>e.regular};
327    font-family: ${({fontFamily:e})=>e.regular};
328    font-feature-settings:
329      'liga' off,
330      'clig' off;
331  }
332
333  .wui-font-md-medium {
334    font-size: ${({textSize:e})=>e.medium};
335    line-height: ${({typography:e})=>e["md-medium"].lineHeight};
336    letter-spacing: ${({typography:e})=>e["md-medium"].letterSpacing};
337    font-weight: ${({fontWeight:e})=>e.medium};
338    font-family: ${({fontFamily:e})=>e.regular};
339    font-feature-settings:
340      'liga' off,
341      'clig' off;
342  }
343
344  .wui-font-sm-regular-mono {
345    font-size: ${({textSize:e})=>e.small};
346    line-height: ${({typography:e})=>e["sm-regular-mono"].lineHeight};
347    letter-spacing: ${({typography:e})=>e["sm-regular-mono"].letterSpacing};
348    font-weight: ${({fontWeight:e})=>e.regular};
349    font-family: ${({fontFamily:e})=>e.mono};
350  }
351
352  .wui-font-sm-regular {
353    font-size: ${({textSize:e})=>e.small};
354    line-height: ${({typography:e})=>e["sm-regular"].lineHeight};
355    letter-spacing: ${({typography:e})=>e["sm-regular"].letterSpacing};
356    font-weight: ${({fontWeight:e})=>e.regular};
357    font-family: ${({fontFamily:e})=>e.regular};
358    font-feature-settings:
359      'liga' off,
360      'clig' off;
361  }
362
363  .wui-font-sm-medium {
364    font-size: ${({textSize:e})=>e.small};
365    line-height: ${({typography:e})=>e["sm-medium"].lineHeight};
366    letter-spacing: ${({typography:e})=>e["sm-medium"].letterSpacing};
367    font-weight: ${({fontWeight:e})=>e.medium};
368    font-family: ${({fontFamily:e})=>e.regular};
369    font-feature-settings:
370      'liga' off,
371      'clig' off;
372  }
373`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h={primary:a.f.tokens.theme.textPrimary,secondary:a.f.tokens.theme.textSecondary,tertiary:a.f.tokens.theme.textTertiary,invert:a.f.tokens.theme.textInvert,error:a.f.tokens.core.textError,success:a.f.tokens.core.textSuccess,warning:a.f.tokens.core.textWarning,"accent-primary":a.f.tokens.core.textAccentPrimary},u=class extends r.WF{constructor(){super(...arguments),this.variant="md-regular",this.color="inherit",this.align="left",this.lineClamp=void 0,this.display="inline-flex"}render(){let e={[`wui-font-${this.variant}
373`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=`
374      display: ${this.display};
375      --local-align: ${this.align};
376      --local-color: ${"inherit"===this.color?"inherit":h[this.color??"primary"]};
377      `,(0,r.qy)`<slot class=${(0,s.H)(e)}></slot>`}};u.styles=[o.W5,c],d([(0,n.MZ)()],u.prototype,"variant",void 0),d([(0,n.MZ)()],u.prototype,"color",void 0),d([(0,n.MZ)()],u.prototype,"align",void 0),d([(0,n.MZ)()],u.prototype,"lineClamp",void 0),d([(0,n.MZ)()],u.prototype,"display",void 0),u=d([(0,l.E)("wui-text")],u)},13226:(e,t,i)=>{"use strict";i.d(t,{o:()=>r});let r={METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",OKX_CONNECTOR_NAME:"OKX Wallet",BINANCE_CONNECTOR_NAME:"Binance Wallet",EIP155:i(34386).o.CHAIN.EVM,ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"AUTH",getSDKVersionWarningMessage:(e,t)=>`
378     @@@@@@@           @@@@@@@@@@@@@@@@@@      
379   @@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@   
380  @@@@@@@@@@@@@    @@@@@@@@@@@@@@@@@@@@@@@@@@  
381 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@  
382 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@   @@@@@@@@@@@ 
383 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@   @@@@@@@@@@@@ 
384 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@  @@@@@@@@@@@@@
385 @@@@@@@@@@@@@@@  @@@@@@@@@@@@   @@@@@@@@@@@@@    
386 @@@@@@   @@@@@@  @@@@@@@@@@@   @@@@@@@@@@@@@@    
387 @@@@@@   @@@@@@  @@@@@@@@@@@  @@@@@@@@@@@@@@@ 
388 @@@@@@@@@@@@@@@  @@@@@@@@@@   @@@@@@@@@@@@@@@ 
389 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@  
390  @@@@@@@@@@@@@    @@@@@@@@@@@@@@@@@@@@@@@@@@  
391   @@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@   
392      @@@@@            @@@@@@@@@@@@@@@@@@  
393      
394AppKit SDK version ${e} is outdated. Latest version is ${t}. Please update to the latest version for bug fixes and new features.
395            
396Changelog: https://github.com/reown-com/appkit/releases
397NPM Registry: https://www.npmjs.com/package/@reown/appkit`}},15642:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(40859);i(82016);var a=i(94895),o=i(69428),l=i(34175);let c=(0,l.AH)`
398  :host {
399    display: inline-flex;
400    justify-content: center;
401    align-items: center;
402    border-radius: ${({borderRadius:e})=>e[2]};
403    padding: ${({spacing:e})=>e[1]} !important;
404    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
405    position: relative;
406  }
407
408  :host([data-padding='2']) {
409    padding: ${({spacing:e})=>e[2]} !important;
410  }
411
412  :host:after {
413    content: '';
414    position: absolute;
415    top: 0;
416    left: 0;
417    width: 100%;
418    height: 100%;
419    border-radius: ${({borderRadius:e})=>e[2]};
420  }
421
422  :host > wui-icon {
423    z-index: 10;
424  }
425
426  /* -- Colors --------------------------------------------------- */
427  :host([data-color='accent-primary']) {
428    color: ${({tokens:e})=>e.core.iconAccentPrimary};
429  }
430
431  :host([data-color='accent-primary']):after {
432    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
433  }
434
435  :host([data-color='default']),
436  :host([data-color='secondary']) {
437    color: ${({tokens:e})=>e.theme.iconDefault};
438  }
439
440  :host([data-color='default']):after {
441    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
442  }
443
444  :host([data-color='secondary']):after {
445    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
446  }
447
448  :host([data-color='success']) {
449    color: ${({tokens:e})=>e.core.iconSuccess};
450  }
451
452  :host([data-color='success']):after {
453    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
454  }
455
456  :host([data-color='error']) {
457    color: ${({tokens:e})=>e.core.iconError};
458  }
459
460  :host([data-color='error']):after {
461    background-color: ${({tokens:e})=>e.core.backgroundError};
462  }
463
464  :host([data-color='warning']) {
465    color: ${({tokens:e})=>e.core.iconWarning};
466  }
467
468  :host([data-color='warning']):after {
469    background-color: ${({tokens:e})=>e.core.backgroundWarning};
470  }
471
472  :host([data-color='inverse']) {
473    color: ${({tokens:e})=>e.theme.iconInverse};
474  }
475
476  :host([data-color='inverse']):after {
477    background-color: transparent;
478  }
479`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(...arguments),this.icon="copy",this.size="md",this.padding="1",this.color="default"}render(){return this.dataset.padding=this.padding,this.dataset.color=this.color,(0,r.qy)`
480      <wui-icon size=${(0,s.J)(this.size)} name=${this.icon} color="inherit"></wui-icon>
481    `}};h.styles=[a.W5,a.fD,c],d([(0,n.MZ)()],h.prototype,"icon",void 0),d([(0,n.MZ)()],h.prototype,"size",void 0),d([(0,n.MZ)()],h.prototype,"padding",void 0),d([(0,n.MZ)()],h.prototype,"color",void 0),h=d([(0,o.E)("wui-icon-box")],h)},15762:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(94895),a=i(69428),o=i(34175);let l=(0,o.AH)`
482  :host {
483    display: block;
484    width: 100px;
485    height: 100px;
486  }
487
488  svg {
489    width: 100px;
490    height: 100px;
491  }
492
493  rect {
494    fill: none;
495    stroke: ${e=>e.colors.accent100};
496    stroke-width: 3px;
497    stroke-linecap: round;
498    animation: dash 1s linear infinite;
499  }
500
501  @keyframes dash {
502    to {
503      stroke-dashoffset: 0px;
504    }
505  }
506`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){let e=this.radius>50?50:this.radius,t=36-e;return(0,r.qy)`
507      <svg viewBox="0 0 110 110" width="110" height="110">
508        <rect
509          x="2"
510          y="2"
511          width="106"
512          height="106"
513          rx=${e}
514          stroke-dasharray="${116+t} ${245+t}"
515          stroke-dashoffset=${360+1.75*t}
516        />
517      </svg>
518    `}};d.styles=[s.W5,l],c([(0,n.MZ)({type:Number})],d.prototype,"radius",void 0),d=c([(0,a.E)("wui-loading-thumbnail")],d)},16025:(e,t,i)=>{"use strict";i.d(t,{R:()=>E});var r=i(92679),n=i(3125),s=i(93849),a=i(17008),o=i(34386),l=i(92087),c=i(67066),d=i(74714),h=i(33452),u=i(29400),p=i(37056),f=i(16528),g=i(51369),m=i(1024),w=i(60319),y=i(43242),b=i(44458),v=i(44963);let C=(0,r.BX)({tokenBalances:[],loading:!1}),E=(0,g.X)({state:C,subscribe:e=>(0,r.B1)(C,()=>e(C)),subscribeKey:(e,t)=>(0,n.u$)(C,e,t),setToken(e){e&&(C.token=(0,r.KR)(e))},setTokenAmount(e){C.sendTokenAmount=e},setReceiverAddress(e){C.receiverAddress=e},setReceiverProfileImageUrl(e){C.receiverProfileImageUrl=e},setReceiverProfileName(e){C.receiverProfileName=e},setNetworkBalanceInUsd(e){C.networkBalanceInUSD=e},setLoading(e){C.loading=e},getSdkEventProperties:e=>({message:p.w.parseError(e),isSmartAccount:(0,h.lj)(m.W.state.activeChain)===c.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:C.token?.symbol||"",amount:C.sendTokenAmount??0,network:m.W.state.activeCaipNetwork?.caipNetworkId||""}),async sendToken(){try{switch(E.setLoading(!0),m.W.state.activeCaipNetwork?.chainNamespace){case"eip155":await E.sendEvmToken();return;case"solana":await E.sendSolanaToken();return;default:throw Error("Unsupported chain")}}catch(e){if(s.RQ.isUserRejectedRequestError(e))throw new s.vx(e);throw e}
518finally{E.setLoading(!1)}},async sendEvmToken(){let e=m.W.state.activeChain;if(!e)throw Error("SendController:sendEvmToken - activeChainNamespace is required");let t=(0,h.lj)(e);if(!E.state.sendTokenAmount||!E.state.receiverAddress)throw Error("An amount and receiver address are required");if(!E.state.token)throw Error("A token is required");if(E.state.token?.address){y.E.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:t===c.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:E.state.token.address,amount:E.state.sendTokenAmount,network:m.W.state.activeCaipNetwork?.caipNetworkId||""}});let{hash:e}=await E.sendERC20Token({receiverAddress:E.state.receiverAddress,tokenAddress:E.state.token.address,sendTokenAmount:E.state.sendTokenAmount,decimals:E.state.token.quantity.decimals});e&&(C.hash=e)}else{y.E.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:t===c.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:E.state.token.symbol||"",amount:E.state.sendTokenAmount,network:m.W.state.activeCaipNetwork?.caipNetworkId||""}});let{hash:e}=await E.sendNativeToken({receiverAddress:E.state.receiverAddress,sendTokenAmount:E.state.sendTokenAmount,decimals:E.state.token.quantity.decimals});e&&(C.hash=e)}},async fetchTokenBalance(e){C.loading=!0;let t=m.W.state.activeChain,i=m.W.state.activeCaipNetwork?.caipNetworkId,r=m.W.state.activeCaipNetwork?.chainNamespace,n=m.W.getAccountData(t)?.caipAddress??m.W.state.activeCaipAddress,s=n?p.w.getPlainAddress(n):void 0;if(C.lastRetry&&!p.w.isAllowedRetry(C.lastRetry,30*u.oU.ONE_SEC_MS))return C.loading=!1,[];try{if(s&&i&&r){let e=await d.Z.getMyTokensWithBalance();return C.tokenBalances=e,C.lastRetry=void 0,e}}catch(t){C.lastRetry=Date.now(),e?.(t),v.P.showError("Token Balance Unavailable")}finally{C.loading=!1}return[]},fetchNetworkBalance(){if(0===C.tokenBalances.length)return;let e=f.s.mapBalancesToSwapTokens(C.tokenBalances);if(!e)return;let t=e.find(e=>e.address===(0,h.K1)());t&&(C.networkBalanceInUSD=t?a.S.multiply(t.quantity.numeric,t.price).toString():"0")},async sendNativeToken(e){b.I.pushTransactionStack({});let t=e.receiverAddress,i=m.W.getAccountData()?.address,r=w.x.parseUnits(e.sendTokenAmount.toString(),Number(e.decimals)),n=await w.x.sendTransaction({chainNamespace:o.o.CHAIN.EVM,to:t,address:i,data:"0x",value:r??BigInt(0)});return y.E.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:(0,h.lj)("eip155")===c.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:E.state.token?.symbol||"",amount:e.sendTokenAmount,network:m.W.state.activeCaipNetwork?.caipNetworkId||"",hash:n||""}}),w.x._getClient()?.updateBalance("eip155"),E.resetSend(),{hash:n}},async sendERC20Token(e){b.I.pushTransactionStack({onSuccess(){b.I.replace("Account")}});let t=w.x.parseUnits(e.sendTokenAmount.toString(),Number(e.decimals)),i=m.W.getAccountData()?.address;if(i&&e.sendTokenAmount&&e.receiverAddress&&e.tokenAddress){let r=p.w.getPlainAddress(e.tokenAddress);if(!r)throw Error("SendController:sendERC20Token - tokenAddress is required");let n=await w.x.writeContract({fromAddress:i,tokenAddress:r,args:[e.receiverAddress,t??BigInt(0)],method:"transfer",abi:l.v.getERC20Abi(r),chainNamespace:o.o.CHAIN.EVM});return y.E.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:(0,h.lj)("eip155")===c.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,token:E.state.token?.symbol||"",amount:e.sendTokenAmount,network:m.W.state.activeCaipNetwork?.caipNetworkId||"",hash:n||""}}),E.resetSend(),{hash:n}}return{hash:void 0}},async sendSolanaToken(){let e;if(!E.state.sendTokenAmount||!E.state.receiverAddress)throw Error("An amount and receiver address are required");b.I.pushTransactionStack({onSuccess(){b.I.replace("Account")}}),E.state.token&&E.state.token.address!==u.oU.SOLANA_NATIVE_TOKEN_ADDRESS&&(e=p.w.isCaipAddress(E.state.token.address)?p.w.getPlainAddress(E.state.token.address):E.state.token.address);let t=await w.x.sendTransaction({chainNamespace:"solana",tokenMint:e,to:E.state.receiverAddress,value:E.state.sendTokenAmount});t&&(C.hash=t),w.x._getClient()?.updateBalance("solana"),y.E.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:!1,token:E.state.token?.symbol||"",amount:E.state.sendTokenAmount,network:m.W.state.activeCaipNetwork?.caipNetworkId||"",hash:t||""}}),E.resetSend()},resetSend(){C.token=void 0,C.sendTokenAmount=void 0,C.receiverAddress=void 0,C.receiverProfileImageUrl=void 0,C.receiverProfileName=void 0,C.loading=!1,C.tokenBalances=[]}})},16096:e=>{"use strict";var t,i="object"==typeof Reflect?Reflect:null,r=i&&"function"==typeof i.apply?i.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};t=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(i,r){var n,s,a;function o(i){e.removeListener(t,l),r(i)}function l(){"function"==typeof e.removeListener&&e.removeListener("error",o),i([].slice.call(arguments))}g(e,t,l,{once:!0}),"error"!==t&&(n=e,s=o,a={once:!0},"function"==typeof n.on&&g(n,"error",s,a))})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,i,r){if(o(i),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),a=s[t]),void 0===a)a=s[t]=i,++e._eventsCount;else if("function"==typeof a?a=s[t]=r?[i,a]:[a,i]:r?a.unshift(i):a.push(i),(n=l(e))>0&&a.length>n&&!a.warned){a.warned=!0;var n,s,a,c=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,console&&console.warn&&console.warn(c)}return e}function d(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,i){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},n=d.bind(r);return n.listener=i,r.wrapFn=n,n}function u(e,t,i){var r=e._events;if(void 0===r)return[];var n=r[t];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(e){for(var t=Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(n):f(n,n.length)}function p(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function f(e,t){for(var i=Array(t),r=0;r<t;++r)i[r]=e[r];return i}function g(e,t,i,r){if("function"==typeof e.on)r.once?e.once(t,i):e.on(t,i);else if("function"==typeof e.addEventListener)e.addEventListener(t,function n(s){r.once&&e.removeEventListener(t,n),i(s)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a}
518,set:function(e){if("number"!=typeof e||e<0||n(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var a,o=Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else for(var c=l.length,d=f(l,c),i=0;i<c;++i)r(d[i],this,t);return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return o(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return o(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var i,r,n,s,a;if(o(t),void 0===(r=this._events)||void 0===(i=r[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(n=-1,s=i.length-1;s>=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,n=s;break}if(n<0)return this;0===n?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,n),1===i.length&&(r[e]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,i,r;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0==arguments.length){var n,s=Object.keys(i);for(r=0;r<s.length;++r)"removeListener"!==(n=s[r])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return u(this,e,!0)},s.prototype.rawListeners=function(e){return u(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},16528:(e,t,i)=>{"use strict";i.d(t,{s:()=>l});var r=i(18715),n=i(1024),s=i(60319),a=i(74714),o=i(33452);let l={async getTokenList(e){let t=await r.T.fetchSwapTokens({chainId:e});return t?.tokens?.map(e=>({...e,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0}))||[]},async fetchGasPrice(){let e=n.W.state.activeCaipNetwork;if(!e)return null;try{if("solana"!==e.chainNamespace)return await r.T.fetchGasPrice({chainId:e.caipNetworkId});{let e=(await s.x?.estimateGas({chainNamespace:"solana"}))?.toString();return{standard:e,fast:e,instant:e}}}catch{return null}},async fetchSwapAllowance({tokenAddress:e,userAddress:t,sourceTokenAmount:i,sourceTokenDecimals:n}){let a=await r.T.fetchSwapAllowance({tokenAddress:e,userAddress:t});if(a?.allowance&&i&&n){let e=s.x.parseUnits(i,n)||0;return BigInt(a.allowance)>=e}return!1},async getMyTokensWithBalance(e){let t=await a.Z.getMyTokensWithBalance({forceUpdate:e,caipNetwork:n.W.state.activeCaipNetwork,address:n.W.getAccountData()?.address});return n.W.setAccountProp("tokenBalance",t,n.W.state.activeChain),this.mapBalancesToSwapTokens(t)},mapBalancesToSwapTokens:e=>e?.map(e=>({...e,address:e?.address?e.address:(0,o.K1)(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1}))||[],async handleSwapError(e){try{let t=e?.cause;if(!t?.json)return;let i=await t.json(),r=i?.reasons?.[0]?.description;if(r?.includes("insufficient liquidity"))return"Insufficient liquidity";return}catch{return}}}},16696:(e,t,i)=>{"use strict";i.d(t,{v:()=>s});var r=i(11403),n=i(24859);class s{static getInstance({projectId:e,chainId:t,enableLogger:i,onTimeout:a,abortController:o,getActiveCaipNetwork:l,getCaipNetworks:c}){let{metadata:d,sdkVersion:h,sdkType:u}=r.H.getSnapshot();return s.instance||(s.instance=new n.Y({projectId:e,chainId:t,enableLogger:i,onTimeout:a,abortController:o,getActiveCaipNetwork:l,getCaipNetworks:c,enableCloudAuthAccount:!!r.H.state.remoteFeatures?.emailCapture,metadata:d,sdkVersion:h,sdkType:u})),s.instance}}},17008:(e,t,i)=>{"use strict";i.d(t,{S:()=>f});
518var r="[big.js] ",n=r+"Invalid ",s=n+"decimal places",a=n+"rounding mode",o=r+"Division by zero",l={},c=void 0,d=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function h(e,t,i,r){var n=e.c;if(i===c&&(i=e.constructor.RM),0!==i&&1!==i&&2!==i&&3!==i)throw Error(a);if(t<1)r=3===i&&(r||!!n[0])||0===t&&(1===i&&n[0]>=5||2===i&&(n[0]>5||5===n[0]&&(r||n[1]!==c))),n.length=1,r?(e.e=e.e-t+1,n[0]=1):n[0]=e.e=0;else if(t<n.length){if(r=1===i&&n[t]>=5||2===i&&(n[t]>5||5===n[t]&&(r||n[t+1]!==c||1&n[t-1]))||3===i&&(r||!!n[0]),n.length=t,r){for(;++n[--t]>9;)if(n[t]=0,0===t){++e.e,n.unshift(1);break}}for(t=n.length;!n[--t];)n.pop()}return e}function u(e,t,i){var r=e.e,n=e.c.join(""),s=n.length;if(t)n=n.charAt(0)+(s>1?"."+n.slice(1):"")+(r<0?"e":"e+")+r;else if(r<0){for(;++r;)n="0"+n;n="0."+n}else if(r>0)if(++r>s)for(r-=s;r--;)n+="0";else r<s&&(n=n.slice(0,r)+"."+n.slice(r));else s>1&&(n=n.charAt(0)+"."+n.slice(1));return e.s<0&&i?"-"+n:n}l.abs=function(){var e=new this.constructor(this);return e.s=1,e},l.cmp=function(e){var t,i=this.c,r=(e=new this.constructor(e)).c,n=this.s,s=e.s,a=this.e,o=e.e;if(!i[0]||!r[0])return i[0]?n:r[0]?-s:0;if(n!=s)return n;if(t=n<0,a!=o)return a>o^t?1:-1;for(s=(a=i.length)<(o=r.length)?a:o,n=-1;++n<s;)if(i[n]!=r[n])return i[n]>r[n]^t?1:-1;return a==o?0:a>o^t?1:-1},l.div=function(e){var t=this.constructor,i=this.c,r=(e=new t(e)).c,n=this.s==e.s?1:-1,a=t.DP;if(a!==~~a||a<0||a>1e6)throw Error(s);if(!r[0])throw Error(o);if(!i[0])return e.s=n,e.c=[e.e=0],e;var l,d,u,p,f,g=r.slice(),m=l=r.length,w=i.length,y=i.slice(0,l),b=y.length,v=e,C=v.c=[],E=0,x=a+(v.e=this.e-e.e)+1;for(v.s=n,n=x<0?0:x,g.unshift(0);b++<l;)y.push(0);do{for(u=0;u<10;u++){if(l!=(b=y.length))p=l>b?1:-1;else for(f=-1,p=0;++f<l;)if(r[f]!=y[f]){p=r[f]>y[f]?1:-1;break}if(p<0){for(d=b==l?r:g;b;){if(y[--b]<d[b]){for(f=b;f&&!y[--f];)y[f]=9;--y[f],y[b]+=10}y[b]-=d[b]}for(;!y[0];)y.shift()}else break}C[E++]=p?u:++u,y[0]&&p?y[b]=i[m]||0:y=[i[m]]}while((m++<w||y[0]!==c)&&n--);return!C[0]&&1!=E&&(C.shift(),v.e--,x--),E>x&&h(v,x,t.RM,y[0]!==c),v},l.eq=function(e){return 0===this.cmp(e)},l.gt=function(e){return this.cmp(e)>0},l.gte=function(e){return this.cmp(e)>-1},l.lt=function(e){return 0>this.cmp(e)},l.lte=function(e){return 1>this.cmp(e)},l.minus=l.sub=function(e){var t,i,r,n,s=this.constructor,a=this.s,o=(e=new s(e)).s;if(a!=o)return e.s=-o,this.plus(e);var l=this.c.slice(),c=this.e,d=e.c,h=e.e;if(!l[0]||!d[0])return d[0]?e.s=-o:l[0]?e=new s(this):e.s=1,e;if(a=c-h){for((n=a<0)?(a=-a,r=l):(h=c,r=d),r.reverse(),o=a;o--;)r.push(0);r.reverse()}else for(i=((n=l.length<d.length)?l:d).length,a=o=0;o<i;o++)if(l[o]!=d[o]){n=l[o]<d[o];break}if(n&&(r=l,l=d,d=r,e.s=-e.s),(o=(i=d.length)-(t=l.length))>0)for(;o--;)l[t++]=0;for(o=t;i>a;){if(l[--i]<d[i]){for(t=i;t&&!l[--t];)l[t]=9;--l[t],l[i]+=10}l[i]-=d[i]}for(;0===l[--o];)l.pop();for(;0===l[0];)l.shift(),--h;return l[0]||(e.s=1,l=[h=0]),e.c=l,e.e=h,e},l.mod=function(e){var t,i=this,r=i.constructor,n=i.s,s=(e=new r(e)).s;if(!e.c[0])throw Error(o);return(i.s=e.s=1,t=1==e.cmp(i),i.s=n,e.s=s,t)?new r(i):(n=r.DP,s=r.RM,r.DP=r.RM=0,i=i.div(e),r.DP=n,r.RM=s,this.minus(i.times(e)))},l.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e},l.plus=l.add=function(e){var t,i,r,n=this.constructor;if(e=new n(e),this.s!=e.s)return e.s=-e.s,this.minus(e);var s=this.e,a=this.c,o=e.e,l=e.c;if(!a[0]||!l[0])return l[0]||(a[0]?e=new n(this):e.s=this.s),e;if(a=a.slice(),t=s-o){for(t>0?(o=s,r=l):(t=-t,r=a),r.reverse();t--;)r.push(0);r.reverse()}for(a.length-l.length<0&&(r=l,l=a,a=r),t=l.length,i=0;t;a[t]%=10)i=(a[--t]=a[t]+l[t]+i)/10|0;for(i&&(a.unshift(i),++o),t=a.length;0===a[--t];)a.pop();return e.c=a,e.e=o,e},l.pow=function(e){var t=this,i=new t.constructor("1"),r=i,s=e<0;if(e!==~~e||e<-1e6||e>1e6)throw Error(n+"exponent");for(s&&(e=-e);1&e&&(r=r.times(t)),e>>=1;)t=t.times(t);return s?i.div(r):r},l.prec=function(e,t){if(e!==~~e||e<1||e>1e6)throw Error(n+"precision");return h(new this.constructor(this),e,t)},l.round=function(e,t){if(e===c)e=0;else if(e!==~~e||e<-1e6||e>1e6)throw Error(s);return h(new this.constructor(this),e+this.e+1,t)},l.sqrt=function(){var e,t,i,n=this.constructor,s=this.s,a=this.e,o=new n("0.5");
518if(!this.c[0])return new n(this);if(s<0)throw Error(r+"No square root");0===(s=Math.sqrt(+u(this,!0,!0)))||s===1/0?((t=this.c.join("")).length+a&1||(t+="0"),a=((a+1)/2|0)-(a<0||1&a),e=new n(((s=Math.sqrt(t))==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+a)):e=new n(s+""),a=e.e+(n.DP+=4);do i=e,e=o.times(i.plus(this.div(i)));while(i.c.slice(0,a).join("")!==e.c.slice(0,a).join(""));return h(e,(n.DP-=4)+e.e+1,n.RM)},l.times=l.mul=function(e){var t,i=this.constructor,r=this.c,n=(e=new i(e)).c,s=r.length,a=n.length,o=this.e,l=e.e;if(e.s=this.s==e.s?1:-1,!r[0]||!n[0])return e.c=[e.e=0],e;for(e.e=o+l,s<a&&(t=r,r=n,n=t,l=s,s=a,a=l),t=Array(l=s+a);l--;)t[l]=0;for(o=a;o--;){for(a=0,l=s+o;l>o;)a=t[l]+n[o]*r[l-o-1]+a,t[l--]=a%10,a=a/10|0;t[l]=a}for(a?++e.e:t.shift(),o=t.length;!t[--o];)t.pop();return e.c=t,e},l.toExponential=function(e,t){var i=this,r=i.c[0];if(e!==c){if(e!==~~e||e<0||e>1e6)throw Error(s);for(i=h(new i.constructor(i),++e,t);i.c.length<e;)i.c.push(0)}return u(i,!0,!!r)},l.toFixed=function(e,t){var i=this,r=i.c[0];if(e!==c){if(e!==~~e||e<0||e>1e6)throw Error(s);for(i=h(new i.constructor(i),e+i.e+1,t),e=e+i.e+1;i.c.length<e;)i.c.push(0)}return u(i,!1,!!r)},l[Symbol.for("nodejs.util.inspect.custom")]=l.toJSON=l.toString=function(){var e=this.constructor;return u(this,this.e<=e.NE||this.e>=e.PE,!!this.c[0])},l.toNumber=function(){var e=+u(this,!0,!0);if(!0===this.constructor.strict&&!this.eq(e.toString()))throw Error(r+"Imprecise conversion");return e},l.toPrecision=function(e,t){var i=this,r=i.constructor,s=i.c[0];if(e!==c){if(e!==~~e||e<1||e>1e6)throw Error(n+"precision");for(i=h(new r(i),e,t);i.c.length<e;)i.c.push(0)}return u(i,e<=i.e||i.e<=r.NE||i.e>=r.PE,!!s)},l.valueOf=function(){var e=this.constructor;if(!0===e.strict)throw Error(r+"valueOf disallowed");return u(this,this.e<=e.NE||this.e>=e.PE,!0)};var p=function e(){function t(i){if(!(this instanceof t))return i===c?e():new t(i);if(i instanceof t)this.s=i.s,this.e=i.e,this.c=i.c.slice();else{if("string"!=typeof i){if(!0===t.strict&&"bigint"!=typeof i)throw TypeError(n+"value");i=0===i&&1/i<0?"-0":String(i)}!function(e,t){var i,r,s;if(!d.test(t))throw Error(n+"number");for(e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(i=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(i<0&&(i=r),i+=+t.slice(r+1),t=t.substring(0,r)):i<0&&(i=t.length),s=t.length,r=0;r<s&&"0"==t.charAt(r);)++r;if(r==s)e.c=[e.e=0];else{for(;s>0&&"0"==t.charAt(--s););for(e.e=i-r-1,e.c=[],i=0;r<=s;)e.c[i++]=+t.charAt(r++)}}(this,i)}this.constructor=t}return t.prototype=l,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.strict=!1,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}();let f={bigNumber(e,t={safe:!1}){try{if(!e)return new p(0);return new p(e)}catch(e){if(t.safe)return new p(0);throw e}},formatNumber(e,t){let{decimals:i,round:r=8,safe:n=!0}=t;return f.bigNumber(e,{safe:n}).div(new p(10).pow(i)).round(r)},multiply(e,t){if(void 0===e||void 0===t)return new p(0);let i=new p(e),r=new p(t);return i.times(r)},toFixed:(e,t=2)=>void 0===e||""===e?new p(0).toFixed(t):new p(e).toFixed(t),formatNumberToLocalString:(e,t=2)=>void 0===e||""===e?"0.00":"number"==typeof e?e.toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t,roundingMode:"floor"}):parseFloat(e).toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t,roundingMode:"floor"}),parseLocalStringToNumber:e=>void 0===e||""===e?0:new p(e.replace(/,/gu,"")).toNumber()}},17078:e=>{"use strict";e.exports=function(e){for(var t=[],i=e.length,r=0;r<i;r++){var n=e.charCodeAt(r);if(n>=55296&&n<=56319&&i>r+1){var s=e.charCodeAt(r+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,r+=1)}if(n<128){t.push(n);continue}if(n<2048){t.push(n>>6|192),t.push(63&n|128);continue}if(n<55296||n>=57344&&n<65536){t.push(n>>12|224),t.push(n>>6&63|128),t.push(63&n|128);continue}if(n>=65536&&n<=1114111){t.push(n>>18|240),t.push(n>>12&63|128),t.push(n>>6&63|128),t.push(63&n|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer}},18128:(e,t,i)=>{"use strict";i(19690)},18715:(e,t,i)=>{"use strict";i.d(t,{T:()=>f});var r=i(92679),n=i(29400),s=i(37056),a=i(75821),o=i(5820),l=i(1024),c=i(11403),d=i(44963);
518let h={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},u=s.w.getBlockchainApiUrl(),p=(0,r.BX)({clientId:null,api:new a.Z({baseUrl:u,clientId:null}),supportedChains:{http:[],ws:[]}}),f={state:p,async get(e){let{st:t,sv:i}=f.getSdkProperties(),r=c.H.state.projectId,n={...e.params||{},st:t,sv:i,projectId:r};return p.api.get({...e,params:n})},getSdkProperties(){let{sdkType:e,sdkVersion:t}=c.H.state;return{st:e||"unknown",sv:t||"unknown"}},async isNetworkSupported(e){if(!e)return!1;try{p.supportedChains.http.length||await f.getSupportedNetworks()}catch(e){return!1}return p.supportedChains.http.includes(e)},async getSupportedNetworks(){try{let e=await f.get({path:"v1/supported-chains"});return p.supportedChains=e,e}catch{return p.supportedChains}},async fetchIdentity({address:e}){let t=o.i.getIdentityFromCacheForAddress(e);if(t)return t;let i=await f.get({path:`/v1/identity/${e}`,params:{sender:l.W.state.activeCaipAddress?s.w.getPlainAddress(l.W.state.activeCaipAddress):void 0}});return o.i.updateIdentityCache({address:e,identity:i,timestamp:Date.now()}),i},async fetchTransactions({account:e,cursor:t,signal:i,cache:r,chainId:n}){if(!await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId))return{data:[],next:void 0};let s=o.i.getTransactionsCacheForAddress({address:e,chainId:n});if(s)return s;let a=await f.get({path:`/v1/account/${e}/history`,params:{cursor:t,chainId:n},signal:i,cache:r});return o.i.updateTransactionsCache({address:e,chainId:n,timestamp:Date.now(),transactions:a}),a},fetchSwapQuote:async({amount:e,userAddress:t,from:i,to:r,gasPrice:n})=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?f.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{amount:e,userAddress:t,from:i,to:r,gasPrice:n}}):{quotes:[]},fetchSwapTokens:async({chainId:e})=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?f.get({path:"/v1/convert/tokens",params:{chainId:e}}):{tokens:[]},getAddressBalance:async({caipNetworkId:e,address:t,method:i="getAddressBalance",params:r})=>p.api.post({path:`/v1?chainId=${e}&projectId=${c.H.state.projectId}`,body:{id:"1",jsonrpc:"2.0",method:i,params:r??{address:t}}}).then(e=>e.result),async fetchTokenPrice({addresses:e,caipNetworkId:t=l.W.state.activeCaipNetwork?.caipNetworkId}){if(!await f.isNetworkSupported(t))return{fungibles:[]};let i=o.i.getTokenPriceCacheForAddresses(e);if(i)return i;let r=await p.api.post({path:"/v1/fungible/price",body:{currency:"usd",addresses:e,projectId:c.H.state.projectId},headers:{"Content-Type":"application/json"}});return o.i.updateTokenPriceCache({addresses:e,timestamp:Date.now(),tokenPrice:r}),r},fetchSwapAllowance:async({tokenAddress:e,userAddress:t})=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?f.get({path:"/v1/convert/allowance",params:{tokenAddress:e,userAddress:t},headers:{"Content-Type":"application/json"}}):{allowance:"0"},async fetchGasPrice({chainId:e}){let{st:t,sv:i}=f.getSdkProperties();if(!await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId))throw Error("Network not supported for Gas Price");return f.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json"},params:{chainId:e,st:t,sv:i}})},async generateSwapCalldata({amount:e,from:t,to:i,userAddress:r,disableEstimate:s}){if(!await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId))throw Error("Network not supported for Swaps");return p.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:e,eip155:{slippage:n.oU.CONVERT_SLIPPAGE_TOLERANCE},projectId:c.H.state.projectId,from:t,to:i,userAddress:r,disableEstimate:s}})},async generateApproveCalldata({from:e,to:t,userAddress:i}){let{st:r,sv:n}=f.getSdkProperties();if(!await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId))throw Error("Network not supported for Swaps");return f.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json"}
518,params:{userAddress:i,from:e,to:t,st:r,sv:n}})},async getBalance(e,t,i){let{st:r,sv:n}=f.getSdkProperties();if(!await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId))return d.P.showError("Token Balance Unavailable"),{balances:[]};let s=`${t}:${e}`,a=o.i.getBalanceCacheForCaipAddress(s);if(a)return a;let c=await f.get({path:`/v1/account/${e}/balance`,params:{currency:"usd",chainId:t,forceUpdate:i,st:r,sv:n}});return o.i.updateBalanceCache({caipAddress:s,balance:c,timestamp:Date.now()}),c},lookupEnsName:async e=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?f.get({path:`/v1/profile/account/${e}`,params:{apiVersion:"2"}}):{addresses:{},attributes:[]},async reverseLookupEnsName({address:e}){if(!await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId))return[];let t=l.W.getAccountData()?.address;return f.get({path:`/v1/profile/reverse/${e}`,params:{sender:t,apiVersion:"2"}})},getEnsNameSuggestions:async e=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?f.get({path:`/v1/profile/suggestions/${e}`,params:{zone:"reown.id"}}):{suggestions:[]},registerEnsName:async({coinType:e,address:t,message:i,signature:r})=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?p.api.post({path:"/v1/profile/account",body:{coin_type:e,address:t,message:i,signature:r},headers:{"Content-Type":"application/json"}}):{success:!1},generateOnRampURL:async({destinationWallets:e,partnerUserId:t,defaultNetwork:i,purchaseAmount:r,paymentAmount:n})=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?(await p.api.post({path:"/v1/generators/onrampurl",params:{projectId:c.H.state.projectId},body:{destinationWallets:e,defaultNetwork:i,partnerUserId:t,defaultExperience:"buy",presetCryptoAmount:r,presetFiatAmount:n}})).url:"",async getOnrampOptions(){if(!await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId))return{paymentCurrencies:[],purchaseCurrencies:[]};try{return await f.get({path:"/v1/onramp/options"})}catch(e){return h}},async getOnrampQuote({purchaseCurrency:e,paymentCurrency:t,amount:i,network:r}){try{if(!await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId))return null;return await p.api.post({path:"/v1/onramp/quote",params:{projectId:c.H.state.projectId},body:{purchaseCurrency:e,paymentCurrency:t,amount:i,network:r}})}catch(e){return{networkFee:{amount:i,currency:t.id},paymentSubtotal:{amount:i,currency:t.id},paymentTotal:{amount:i,currency:t.id},purchaseAmount:{amount:i,currency:t.id},quoteId:"mocked-quote-id"}}},getSmartSessions:async e=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?f.get({path:`/v1/sessions/${e}`}):[],revokeSmartSession:async(e,t,i)=>await f.isNetworkSupported(l.W.state.activeCaipNetwork?.caipNetworkId)?p.api.post({path:`/v1/sessions/${e}/revoke`,params:{projectId:c.H.state.projectId},body:{pci:t,signature:i}}):{success:!1},setClientId(e){p.clientId=e,p.api=new a.Z({baseUrl:u,clientId:e})}}},19341:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);let s=(0,r.JW)`<svg width="86" height="96" fill="none">
519  <path
520    d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
521  />
522</svg>`;var a=i(31320);let o=(0,r.JW)`
523  <svg fill="none" viewBox="0 0 36 40">
524    <path
525      d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z"
526    />
527  </svg>
528`;i(82016),i(88364);var l=i(94895),c=i(69428),d=i(34175);let h=(0,d.AH)`
529  :host {
530    position: relative;
531    border-radius: inherit;
532    display: flex;
533    justify-content: center;
534    align-items: center;
535    width: var(--local-width);
536    height: var(--local-height);
537  }
538
539  :host([data-round='true']) {
540    background: ${({tokens:e})=>e.theme.foregroundPrimary};
541    border-radius: 100%;
542    outline: 1px solid ${({tokens:e})=>e.core.glass010};
543  }
544
545  svg {
546    position: absolute;
547    top: 0;
548    left: 0;
549    width: 100%;
550    height: 100%;
551    z-index: 1;
552  }
553
554  svg > path {
555    stroke: var(--local-stroke);
556  }
557
558  wui-image {
559    width: 100%;
560    height: 100%;
561    -webkit-clip-path: var(--local-path);
562    clip-path: var(--local-path);
563    background: ${({tokens:e})=>e.theme.foregroundPrimary};
564  }
565
566  wui-icon {
567    transform: translateY(-5%);
568    width: var(--local-icon-size);
569    height: var(--local-icon-size);
570  }
571`;var u=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let p=class extends r.WF{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:o,md:a.a,lg:s},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=`
572      --local-width: var(--apkt-spacing-10);
573      --local-height: var(--apkt-spacing-10);
574      --local-icon-size: var(--apkt-spacing-4);
575    `):this.style.cssText=`
576
577      --local-path: var(--apkt-path-network-${this.size});
578      --local-width:  var(--apkt-width-network-${this.size});
579      --local-height:  var(--apkt-height-network-${this.size});
580      --local-icon-size:  var(--apkt-spacing-${({sm:"4",md:"6",lg:"10"})[this.size]});
581    `,(0,r.qy)`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?(0,r.qy)`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:(0,r.qy)`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};p.styles=[l.W5,h],u([(0,n.MZ)()],p.prototype,"size",void 0),u([(0,n.MZ)()],p.prototype,"name",void 0),u([(0,n.MZ)({type:Object})],p.prototype,"networkImagesBySize",void 0),u([(0,n.MZ)()],p.prototype,"imageSrc",void 0),u([(0,n.MZ)({type:Boolean})],p.prototype,"selected",void 0),u([(0,n.MZ)({type:Boolean})],p.prototype,"round",void 0),p=u([(0,c.E)("wui-network-image")],p)},19493:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(40859),a=i(67786);i(82016),i(12936);var o=i(94895),l=i(69428),c=i(34175);let d=(0,c.AH)`
582  :host {
583    position: relative;
584    width: 100%;
585    display: inline-flex;
586    flex-direction: column;
587    gap: ${({spacing:e})=>e[3]};
588    color: ${({tokens:e})=>e.theme.textPrimary};
589    caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
590  }
591
592  .wui-input-text-container {
593    position: relative;
594    display: flex;
595  }
596
597  input {
598    width: 100%;
599    border-radius: ${({borderRadius:e})=>e[4]};
600    color: inherit;
601    background: transparent;
602    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
603    caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
604    padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[3]}
605      ${({spacing:e})=>e[3]} ${({spacing:e})=>e[10]};
606    font-size: ${({textSize:e})=>e.large};
607    line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
608    letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
609    font-weight: ${({fontWeight:e})=>e.regular};
610    font-family: ${({fontFamily:e})=>e.regular};
611  }
612
613  input[data-size='lg'] {
614    padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]}
615      ${({spacing:e})=>e[4]} ${({spacing:e})=>e[10]};
616  }
617
618  @media (hover: hover) and (pointer: fine) {
619    input:hover:enabled {
620      border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
621    }
622  }
623
624  input:disabled {
625    cursor: unset;
626    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
627  }
628
629  input::placeholder {
630    color: ${({tokens:e})=>e.theme.textSecondary};
631  }
632
633  input:focus:enabled {
634    border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
635    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
636    -webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
637    -moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
638    box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
639  }
640
641  div.wui-input-text-container:has(input:disabled) {
642    opacity: 0.5;
643  }
644
645  wui-icon.wui-input-text-left-icon {
646    position: absolute;
647    top: 50%;
648    transform: translateY(-50%);
649    pointer-events: none;
650    left: ${({spacing:e})=>e[4]};
651    color: ${({tokens:e})=>e.theme.iconDefault};
652  }
653
654  button.wui-input-text-submit-button {
655    position: absolute;
656    top: 50%;
657    transform: translateY(-50%);
658    right: ${({spacing:e})=>e[3]};
659    width: 24px;
660    height: 24px;
661    border: none;
662    background: transparent;
663    border-radius: ${({borderRadius:e})=>e[2]};
664    color: ${({tokens:e})=>e.core.textAccentPrimary};
665  }
666
667  button.wui-input-text-submit-button:disabled {
668    opacity: 1;
669  }
670
671  button.wui-input-text-submit-button.loading wui-icon {
672    animation: spin 1s linear infinite;
673  }
674
675  button.wui-input-text-submit-button:hover {
676    background: ${({tokens:e})=>e.core.foregroundAccent010};
677  }
678
679  input:has(+ .wui-input-text-submit-button) {
680    padding-right: ${({spacing:e})=>e[12]};
681  }
682
683  input[type='number'] {
684    -moz-appearance: textfield;
685  }
686
687  input[type='search']::-webkit-search-decoration,
688  input[type='search']::-webkit-search-cancel-button,
689  input[type='search']::-webkit-search-results-button,
690  input[type='search']::-webkit-search-results-decoration {
691    -webkit-appearance: none;
692  }
693
694  /* -- Keyframes --------------------------------------------------- */
695  @keyframes spin {
696    from {
697      transform: rotate(0deg);
698    }
699    to {
700      transform: rotate(360deg);
701    }
702  }
703`;var h=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends r.WF{constructor(){super(...arguments),this.inputElementRef=(0,a._)(),this.disabled=!1,this.loading=!1,this.placeholder="",this.type="text",this.value="",this.size="md"}render(){return(0,r.qy)` <div class="wui-input-text-container">
704        ${this.templateLeftIcon()}
705        <input
706          data-size=${this.size}
707          ${(0,a.K)(this.inputElementRef)}
708          data-testid="wui-input-text"
709          type=${this.type}
710          enterkeyhint=${(0,s.J)(this.enterKeyHint)}
711          ?disabled=${this.disabled}
712          placeholder=${this.placeholder}
713          @input=${this.dispatchInputChangeEvent.bind(this)}
714          @keydown=${this.onKeyDown}
715          .value=${this.value||""}
716        />
717        ${this.templateSubmitButton()}
718        <slot class="wui-input-text-slot"></slot>
719      </div>
720      ${this.templateError()} ${this.templateWarning()}`}templateLeftIcon(){return this.icon?(0,r.qy)`<wui-icon
721        class="wui-input-text-left-icon"
722        size="md"
723        data-size=${this.size}
724        color="inherit"
725        name=${this.icon}
726      ></wui-icon>`:null}templateSubmitButton(){return this.onSubmit?(0,r.qy)`<button
727        class="wui-input-text-submit-button ${this.loading?"loading":""}"
728        @click=${this.onSubmit?.bind(this)}
729        ?disabled=${this.disabled||this.loading}
730      >
731        ${this.loading?(0,r.qy)`<wui-icon name="spinner" size="md"></wui-icon>`:(0,r.qy)`<wui-icon name="chevronRight" size="md"></wui-icon>`}
732      </button>`:null}templateError(){return this.errorText?(0,r.qy)`<wui-text variant="sm-regular" color="error">${this.errorText}</wui-text>`:null}templateWarning(){return this.warningText?(0,r.qy)`<wui-text variant="sm-regular" color="warning">${this.warningText}</wui-text>`:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};u.styles=[o.W5,o.fD,d],h([(0,n.MZ)()],u.prototype,"icon",void 0),h([(0,n.MZ)({type:Boolean})],u.prototype,"disabled",void 0),h([(0,n.MZ)({type:Boolean})],u.prototype,"loading",void 0),h([(0,n.MZ)()],u.prototype,"placeholder",void 0),h([(0,n.MZ)()],u.prototype,"type",void 0),h([(0,n.MZ)()],u.prototype,"value",void 0),h([(0,n.MZ)()],u.prototype,"errorText",void 0),h([(0,n.MZ)()],u.prototype,"warningText",void 0),h([(0,n.MZ)()],u.prototype,"onSubmit",void 0),h([(0,n.MZ)()],u.prototype,"size",void 0),h([(0,n.MZ)({attribute:!1})],u.prototype,"onKeyDown",void 0),u=h([(0,l.E)("wui-input-text")],u)},19626:(e,t,i)=>{"use strict";function r(e,t){let i=e?.["--apkt-accent"]??e?.["--w3m-accent"];return"light"===t?{"--w3m-accent":i||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":i||"hsla(230, 100%, 67%, 1)","--w3m-background":"#202020"}}i.d(t,{o:()=>r})},19690:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(82016),i(88364);var s=i(94895),a=i(69428);i(15642);var o=i(34175);let l=(0,o.AH)`
733  :host {
734    position: relative;
735    background-color: ${({tokens:e})=>e.theme.foregroundTertiary};
736    display: flex;
737    justify-content: center;
738    align-items: center;
739    border-radius: inherit;
740    border-radius: var(--local-border-radius);
741  }
742
743  :host([data-image='true']) {
744    background-color: transparent;
745  }
746
747  :host > wui-flex {
748    overflow: hidden;
749    border-radius: inherit;
750    border-radius: var(--local-border-radius);
751  }
752
753  :host([data-size='sm']) {
754    width: 32px;
755    height: 32px;
756  }
757
758  :host([data-size='md']) {
759    width: 40px;
760    height: 40px;
761  }
762
763  :host([data-size='lg']) {
764    width: 56px;
765    height: 56px;
766  }
767
768  :host([name='Extension'])::after {
769    border: 1px solid ${({colors:e})=>e.accent010};
770  }
771
772  :host([data-wallet-icon='allWallets'])::after {
773    border: 1px solid ${({colors:e})=>e.accent010};
774  }
775
776  wui-icon[data-parent-size='inherit'] {
777    width: 75%;
778    height: 75%;
779    align-items: center;
780  }
781
782  wui-icon {
783    color: ${({tokens:e})=>e.theme.iconDefault};
784  }
785
786  wui-icon[data-parent-size='sm'] {
787    width: 24px;
788    height: 24px;
789  }
790
791  wui-icon[data-parent-size='md'] {
792    width: 32px;
793    height: 32px;
794  }
795
796  :host > wui-icon-box {
797    position: absolute;
798    overflow: hidden;
799    right: -1px;
800    bottom: -2px;
801    z-index: 1;
802    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
803    padding: 1px;
804  }
805`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="1";return"lg"===this.size?e="4":"md"===this.size?e="2":"sm"===this.size&&(e="1"),this.style.cssText=`
806       --local-border-radius: var(--apkt-borderRadius-${e});
807   `,this.dataset.size=this.size,this.imageSrc&&(this.dataset.image="true"),this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),(0,r.qy)`
808      <wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex>
809    `}templateVisual(){return this.imageSrc?(0,r.qy)`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?(0,r.qy)`<wui-icon size="md" color="default" name=${this.walletIcon}></wui-icon>`:(0,r.qy)`<wui-icon
810      data-parent-size=${this.size}
811      size="inherit"
812      color="inherit"
813      name="wallet"
814    ></wui-icon>`}};d.styles=[s.W5,l],c([(0,n.MZ)()],d.prototype,"size",void 0),c([(0,n.MZ)()],d.prototype,"name",void 0),c([(0,n.MZ)()],d.prototype,"imageSrc",void 0),c([(0,n.MZ)()],d.prototype,"walletIcon",void 0),c([(0,n.MZ)({type:Boolean})],d.prototype,"installed",void 0),c([(0,n.MZ)()],d.prototype,"badgeSize",void 0),d=c([(0,a.E)("wui-wallet-image")],d)},19995:e=>{"use strict";var t={single_source_shortest_paths:function(e,i,r){var n,s,a,o,l,c,d,h={},u={};u[i]=0;var p=t.PriorityQueue.make();for(p.push(i,0);!p.empty();)for(a in s=(n=p.pop()).value,o=n.cost,l=e[s]||{})l.hasOwnProperty(a)&&(c=o+l[a],d=u[a],(void 0===u[a]||d>c)&&(u[a]=c,p.push(a,c),h[a]=s));if(void 0!==r&&void 0===u[r])throw Error(["Could not find a path from ",i," to ",r,"."].join(""));return h},extract_shortest_path_from_predecessor_list:function(e,t){for(var i=[],r=t;r;)i.push(r),e[r],r=e[r];return i.reverse(),i},find_path:function(e,i,r){var n=t.single_source_shortest_paths(e,i,r);return t.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var i,r=t.PriorityQueue,n={};for(i in e=e||{},r)r.hasOwnProperty(i)&&(n[i]=r[i]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},20903:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(82016);var s=i(94895),a=i(69428),o=i(34175);let l=(0,o.AH)`
815  button {
816    background-color: transparent;
817    padding: ${({spacing:e})=>e[1]};
818  }
819
820  button:focus-visible {
821    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
822  }
823
824  button[data-variant='accent']:hover:enabled,
825  button[data-variant='accent']:focus-visible {
826    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
827  }
828
829  button[data-variant='primary']:hover:enabled,
830  button[data-variant='primary']:focus-visible,
831  button[data-variant='secondary']:hover:enabled,
832  button[data-variant='secondary']:focus-visible {
833    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
834  }
835
836  button[data-size='xs'] > wui-icon {
837    width: 8px;
838    height: 8px;
839  }
840
841  button[data-size='sm'] > wui-icon {
842    width: 12px;
843    height: 12px;
844  }
845
846  button[data-size='xs'],
847  button[data-size='sm'] {
848    border-radius: ${({borderRadius:e})=>e[1]};
849  }
850
851  button[data-size='md'],
852  button[data-size='lg'] {
853    border-radius: ${({borderRadius:e})=>e[2]};
854  }
855
856  button[data-size='md'] > wui-icon {
857    width: 16px;
858    height: 16px;
859  }
860
861  button[data-size='lg'] > wui-icon {
862    width: 20px;
863    height: 20px;
864  }
865
866  button:disabled {
867    background-color: transparent;
868    cursor: not-allowed;
869    opacity: 0.5;
870  }
871
872  button:hover:not(:disabled) {
873    background-color: var(--wui-color-accent-glass-015);
874  }
875
876  button:focus-visible:not(:disabled) {
877    background-color: var(--wui-color-accent-glass-015);
878    box-shadow:
879      inset 0 0 0 1px var(--wui-color-accent-100),
880      0 0 0 4px var(--wui-color-accent-glass-020);
881  }
882`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="default",this.variant="accent"}render(){return(0,r.qy)`
883      <button data-variant=${this.variant} ?disabled=${this.disabled} data-size=${this.size}>
884        <wui-icon
885          color=${({accent:"accent-primary",primary:"inverse",secondary:"default"})[this.variant]||this.iconColor}
886          size=${this.size}
887          name=${this.icon}
888        ></wui-icon>
889      </button>
890    `}};d.styles=[s.W5,s.fD,l],c([(0,n.MZ)()],d.prototype,"size",void 0),c([(0,n.MZ)({type:Boolean})],d.prototype,"disabled",void 0),c([(0,n.MZ)()],d.prototype,"icon",void 0),c([(0,n.MZ)()],d.prototype,"iconColor",void 0),c([(0,n.MZ)()],d.prototype,"variant",void 0),d=c([(0,a.E)("wui-icon-link")],d)},21403:(e,t,i)=>{"use strict";let r,n;i.r(t),i.d(t,{AppKit:()=>ex,AppKitAccountButton:()=>eB,AppKitButton:()=>eD,AppKitConnectButton:()=>eW,AppKitNetworkButton:()=>eL,AppKitProvider:()=>eF,CoreHelperUtil:()=>s.w,WcConstantsUtil:()=>em,createAppKit:()=>eH,getAppKit:()=>eA,modal:()=>n,useAppKit:()=>eI,useAppKitAccount:()=>O,useAppKitBalance:()=>ez,useAppKitConnection:()=>$,useAppKitConnections:()=>P,useAppKitEvents:()=>ek,useAppKitNetwork:()=>eq,useAppKitNetworkCore:()=>T,useAppKitProvider:()=>k,useAppKitState:()=>eN,useAppKitTheme:()=>e_,useAppKitWallets:()=>U,useDisconnect:()=>R,useWalletInfo:()=>eS});var s=i(37056),a=i(12115),o=i(32535),l=i(92679);let c=new WeakMap;function d(e,t){let i,r=null==t?void 0:t.sync,n=(0,a.useMemo)(()=>e&&new WeakMap,[e]),s=(0,a.useRef)(void 0),d=!0,h=(0,a.useSyncExternalStore)((0,a.useCallback)(t=>{let i=(0,l.B1)(e,t,r);return t(),i},[e,r]),()=>{let t=(0,l.P9)(e);try{if(!d&&s.current&&!(0,o.Hq)(s.current,t,n,new WeakMap))return s.current}catch(e){}return t},()=>(0,l.P9)(e));d=!1,(0,a.useLayoutEffect)(()=>{s.current=h}),i=(0,a.useRef)(void 0),(0,a.useEffect)(()=>{i.current=(0,o.JR)(h,n,!0)}),(0,a.useDebugValue)(i.current);let u=(0,a.useMemo)(()=>new WeakMap,[]);return(0,o.tz)(h,n,u,c)}var h=i(34386),u=i(25663),p=i(92929),f=i(76581),g=i(1024),m=i(60319),w=i(11446),y=i(11403),b=i(79954),v=i(83931),C=i(48789),E=i(88570),x=i(7046);let A={getInitialWallets(){return E.g.connectorList().map(e=>"connector"===e.kind?this.mapConnectorToWalletItem(e.connector,e.subtype):"wallet"===e.kind?this.mapWalletToWalletItem(e.wallet):null).filter(Boolean)},getWalletConnectWallets(e,t){return t.length>0?t.map(e=>this.mapWalletToWalletItem(e)):x.A.getWalletConnectWallets(e).map(e=>this.mapWalletToWalletItem(e))},serializeWcWallet:e=>e?{walletInfo:{description:e.description,supportedChains:e.chains,website:e.homepage,installationLinks:{appStore:e.app_store,playStore:e.play_store,chromeStore:e.chrome_store,desktopLink:e.desktop_link},deepLink:e.mobile_link,linkMode:e.link_mode,isCertified:"certified"===e.badge_type,supportsWcPay:e.supports_wcpay??!1}}:{walletInfo:{}},mapConnectorToWalletItem(e,t){let i=e.connectors?.length?e.connectors?.map(e=>({id:e.id,chain:e.chain,chainImageUrl:C.$.getChainNamespaceImageUrl(e.chain)}))||[]:[{id:e.id,chain:e.chain,chainImageUrl:C.$.getChainNamespaceImageUrl(e.chain)}];return{id:e.id,connectors:"walletConnect"===t?[]:i,name:e.name,imageUrl:e.imageUrl||C.$.getAssetImageUrl(e.imageId),imageId:e.imageId,isInjected:"walletConnect"!==t,isRecent:!1,...this.serializeWcWallet(e.explorerWallet)}},mapWalletToWalletItem(e){return{id:e.id,connectors:[],name:e.name,imageUrl:C.$.getWalletImageUrl(e.image_id),imageId:e.image_id,isInjected:!1,isRecent:!1,...this.serializeWcWallet(e)}},mapWalletItemToWcWallet:e=>({id:e.id,name:e.name,image_id:e.imageId,image_url:e.imageUrl,description:e.walletInfo.description,mobile_link:e.walletInfo.deepLink,link_mode:e.walletInfo.linkMode??null,chains:e.walletInfo.supportedChains})};var _=i(22787),I=i(11282),S=i(39564),N=i(5820);function k(e){let{providers:t,providerIds:i}=d(b.G.state);return{walletProvider:t[e],walletProviderType:i[e]}}function T(){let{activeCaipNetwork:e}=d(g.W.state);return{caipNetwork:e,chainId:e?.id,caipNetworkId:e?.caipNetworkId}}function O(e){let t=d(g.W.state),{activeConnectorIds:i}=d(w.a.state),{connections:r}=d(m.x.state),n=e?.namespace||t.activeChain;if(!n)return{allAccounts:[],address:void 0,caipAddress:void 0,status:void 0,isConnected:!1,embeddedWalletInfo:void 0};let a=t.chains.get(n)?.accountState,o=w.a.getAuthConnector(n),l=i[n];return{allAccounts:(r.get(n)??[]).flatMap(e=>{let{caipNetwork:t}=e;return t?e.accounts.map(({address:e,type:i,publicKey:r})=>s.w.createAccount({caipAddress:`${t.caipNetworkId}:${e}`,type:i||"eoa",publicKey:r})):[]}),caipAddress:a?.caipAddress,address:s.w.getPlainAddress(a?.caipAddress),isConnected:!!a?.caipAddress,status:a?.status,embeddedWalletInfo:o&&l===h.o.CONNECTOR_ID.AUTH?{user:a?.user?{...a.user,username:N.i.getConnectedSocialUsername()}:void 0,authProvider:a?.socialProvider||"email",accountType:a?.preferredAccountType,isSmartAccountDeployed:!!a?.smartAccountDeployed}:void 0}}function R(){return{disconnect:async function(e){await m.x.disconnect(e)}}}function P(e){d(m.x.state),d(w.a.state),d(f.j.state);let{activeChain:t}=d(g.W.state),{remoteFeatures:i}=d(y.H.state),r=e??t,n=!!i?.multiWallet;if(!r)throw Error("No namespace found");let s=(0,a.useCallback)(e=>{let t=w.a.getConnectorById(e.connectorId),i=w.a.getConnectorName(t?.name);return{name:i,icon:C.$.getConnectorImage(t),networkIcon:C.$.getNetworkImage(e.caipNetwork),...e}},[]),{connections:o,recentConnections:l}=_.b.getConnectionsData(r);return n?{connections:o.map(s),recentConnections:l.map(s)}:(u.h.open(h.o.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.CONNECTIONS_HOOK,"info"),{connections:[],recentConnections:[]})}function $({namespace:e,onSuccess:t,onError:i}){let{connections:r,isSwitchingConnection:n}=d(m.x.state),{activeConnectorIds:s}=d(w.a.state),{activeChain:o}=d(g.W.state),{remoteFeatures:l}=d(y.H.state),c=e??o;if(!c)throw Error("No namespace found");let p=!!l?.multiWallet,f=(0,a.useCallback)(async({connection:e,address:r})=>{try{m.x.setIsSwitchingConnection(!0),await m.x.switchConnection({connection:e,address:r,namespace:c,onChange({address:e,namespace:i,hasSwitchedAccount:r,hasSwitchedWallet:n}){t?.({address:e,namespace:i,hasSwitchedAccount:r,hasSwitchedWallet:n,hasDeletedWallet:!1})}})}catch(t){let e=t instanceof Error?t:Error("Something went wrong");i?.(e)}finally{m.x.setIsSwitchingConnection(!1)}},[c,t,i]),b=(0,a.useCallback)(({address:e,connectorId:i})=>{N.i.deleteAddressFromConnection({connectorId:i,address:e,namespace:c}),m.x.syncStorageConnections(),t?.({address:e,namespace:c,hasSwitchedAccount:!1,hasSwitchedWallet:!1,hasDeletedWallet:!0})},[c]);if(!p)return u.h.open(h.o.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.CONNECTION_HOOK,"info"),{connection:void 0,isPending:!1,switchConnection:()=>Promise.resolve(void 0),deleteConnection:()=>({})};let v=s[c],C=r.get(c);return{connection:C?.find(e=>e.connectorId.toLowerCase()===v?.toLowerCase()),isPending:n,switchConnection:f,deleteConnection:b}}function U(){let{features:e,remoteFeatures:t}=d(y.H.state),i=!!(e?.headless&&t?.headless),[r,n]=(0,a.useState)(!1),[o,l]=(0,a.useState)(void 0),{wcUri:c,wcFetchingUri:f,wcError:b}=d(m.x.state),{wallets:C,search:E,page:x,count:N}=d(p.N.state),{initialized:k,connectingWallet:T}=d(v.z.state);async function O(){$(),await m.x.connectWalletConnect({cache:"auto"})}async function R(e){n(!0);try{let{query:t,...i}=e??{},r=i.search??t;r?await p.N.searchWallet({...i,search:r}):(p.N.state.search=[],await p.N.fetchWalletsByPage({page:1,...i}))}catch(e){console.error("Failed to fetch WalletConnect wallets:",e)}finally{n(!1)}}async function P(e,t,i){l(i?.wcPayUrl),v.z.set({connectingWallet:e});let r=s.w.isMobile(),n=t||g.W.state.activeChain;try{let t=e?.connectors.find(e=>e.chain===n),s=t&&n?w.a.getConnector({id:t?.id,namespace:n}):void 0,a=!s&&n?w.a.getConnector({id:e?.id,namespace:n}):void 0;if(e?.isInjected&&s)await I.g.connectExternal(s);else if(a)await I.g.connectExternal(a);else if(r){let t=A.mapWalletItemToWcWallet(e);t.mobile_link?_.b.onConnectMobile(t,i?.wcPayUrl):S.W.handleMobileDeeplinkRedirect(e.id,n,{isCoinbaseDisabled:!1===y.H.state.enableCoinbase})}else await m.x.connectWalletConnect({cache:"never"})}catch(e){throw v.z.set({connectingWallet:void 0}),e}}function $(){m.x.resetUri(),m.x.setWcLinking(void 0),l(void 0)}function U(){v.z.set({connectingWallet:void 0})}(0,a.useEffect)(()=>{!k||t?.headless===void 0||i&&t?.headless||u.h.open(h.o.REMOTE_FEATURES_ALERTS.HEADLESS_NOT_ENABLED.DEFAULT,"info")},[k,i,t?.headless]);let M=o&&c?s.w.appendPayToUri(c,o):c;return i&&t?.headless?{wallets:A.getInitialWallets(),wcWallets:A.getWalletConnectWallets(C,E),isFetchingWallets:r,isFetchingWcUri:f,isInitialized:k,wcUri:M,wcError:b??!1,connectingWallet:T,page:x,count:N,connect:P,fetchWallets:R,resetWcUri:$,resetConnectingWallet:U,getWcUri:O}:{wallets:[],wcWallets:[],isFetchingWallets:!1,isFetchingWcUri:!1,isInitialized:!1,wcUri:void 0,wcError:!1,connectingWallet:void 0,page:0,count:0,connect:()=>Promise.resolve(),fetchWallets:()=>Promise.resolve(),resetWcUri:$,resetConnectingWallet:U,getWcUri:()=>Promise.resolve()}}var M=i(19626),D=i(41300),L=i(33452),W=i(43242),B=i(44458),j=i(29400),F=i(69148),H=i(60890),q=i(13226),z=i(60945),V=i(64461),Z=i(67066),K=i(16696),G=i(45027),Y=i(30840),J=i(37633),
890X=i(18715),Q=i(38618),ee=i(83630),et=i(24568),ei=i(16025),er=i(43587),en=i(47653),es=i(44963),ea=i(59306),eo=i(8586);let el={TOKEN_ADDRESSES_BY_SYMBOL:{USDC:{8453:eo.$f.asset,84532:eo.sP.asset}},getTokenSymbolByAddress(e){if(!e)return;let[t]=Object.entries(el.TOKEN_ADDRESSES_BY_SYMBOL).find(([t,i])=>Object.values(i).includes(e))??[];return t}};var ec=i(27136),ed=i(5873);let eh={createLogger(e,t="error"){let i=(0,ed.iP)({level:t}),{logger:r}=(0,ed.D5)({opts:i});return r.error=(...t)=>{for(let i of t)if(i instanceof Error)return void e(i,...t);e(void 0,...t)},r}};var eu=i(50248),ep=i(84428),ef=i(56018),eg=i(89219);let em={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603};class ew extends ef.X{async setUniversalProvider(e){if(!this.namespace)throw Error("UniversalAdapter:setUniversalProvider - namespace is required");return this.addConnector(new eg.F({provider:e,caipNetworks:this.getCaipNetworks(),namespace:this.namespace})),Promise.resolve()}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){try{let e=this.getWalletConnectConnector();await e.disconnect(),this.emit("disconnect")}catch(e){console.warn("UniversalAdapter:disconnect - error",e)}return{connections:[]}}syncConnections(){return Promise.resolve()}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async getAccounts({namespace:e}){let t=this.provider;return Promise.resolve({accounts:(t?.session?.namespaces?.[e]?.accounts||[]).filter((e,t,i)=>i.indexOf(e)===t).map(t=>s.w.createAccount({caipAddress:t,type:"bip122"===e?"payment":"eoa"}))})}async syncConnectors(){return Promise.resolve()}async getBalance(e){if(!(e.caipNetwork&&j.oU.BALANCE_SUPPORTED_CHAINS.includes(e.caipNetwork?.chainNamespace))||e.caipNetwork?.testnet)return{balance:"0.00",symbol:e.caipNetwork?.nativeCurrency.symbol||""};let t=g.W.getAccountData();if(t?.balanceLoading&&e.chainId===g.W.state.activeCaipNetwork?.id)return{balance:t?.balance||"0.00",symbol:t?.balanceSymbol||""};let i=(await g.W.fetchTokenBalance()).find(t=>t.chainId===`${e.caipNetwork?.chainNamespace}:${e.chainId}`&&t.symbol===e.caipNetwork?.nativeCurrency.symbol);return{balance:i?.quantity.numeric||"0.00",symbol:i?.symbol||e.caipNetwork?.nativeCurrency.symbol||""}}async signMessage(e){let{provider:t,message:i,address:r}=e;if(!t)throw Error("UniversalAdapter:signMessage - provider is undefined");return{signature:g.W.state.activeCaipNetwork?.chainNamespace===h.o.CHAIN.SOLANA?(await t.request({method:"solana_signMessage",params:{message:eu.A.encode(new TextEncoder().encode(i)),pubkey:r}},g.W.state.activeCaipNetwork?.caipNetworkId)).signature:await t.request({method:"personal_sign",params:[i,r]},g.W.state.activeCaipNetwork?.caipNetworkId)}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(e){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}emitFirstAvailableConnection(){}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){let{caipNetwork:t}=e,i=this.getWalletConnectConnector();if(t.chainNamespace===h.o.CHAIN.EVM)try{await i.provider?.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,ep.nj)(t.id)}]})}catch(e){if(e.code===em.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||e.code===em.ERROR_INVALID_CHAIN_ID||e.code===em.ERROR_CODE_DEFAULT||e?.data?.originalError?.code===em.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await i.provider?.request({method:"wallet_addEthereumChain",params:[{chainId:(0,ep.nj)(t.id),rpcUrls:[t?.rpcUrls.chainDefault?.http],chainName:t.name,nativeCurrency:t.nativeCurrency,blockExplorerUrls:[t.blockExplorers?.default.url]}]})}catch(e){throw Error("Chain is not supported")}}i.provider.setDefaultChain(t.caipNetworkId)}getWalletConnectProvider(){let e=this.connectors.find(e=>"WALLET_CONNECT"===e.type);return e?.provider}}let ey=["email","socials","swaps","onramp","activity","reownBranding","multiWallet","emailCapture","payWithExchange","payments","reownAuthentication","headless"],eb={email:{apiFeatureName:"social_login",localFeatureName:"email",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.includes("email")},processFallback:e=>void 0===e?j.oU.DEFAULT_REMOTE_FEATURES.email:!!e},socials:{apiFeatureName:"social_login",localFeatureName:"socials",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t.filter(e=>"email"!==e)},processFallback:e=>void 0===e?j.oU.DEFAULT_REMOTE_FEATURES.socials:"boolean"==typeof e?!!e&&j.oU.DEFAULT_REMOTE_FEATURES.socials:e},swaps:{apiFeatureName:"swap",localFeatureName:"swaps",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t},processFallback:e=>void 0===e?j.oU.DEFAULT_REMOTE_FEATURES.swaps:"boolean"==typeof e?!!e&&j.oU.DEFAULT_REMOTE_FEATURES.swaps:e},onramp:{apiFeatureName:"onramp",localFeatureName:"onramp",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t},processFallback:e=>void 0===e?j.oU.DEFAULT_REMOTE_FEATURES.onramp:"boolean"==typeof e?!!e&&j.oU.DEFAULT_REMOTE_FEATURES.onramp:e},activity:{apiFeatureName:"activity",localFeatureName:"history",returnType:!1,isLegacy:!0,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?j.oU.DEFAULT_REMOTE_FEATURES.activity:!!e},reownBranding:{apiFeatureName:"reown_branding",localFeatureName:"reownBranding",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?j.oU.DEFAULT_REMOTE_FEATURES.reownBranding:!!e},emailCapture:{apiFeatureName:"email_capture",localFeatureName:"emailCapture",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>e.isEnabled&&(e.config??[]),processFallback:e=>!1},multiWallet:{apiFeatureName:"multi_wallet",localFeatureName:"multiWallet",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>j.oU.DEFAULT_REMOTE_FEATURES.multiWallet},payWithExchange:{apiFeatureName:"fund_from_exchange",localFeatureName:"payWithExchange",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>j.oU.DEFAULT_REMOTE_FEATURES.payWithExchange},payments:{apiFeatureName:"payments",localFeatureName:"payments",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>j.oU.DEFAULT_REMOTE_FEATURES.payments},reownAuthentication:{apiFeatureName:"reown_authentication",localFeatureName:"reownAuthentication",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?j.oU.DEFAULT_REMOTE_FEATURES.reownAuthentication:!!e},headless:{apiFeatureName:"headless",localFeatureName:"headless",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>j.oU.DEFAULT_REMOTE_FEATURES.headless}},ev={localSettingsOverridden:new Set,getApiConfig:(e,t)=>
890t?.find(t=>t.id===e),addWarning(e,t){if(void 0!==e){let e=eb[t],i=e.isLegacy?`"features.${e.localFeatureName}" (now "${t}")`:`"features.${t}"`;this.localSettingsOverridden.add(i)}},processFeature(e,t,i,r,n){let s=eb[e],a=t[s.localFeatureName];if(n&&!s.isAvailableOnBasic)return!1;if(r){let t=this.getApiConfig(s.apiFeatureName,i);return t?.config===null?this.processFallbackFeature(e,a):!!t?.config&&(void 0!==a&&this.addWarning(a,e),this.processApiFeature(e,t))}return this.processFallbackFeature(e,a)},processApiFeature:(e,t)=>eb[e].processApi(t),processFallbackFeature:(e,t)=>eb[e].processFallback(t),async fetchRemoteFeatures(e){let t=e.basic??!1,i=e.features||{};this.localSettingsOverridden.clear();let r=null,n=!1;try{n=null!=(r=await p.N.fetchProjectConfig())}catch(e){console.warn("[Reown Config] Failed to fetch remote project configuration. Using local/default values.",e)}let s=n&&!t?j.oU.DEFAULT_REMOTE_FEATURES:j.oU.DEFAULT_REMOTE_FEATURES_DISABLED;try{for(let e of ey){let a=this.processFeature(e,i,r,n,t);Object.assign(s,{[e]:a})}}catch(e){return console.warn("[Reown Config] Failed to process the configuration from Cloud. Using default values.",e),j.oU.DEFAULT_REMOTE_FEATURES}if(n&&this.localSettingsOverridden.size>0){let e=`Your local configuration for ${Array.from(this.localSettingsOverridden).join(", ")} was ignored because a remote configuration was successfully fetched. Please manage these features via your project dashboard on dashboard.reown.com.`;u.h.open({debugMessage:z.R.ALERT_WARNINGS.LOCAL_CONFIGURATION_IGNORED.debugMessage(e)},"warning")}return s}};class eC{constructor(e){this.chainNamespaces=[],this.features={},this.remoteFeatures={},this.reportedAlertErrors={},this.getCaipNetwork=(e,t)=>{if(e){let i=g.W.getCaipNetworks(e)?.find(e=>e.id===t);if(i)return i;let r=g.W.getNetworkData(e)?.caipNetwork;if(r)return r;let n=g.W.getRequestedCaipNetworks(e);return n.filter(t=>t.chainNamespace===e)?.[0]}return g.W.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{let e=this.getCaipNetwork();if(e)return e.id},this.getCaipNetworks=e=>g.W.getCaipNetworks(e),this.getActiveChainNamespace=()=>g.W.state.activeChain,this.setRequestedCaipNetworks=(e,t)=>{g.W.setRequestedCaipNetworks(e,t)},this.getApprovedCaipNetworkIds=()=>g.W.getAllApprovedCaipNetworkIds(),this.getCaipAddress=e=>g.W.state.activeChain!==e&&e?g.W.state.chains.get(e)?.accountState?.caipAddress:g.W.state.activeCaipAddress,this.setClientId=e=>{X.T.setClientId(e)},this.getProvider=e=>b.G.getProvider(e),this.getProviderType=e=>b.G.getProviderId(e),this.getPreferredAccountType=e=>(0,L.lj)(e),this.setCaipAddress=(e,t,i=!1)=>{g.W.setAccountProp("caipAddress",e,t,i),g.W.setAccountProp("address",s.w.getPlainAddress(e),t,i)},this.setBalance=(e,t,i)=>{g.W.setAccountProp("balance",e,i),g.W.setAccountProp("balanceSymbol",t,i)},this.setProfileName=(e,t)=>{g.W.setAccountProp("profileName",e,t)},this.setProfileImage=(e,t)=>{g.W.setAccountProp("profileImage",e,t)},this.setUser=(e,t)=>{g.W.setAccountProp("user",e,t)},this.resetAccount=e=>{g.W.resetAccount(e)},this.setCaipNetwork=e=>{g.W.setActiveCaipNetwork(e)},this.setCaipNetworkOfNamespace=(e,t)=>{g.W.setChainNetworkData(t,{caipNetwork:e})},this.setStatus=(e,t)=>{g.W.setAccountProp("status",e,t),w.a.isConnected()?N.i.setConnectionStatus("connected"):N.i.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=e=>g.W.getAccountData(e)?.address,this.setConnectors=e=>{let t=[...w.a.state.allConnectors,...e];w.a.setConnectors(t)},this.setConnections=(e,t)=>{N.i.setConnections(e,t),m.x.setConnections(e,t)},this.fetchIdentity=e=>X.T.fetchIdentity(e),this.getReownName=e=>Q.f.getNamesForAddress(e),this.getConnectors=()=>w.a.getConnectors(),this.getConnectorImage=e=>C.$.getConnectorImage(e),this.getConnections=e=>this.remoteFeatures.multiWallet?_.b.getConnectionsData(e).connections:(u.h.open(h.o.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.getRecentConnections=e=>this.remoteFeatures.multiWallet?_.b.getConnectionsData(e).recentConnections:(u.h.open(h.o.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.switchConnection=async e=>{this.remoteFeatures.multiWallet?await m.x.switchConnection(e):u.h.open(h.o.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info")},this.deleteConnection=e=>{this.remoteFeatures.multiWallet?(N.i.deleteAddressFromConnection(e),m.x.syncStorageConnections()):u.h.open(h.o.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info")},this.setConnectedWalletInfo=(e,t)=>{let i=b.G.getProviderId(t),r=e?{...e,type:i}:void 0;g.W.setAccountProp("connectedWalletInfo",r,t)},this.getIsConnectedState=()=>!!g.W.state.activeCaipAddress,this.addAddressLabel=(e,t,i)=>{let r=g.W.getAccountData(i)?.addressLabels||{};g.W.setAccountProp("addressLabels",{...r,[e]:t},i)},this.removeAddressLabel=(e,t)=>
890{let i=g.W.getAccountData(t)?.addressLabels||{};g.W.setAccountProp("addressLabels",{...i,[e]:void 0},t)},this.getAddress=e=>{let t=e||g.W.state.activeChain;return g.W.getAccountData(t)?.address},this.resetNetwork=e=>{g.W.resetNetwork(e)},this.addConnector=e=>{w.a.addConnector(e)},this.resetWcConnection=()=>{m.x.resetWcConnection()},this.setAddressExplorerUrl=(e,t)=>{g.W.setAccountProp("addressExplorerUrl",e,t)},this.setSmartAccountDeployed=(e,t)=>{g.W.setAccountProp("smartAccountDeployed",e,t)},this.setPreferredAccountType=(e,t)=>{g.W.setAccountProp("preferredAccountType",e,t)},this.setEIP6963Enabled=e=>{y.H.setEIP6963Enabled(e)},this.handleUnsafeRPCRequest=()=>{this.isOpen()?this.isTransactionStackEmpty()||this.redirect("ApproveTransaction"):this.open({view:"ApproveTransaction"})},this.options=e,this.version=e.sdkVersion,this.caipNetworks=this.extendCaipNetworks(e),this.chainNamespaces=this.getChainNamespacesSet(e.adapters,this.caipNetworks),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),this.chainAdapters=this.createAdapters(e.adapters),this.readyPromise=this.initialize(e)}getChainNamespacesSet(e,t){let i=e?.map(e=>e.namespace).filter(e=>!!e);return i?.length?[...new Set(i)]:[...new Set(t?.map(e=>e.chainNamespace))]}async initialize(e){if(this.initializeProjectSettings(e),this.initControllers(e),await this.initChainAdapters(),this.sendInitializeEvent(e),e.features?.headless&&!E.g.hasInjectedConnectors()&&p.N.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1,fetchWalletRanks:!1,fetchRecommendedWallets:!0}),y.H.state.enableReconnect?(await this.syncExistingConnection(),await this.syncAdapterConnections()):await this.unSyncExistingConnection(),e.basic||e.manualWCControl||(this.remoteFeatures=await ev.fetchRemoteFeatures(e)),await p.N.fetchUsage(),y.H.setRemoteFeatures(this.remoteFeatures),this.remoteFeatures.onramp&&ee.aG.setOnrampProviders(this.remoteFeatures.onramp),(y.H.state.remoteFeatures?.email||Array.isArray(y.H.state.remoteFeatures?.socials)&&y.H.state.remoteFeatures?.socials.length>0)&&await this.checkAllowedOrigins(),y.H.state.features?.reownAuthentication||y.H.state.remoteFeatures?.reownAuthentication){let{ReownAuthentication:e}=await i.e(42417).then(i.bind(i,64798)),t=y.H.state.siwx;t instanceof e||(t&&console.warn("ReownAuthentication option is enabled, SIWX configuration will be overridden."),y.H.setSIWX(new e))}}async openSend(e){let t=e.namespace||g.W.state.activeChain,i=this.getCaipAddress(t),r=this.getCaipNetwork(t)?.id;if(!i)throw Error("openSend: caipAddress not found");if(r?.toString()!==e.chainId.toString()){let i=g.W.getCaipNetworkById(e.chainId,t);if(!i)throw Error(`openSend: caipNetwork with chainId ${e.chainId} not found`);await this.switchNetwork(i,{throwOnFailure:!0})}try{let t=el.getTokenSymbolByAddress(e.assetAddress);t&&await p.N.fetchTokenImages([t])}catch{}return await et.W.open({view:"WalletSend",data:{send:e}}),new Promise((e,t)=>{let i=ei.R.subscribeKey("hash",t=>{t&&(n(),e({hash:t}))}),r=et.W.subscribe(e=>{e.open||(n(),t(Error("Modal closed")))}),n=this.createCleanupHandler([i,r])})}toModalOptions(){return{isSwap:function(e){return e?.view==="Swap"},isSend:function(e){return e?.view==="WalletSend"}}}async checkAllowedOrigins(){try{let e=await p.N.fetchAllowedOrigins();if(!s.w.isClient())return;let t=window.location.origin;er.k.isOriginAllowed(t,e,h.o.DEFAULT_ALLOWED_ANCESTORS)||u.h.open(z.R.ALERT_ERRORS.ORIGIN_NOT_ALLOWED,"error")}catch(e){if(!(e instanceof Error))return;switch(e.message){case"RATE_LIMITED":u.h.open(z.R.ALERT_ERRORS.RATE_LIMITED_APP_CONFIGURATION,"error");break;case"SERVER_ERROR":{let t=e.cause instanceof Error?e.cause:e;u.h.open({displayMessage:z.R.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.displayMessage,debugMessage:z.R.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.debugMessage(t.message)},"error")}}}}createCleanupHandler(e){return()=>{e.forEach(e=>{try{e()}catch{}})}}sendInitializeEvent(e){let{...t}=e;delete t.adapters,delete t.universalProvider,W.E.sendEvent({type:"track",event:"INITIALIZE",properties:{...t,networks:e.networks.map(e=>e.id),siweConfig:{options:e.siweConfig?.options||{}}}})}initControllers(e){this.initializeOptionsController(e),this.initializeChainController(e),this.initializeThemeController(e),this.initializeConnectionController(e),this.initializeConnectorController()}initAdapterController(){en.q.initialize(this.chainAdapters)}initializeThemeController(e){e.themeMode&&F.W.setThemeMode(e.themeMode),e.themeVariables&&F.W.setThemeVariables(e.themeVariables)}initializeChainController(e){if(!this.connectionControllerClient)throw Error("ConnectionControllerClient must be set");g.W.initialize(e.adapters??[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient});let t=this.getDefaultNetwork();t&&g.W.setActiveCaipNetwork(t)}initializeConnectionController(e){m.x.initialize(e.adapters??[]),m.x.setWcBasic(e.basic??!1)}initializeConnectorController(){w.a.initialize(this.chainNamespaces)}initializeProjectSettings(e){y.H.setProjectId(e.projectId),y.H.setSdkVersion(e.sdkVersion)}initializeOptionsController(e){y.H.setDebug(!1!==e.debug),y.H.setEnableWalletGuide(!1!==e.enableWalletGuide),y.H.setEnableWallets(!1!==e.enableWallets),y.H.setEIP6963Enabled(!1!==e.enableEIP6963),y.H.setEnableCoinbase(!1!==e.enableCoinbase),y.H.setEnableNetworkSwitch(!1!==e.enableNetworkSwitch),y.H.setEnableReconnect(!1!==e.enableReconnect),y.H.setEnableMobileFullScreen(!0===e.enableMobileFullScreen),y.H.setCoinbasePreference(e.coinbasePreference),y.H.setEnableAuthLogger(!1!==e.enableAuthLogger),y.H.setCustomRpcUrls(e.customRpcUrls),y.H.setEnableEmbedded(e.enableEmbedded),y.H.setAllWallets(e.allWallets),y.H.setIncludeWalletIds(e.includeWalletIds),y.H.setExcludeWalletIds(e.excludeWalletIds),y.H.setFeaturedWalletIds(e.featuredWalletIds),y.H.setTokens(e.tokens),y.H.setTermsConditionsUrl(e.termsConditionsUrl),y.H.setPrivacyPolicyUrl(e.privacyPolicyUrl),y.H.setCustomWallets(e.customWallets),y.H.setFeatures(e.features),y.H.setAllowUnsupportedChain(e.allowUnsupportedChain),y.H.setUniversalProviderConfigOverride(e.universalProviderConfigOverride),y.H.setPreferUniversalLinks(e.experimental_preferUniversalLinks),y.H.setDefaultAccountTypes(e.defaultAccountTypes);let t=this.getDefaultMetaData();if(!e.metadata&&t&&(e.metadata=t),y.H.setMetadata(e.metadata),y.H.setDisableAppend(e.disableAppend),y.H.setEnableEmbedded(e.enableEmbedded),y.H.setSIWX(e.siwx),this.features=y.H.state.features??{},!e.projectId)return void u.h.open(z.R.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");
890if(e.adapters?.find(e=>e.namespace===h.o.CHAIN.EVM)&&e.siweConfig){if(e.siwx)throw Error("Cannot set both `siweConfig` and `siwx` options");y.H.setSIWX(e.siweConfig.mapToSIWX())}}getDefaultMetaData(){return s.w.isClient()?{name:document.getElementsByTagName("title")?.[0]?.textContent||"",description:document.querySelector('meta[property="og:description"]')?.content||"",url:window.location.origin,icons:[document.querySelector('link[rel~="icon"]')?.href||""]}:null}setUnsupportedNetwork(e){let t=this.getActiveChainNamespace();if(t){let i=ec.R.getUnsupportedNetwork(`${t}:${e}`);g.W.setActiveCaipNetwork(i)}}getDefaultNetwork(){return ec.R.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(e,t){return ec.R.extendCaipNetwork(e,{customNetworkImageUrls:t.chainImages,projectId:t.projectId})}extendCaipNetworks(e){return ec.R.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId})}extendDefaultCaipNetwork(e){let t=e.networks.find(t=>t.id===e.defaultNetwork?.id);return t?ec.R.extendCaipNetwork(t,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId}):void 0}async disconnectConnector(e,t){try{this.setLoading(!0,e);let i={connections:[]},r=this.getAdapter(e);return(g.W.state.chains.get(e)?.accountState?.caipAddress||!y.H.state.enableReconnect)&&r?.disconnect&&(i=await r.disconnect({id:t})),this.setLoading(!1,e),i}catch(t){throw this.setLoading(!1,e),Error(`Failed to disconnect chains: ${t.message}`)}}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{let e=g.W.state.activeChain,t=this.getAdapter(e),i=this.getCaipNetwork(e)?.id,r=m.x.getConnections(e),n=this.remoteFeatures.multiWallet,s=r.length>0;if(!t)throw Error("Adapter not found");let a=await t.connectWalletConnect(i);s&&n||this.close(),this.setClientId(a?.clientId||null),N.i.setConnectedNamespaces([...g.W.state.chains.keys()]),await this.syncWalletConnectAccount(),await D.U.initializeIfEnabled()},connectExternal:async e=>{let t=await this.onConnectExternal(e);return await this.connectInactiveNamespaces(e,t),t?{address:t.address}:void 0},reconnectExternal:async({id:e,info:t,type:i,provider:r})=>{let n=g.W.state.activeChain,s=this.getAdapter(n);if(!n)throw Error("reconnectExternal: namespace not found");if(!s)throw Error("reconnectExternal: adapter not found");s?.reconnect&&(await s?.reconnect({id:e,info:t,type:i,provider:r,chainId:this.getCaipNetwork()?.id}),N.i.addConnectedNamespace(n),this.syncConnectedWalletInfo(n))},disconnectConnector:async e=>{await this.disconnectConnector(e.namespace,e.id)},disconnect:async e=>{let{id:t,chainNamespace:i,initialDisconnect:r}=e||{},n=i||g.W.state.activeChain,s=w.a.getConnectorId(n),a=t===h.o.CONNECTOR_ID.AUTH||s===h.o.CONNECTOR_ID.AUTH,o=t===h.o.CONNECTOR_ID.WALLET_CONNECT||s===h.o.CONNECTOR_ID.WALLET_CONNECT;try{let e=Array.from(g.W.state.chains.keys()),n=i?[i]:e;(o||a)&&(n=e);let s=n.map(async e=>{let i=w.a.getConnectorId(e),n=await this.disconnectConnector(e,t||i);n&&(a&&N.i.deleteConnectedSocialProvider(),n.connections.forEach(t=>{N.i.addDisconnectedConnectorId(t.connectorId,e)})),r&&this.onDisconnectNamespace({chainNamespace:e,closeModal:!1})}),l=await Promise.allSettled(s);ei.R.resetSend(),m.x.resetWcConnection(),D.U.getSIWX()?.signOutOnDisconnect&&await D.U.clearSessions(),w.a.setFilterByNamespace(void 0),m.x.syncStorageConnections();let c=l.filter(e=>"rejected"===e.status);if(c.length>0)throw Error(c.map(e=>e.reason.message).join(", "));W.E.sendEvent({type:"track",event:"DISCONNECT_SUCCESS",properties:{namespace:i||"all"}})}catch(e){throw Error(`Failed to disconnect chains: ${e.message}`)}},checkInstalled:e=>e?e.some(e=>!!window.ethereum?.[String(e)]):!!window.ethereum,signMessage:async e=>{let t=g.W.state.activeChain,i=this.getAdapter(g.W.state.activeChain);if(!t)throw Error("signMessage: namespace not found");if(!i)throw Error("signMessage: adapter not found");let r=this.getAddress(t);if(!r)throw Error("signMessage: address not found");let n=await i?.signMessage({message:e,address:r,provider:b.G.getProvider(t)});return n?.signature||""},sendTransaction:async e=>{let t=e.chainNamespace;if(!t)throw Error("sendTransaction: namespace not found");if(j.oU.SEND_SUPPORTED_NAMESPACES.includes(t)){let i=this.getAdapter(t);if(!i)throw Error("sendTransaction: adapter not found");let r=b.G.getProvider(t),n=await i?.sendTransaction({...e,caipNetwork:this.getCaipNetwork(),provider:r});return n?.hash||""}return""},estimateGas:async e=>{let t=e.chainNamespace;if(t===h.o.CHAIN.EVM){let i=this.getAdapter(t);if(!i)throw Error("estimateGas: adapter is required but got undefined");let r=b.G.getProvider(t),n=this.getCaipNetwork();if(!n)throw Error("estimateGas: caipNetwork is required but got undefined");let s=await i?.estimateGas({...e,provider:r,caipNetwork:n});
890return s?.gas||0n}return 0n},getEnsAvatar:async()=>{let e=g.W.state.activeChain;if(!e)throw Error("getEnsAvatar: namespace is required but got undefined");let t=this.getAddress(e);if(!t)throw Error("getEnsAvatar: address not found");await this.syncIdentity({address:t,chainId:Number(this.getCaipNetwork()?.id),chainNamespace:e});let i=g.W.getAccountData();return i?.profileImage||!1},getEnsAddress:async e=>await er.k.resolveReownName(e),writeContract:async e=>{let t=g.W.state.activeChain,i=this.getAdapter(t);if(!t)throw Error("writeContract: namespace is required but got undefined");if(!i)throw Error("writeContract: adapter is required but got undefined");let r=this.getCaipNetwork(),n=this.getCaipAddress(),s=b.G.getProvider(t);if(!r||!n)throw Error("writeContract: caipNetwork or caipAddress is required but got undefined");let a=await i?.writeContract({...e,caipNetwork:r,provider:s,caipAddress:n});return a?.hash},writeSolanaTransaction:async e=>{let t=g.W.state.activeChain,i=this.getAdapter(t);if(!t)throw Error("writeContract: namespace is required but got undefined");if(!i)throw Error("writeContract: adapter is required but got undefined");let r=this.getCaipNetwork(),n=this.getCaipAddress(),s=b.G.getProvider(t);if(!r||!n)throw Error("writeContract: caipNetwork or caipAddress is required but got undefined");let a=await i?.writeSolanaTransaction({...e,caipNetwork:r,provider:s,caipAddress:n});return a?.hash},parseUnits:(e,t)=>{let i=this.getAdapter(g.W.state.activeChain);if(!i)throw Error("parseUnits: adapter is required but got undefined");return i?.parseUnits({value:e,decimals:t})??0n},formatUnits:(e,t)=>{let i=this.getAdapter(g.W.state.activeChain);if(!i)throw Error("formatUnits: adapter is required but got undefined");return i?.formatUnits({value:e,decimals:t})??"0"},getCapabilities:async e=>{let t=this.getAdapter(g.W.state.activeChain);if(!t)throw Error("getCapabilities: adapter is required but got undefined");return await t?.getCapabilities(e)},grantPermissions:async e=>{let t=this.getAdapter(g.W.state.activeChain);if(!t)throw Error("grantPermissions: adapter is required but got undefined");return await t?.grantPermissions(e)},revokePermissions:async e=>{let t=this.getAdapter(g.W.state.activeChain);if(!t)throw Error("revokePermissions: adapter is required but got undefined");return t?.revokePermissions?await t.revokePermissions(e):"0x"},walletGetAssets:async e=>{let t=this.getAdapter(g.W.state.activeChain);if(!t)throw Error("walletGetAssets: adapter is required but got undefined");return await t?.walletGetAssets(e)??{}},updateBalance:e=>{let t=this.getAddress(e),i=this.getCaipNetwork(e);i&&t&&this.updateNativeBalance(t,i?.id,e)}},m.x.setClient(this.connectionControllerClient)}async onConnectExternal(e){let t=g.W.state.activeChain,i=e.chain||t,r=this.getAdapter(i),n=!0;if(e.type===q.o.CONNECTOR_TYPE_AUTH&&h.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(e=>w.a.getConnectorId(e)===h.o.CONNECTOR_ID.AUTH)&&e.chain!==t&&(n=!1),e.chain&&e.chain!==t&&!e.caipNetwork){let t=this.getCaipNetworks().find(t=>t.chainNamespace===e.chain);t&&n&&this.setCaipNetwork(t)}if(!i)throw Error("connectExternal: namespace not found");if(!r)throw Error("connectExternal: adapter not found");let s=this.getCaipNetwork(i),a=e.caipNetwork||s,o=await r.connect({id:e.id,address:e.address,info:e.info,type:e.type,provider:e.provider,socialUri:e.socialUri,chainId:e.caipNetwork?.id||s?.id,rpcUrl:e.caipNetwork?.rpcUrls?.default?.http?.[0]||s?.rpcUrls?.default?.http?.[0]});if(o)return N.i.addConnectedNamespace(i),this.syncProvider({...o,chainNamespace:i}),this.setStatus("connected",i),this.syncConnectedWalletInfo(i),N.i.removeDisconnectedConnectorId(e.id,i),{address:o.address,connectedCaipNetwork:a}}async connectInactiveNamespaces(e,t){let i=e.type===q.o.CONNECTOR_TYPE_AUTH,r=H.y.getOtherAuthNamespaces(t?.connectedCaipNetwork?.chainNamespace),n=g.W.state.activeCaipNetwork,s=this.getAdapter(n?.chainNamespace);i&&(await Promise.all(r.map(async t=>{try{let i=b.G.getProvider(t),r=this.getCaipNetwork(t),n=this.getAdapter(t);await n?.connect({...e,provider:i,socialUri:void 0,chainId:r?.id,rpcUrl:r?.rpcUrls?.default?.http?.[0]})&&(N.i.addConnectedNamespace(t),N.i.removeDisconnectedConnectorId(e.id,t),this.setStatus("connected",t),this.syncConnectedWalletInfo(t))}catch(e){u.h.warn(z.R.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.displayMessage,z.R.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.debugMessage(t,e instanceof Error?e.message:void 0),z.R.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.code)}})),n&&await s?.switchNetwork({caipNetwork:n}))}getApprovedCaipNetworksData(){if(b.G.getProviderId(g.W.state.activeChain)===q.o.CONNECTOR_TYPE_WALLET_CONNECT){let e=this.universalProvider?.session?.namespaces;return{supportsAllNetworks:this.universalProvider?.session?.peer?.metadata.name==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(e)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(e){let t=e.chainNamespace;if(this.getAddressByChainNamespace(e.chainNamespace)){let i=b.G.getProviderId(t);if(e.chainNamespace===g.W.state.activeChain){let i=this.getAdapter(t);await i?.switchNetwork({caipNetwork:e})}else if(this.setCaipNetwork(e),i===q.o.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{let i=this.getAddressByChainNamespace(t);i&&this.syncAccount({address:i,chainId:e.id,chainNamespace:t})}}else this.setCaipNetwork(e)}
890getChainsFromNamespaces(e={}){return Object.values(e).flatMap(e=>Array.from(new Set([...e.chains||[],...e.accounts.map(e=>{let{chainId:t,chainNamespace:i}=Y.C.parseCaipAddress(e);return`${i}:${t}`})])))}createAdapters(e){return this.createClients(),this.chainNamespaces.reduce((t,i)=>{let r=e?.find(e=>e.namespace===i);return r?(r.construct({namespace:i,projectId:this.options?.projectId,networks:this.caipNetworks?.filter(({chainNamespace:e})=>e===i)}),t[i]=r):t[i]=new ew({namespace:i,networks:this.getCaipNetworks()}),t},{})}async initChainAdapter(e){this.onConnectors(e),this.listenAdapter(e);let t=this.getAdapter(e);if(!t)throw Error("adapter not found");await t.syncConnectors(),await this.createUniversalProviderForAdapter(e)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{await this.initChainAdapter(e)})),this.initAdapterController()}onConnectors(e){let t=this.getAdapter(e);t?.on("connectors",this.setConnectors.bind(this))}listenAdapter(e){let t=this.getAdapter(e);if(!t)return;let i=N.i.getConnectionStatus();!1===y.H.state.enableReconnect?this.setStatus("disconnected",e):"connected"===i?this.setStatus("connecting",e):("disconnected"===i&&N.i.clearAddressCache(),this.setStatus(i,e)),t.on("switchNetwork",({address:t,chainId:i})=>{let r=this.getCaipNetworks().find(e=>e.id.toString()===i.toString()||e.caipNetworkId.toString()===i.toString()),n=g.W.state.activeChain===e,s=g.W.state.chains.get(e)?.accountState?.address;if(r){let i=n&&t?t:s;i&&this.syncAccount({address:i,chainId:r.id,chainNamespace:e})}else this.setUnsupportedNetwork(i)}),t.on("disconnect",()=>{let t=this.remoteFeatures.multiWallet,i=Array.from(m.x.state.connections.values()).flat();this.onDisconnectNamespace({chainNamespace:e,closeModal:!t||0===i.length})}),t.on("connections",t=>{this.setConnections(t,e)}),t.on("pendingTransactions",()=>{let t=this.getAddress(e),i=g.W.state.activeCaipNetwork;t&&i?.id&&this.updateNativeBalance(t,i.id,i.chainNamespace)}),t.on("accountChanged",({address:t,chainId:i,connector:r})=>{this.handlePreviousConnectorConnection(r);let n=g.W.state.activeChain===e;r?.provider&&(this.syncProvider({id:r.id,type:r.type,provider:r?.provider,chainNamespace:e}),this.syncConnectedWalletInfo(e));let s=g.W.getNetworkData(e)?.caipNetwork?.id,a=i||s;n&&a?this.syncAccount({address:t,chainId:a,chainNamespace:e}):!n&&a?(this.syncAccountInfo(t,a,e),this.syncBalance({address:t,chainId:a,chainNamespace:e})):this.syncAccountInfo(t,i,e),N.i.addConnectedNamespace(e)})}async handlePreviousConnectorConnection(e){let t=e?.chain,i=e?.id,r=w.a.getConnectorId(t),n=y.H.state.remoteFeatures?.multiWallet,s=r!==i,a=t&&i&&r&&s&&!n;try{a&&await m.x.disconnect({id:r,namespace:t})}catch(e){console.warn("Error disconnecting previous connector",e)}}async createUniversalProviderForAdapter(e){await this.getUniversalProvider(),this.universalProvider&&await this.chainAdapters?.[e]?.setUniversalProvider?.(this.universalProvider)}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(e=>this.syncNamespaceConnection(e)))}async unSyncExistingConnection(){try{await Promise.allSettled(this.chainNamespaces.map(e=>m.x.disconnect({namespace:e,initialDisconnect:!0})))}catch(e){console.error("Error disconnecting existing connections:",e)}}async reconnectWalletConnect(){await this.syncWalletConnectAccount();let e=this.getAddress();this.getCaipAddress()||N.i.deleteRecentWallet();let t=N.i.getRecentWallet();W.E.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:e,properties:{method:s.w.isMobile()?"mobile":"qrcode",name:t?.name||"Unknown",reconnect:!0,view:B.I.state.view,walletRank:t?.order}})}async syncNamespaceConnection(e){try{e===h.o.CHAIN.EVM&&s.w.isSafeApp()&&w.a.setConnectorId(h.o.CONNECTOR_ID.SAFE,e);let t=w.a.getConnectorId(e);switch(this.setStatus("connecting",e),t){case h.o.CONNECTOR_ID.WALLET_CONNECT:await this.reconnectWalletConnect();break;case h.o.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(e)}}catch(t){console.warn("AppKit couldn't sync existing connection",t),this.setStatus("disconnected",e)}}onDisconnectNamespace(e){let{chainNamespace:t,closeModal:i}=e||{};g.W.resetAccount(t),g.W.resetNetwork(t),N.i.removeConnectedNamespace(t);let r=Array.from(g.W.state.chains.keys());
890(t?[t]:r).forEach(e=>N.i.addDisconnectedConnectorId(w.a.getConnectorId(e)||"",e)),w.a.removeConnectorId(t),b.G.resetChain(t),this.setUser(null,t),this.setStatus("disconnected",t),this.setConnectedWalletInfo(null,t),!1!==i&&et.W.close()}async syncAdapterConnections(){await Promise.allSettled(this.chainNamespaces.map(e=>{let t=this.getAdapter(e),i=this.getCaipAddress(e),r=this.getCaipNetwork(e);return t?.syncConnections({connectToFirstConnector:!i,caipNetwork:r})}))}async syncAdapterConnection(e){let t=this.getAdapter(e),i=this.getCaipNetwork(e),r=w.a.getConnectorId(e),n=w.a.getConnectors(e).find(e=>e.id===r);try{if(!t||!n)throw Error(`Adapter or connector not found for namespace ${e}`);if(!i?.id)throw Error("CaipNetwork not found");let r=await t?.syncConnection({namespace:e,id:n.id,chainId:i.id,rpcUrl:i?.rpcUrls?.default?.http?.[0]});r?(this.syncProvider({...r,chainNamespace:e}),await this.syncAccount({...r,chainNamespace:e}),this.setStatus("connected",e),W.E.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:r.address,properties:{method:"browser",name:n.info?.name||n.name||"Unknown",reconnect:!0,view:B.I.state.view,walletRank:n?.explorerWallet?.order}})):this.setStatus("disconnected",e)}catch(t){this.onDisconnectNamespace({chainNamespace:e,closeModal:!1})}}async syncWalletConnectAccount(){let e=Object.keys(this.universalProvider?.session?.namespaces||{}),t=this.chainNamespaces.map(async t=>{let i=this.getAdapter(t);if(!i)return;let r=this.universalProvider?.session?.namespaces?.[t]?.accounts||[],n=g.W.state.activeCaipNetwork?.id,s=r.find(e=>{let{chainId:t}=Y.C.parseCaipAddress(e);return t===n?.toString()})||r[0];if(s){let e=Y.C.validateCaipAddress(s),{chainId:r,address:n}=Y.C.parseCaipAddress(e);if(b.G.setProviderId(t,q.o.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&g.W.state.activeCaipNetwork&&i.namespace!==h.o.CHAIN.EVM){let e=i.getWalletConnectProvider({caipNetworks:this.getCaipNetworks(),provider:this.universalProvider,activeCaipNetwork:g.W.state.activeCaipNetwork});b.G.setProvider(t,e)}else b.G.setProvider(t,this.universalProvider);w.a.setConnectorId(h.o.CONNECTOR_ID.WALLET_CONNECT,t),N.i.addConnectedNamespace(t),await this.syncAccount({address:n,chainId:r,chainNamespace:t})}else e.includes(t)&&this.setStatus("disconnected",t);let a=this.getApprovedCaipNetworksData();this.syncConnectedWalletInfo(t),g.W.setApprovedCaipNetworksData(t,{approvedCaipNetworkIds:a.approvedCaipNetworkIds,supportsAllNetworks:a.supportsAllNetworks})});await Promise.all(t)}syncProvider({type:e,provider:t,id:i,chainNamespace:r}){b.G.setProviderId(r,e),b.G.setProvider(r,t),w.a.setConnectorId(i,r)}async syncAccount(e){let t=e.chainNamespace===g.W.state.activeChain,i=g.W.getCaipNetworkByNamespace(e.chainNamespace,e.chainId),{address:r,chainId:n,chainNamespace:s}=e,{chainId:a}=N.i.getActiveNetworkProps(),o=i?.id||a,l=g.W.state.activeCaipNetwork?.name===h.o.UNSUPPORTED_NETWORK_NAME,c=g.W.getNetworkProp("supportsAllNetworks",s);if(this.setStatus("connected",s),(!l||c)&&o){let e=this.getCaipNetworks().find(e=>e.id.toString()===o.toString()),a=this.getCaipNetworks().find(e=>e.chainNamespace===s);if(!c&&!e&&!a){let t=this.getApprovedCaipNetworkIds()||[],i=t.find(e=>Y.C.parseCaipNetworkId(e)?.chainId===o.toString()),r=t.find(e=>Y.C.parseCaipNetworkId(e)?.chainNamespace===s);e=this.getCaipNetworks().find(e=>e.caipNetworkId===i),a=this.getCaipNetworks().find(e=>e.caipNetworkId===r||"deprecatedCaipNetworkId"in e&&e.deprecatedCaipNetworkId===r)}let l=e||a;l?.chainNamespace===g.W.state.activeChain?y.H.state.enableNetworkSwitch&&!y.H.state.allowUnsupportedChain&&g.W.state.activeCaipNetwork?.name===h.o.UNSUPPORTED_NETWORK_NAME?g.W.showUnsupportedChainUI():this.setCaipNetwork(l):!t&&i&&this.setCaipNetworkOfNamespace(i,s),this.syncConnectedWalletInfo(s);let d=this.getAddress(s);H.y.isLowerCaseMatch(r,d)||this.syncAccountInfo(r,l?.id,s),t?await this.syncBalance({address:r,chainId:l?.id,chainNamespace:s}):await this.syncBalance({address:r,chainId:i?.id,chainNamespace:s}),this.syncIdentity({address:r,chainId:n,chainNamespace:s})}}async syncAccountInfo(e,t,i){let r=this.getCaipAddress(i),n=t||r?.split(":")[1];if(!n)return;let s=`${i}:${n}:${e}`;this.setCaipAddress(s,i,!0),await this.syncIdentity({address:e,chainId:n,chainNamespace:i})}async syncReownName(e,t){try{let i=await this.getReownName(e);
890if(i[0]){let e=i[0];this.setProfileName(e.name,t)}else this.setProfileName(null,t)}catch{this.setProfileName(null,t)}}syncConnectedWalletInfo(e){let t=w.a.getConnectorId(e),i=b.G.getProviderId(e);if(i===q.o.CONNECTOR_TYPE_ANNOUNCED||i===q.o.CONNECTOR_TYPE_INJECTED){if(t){let i=this.getConnectors().find(e=>{let i=e.id===t,r=e.info?.rdns===t,n=e.connectors?.some(e=>e.id===t||e.info?.rdns===t);return i||r||!!n});if(i){let{info:t,name:r,imageUrl:n}=i,s=n||this.getConnectorImage(i);this.setConnectedWalletInfo({name:r,icon:s,...t},e)}}}else if(i===q.o.CONNECTOR_TYPE_WALLET_CONNECT){let t=b.G.getProvider(e);t?.session&&this.setConnectedWalletInfo({...t.session.peer.metadata,name:t.session.peer.metadata.name,icon:t.session.peer.metadata.icons?.[0]},e)}else if(t&&(t===h.o.CONNECTOR_ID.COINBASE_SDK||t===h.o.CONNECTOR_ID.COINBASE)){let i=this.getConnectors().find(e=>e.id===t),r=i?.name||"Coinbase Wallet",n=i?.imageUrl||this.getConnectorImage(i),s=i?.info;this.setConnectedWalletInfo({...s,name:r,icon:n},e)}}async syncBalance(e){J.L.getNetworksByNamespace(this.getCaipNetworks(),e.chainNamespace).find(t=>t.id.toString()===e.chainId?.toString())&&e.chainId&&await this.updateNativeBalance(e.address,e.chainId,e.chainNamespace)}async ready(){await this.readyPromise}async updateNativeBalance(e,t,i){let r=this.getAdapter(i),n=g.W.getCaipNetworkByNamespace(i,t);if(r){let s=await r.getBalance({address:e,chainId:t,caipNetwork:n,tokens:this.options.tokens});return this.setBalance(s.balance,s.symbol,i),s}}async initializeUniversalAdapter(){let e=eh.createLogger((e,...t)=>{e&&this.handleAlertError(e),console.error(...t)}),t={projectId:this.options?.projectId,metadata:{name:this.options?.metadata?this.options?.metadata.name:"",description:this.options?.metadata?this.options?.metadata.description:"",url:this.options?.metadata?this.options?.metadata.url:"",icons:this.options?.metadata?this.options?.metadata.icons:[""]},logger:e};y.H.setManualWCControl(!!this.options?.manualWCControl),this.universalProvider=this.options.universalProvider??await G.A.init(t);let i=this.universalProvider.disconnect.bind(this.universalProvider);this.universalProvider.disconnect=async()=>{try{return await i()}catch(e){if(e instanceof Error&&e.message.includes("Missing or invalid. Record was recently deleted"))return;throw e}},!1===y.H.state.enableReconnect&&this.universalProvider.session&&await this.universalProvider.disconnect(),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&this.chainNamespaces.forEach(e=>{er.k.listenWcProvider({universalProvider:this.universalProvider,namespace:e,onDisplayUri:e=>{m.x.setUri(e)},onConnect:e=>{let{address:t}=s.w.getAccount(e[0]);for(let e of this.chainNamespaces)N.i.removeDisconnectedConnectorId(h.o.CONNECTOR_ID.WALLET_CONNECT,e);m.x.finalizeWcConnection(t)},onDisconnect:()=>{g.W.state.noAdapters&&this.resetAccount(e),m.x.resetWcConnection()},onChainChanged:t=>{let i=g.W.state.activeChain,r=i&&w.a.state.activeConnectorIds[i]===h.o.CONNECTOR_ID.WALLET_CONNECT;if(i===e&&(g.W.state.noAdapters||r)){let e=this.getCaipNetworks().find(e=>e.id.toString()===t.toString()||e.caipNetworkId.toString()===t.toString()),i=this.getCaipNetwork();if(!e)return void this.setUnsupportedNetwork(t);i?.id.toString()!==e?.id.toString()&&i?.chainNamespace===e?.chainNamespace&&this.setCaipNetwork(e)}},onAccountsChanged:t=>{let i=g.W.state.activeChain,r=i&&w.a.state.activeConnectorIds[i]===h.o.CONNECTOR_ID.WALLET_CONNECT;if(i===e&&(g.W.state.noAdapters||r)){let e=t?.[0];e&&this.syncAccount({address:e.address,chainId:e.chainId,chainNamespace:e.chainNamespace})}}})})}createUniversalProvider(){return!this.universalProviderInitPromise&&s.w.isClient()&&this.options?.projectId&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}
890async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){W.E.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:e instanceof Error?e.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",e)}return this.universalProvider}getDisabledCaipNetworks(){let e=g.W.getAllApprovedCaipNetworkIds(),t=g.W.getAllRequestedCaipNetworks();return s.w.sortRequestedNetworks(e,t).filter(e=>g.W.isCaipNetworkDisabled(e))}handleAlertError(e){let[t,i]=Object.entries(z.R.UniversalProviderErrors).find(([,{message:t}])=>e.message.includes(t))??[],{message:r,alertErrorKey:n}=i??{};if(t&&r&&!this.reportedAlertErrors[t]){let e=z.R.ALERT_ERRORS[n];e&&(u.h.open(e,"error"),this.reportedAlertErrors[t]=!0)}}getAdapter(e){if(e)return this.chainAdapters?.[e]}createAdapter(e){if(!e)return;let t=e.namespace;t&&(this.createClients(),e.namespace=t,e.construct({namespace:t,projectId:this.options?.projectId,networks:this.caipNetworks?.filter(({chainNamespace:e})=>e===t)}),this.chainNamespaces.includes(t)||this.chainNamespaces.push(t),this.chainAdapters&&(this.chainAdapters[t]=e))}async open(e){await this.injectModalUi(),e?.uri&&m.x.setUri(e.uri);let{isSwap:t,isSend:i}=this.toModalOptions();return t(e)?et.W.open({...e,data:{swap:e.arguments}}):i(e)&&e.arguments?this.openSend(e.arguments):et.W.open(e)}async close(){await this.injectModalUi(),et.W.close()}setLoading(e,t){et.W.setLoading(e,t)}async disconnect(e){await m.x.disconnect({namespace:e})}getSIWX(){return y.H.state.siwx}getError(){return""}getChainId(){return g.W.state.activeCaipNetwork?.id}async switchNetwork(e,{throwOnFailure:t=!1}={}){let i=this.getCaipNetworks().find(t=>t.id===e.id);i?await g.W.switchActiveNetwork(i,{throwOnFailure:t}):u.h.open(z.R.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error")}getWalletProvider(){return g.W.state.activeChain?b.G.state.providers[g.W.state.activeChain]:null}getWalletProviderType(){return b.G.getProviderId(g.W.state.activeChain)}subscribeProviders(e){return b.G.subscribeProviders(e)}getThemeMode(){return F.W.state.themeMode}getThemeVariables(){return F.W.state.themeVariables}setThemeMode(e){F.W.setThemeMode(e),(0,ea.JX)(F.W.state.themeMode)}setTermsConditionsUrl(e){y.H.setTermsConditionsUrl(e)}setPrivacyPolicyUrl(e){y.H.setPrivacyPolicyUrl(e)}setThemeVariables(e){F.W.setThemeVariables(e),(0,ea.ds)(F.W.state.themeVariables)}subscribeTheme(e){return F.W.subscribe(e)}subscribeConnections(e){return this.remoteFeatures.multiWallet?m.x.subscribe(e):(u.h.open(h.o.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),()=>void 0)}getWalletInfo(e){if(e)return g.W.state.chains.get(e)?.accountState?.connectedWalletInfo;let t=g.W.getAccountData();return t?.connectedWalletInfo}getAccount(e){let t=e||g.W.state.activeChain,i=w.a.getAuthConnector(t),r=g.W.getAccountData(t),n=N.i.getConnectedConnectorId(g.W.state.activeChain),a=m.x.getConnections(t);if(!t)throw Error("AppKit:getAccount - namespace is required");let o=a.flatMap(e=>{let{caipNetwork:t}=e;return t?e.accounts.map(({address:e,type:i,publicKey:r})=>s.w.createAccount({caipAddress:`${t.caipNetworkId}:${e}`,type:i||"eoa",publicKey:r})):[]});if(r)return{allAccounts:o,caipAddress:r.caipAddress,address:s.w.getPlainAddress(r.caipAddress),isConnected:!!r.caipAddress,status:r.status,embeddedWalletInfo:i&&n===h.o.CONNECTOR_ID.AUTH?{user:r.user?{...r.user,username:N.i.getConnectedSocialUsername()}:void 0,authProvider:r.socialProvider||"email",accountType:(0,L.lj)(t),isSmartAccountDeployed:!!r.smartAccountDeployed}:void 0}}subscribeAccount(e,t){let i=[],r=()=>{let i=this.getAccount(t);i&&e(i)};if(t){let e=g.W.subscribeChainProp("accountState",r,t);i.push(e)}else{let e=g.W.subscribe(r);i.push(e)}let n=w.a.subscribe(r);return i.push(n),()=>{i.forEach(e=>e())}}subscribeNetwork(e){return g.W.subscribe(({activeCaipNetwork:t})=>{e({caipNetwork:t,chainId:t?.id,caipNetworkId:t?.caipNetworkId})})}subscribeWalletInfo(e,t){return t?g.W.subscribeChainProp("accountState",t=>e(t?.connectedWalletInfo),t):g.W.subscribeChainProp("accountState",t=>e(t?.connectedWalletInfo))}subscribeShouldUpdateToAddress(e){return g.W.subscribeChainProp("accountState",t=>e(t?.shouldUpdateToAddress))}subscribeCaipNetworkChange(e){return g.W.subscribeKey("activeCaipNetwork",e)}getState(){return v.z.state}getRemoteFeatures(){return y.H.state.remoteFeatures}subscribeState(e){return v.z.subscribe(e)}subscribeRemoteFeatures(e){return y.H.subscribeKey("remoteFeatures",e)}showErrorMessage(e){es.P.showError(e)}showSuccessMessage(e){es.P.showSuccess(e)}getEvent(){return{...W.E.state}}subscribeEvents(e){return W.E.subscribe(e)}replace(e){B.I.replace(e)}redirect(e){B.I.push(e)}popTransactionStack(e){B.I.popTransactionStack(e)}isOpen(){return et.W.state.open}isTransactionStackEmpty(){return 0===B.I.state.transactionStack.length}static getInstance(){return this.instance}updateFeatures(e){y.H.setFeatures(e)}updateRemoteFeatures(e){y.H.setRemoteFeatures(e)}updateOptions(e){let t={...y.H.state||{},...e};y.H.setOptions(t)}setConnectMethodsOrder(e){y.H.setConnectMethodsOrder(e)}setWalletFeaturesOrder(e){y.H.setWalletFeaturesOrder(e)}setCollapseWallets(e){y.H.setCollapseWallets(e)}setSocialsOrder(e){y.H.setSocialsOrder(e)}getConnectMethodsOrder(){return x.A.getConnectOrderMethod(y.H.state.features,w.a.getConnectors())}addNetwork(e,t){if(this.chainAdapters&&!this.chainAdapters[e])throw Error(`Adapter for namespace ${e} doesn't exist`);let i=this.extendCaipNetwork(t,this.options);this.getCaipNetworks().find(e=>e.id===i.id)||g.W.addNetwork(i)}removeNetwork(e,t){if(this.chainAdapters&&!this.chainAdapters[e])throw Error(`Adapter for namespace ${e} doesn't exist`);this.getCaipNetworks().find(e=>e.id===t)&&g.W.removeNetwork(e,t)}}let eE=!1;class ex extends eC{async onAuthProviderConnected(e){let t=H.y.userChainIdToChainNamespace(e?.chainId);if(e.message&&e.signature&&e.siwxMessage&&await D.U.addEmbeddedWalletSession({chainId:e.siwxMessage.chainId,accountAddress:e.address,notBefore:e.siwxMessage.notBefore,statement:e.siwxMessage.statement,resources:e.siwxMessage.resources,requestId:e.siwxMessage.requestId,issuedAt:e.siwxMessage.issuedAt,domain:e.siwxMessage.domain,uri:e.siwxMessage.uri,version:e.siwxMessage.version,nonce:e.siwxMessage.nonce},e.message,e.signature),!t)throw Error("AppKit:onAuthProviderConnected - namespace is required");let i=t===h.o.CHAIN.EVM?`eip155:${e.chainId}:${e.address}`:`${e.chainId}:${e.address}`,r=y.H.state.defaultAccountTypes[t],n=(0,L.lj)(t),s=e.preferredAccountType||n||r;this.setCaipAddress(i,t);let{signature:a,siwxMessage:o,message:l,...c}=e,d=g.W.getAccountData(t);this.setUser({...d?.user||{},...c},t),this.setSmartAccountDeployed(!!e.smartAccountDeployed,t),this.setPreferredAccountType(s,t),await Promise.all([this.syncAuthConnectorTheme(this.authProvider),this.syncAccount({address:e.address,chainId:e.chainId,chainNamespace:t})]),this.setLoading(!1,t)}setupAuthConnectorListeners(e){e.onRpcRequest(t=>{V.Q.checkIfRequestExists(t)?V.Q.checkIfRequestIsSafe(t)||this.handleUnsafeRPCRequest():(this.open(),console.error(Z.Vl.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:t.method}),setTimeout(()=>{this.showErrorMessage(Z.Vl.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),e.rejectRpcRequests())}),e.onRpcError(()=>{this.isOpen()&&(this.isTransactionStackEmpty()?this.close():this.popTransactionStack("error"))}),e.onRpcSuccess((e,t)=>{let i=V.Q.checkIfRequestIsSafe(t),r=this.getAddress(),n=g.W.state.activeCaipNetwork;
890i||(r&&n?.id&&this.updateNativeBalance(r,n.id,n.chainNamespace),this.isTransactionStackEmpty()?this.close():this.popTransactionStack("success"))}),e.onNotConnected(()=>{let e=g.W.state.activeChain;if(!e)throw Error("AppKit:onNotConnected - namespace is required");w.a.getConnectorId(e)===h.o.CONNECTOR_ID.AUTH&&(this.setCaipAddress(null,e),this.setLoading(!1,e))}),e.onConnect(this.onAuthProviderConnected.bind(this)),e.onSocialConnected(this.onAuthProviderConnected.bind(this)),e.onSetPreferredAccount(({address:e,type:t})=>{let i=g.W.state.activeChain;if(!i)throw Error("AppKit:onSetPreferredAccount - namespace is required");e&&this.setPreferredAccountType(t,i)})}async syncAuthConnectorTheme(e){if(!e)return;let t=F.W.getSnapshot();await e.syncTheme({themeMode:t.themeMode,themeVariables:t.themeVariables,w3mThemeVariables:(0,M.o)(t.themeVariables,t.themeMode)})}async syncAuthConnector(e,t){let i=h.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(t),r=t===g.W.state.activeChain;if(!i)return;this.setLoading(!0,t);let n=e.getLoginEmailUsed();this.setLoading(n,t),n&&this.setStatus("connecting",t);let s=e.getEmail(),a=e.getUsername(),o=g.W.getAccountData(t)?.user||{};this.setUser({...o,username:a,email:s},t),this.setupAuthConnectorListeners(e);let{isConnected:l}=await e.isConnected();if(t&&i&&r)if(l&&this.connectionControllerClient?.connectExternal){await e.init(),await this.syncAuthConnectorTheme(e),await this.connectionControllerClient?.connectExternal({id:h.o.CONNECTOR_ID.AUTH,info:{name:h.o.CONNECTOR_ID.AUTH},type:q.o.CONNECTOR_TYPE_AUTH,provider:e,chainId:g.W.getNetworkData(t)?.caipNetwork?.id,chain:t}),this.setStatus("connected",t);let i=N.i.getConnectedSocialProvider();i?W.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",address:this.getAddress(),properties:{provider:i,reconnect:!0}}):W.E.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:this.getAddress(),properties:{method:"email",name:this.universalProvider?.session?.peer?.metadata?.name||"Unknown",reconnect:!0,view:B.I.state.view,walletRank:void 0}})}else w.a.getConnectorId(t)===h.o.CONNECTOR_ID.AUTH&&(this.setStatus("disconnected",t),N.i.removeConnectedNamespace(t));this.setLoading(!1,t)}async checkExistingTelegramSocialConnection(e){try{if(!s.w.isTelegram())return;let t=N.i.getTelegramSocialProvider();if(!t||!s.w.isClient())return;let i=new URL(window.location.href).searchParams.get("result_uri");if(!i)return;t&&g.W.setAccountProp("socialProvider",t,e),await this.authProvider?.init();let r=w.a.getAuthConnector();t&&r&&(this.setLoading(!0,e),await m.x.connectExternal({id:r.id,type:r.type,socialUri:i},r.chain),N.i.setConnectedSocialProvider(t),N.i.removeTelegramSocialProvider(),W.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:t}}))}catch(t){this.setLoading(!1,e),console.error("checkExistingSTelegramocialConnection error",t)}try{let e=new URL(window.location.href);e.searchParams.delete("result_uri"),window.history.replaceState({},document.title,e.toString())}catch(e){console.error("tma social login failed",e)}}createAuthProvider(e){if(!h.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(e))return;let t=this.remoteFeatures?.email,i=Array.isArray(this.remoteFeatures?.socials)&&this.remoteFeatures.socials.length>0,r=H.y.getActiveNamespaceConnectedToAuth()||e;!this.authProvider&&this.options?.projectId&&(t||i)&&(this.authProvider=K.v.getInstance({projectId:this.options.projectId,enableLogger:this.options.enableAuthLogger,chainId:this.getCaipNetwork(r)?.caipNetworkId,abortController:z.R.EmbeddedWalletAbortController,onTimeout:e=>{"iframe_load_failed"===e?u.h.open(z.R.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):"iframe_request_timeout"===e?u.h.open(z.R.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):"unverified_domain"===e&&u.h.open(z.R.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:e=>(0,L.kg)(e),getCaipNetworks:e=>g.W.getCaipNetworks(e)}),v.z.subscribeOpen(e=>{!e&&this.isTransactionStackEmpty()&&this.authProvider?.rejectRpcRequests()}));let n=e===g.W.state.activeChain&&y.H.state.enableReconnect;!1===y.H.state.enableReconnect?this.syncAuthConnectorTheme(this.authProvider):this.authProvider&&n&&(this.syncAuthConnector(this.authProvider,e),this.checkExistingTelegramSocialConnection(e))}createAuthProviderForAdapter(e){this.createAuthProvider(e),this.authProvider&&this.chainAdapters?.[e]?.setAuthProvider?.(this.authProvider)}initControllers(e){super.initControllers(e),this.options.excludeWalletIds&&p.N.initializeExcludedWallets({ids:this.options.excludeWalletIds})}async switchCaipNetwork(e){if(!e)return;let t=g.W.state.activeChain,i=e.chainNamespace,r=this.getAddressByChainNamespace(i);if(i===t&&g.W.getAccountData(i)?.caipAddress){let t=this.getAdapter(i);await t?.switchNetwork({caipNetwork:e}),this.setCaipNetwork(e)}else{let n=b.G.getProviderId(t)===q.o.CONNECTOR_TYPE_AUTH,s=b.G.getProviderId(i),a=s===q.o.CONNECTOR_TYPE_AUTH,o=h.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(i);if(!i)throw Error("AppKit:switchCaipNetwork - networkNamespace is required");if((n&&void 0===s||a)&&o)try{if(g.W.state.activeChain=e.chainNamespace,r){let t=this.getAdapter(i);await t?.switchNetwork({caipNetwork:e})}else await this.connectionControllerClient?.connectExternal?.({id:h.o.CONNECTOR_ID.AUTH,provider:this.authProvider,chain:i,chainId:e.id,type:q.o.CONNECTOR_TYPE_AUTH,caipNetwork:e});this.setCaipNetwork(e)}catch(r){let t=this.getAdapter(i);await t?.switchNetwork({caipNetwork:e})}else if(s===q.o.CONNECTOR_TYPE_WALLET_CONNECT){if(!g.W.state.noAdapters){let t=this.getAdapter(i);await t?.switchNetwork({caipNetwork:e})}this.setCaipNetwork(e),this.syncWalletConnectAccount()}else this.setCaipNetwork(e),r&&this.syncAccount({address:r,chainId:e.id,chainNamespace:i})}}async initialize(e){await super.initialize(e),this.chainNamespaces?.forEach(e
890=>{this.createAuthProviderForAdapter(e)}),await this.injectModalUi(),v.z.set({initialized:!0})}async syncIdentity({address:e,chainId:t,chainNamespace:i}){if(i!==h.o.CHAIN.EVM)return;let r=`${i}:${t}`,n=this.caipNetworks?.find(e=>e.caipNetworkId===r);if(n?.testnet){this.setProfileName(null,i),this.setProfileImage(null,i);return}let s=w.a.getConnectorId(i)===h.o.CONNECTOR_ID.AUTH;try{let{name:t,avatar:r}=await this.fetchIdentity({address:e});!t&&s?await this.syncReownName(e,i):(this.setProfileName(t,i),this.setProfileImage(r,i))}catch{1!==t&&this.setProfileImage(null,i)}}syncConnectedWalletInfo(e){let t=b.G.getProviderId(e);if(t===q.o.CONNECTOR_TYPE_AUTH){let i=this.authProvider;if(i){let r=N.i.getConnectedSocialProvider()??"email",n=i.getEmail()??i.getUsername();this.setConnectedWalletInfo({name:t,identifier:n,social:r},e)}}else super.syncConnectedWalletInfo(e)}async injectModalUi(){if(!s.w.isClient())return;let e={...j.oU.DEFAULT_FEATURES,...this.options.features};if(!e.headless&&!eE)try{let t=this.remoteFeatures;if(await this.loadModalComponents(e,t),s.w.isClient()&&!document.querySelector("w3m-modal")){let e=document.createElement("w3m-modal");y.H.state.disableAppend||y.H.state.enableEmbedded||document.body.insertAdjacentElement("beforeend",e)}eE=!0}catch(e){console.error("Error injecting modal UI:",e)}}async loadModalComponents(e,t){if(!s.w.isClient())return;let r=[];(t.email||t.socials&&t.socials.length>0)&&r.push(i.e(39e3).then(i.bind(i,39e3))),t.email&&r.push(i.e(33112).then(i.bind(i,33112))),t.socials&&r.push(i.e(92257).then(i.bind(i,92257))),t.swaps&&t.swaps.length>0&&r.push(Promise.all([i.e(89726),i.e(71081)]).then(i.bind(i,71081))),e.send&&r.push(Promise.all([i.e(89726),i.e(95332)]).then(i.bind(i,95332))),e.receive&&r.push(i.e(94187).then(i.bind(i,94187))),t.onramp&&t.onramp.length>0&&r.push(i.e(50445).then(i.bind(i,50445))),t.payWithExchange&&r.push(i.e(46472).then(i.bind(i,46472))),t.activity&&r.push(i.e(68903).then(i.bind(i,68903))),(e.pay||t.payments)&&r.push(i.e(31219).then(i.bind(i,31219))),t.emailCapture&&r.push(i.e(85278).then(i.bind(i,85278))),await Promise.all([...r,Promise.resolve().then(i.bind(i,36198)),Promise.all([i.e(31219),i.e(89726),i.e(78981)]).then(i.bind(i,78981))])}}function eA(e){e&&(r=e)}function e_(){if(!r)throw Error('Please call "createAppKit" before using "useAppKitTheme" hook');let[e,t]=(0,a.useState)(r.getThemeMode()),[i,n]=(0,a.useState)(r.getThemeVariables());return(0,a.useEffect)(()=>{let e=r?.subscribeTheme(e=>{t(e.themeMode),n(e.themeVariables)});return()=>{e?.()}},[]),{themeMode:e,themeVariables:i,setThemeMode:function(e){e&&r?.setThemeMode(e)},setThemeVariables:function(e){e&&r?.setThemeVariables(e)}}}function eI(){if(!r)throw Error('Please call "createAppKit" before using "useAppKit" hook');return{open:async function(e){return r?.open(e)},close:async function(){await r?.close()}}}function eS(e){if(!r)throw Error('Please call "createAppKit" before using "useWalletInfo" hook');let[t,i]=(0,a.useState)(()=>r?.getWalletInfo(e));return(0,a.useEffect)(()=>{i(r?.getWalletInfo(e));let t=r?.subscribeWalletInfo(e=>{i(e)},e);return()=>t?.()},[e]),{walletInfo:t}}function eN(){if(!r)throw Error('Please call "createAppKit" before using "useAppKitState" hook');let[e,t]=(0,a.useState)({...r.getState(),initialized:!1}),[i,n]=(0,a.useState)(r.getRemoteFeatures());return(0,a.useEffect)(()=>{if(r){t({...r.getState()}),n(r.getRemoteFeatures());let e=r?.subscribeState(e=>{t({...e})}),i=r?.subscribeRemoteFeatures(e=>{n(e)});return()=>{e?.(),i?.()}}return()=>null},[]),{...e,...i??{}}}function ek(){if(!r)throw Error('Please call "createAppKit" before using "useAppKitEvents" hook');let[e,t]=(0,a.useState)(r.getEvent());return(0,a.useEffect)(()=>{let e=r?.subscribeEvents(e=>{t({...e})});return()=>{e?.()}},[]),e}async function eT(e){if(!e)throw Error("AppKit not initialized when  fetchBalance was called.");return await eO(e)}async function eO(e){let t=e.getAddress(),i=e.getActiveChainNamespace(),r=e.getCaipNetwork()?.id;if(!t||!i||!r)return{data:void 0,error:"Not able to retrieve balance",isSuccess:!1,isError:!0};let n=await e.updateNativeBalance(t,r,i);return{data:n,error:n?null:"No balance found",isSuccess:!!n,isError:!n}}let eR=new Set(["children","localName","ref","style","className"]),eP=new WeakMap,e$=(e,t,i,r,n)=>{let s,a,o=n?.[t];void 0===o?(e[t]=i,null==i&&t in HTMLElement.prototype&&e.removeAttribute(t)):i!==r&&(void 0===(s=eP.get(e))&&eP.set(e,s=new Map),a=s.get(o),void 0!==i?void 0===a?(s.set(o,a={handleEvent:i}),e.addEventListener(o,a)):a.handleEvent=i:void 0!==a&&(s.delete(o),e.removeEventListener(o,a)))},eU=({react:e,tagName:t,elementClass:i,events:r,displayName:n})=>{let s=new Set(Object.keys(r??{})),a=e.forwardRef((n,a)=>{let o=e.useRef(new Map),l=e.useRef(null),c={},d={};for(let[e,t]of Object.entries(n))eR.has(e)?c["className"===e?"class":e]=t:s.has(e)||e in i.prototype?d[e]=t:c[e]=t;return e.useLayoutEffect(()=>{if(null===l.current)return;let e=new Map;for(let t in d)e$(l.current,t,n[t],o.current.get(t),r),o.current.delete(t),e.set(t,n[t]);for(let[e,t]of o.current)e$(l.current,e,void 0,t,r);o.current=e}),e.useLayoutEffect(()=>{l.current?.removeAttribute("defer-hydration")},[]),c.suppressHydrationWarning=!0,e.createElement(t,{...c,ref:e.useCallback(e=>{l.current=e,"function"==typeof a?a(e):null!==a&&(a.current=e)},[a])})});return a.displayName=n??i.name,a};var eM=i(36198);let eD=eU({tagName:"appkit-button",elementClass:eM.AppKitButton,react:a}),eL=eU({tagName:"appkit-network-button",elementClass:eM.AppKitNetworkButton,react:a}
890),eW=eU({tagName:"appkit-connect-button",elementClass:eM.AppKitConnectButton,react:a}),eB=eU({tagName:"appkit-account-button",elementClass:eM.AppKitAccountButton,react:a}),ej=null;function eF({children:e,...t}){return ej||(ej=eH(t)),e}function eH(e){return n||eA(n=new ex({...e,sdkVersion:s.w.generateSdkVersion(e.adapters??[],"react","1.8.19")})),n}function eq(){let{caipNetwork:e,caipNetworkId:t,chainId:i}=T();return{caipNetwork:e,caipNetworkId:t,chainId:i,switchNetwork:async function(e){await n?.switchNetwork(e)}}}function ez(){return{fetchBalance:async function(){return await eT(n)}}}},21736:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let r={getSpacingStyles:(e,t)=>Array.isArray(e)?e[t]?`var(--apkt-spacing-${e[t]})`:void 0:"string"==typeof e?`var(--apkt-spacing-${e})`:void 0,getFormattedDate:e=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(e),formatCurrency(e=0,t={}){let i=Number(e);return isNaN(i)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...t}).format(i)},getHostName(e){try{return new URL(e).hostname}catch(e){return""}},getTruncateString:({string:e,charsStart:t,charsEnd:i,truncate:r})=>e.length<=t+i?e:"end"===r?`${e.substring(0,t)}...`:"start"===r?`...${e.substring(e.length-i)}`:`${e.substring(0,Math.floor(t))}...${e.substring(e.length-Math.floor(i))}`,generateAvatarColors(e){let t=e.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),i=this.hexToRgb(t),r=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),n=100-3*Number(r?.replace("px","")),s=`${n}% ${n}% at 65% 40%`,a=[];for(let e=0;e<5;e+=1){let t=this.tintColor(i,.15*e);a.push(`rgb(${t[0]}, ${t[1]}, ${t[2]})`)}return`
891    --local-color-1: ${a[0]};
892    --local-color-2: ${a[1]};
893    --local-color-3: ${a[2]};
894    --local-color-4: ${a[3]};
895    --local-color-5: ${a[4]};
896    --local-radial-circle: ${s}
897   `},hexToRgb(e){let t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t]},tintColor(e,t){let[i,r,n]=e;return[Math.round(i+(255-i)*t),Math.round(r+(255-r)*t),Math.round(n+(255-n)*t)]},isNumber:e=>/^[0-9]+$/u.test(e),getColorTheme:e=>e?e:"u">typeof window&&window.matchMedia&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)")?.matches?"dark":"light":"dark",splitBalance(e){let t=e.split(".");return 2===t.length?[t[0],t[1]]:["0","00"]},roundNumber:(e,t,i)=>e.toString().length>=t?Number(e).toFixed(i):e,cssDurationToNumber:e=>e.endsWith("s")?1e3*Number(e.replace("s","")):e.endsWith("ms")?Number(e.replace("ms","")):0,maskInput({value:e,decimals:t,integers:i}){if("."===(e=e.replace(",",".")))return"0.";let[r="",n]=e.split(".").map(e=>e.replace(/[^0-9]/gu,"")),s=i?r.substring(0,i):r,a=2===s.length?String(Number(s)):s,o="number"==typeof t?n?.substring(0,t):n;return("string"==typeof o&&("number"!=typeof t||t>0)?[a,o].join("."):a)??""},capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1):""}},22787:(e,t,i)=>{"use strict";i.d(t,{b:()=>l});var r=i(60319),n=i(11446),s=i(43242),a=i(11403),o=i(37056);let l={getConnectionStatus(e,t){let i=n.a.state.activeConnectorIds[t],s=r.x.getConnections(t);return i&&e.connectorId===i?"connected":s.some(t=>t.connectorId.toLowerCase()===e.connectorId.toLowerCase())?"active":"disconnected"},excludeConnectorAddressFromConnections:({connections:e,connectorId:t,addresses:i})=>e.map(e=>{if(t&&e.connectorId.toLowerCase()===t.toLowerCase()&&i){let t=e.accounts.filter(e=>!i.some(t=>t.toLowerCase()===e.address.toLowerCase()));return{...e,accounts:t}}return e}),excludeExistingConnections(e,t){let i=new Set(e);return t.filter(e=>!i.has(e.connectorId))},getConnectionsByConnectorId:(e,t)=>e.filter(e=>e.connectorId.toLowerCase()===t.toLowerCase()),getConnectionsData(e){let t=!!a.H.state.remoteFeatures?.multiWallet,i=n.a.state.activeConnectorIds[e],s=r.x.getConnections(e),o=(r.x.state.recentConnections.get(e)??[]).filter(e=>n.a.getConnectorById(e.connectorId)),c=l.excludeExistingConnections([...s.map(e=>e.connectorId),...i?[i]:[]],o);return t?{connections:s,recentConnections:c}:{connections:s.filter(e=>e.connectorId.toLowerCase()===i?.toLowerCase()),recentConnections:[]}},onConnectMobile(e,t){let i=r.x.state.wcUri;if(e?.mobile_link&&i)try{r.x.setWcError(!1);let{mobile_link:n,link_mode:s,name:l}=e,c=o.w.appendPayToUri(i,t),{redirect:d,redirectUniversalLink:h,href:u}=o.w.formatNativeUrl(n,c,s),p=o.w.isIframe()?"_top":"_self";r.x.setWcLinking({name:l,href:u}),r.x.setRecentWallet(e),a.H.state.experimental_preferUniversalLinks&&h?o.w.openHref(h,p):o.w.openHref(d,p)}catch(t){s.E.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:t instanceof Error?t.message:"Error parsing the deep link",uri:i,mobile_link:e.mobile_link,name:e.name}}),r.x.setWcError(!0)}}}},24393:(e,t,i)=>{"use strict";i.r(t),i.d(t,{__assign:()=>s,__asyncDelegator:()=>v,__asyncGenerator:()=>b,__asyncValues:()=>C,__await:()=>y,__awaiter:()=>d,__classPrivateFieldGet:()=>_,__classPrivateFieldSet:()=>I,__createBinding:()=>u,__decorate:()=>o,__exportStar:()=>p,__extends:()=>n,__generator:()=>h,__importDefault:()=>A,__importStar:()=>
897x,__makeTemplateObject:()=>E,__metadata:()=>c,__param:()=>l,__read:()=>g,__rest:()=>a,__spread:()=>m,__spreadArrays:()=>w,__values:()=>f});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function n(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var s=function(){return(s=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function a(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)0>t.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]]);return i}function o(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}function l(e,t){return function(i,r){t(i,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function d(e,t,i,r){return new(i||(i=Promise))(function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})}function h(e,t){var i,r,n,s,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){var l=[s,o];if(i)throw TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(n=2&l[0]?r.return:l[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,l[1])).done)return n;switch(r=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){a.label=l[1];break}if(6===l[0]&&a.label<n[1]){a.label=n[1],n=l;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(l);break}n[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{i=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function u(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}function p(e,t){for(var i in e)"default"===i||t.hasOwnProperty(i)||(t[i]=e[i])}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,s=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function w(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<i;t++)for(var s=arguments[t],a=0,o=s.length;a<o;a++,n++)r[n]=s[a];return r}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function b(e,t,i){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var r,n=i.apply(e,t||[]),s=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){n[e]&&(r[e]=function(t){return new Promise(function(i,r){s.push([e,t,i,r])>1||o(e,t)})})}function o(e,t){try{var i;(i=n[e](t)).value instanceof y?Promise.resolve(i.value.v).then(l,c):d(s[0][2],i)}catch(e){d(s[0][3],e)}}function l(e){o("next",e)}function c(e){o("throw",e)}function d(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function v(e){var t,i;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(i=!i)?{value:y(e[r](t)),done:"return"===r}:n?n(t):t}:n}}function C(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=e[i]&&function(t){return new Promise(function(r,n){var s,a,o;s=r,a=n,o=(t=e[i](t)).done,Promise.resolve(t.value).then(function(e){s({value:e,done:o})},a)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
897function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,i){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,i),i}},24568:(e,t,i)=>{"use strict";i.d(t,{W:()=>w});var r=i(92679),n=i(3125),s=i(37056),a=i(48075),o=i(51369),l=i(92929),c=i(1024),d=i(60319),h=i(11446),u=i(43242),p=i(11403),f=i(83931),g=i(44458);let m=(0,r.BX)({loading:!1,loadingNamespaceMap:new Map,open:!1,shake:!1,namespace:void 0}),w=(0,o.X)({state:m,subscribe:e=>(0,r.B1)(m,()=>e(m)),subscribeKey:(e,t)=>(0,n.u$)(m,e,t),async open(e){let t=e?.namespace,i=c.W.state.activeChain,r=t&&t!==i,n=c.W.getAccountData(e?.namespace)?.caipAddress,o=c.W.state.noAdapters;if(d.x.state.wcBasic?l.N.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1,fetchWalletRanks:!1}):await l.N.prefetch(),h.a.setFilterByNamespace(e?.namespace),w.setLoading(!0,t),t&&r){let e=c.W.getNetworkData(t)?.caipNetwork||c.W.getRequestedCaipNetworks(t)[0];e&&(o?(await c.W.switchActiveNetwork(e),g.I.push("ConnectingWalletConnectBasic")):a.L.onSwitchNetwork({network:e,ignoreSwitchConfirmation:!0}))}else p.H.state.manualWCControl||o&&!n?s.w.isMobile()?g.I.reset("AllWallets"):g.I.reset("ConnectingWalletConnectBasic"):e?.view?g.I.reset(e.view,e.data):n?g.I.reset("Account"):g.I.reset("Connect");m.open=!0,f.z.set({open:!0}),u.E.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!n}})},close(){let e=p.H.state.enableEmbedded,t=!!c.W.state.activeCaipAddress;m.open&&u.E.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:t}}),m.open=!1,g.I.reset("Connect"),w.clearLoading(),e?t?g.I.replace("Account"):g.I.push("Connect"):f.z.set({open:!1}),d.x.resetUri()},setLoading(e,t){t&&m.loadingNamespaceMap.set(t,e),m.loading=e,f.z.set({loading:e})},clearLoading(){m.loadingNamespaceMap.clear(),m.loading=!1,f.z.set({loading:!1})},shake(){m.shake||(m.shake=!0,setTimeout(()=>{m.shake=!1},500))}})},24859:(e,t,i)=>{"use strict";let r;i.d(t,{Y:()=>i_});var n,s,a,o,l,c,d,h=i(30840),u=i(34386),p=i(67066),f=i(64461);(n=o||(o={})).assertEqual=e=>e,n.assertIs=function(e){},n.assertNever=function(e){throw Error()},n.arrayToEnum=e=>{let t={};for(let i of e)t[i]=i;return t},n.getValidEnumValues=e=>{let t=n.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),i={};for(let r of t)i[r]=e[r];return n.objectValues(i)},n.objectValues=e=>n.objectKeys(e).map(function(t){return e[t]}),n.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t},n.find=(e,t)=>{for(let i of e)if(t(i))return i},n.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,n.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},n.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(l||(l={})).mergeShapes=(e,t)=>({...e,...t});let g=o.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),m=e=>{switch(typeof e){case"undefined":return g.undefined;case"string":return g.string;case"number":return isNaN(e)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":if(Array.isArray(e))return g.array;if(null===e)return g.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return g.promise;if("u">typeof Map&&e instanceof Map)return g.map;if("u">typeof Set&&e instanceof Set)return g.set;if("u">typeof Date&&e instanceof Date)return g.date;return g.object;default:return g.unknown}}
897,w=o.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class y extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(e){return e.message},i={_errors:[]},r=e=>{for(let n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(r);else if("invalid_return_type"===n.code)r(n.returnTypeError);else if("invalid_arguments"===n.code)r(n.argumentsError);else if(0===n.path.length)i._errors.push(t(n));else{let e=i,r=0;for(;r<n.path.length;){let i=n.path[r];r===n.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(t(n))):e[i]=e[i]||{_errors:[]},e=e[i],r++}}};return r(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,o.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},i=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}y.create=e=>new y(e);let b=(e,t)=>{let i;switch(e.code){case w.invalid_type:i=e.received===g.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(e.expected,o.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:i=`Unrecognized key(s) in object: ${o.joinValues(e.keys,", ")}`;break;case w.invalid_union:i="Invalid input";break;case w.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${o.joinValues(e.options)}`;break;case w.invalid_enum_value:i=`Invalid enum value. Expected ${o.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:i="Invalid function arguments";break;case w.invalid_return_type:i="Invalid function return type";break;case w.invalid_date:i="Invalid date";break;case w.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:o.assertNever(e.validation):i="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case w.too_small:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case w.too_big:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case w.custom:i="Invalid input";break;case w.invalid_intersection_types:i="Intersection results could not be merged";break;case w.not_multiple_of:i=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:i="Number must be finite";break;default:i=t.defaultError,o.assertNever(e)}return{message:i}},v=b;function C(){return v}let E=e=>
897{let{data:t,path:i,errorMaps:r,issueData:n}=e,s=[...i,...n.path||[]],a={...n,path:s},o="";for(let e of r.filter(e=>!!e).slice().reverse())o=e(a,{data:t,defaultError:o}).message;return{...n,path:s,message:n.message||o}};function x(e,t){let i=E({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,C(),b].filter(e=>!!e)});e.common.issues.push(i)}class A{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let i=[];for(let r of t){if("aborted"===r.status)return _;"dirty"===r.status&&e.dirty(),i.push(r.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){let i=[];for(let e of t)i.push({key:await e.key,value:await e.value});return A.mergeObjectSync(e,i)}static mergeObjectSync(e,t){let i={};for(let r of t){let{key:t,value:n}=r;if("aborted"===t.status||"aborted"===n.status)return _;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==n.value||r.alwaysSet)&&(i[t.value]=n.value)}return{status:e.value,value:i}}}let _=Object.freeze({status:"aborted"}),I=e=>({status:"dirty",value:e}),S=e=>({status:"valid",value:e}),N=e=>"aborted"===e.status,k=e=>"dirty"===e.status,T=e=>"valid"===e.status,O=e=>"u">typeof Promise&&e instanceof Promise;(s=c||(c={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},s.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class R{constructor(e,t,i,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let P=(e,t)=>{if(T(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new y(e.common.issues);return this._error=t,this._error}}};function $(e){if(!e)return{};let{errorMap:t,invalid_type_error:i,required_error:r,description:n}=e;if(t&&(i||r))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=i?i:t.defaultError},description:n}}class U{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return m(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:m(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:m(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(O(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){var i;let r={common:{issues:[],async:null!=(i=null==t?void 0:t.async)&&i,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)},n=this._parseSync({data:e,path:r.path,parent:r});return P(r,n)}async parseAsync(e,t){let i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){let i={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)},r=this._parse({data:e,path:i.path,parent:i});return P(i,await (O(r)?r:Promise.resolve(r)))}refine(e,t){return this._refinement((i,r)=>{let n=e(i),s=()=>r.addIssue({code:w.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(i):t});return"u">typeof Promise&&n instanceof Promise?n.then(e=>!!e||(s(),!1)):!!n||(s(),!1)})}refinement(e,t){return this._refinement((i,r)=>!!e(i)||(r.addIssue("function"==typeof t?t(i,r):t),!1))}_refinement(e){return new eb({schema:this,typeName:d.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ev.create(this,this._def)}nullable(){return eC.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ei.create(this,this._def)}promise(){return ey.create(this,this._def)}or(e){return en.create([this,e],this._def)}and(e){return eo.create(this,e,this._def)}transform(e){return new eb({...$(this._def),schema:this,typeName:d.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new eE({...$(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:d.ZodDefault})}brand(){return new eI({typeName:d.ZodBranded,type:this,...$(this._def)})}catch(e){return new ex({...$(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:d.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return eS.create(this,e)}readonly(){return eN.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let M=/^c[^\s-]{8,}
897$/i,D=/^[a-z][a-z0-9]*$/,L=/^[0-9A-HJKMNP-TV-Z]{26}$/,W=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,B=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,j=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,F=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,H=e=>{if(e.precision)if(e.offset)return RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`);else return RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`);if(0===e.precision)if(e.offset)return RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$");else return RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$");return e.offset?RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")};class q extends U{_parse(e){let t;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.string,received:t.parsedType}),_}let i=new A;for(let a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(x(t=this._getOrReturnCtx(e,t),{code:w.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if("max"===a.kind)e.data.length>a.value&&(x(t=this._getOrReturnCtx(e,t),{code:w.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),i.dirty());else if("length"===a.kind){let r=e.data.length>a.value,n=e.data.length<a.value;(r||n)&&(t=this._getOrReturnCtx(e,t),r?x(t,{code:w.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):n&&x(t,{code:w.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),i.dirty())}else if("email"===a.kind)B.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"email",code:w.invalid_string,message:a.message}),i.dirty());else if("emoji"===a.kind)r||(r=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),r.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"emoji",code:w.invalid_string,message:a.message}),i.dirty());else if("uuid"===a.kind)W.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"uuid",code:w.invalid_string,message:a.message}),i.dirty());else if("cuid"===a.kind)M.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"cuid",code:w.invalid_string,message:a.message}),i.dirty());else if("cuid2"===a.kind)D.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"cuid2",code:w.invalid_string,message:a.message}),i.dirty());else if("ulid"===a.kind)L.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"ulid",code:w.invalid_string,message:a.message}),i.dirty());else if("url"===a.kind)try{new URL(e.data)}catch(r){x(t=this._getOrReturnCtx(e,t),{validation:"url",code:w.invalid_string,message:a.message}),i.dirty()}else if("regex"===a.kind)a.regex.lastIndex=0,a.regex.test(e.data)||(x(t=this._getOrReturnCtx(e,t),{validation:"regex",code:w.invalid_string,message:a.message}),i.dirty());else if("trim"===a.kind)e.data=e.data.trim();else if("includes"===a.kind)e.data.includes(a.value,a.position)||(x(t=this._getOrReturnCtx(e,t),{code:w.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),i.dirty());else if("toLowerCase"===a.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===a.kind)e.data=e.data.toUpperCase();else if("startsWith"===a.kind)e.data.startsWith(a.value)||(x(t=this._getOrReturnCtx(e,t),{code:w.invalid_string,validation:{startsWith:a.value},message:a.message}),i.dirty());else if("endsWith"===a.kind)e.data.endsWith(a.value)||(x(t=this._getOrReturnCtx(e,t),{code:w.invalid_string,validation:{endsWith:a.value},message:a.message}),i.dirty());else if("datetime"===a.kind)H(a).test(e.data)||(x(t=this._getOrReturnCtx(e,t),{code:w.invalid_string,validation:"datetime",message:a.message}),i.dirty());else if("ip"===a.kind){var n,s;n=e.data,!(("v4"===(s=a.version)||!s)&&j.test(n)||("v6"===s||!s)&&F.test(n))&&1&&
897(x(t=this._getOrReturnCtx(e,t),{validation:"ip",code:w.invalid_string,message:a.message}),i.dirty())}else o.assertNever(a);return{status:i.value,value:e.data}}_regex(e,t,i){return this.refinement(t=>e.test(t),{validation:t,code:w.invalid_string,...c.errToObj(i)})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...c.errToObj(e)})}url(e){return this._addCheck({kind:"url",...c.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...c.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...c.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...c.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...c.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...c.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...c.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!=(t=null==e?void 0:e.offset)&&t,...c.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...c.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...c.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...c.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...c.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...c.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...c.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...c.errToObj(t)})}nonempty(e){return this.min(1,c.errToObj(e))}trim(){return new q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}q.create=e=>{var t;return new q({checks:[],typeName:d.ZodString,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...$(e)})};class z extends U{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.number,received:t.parsedType}),_}let i=new A;for(let r of this._def.checks)"int"===r.kind?o.isInteger(e.data)||(x(t=this._getOrReturnCtx(e,t),{code:w.invalid_type,expected:"integer",received:"float",message:r.message}),i.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(x(t=this._getOrReturnCtx(e,t),{code:w.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(x(t=this._getOrReturnCtx(e,t),{code:w.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),i.dirty()):"multipleOf"===r.kind?0!==function(e,t){let i=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,n=i>r?i:r;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}(e.data,r.value)&&(x(t=this._getOrReturnCtx(e,t),{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(x(t=this._getOrReturnCtx(e,t),{code:w.not_finite,message:r.message}),i.dirty()):o.assertNever(r);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,c.toString(t))}gt(e,t){return this.setLimit("min",e,!1,c.toString(t))}lte(e,t){return this.setLimit("max",e,!0,c.toString(t))}lt(e,t){return this.setLimit("max",e,!1,c.toString(t))}setLimit(e,t,i,r){return new z({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:c.toString(r)}]})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:c.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:c.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:c.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:c.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:c.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:c.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:c.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:c.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:c.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&o.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let i of this._def.checks)if("finite"===i.kind||"int"===i.kind||"multipleOf"===i.kind)return!0;else"min"===i.kind?(null===t||i.value>t)&&(t=i.value):"max"===i.kind&&(null===e||i.value<e)&&(e=i.value);return Number.isFinite(t)&&Number.isFinite(e)}}z.create=e=>new z({checks:[],typeName:d.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...$(e)});class V extends U{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==g.bigint){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.bigint,received:t.parsedType}),_}let i=new A;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(x(t=this._getOrReturnCtx(e,t),{code:w.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(x(t=this._getOrReturnCtx(e,t),{code:w.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),i.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(x(t=this._getOrReturnCtx(e,t),{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),i.dirty()):o.assertNever(r);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,c.toString(t))}gt(e,t){return this.setLimit("min",e,!1,c.toString(t))}lte(e,t){return this.setLimit("max",e,!0,c.toString(t))}lt(e,t){return this.setLimit("max",e,!1,c.toString(t))}setLimit(e,t,i,r){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:c.toString(r)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}
897positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:c.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:c.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:c.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:c.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:c.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}V.create=e=>{var t;return new V({checks:[],typeName:d.ZodBigInt,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...$(e)})};class Z extends U{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.boolean,received:t.parsedType}),_}return S(e.data)}}Z.create=e=>new Z({typeName:d.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...$(e)});class K extends U{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.date,received:t.parsedType}),_}if(isNaN(e.data.getTime()))return x(this._getOrReturnCtx(e),{code:w.invalid_date}),_;let i=new A;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(x(t=this._getOrReturnCtx(e,t),{code:w.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),i.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(x(t=this._getOrReturnCtx(e,t),{code:w.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),i.dirty()):o.assertNever(r);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:c.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:c.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}K.create=e=>new K({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:d.ZodDate,...$(e)});class G extends U{_parse(e){if(this._getType(e)!==g.symbol){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.symbol,received:t.parsedType}),_}return S(e.data)}}G.create=e=>new G({typeName:d.ZodSymbol,...$(e)});class Y extends U{_parse(e){if(this._getType(e)!==g.undefined){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.undefined,received:t.parsedType}),_}return S(e.data)}}Y.create=e=>new Y({typeName:d.ZodUndefined,...$(e)});class J extends U{_parse(e){if(this._getType(e)!==g.null){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.null,received:t.parsedType}),_}return S(e.data)}}J.create=e=>new J({typeName:d.ZodNull,...$(e)});class X extends U{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}X.create=e=>new X({typeName:d.ZodAny,...$(e)});class Q extends U{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}Q.create=e=>new Q({typeName:d.ZodUnknown,...$(e)});class ee extends U{_parse(e){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.never,received:t.parsedType}),_}}ee.create=e=>new ee({typeName:d.ZodNever,...$(e)});class et extends U{_parse(e){if(this._getType(e)!==g.undefined){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.void,received:t.parsedType}),_}return S(e.data)}}et.create=e=>new et({typeName:d.ZodVoid,...$(e)});class ei extends U{_parse(e){let{ctx:t,status:i}=this._processInputParams(e),r=this._def;if(t.parsedType!==g.array)return x(t,{code:w.invalid_type,expected:g.array,received:t.parsedType}),_;if(null!==r.exactLength){let e=t.data.length>
897r.exactLength.value,n=t.data.length<r.exactLength.value;(e||n)&&(x(t,{code:e?w.too_big:w.too_small,minimum:n?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(x(t,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(x(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map((e,i)=>r.type._parseAsync(new R(t,e,t.path,i)))).then(e=>A.mergeArray(i,e));let n=[...t.data].map((e,i)=>r.type._parseSync(new R(t,e,t.path,i)));return A.mergeArray(i,n)}get element(){return this._def.type}min(e,t){return new ei({...this._def,minLength:{value:e,message:c.toString(t)}})}max(e,t){return new ei({...this._def,maxLength:{value:e,message:c.toString(t)}})}length(e,t){return new ei({...this._def,exactLength:{value:e,message:c.toString(t)}})}nonempty(e){return this.min(1,e)}}ei.create=(e,t)=>new ei({type:e,minLength:null,maxLength:null,exactLength:null,typeName:d.ZodArray,...$(t)});class er extends U{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=o.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==g.object){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.object,received:t.parsedType}),_}let{status:t,ctx:i}=this._processInputParams(e),{shape:r,keys:n}=this._getCached(),s=[];if(!(this._def.catchall instanceof ee&&"strip"===this._def.unknownKeys))for(let e in i.data)n.includes(e)||s.push(e);let a=[];for(let e of n){let t=r[e],n=i.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new R(i,n,i.path,e)),alwaysSet:e in i.data})}if(this._def.catchall instanceof ee){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of s)a.push({key:{status:"valid",value:e},value:{status:"valid",value:i.data[e]}});else if("strict"===e)s.length>0&&(x(i,{code:w.unrecognized_keys,keys:s}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of s){let r=i.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new R(i,r,i.path,t)),alwaysSet:t in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of a){let i=await t.key;e.push({key:i,value:await t.value,alwaysSet:t.alwaysSet})}return e}).then(e=>A.mergeObjectSync(t,e)):A.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return c.errToObj,new er({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{var r,n,s,a;let o=null!=(s=null==(n=(r=this._def).errorMap)?void 0:n.call(r,t,i).message)?s:i.defaultError;return"unrecognized_keys"===t.code?{message:null!=(a=c.errToObj(e).message)?a:o}:{message:o}}}:{}})}strip(){return new er({...this._def,unknownKeys:"strip"})}passthrough(){return new er({...this._def,unknownKeys:"passthrough"})}extend(e){return new er({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new er({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:d.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new er({...this._def,catchall:e})}pick(e){let t={};return o.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(t[i]=this.shape[i])}),new er({...this._def,shape:()=>t})}omit(e){let t={};return o.objectKeys(this.shape).forEach(i=>{e[i]||(t[i]=this.shape[i])}),new er({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof er){let i={};for(let r in t.shape){let n=t.shape[r];i[r]=ev.create(e(n))}return new er({...t._def,shape:()=>i})}if(t instanceof ei)return new ei({...t._def,type:e(t.element)});if(t instanceof ev)return ev.create(e(t.unwrap()));if(t instanceof eC)return eC.create(e(t.unwrap()));if(t instanceof el)return el.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};return o.objectKeys(this.shape).forEach(i=>
897{let r=this.shape[i];e&&!e[i]?t[i]=r:t[i]=r.optional()}),new er({...this._def,shape:()=>t})}required(e){let t={};return o.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])t[i]=this.shape[i];else{let e=this.shape[i];for(;e instanceof ev;)e=e._def.innerType;t[i]=e}}),new er({...this._def,shape:()=>t})}keyof(){return eg(o.objectKeys(this.shape))}}er.create=(e,t)=>new er({shape:()=>e,unknownKeys:"strip",catchall:ee.create(),typeName:d.ZodObject,...$(t)}),er.strictCreate=(e,t)=>new er({shape:()=>e,unknownKeys:"strict",catchall:ee.create(),typeName:d.ZodObject,...$(t)}),er.lazycreate=(e,t)=>new er({shape:e,unknownKeys:"strip",catchall:ee.create(),typeName:d.ZodObject,...$(t)});class en extends U{_parse(e){let{ctx:t}=this._processInputParams(e),i=this._def.options;if(t.common.async)return Promise.all(i.map(async e=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let i of e)if("dirty"===i.result.status)return t.common.issues.push(...i.ctx.common.issues),i.result;let i=e.map(e=>new y(e.ctx.common.issues));return x(t,{code:w.invalid_union,unionErrors:i}),_});{let e,r=[];for(let n of i){let i={...t,common:{...t.common,issues:[]},parent:null},s=n._parseSync({data:t.data,path:t.path,parent:i});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:i}),i.common.issues.length&&r.push(i.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let n=r.map(e=>new y(e));return x(t,{code:w.invalid_union,unionErrors:n}),_}}get options(){return this._def.options}}en.create=(e,t)=>new en({options:e,typeName:d.ZodUnion,...$(t)});let es=e=>{if(e instanceof ep)return es(e.schema);if(e instanceof eb)return es(e.innerType());if(e instanceof ef)return[e.value];if(e instanceof em)return e.options;if(e instanceof ew)return Object.keys(e.enum);else if(e instanceof eE)return es(e._def.innerType);else if(e instanceof Y)return[void 0];else if(e instanceof J)return[null];else return null};class ea extends U{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.object)return x(t,{code:w.invalid_type,expected:g.object,received:t.parsedType}),_;let i=this.discriminator,r=t.data[i],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(x(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){let r=new Map;for(let i of t){let t=es(i.shape[e]);if(!t)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of t){if(r.has(n))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,i)}}return new ea({typeName:d.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...$(i)})}}class eo extends U{_parse(e){let{status:t,ctx:i}=this._processInputParams(e),r=(e,r)=>{if(N(e)||N(r))return _;let n=function e(t,i){let r=m(t),n=m(i);if(t===i)return{valid:!0,data:t};if(r===g.object&&n===g.object){let r=o.objectKeys(i),n=o.objectKeys(t).filter(e=>-1!==r.indexOf(e)),s={...t,...i};for(let r of n){let n=e(t[r],i[r]);if(!n.valid)return{valid:!1};s[r]=n.data}return{valid:!0,data:s}}if(r===g.array&&n===g.array){if(t.length!==i.length)return{valid:!1};let r=[];for(let n=0;n<t.length;n++){let s=e(t[n],i[n]);if(!s.valid)return{valid:!1};r.push(s.data)}return{valid:!0,data:r}}if(r===g.date&&n===g.date&&+t==+i)return{valid:!0,data:t};return{valid:!1}}(e.value,r.value);return n.valid?((k(e)||k(r))&&t.dirty(),{status:t.value,value:n.data}):(x(i,{code:w.invalid_intersection_types}),_)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}eo.create=(e,t,i)=>new eo({left:e,right:t,typeName:d.ZodIntersection,...$(i)});class el extends U{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==g.array)return x(i,{code:w.invalid_type,expected:g.array,received:i.parsedType}),_;if(i.data.length<this._def.items.length)return x(i,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&i.data.length>this._def.items.length&&(x(i,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let r=[...i.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new R(i,e,i.path,t)):null}).filter(e=>!!e);return i.common.async?Promise.all(r).then(e=>A.mergeArray(t,e)):A.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new el({...this._def,rest:e})}}el.create=(e,t)=>
897{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new el({items:e,typeName:d.ZodTuple,rest:null,...$(t)})};class ec extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==g.object)return x(i,{code:w.invalid_type,expected:g.object,received:i.parsedType}),_;let r=[],n=this._def.keyType,s=this._def.valueType;for(let e in i.data)r.push({key:n._parse(new R(i,e,i.path,e)),value:s._parse(new R(i,i.data[e],i.path,e))});return i.common.async?A.mergeObjectAsync(t,r):A.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,i){return new ec(t instanceof U?{keyType:e,valueType:t,typeName:d.ZodRecord,...$(i)}:{keyType:q.create(),valueType:e,typeName:d.ZodRecord,...$(t)})}}class ed extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==g.map)return x(i,{code:w.invalid_type,expected:g.map,received:i.parsedType}),_;let r=this._def.keyType,n=this._def.valueType,s=[...i.data.entries()].map(([e,t],s)=>({key:r._parse(new R(i,e,i.path,[s,"key"])),value:n._parse(new R(i,t,i.path,[s,"value"]))}));if(i.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let i of s){let r=await i.key,n=await i.value;if("aborted"===r.status||"aborted"===n.status)return _;("dirty"===r.status||"dirty"===n.status)&&t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}})}{let e=new Map;for(let i of s){let r=i.key,n=i.value;if("aborted"===r.status||"aborted"===n.status)return _;("dirty"===r.status||"dirty"===n.status)&&t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}}}}ed.create=(e,t,i)=>new ed({valueType:t,keyType:e,typeName:d.ZodMap,...$(i)});class eh extends U{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==g.set)return x(i,{code:w.invalid_type,expected:g.set,received:i.parsedType}),_;let r=this._def;null!==r.minSize&&i.data.size<r.minSize.value&&(x(i,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&i.data.size>r.maxSize.value&&(x(i,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let n=this._def.valueType;function s(e){let i=new Set;for(let r of e){if("aborted"===r.status)return _;"dirty"===r.status&&t.dirty(),i.add(r.value)}return{status:t.value,value:i}}let a=[...i.data.values()].map((e,t)=>n._parse(new R(i,e,i.path,t)));return i.common.async?Promise.all(a).then(e=>s(e)):s(a)}min(e,t){return new eh({...this._def,minSize:{value:e,message:c.toString(t)}})}max(e,t){return new eh({...this._def,maxSize:{value:e,message:c.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}eh.create=(e,t)=>new eh({valueType:e,minSize:null,maxSize:null,typeName:d.ZodSet,...$(t)});class eu extends U{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.function)return x(t,{code:w.invalid_type,expected:g.function,received:t.parsedType}),_;function i(e,i){return E({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,C(),b].filter(e=>!!e),issueData:{code:w.invalid_arguments,argumentsError:i}})}function r(e,i){return E({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,C(),b].filter(e=>!!e),issueData:{code:w.invalid_return_type,returnTypeError:i}})}let n={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ey){let e=this;return S(async function(...t){let a=new y([]),o=await e._def.args.parseAsync(t,n).catch(e=>{throw a.addIssue(i(t,e)),a}),l=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(l,n).catch(e=>{throw a.addIssue(r(l,e)),a})})}{let e=this;return S(function(...t){let a=e._def.args.safeParse(t,n);if(!a.success)throw new y([i(t,a.error)]);let o=Reflect.apply(s,this,a.data),l=e._def.returns.safeParse(o,n);if(!l.success)throw new y([r(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new eu({...this._def,args:el.create(e).rest(Q.create())})}returns(e){return new eu({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new eu({args:e||el.create([]).rest(Q.create()),returns:t||Q.create(),typeName:d.ZodFunction,...$(i)})}}class ep extends U{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ep.create=(e,t)=>
897new ep({getter:e,typeName:d.ZodLazy,...$(t)});class ef extends U{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}function eg(e,t){return new em({values:e,typeName:d.ZodEnum,...$(t)})}ef.create=(e,t)=>new ef({value:e,typeName:d.ZodLiteral,...$(t)});class em extends U{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),i=this._def.values;return x(t,{expected:o.joinValues(i),received:t.parsedType,code:w.invalid_type}),_}if(-1===this._def.values.indexOf(e.data)){let t=this._getOrReturnCtx(e),i=this._def.values;return x(t,{received:t.data,code:w.invalid_enum_value,options:i}),_}return S(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return em.create(e)}exclude(e){return em.create(this.options.filter(t=>!e.includes(t)))}}em.create=eg;class ew extends U{_parse(e){let t=o.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==g.string&&i.parsedType!==g.number){let e=o.objectValues(t);return x(i,{expected:o.joinValues(e),received:i.parsedType,code:w.invalid_type}),_}if(-1===t.indexOf(e.data)){let e=o.objectValues(t);return x(i,{received:i.data,code:w.invalid_enum_value,options:e}),_}return S(e.data)}get enum(){return this._def.values}}ew.create=(e,t)=>new ew({values:e,typeName:d.ZodNativeEnum,...$(t)});class ey extends U{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==g.promise&&!1===t.common.async?(x(t,{code:w.invalid_type,expected:g.promise,received:t.parsedType}),_):S((t.parsedType===g.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ey.create=(e,t)=>new ey({type:e,typeName:d.ZodPromise,...$(t)});class eb extends U{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===d.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:i}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:e=>{x(i,e),e.fatal?t.abort():t.dirty()},get path(){return i.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===r.type){let e=r.transform(i.data,n);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(e).then(e=>this._def.schema._parseAsync({data:e,path:i.path,parent:i})):this._def.schema._parseSync({data:e,path:i.path,parent:i})}if("refinement"===r.type){let e=e=>{let t=r.refinement(e,n);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==i.common.async)return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(i=>"aborted"===i.status?_:("dirty"===i.status&&t.dirty(),e(i.value).then(()=>({status:t.value,value:i.value}))));{let r=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===r.status?_:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}}if("transform"===r.type)if(!1!==i.common.async)return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(e=>T(e)?Promise.resolve(r.transform(e.value,n)).then(e=>({status:t.value,value:e})):e);else{let e=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!T(e))return e;let s=r.transform(e.value,n);if(s instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}o.assertNever(r)}}eb.create=(e,t,i)=>new eb({schema:e,typeName:d.ZodEffects,effect:t,...$(i)}),eb.createWithPreprocess=(e,t,i)=>new eb({schema:t,effect:{type:"preprocess",transform:e},typeName:d.ZodEffects,...$(i)});class ev extends U{_parse(e){return this._getType(e)===g.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ev.create=(e,t)=>
897new ev({innerType:e,typeName:d.ZodOptional,...$(t)});class eC extends U{_parse(e){return this._getType(e)===g.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}eC.create=(e,t)=>new eC({innerType:e,typeName:d.ZodNullable,...$(t)});class eE extends U{_parse(e){let{ctx:t}=this._processInputParams(e),i=t.data;return t.parsedType===g.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}eE.create=(e,t)=>new eE({innerType:e,typeName:d.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$(t)});class ex extends U{_parse(e){let{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return O(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new y(i.common.issues)},input:i.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new y(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}ex.create=(e,t)=>new ex({innerType:e,typeName:d.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$(t)});class eA extends U{_parse(e){if(this._getType(e)!==g.nan){let t=this._getOrReturnCtx(e);return x(t,{code:w.invalid_type,expected:g.nan,received:t.parsedType}),_}return{status:"valid",value:e.data}}}eA.create=e=>new eA({typeName:d.ZodNaN,...$(e)});let e_=Symbol("zod_brand");class eI extends U{_parse(e){let{ctx:t}=this._processInputParams(e),i=t.data;return this._def.type._parse({data:i,path:t.path,parent:t})}unwrap(){return this._def.type}}class eS extends U{_parse(e){let{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),I(e.value)):this._def.out._parseAsync({data:e.value,path:i.path,parent:i})})();{let e=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:i.path,parent:i})}}static create(e,t){return new eS({in:e,out:t,typeName:d.ZodPipeline})}}class eN extends U{_parse(e){let t=this._def.innerType._parse(e);return T(t)&&(t.value=Object.freeze(t.value)),t}}eN.create=(e,t)=>new eN({innerType:e,typeName:d.ZodReadonly,...$(t)});let ek=(e,t={},i)=>e?X.create().superRefine((r,n)=>{var s,a;if(!e(r)){let e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,o=null==(a=null!=(s=e.fatal)?s:i)||a,l="string"==typeof e?{message:e}:e;n.addIssue({code:"custom",...l,fatal:o})}}):X.create(),eT={object:er.lazycreate};(a=d||(d={})).ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly";let eO=q.create,eR=z.create,eP=eA.create,e$=V.create,eU=Z.create,eM=K.create,eD=G.create,eL=Y.create,eW=J.create,eB=X.create,ej=Q.create,eF=ee.create,eH=et.create,eq=ei.create,ez=er.create,eV=er.strictCreate,eZ=en.create,eK=ea.create,eG=eo.create,eY=el.create,eJ=ec.create,eX=ed.create,eQ=eh.create,e0=eu.create,e1=ep.create,e2=ef.create,e3=em.create,e5=ew.create,e4=ey.create,e6=eb.create,e8=ev.create,e9=eC.create,e7=eb.createWithPreprocess,te=eS.create;var tt=Object.freeze({__proto__:null,defaultErrorMap:b,setErrorMap:function(e){v=e},getErrorMap:C,makeIssue:E,EMPTY_PATH:[],addIssueToContext:x,ParseStatus:A,INVALID:_,DIRTY:I,OK:S,isAborted:N,isDirty:k,isValid:T,isAsync:O,get util(){return o},get objectUtil(){return l},ZodParsedType:g,getParsedType:m,ZodType:U,ZodString:q,ZodNumber:z,ZodBigInt:V,ZodBoolean:Z,ZodDate:K,ZodSymbol:G,ZodUndefined:Y,ZodNull:J,ZodAny:X,ZodUnknown:Q,ZodNever:ee,ZodVoid:et,ZodArray:ei,ZodObject:er,ZodUnion:en,ZodDiscriminatedUnion:ea,ZodIntersection:eo,ZodTuple:el,ZodRecord:ec,ZodMap:ed,ZodSet:eh,ZodFunction:eu,ZodLazy:ep,ZodLiteral:ef,ZodEnum:em,ZodNativeEnum:ew,ZodPromise:ey,ZodEffects:eb,ZodTransformer:eb,ZodOptional:ev,ZodNullable:eC,ZodDefault:eE,ZodCatch:ex,ZodNaN:eA,BRAND:e_,ZodBranded:eI,ZodPipeline:eS,ZodReadonly:eN,custom:ek,Schema:U,ZodSchema:U,late:eT,get ZodFirstPartyTypeKind(){return d},coerce:{string:e=>q.create({...e,coerce:!0}),number:e=>z.create({...e,coerce:!0}),boolean:e=>Z.create({...e,coerce:!0}),bigint:e=>V.create({...e,coerce:!0}),date:e=>K.create({...e,coerce:!0})},any:eB,array:eq,bigint:e$,boolean:eU,date:eM,discriminatedUnion:eK,effect:e6,enum:e3,function:e0,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>ek(t=>t instanceof e,t),intersection:eG,lazy:e1,literal:e2,map:eX,nan:eP,nativeEnum:e5,never:eF,null:eW,nullable:e9,number:eR,object:ez,oboolean:()=>eU().optional(),onumber:()=>eR().optional(),optional:e8,ostring:()=>eO().optional(),pipeline:te,preprocess:e7,promise:e4,record:eJ,set:eQ,strictObject:eV,str
897ing:eO,symbol:eD,transformer:e6,tuple:eY,undefined:eL,union:eZ,unknown:ej,void:eH,NEVER:_,ZodIssueCode:w,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:y});let ti=tt.object({message:tt.string()});function tr(e){return tt.literal(p.s1[e])}let tn=tt.object({serializedMessage:tt.string().optional(),accountAddress:tt.string(),chainId:tt.string(),notBefore:tt.string().optional(),domain:tt.string(),uri:tt.string(),version:tt.string(),nonce:tt.string(),statement:tt.string().optional(),resources:tt.array(tt.string()).optional(),requestId:tt.string().optional(),issuedAt:tt.string().optional(),expirationTime:tt.string().optional()});tt.object({accessList:tt.array(tt.string()),blockHash:tt.string().nullable(),blockNumber:tt.string().nullable(),chainId:tt.string().or(tt.number()),from:tt.string(),gas:tt.string(),hash:tt.string(),input:tt.string().nullable(),maxFeePerGas:tt.string(),maxPriorityFeePerGas:tt.string(),nonce:tt.string(),r:tt.string(),s:tt.string(),to:tt.string(),transactionIndex:tt.string().nullable(),type:tt.string(),v:tt.string(),value:tt.string()});let ts=tt.object({chainId:tt.string().or(tt.number()),rpcUrl:tt.optional(tt.string())}),ta=tt.object({email:tt.string().email()}),to=tt.object({otp:tt.string()}),tl=tt.object({uri:tt.string(),preferredAccountType:tt.optional(tt.string()),chainId:tt.optional(tt.string().or(tt.number())),siwxMessage:tt.optional(tn),rpcUrl:tt.optional(tt.string())}),tc=tt.object({chainId:tt.optional(tt.string().or(tt.number())),preferredAccountType:tt.optional(tt.string()),socialUri:tt.optional(tt.string()),siwxMessage:tt.optional(tn),rpcUrl:tt.optional(tt.string())}),td=tt.object({provider:tt.enum(["google","github","apple","facebook","x","discord"])}),th=tt.object({email:tt.string().email()}),tu=tt.object({otp:tt.string()}),tp=tt.object({otp:tt.string()}),tf=tt.object({themeMode:tt.optional(tt.enum(["light","dark"])),themeVariables:tt.optional(tt.record(tt.string(),tt.string().or(tt.number()))),w3mThemeVariables:tt.optional(tt.record(tt.string(),tt.string()))}),tg=tt.object({metadata:tt.object({name:tt.string(),description:tt.string(),url:tt.string(),icons:tt.array(tt.string())}).optional(),sdkVersion:tt.string().optional(),sdkType:tt.string().optional(),projectId:tt.string()}),tm=tt.object({type:tt.string()}),tw=tt.object({action:tt.enum(["VERIFY_DEVICE","VERIFY_OTP","CONNECT"])}),ty=tt.object({url:tt.string()}),tb=tt.object({userName:tt.string()}),tv=tt.object({email:tt.string().optional().nullable(),address:tt.string(),chainId:tt.string().or(tt.number()),accounts:tt.array(tt.object({address:tt.string(),type:tt.enum([p.Vl.ACCOUNT_TYPES.EOA,p.Vl.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:tt.string().optional().nullable(),preferredAccountType:tt.optional(tt.string()),signature:tt.string().optional(),message:tt.string().optional(),siwxMessage:tt.optional(tn)}),tC=tt.object({action:tt.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),tE=tt.object({email:tt.string().email().optional().nullable(),address:tt.string(),chainId:tt.string().or(tt.number()),smartAccountDeployed:tt.optional(tt.boolean()),accounts:tt.array(tt.object({address:tt.string(),type:tt.enum([p.Vl.ACCOUNT_TYPES.EOA,p.Vl.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:tt.optional(tt.string()),signature:tt.string().optional(),message:tt.string().optional(),siwxMessage:tt.optional(tn)}),tx=tt.object({uri:tt.string()}),tA=tt.object({isConnected:tt.boolean()}),t_=tt.object({chainId:tt.string().or(tt.number())}),tI=tt.object({chainId:tt.string().or(tt.number())}),tS=tt.object({newEmail:tt.string().email()}),tN=tt.object({smartAccountEnabledNetworks:tt.array(tt.number())});tt.object({address:tt.string(),isDeployed:tt.boolean()});let tk=tt.object({version:tt.string().optional()}),tT=tt.object({type:tt.string(),address:tt.string()}),tO=tt.any(),tR=tt.object({method:tt.literal("eth_accounts")}),tP=tt.object({method:tt.literal("eth_blockNumber")}),t$=tt.object({method:tt.literal("eth_call"),params:tt.array(tt.any())}),tU=tt.object({method:tt.literal("eth_chainId")}),tM=tt.object({method:tt.literal("eth_estimateGas"),params:tt.array(tt.any())}),tD=tt.object({method:tt.literal("eth_feeHistory"),params:tt.array(tt.any())}),tL=tt.object({method:tt.literal("eth_gasPrice")}),tW=tt.object({method:tt.literal("eth_getAccount"),params:tt.array(tt.any())}),tB=tt.object({method:tt.literal("eth_getBalance"),params:tt.array(tt.any())}),tj=tt.object({method:tt.literal("eth_getBlockByHash"),params:tt.array(tt.any())}),tF=tt.object({method:tt.literal("eth_getBlockByNumber"),params:tt.array(tt.any())}),tH=tt.object({method:tt.literal("eth_getBlockReceipts"),params:tt.array(tt.any())}),tq=tt.object({method:tt.literal("eth_getBlockTransactionCountByHash"),params:tt.array(tt.any())}),tz=tt.object({method:tt.literal("eth_getBlockTransactionCountByNumber"),params:tt.array(tt.any())}),tV=tt.object({method:tt.literal("eth_getCode"),params:tt.array(tt.any())}),tZ=tt.object({method:tt.literal("eth_getFilterChanges"),params:tt.array(tt.any())}),tK=tt.object({method:tt.literal("eth_getFilterLogs"),params:tt.array(tt.any())}),tG=tt.object({method:tt.literal("eth_getLogs"),params:tt.array(tt.any())}),tY=tt.object({method:tt.literal("eth_getProof"),params:tt.array(tt.any())}),tJ=tt.object({method:tt.literal("eth_getStorageAt"),params:tt.array(tt.any())}),tX=tt.object({method:tt.literal("eth_getTransactionByBlockHashAndIndex"),params:tt.array(tt.any())}),tQ=tt.object({method:tt.literal("eth_getTransactionByBlockNumberAndIndex"),params:tt.array(tt.any())}),t0=tt.object({method:tt.literal("eth_getTransactionByHash"),params:tt.array(tt.any())}),t1=tt.object({method:tt.literal("eth_getTransactionCount"),params:tt.array(tt.any())}
897),t2=tt.object({method:tt.literal("eth_getTransactionReceipt"),params:tt.array(tt.any())}),t3=tt.object({method:tt.literal("eth_getUncleCountByBlockHash"),params:tt.array(tt.any())}),t5=tt.object({method:tt.literal("eth_getUncleCountByBlockNumber"),params:tt.array(tt.any())}),t4=tt.object({method:tt.literal("eth_maxPriorityFeePerGas")}),t6=tt.object({method:tt.literal("eth_newBlockFilter")}),t8=tt.object({method:tt.literal("eth_newFilter"),params:tt.array(tt.any())}),t9=tt.object({method:tt.literal("eth_newPendingTransactionFilter")}),t7=tt.object({method:tt.literal("eth_sendRawTransaction"),params:tt.array(tt.any())}),ie=tt.object({method:tt.literal("eth_syncing"),params:tt.array(tt.any())}),it=tt.object({method:tt.literal("eth_uninstallFilter"),params:tt.array(tt.any())}),ii=tt.object({method:tt.literal("personal_sign"),params:tt.array(tt.any())}),ir=tt.object({method:tt.literal("eth_signTypedData_v4"),params:tt.array(tt.any())}),is=tt.object({method:tt.literal("eth_sendTransaction"),params:tt.array(tt.any())}),ia=tt.object({method:tt.literal("solana_signMessage"),params:tt.object({message:tt.string(),pubkey:tt.string()})}),io=tt.object({method:tt.literal("solana_signTransaction"),params:tt.object({transaction:tt.string()})}),il=tt.object({method:tt.literal("solana_signAllTransactions"),params:tt.object({transactions:tt.array(tt.string())})}),ic=tt.object({method:tt.literal("solana_signAndSendTransaction"),params:tt.object({transaction:tt.string(),options:tt.object({skipPreflight:tt.boolean().optional(),preflightCommitment:tt.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:tt.number().optional(),minContextSlot:tt.number().optional()}).optional()})}),id=tt.object({method:tt.literal("wallet_sendCalls"),params:tt.array(tt.object({chainId:tt.string().or(tt.number()).optional(),from:tt.string().optional(),version:tt.string().optional(),capabilities:tt.any().optional(),calls:tt.array(tt.object({to:tt.string().startsWith("0x"),data:tt.string().startsWith("0x").optional(),value:tt.string().optional()}))}))}),ih=tt.object({method:tt.literal("wallet_getCallsStatus"),params:tt.array(tt.string())}),iu=tt.object({method:tt.literal("wallet_getCapabilities"),params:tt.array(tt.string().or(tt.number()).optional()).optional()}),ip=tt.object({method:tt.literal("wallet_grantPermissions"),params:tt.array(tt.any())}),ig=tt.object({method:tt.literal("wallet_revokePermissions"),params:tt.any()}),im=tt.object({method:tt.literal("wallet_getAssets"),params:tt.any()}),iw=tt.object({token:tt.string()}),iy=tt.object({id:tt.string().optional()}),ib={appEvent:iy.extend({type:tr("APP_SWITCH_NETWORK"),payload:ts}).or(iy.extend({type:tr("APP_CONNECT_EMAIL"),payload:ta})).or(iy.extend({type:tr("APP_CONNECT_DEVICE")})).or(iy.extend({type:tr("APP_CONNECT_OTP"),payload:to})).or(iy.extend({type:tr("APP_CONNECT_SOCIAL"),payload:tl})).or(iy.extend({type:tr("APP_GET_FARCASTER_URI")})).or(iy.extend({type:tr("APP_CONNECT_FARCASTER")})).or(iy.extend({type:tr("APP_GET_USER"),payload:tt.optional(tc)})).or(iy.extend({type:tr("APP_GET_SOCIAL_REDIRECT_URI"),payload:td})).or(iy.extend({type:tr("APP_SIGN_OUT")})).or(iy.extend({type:tr("APP_IS_CONNECTED"),payload:tt.optional(iw)})).or(iy.extend({type:tr("APP_GET_CHAIN_ID")})).or(iy.extend({type:tr("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(iy.extend({type:tr("APP_INIT_SMART_ACCOUNT")})).or(iy.extend({type:tr("APP_SET_PREFERRED_ACCOUNT"),payload:tm})).or(iy.extend({type:tr("APP_RPC_REQUEST"),payload:ii.or(im).or(tR).or(tP).or(t$).or(tU).or(tM).or(tD).or(tL).or(tW).or(tB).or(tj).or(tF).or(tH).or(tq).or(tz).or(tV).or(tZ).or(tK).or(tG).or(tY).or(tJ).or(tX).or(tQ).or(t0).or(t1).or(t2).or(t3).or(t5).or(t4).or(t6).or(t8).or(t9).or(t7).or(ie).or(it).or(ii).or(ir).or(is).or(ia).or(io).or(il).or(ic).or(ih).or(id).or(iu).or(ip).or(ig).and(tt.object({chainId:tt.string().or(tt.number()).optional(),chainNamespace:tt.enum(["eip155","solana","polkadot","bip122","cosmos"]).optional(),rpcUrl:tt.string().optional()}))})).or(iy.extend({type:tr("APP_UPDATE_EMAIL"),payload:th})).or(iy.extend({type:tr("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:tu})).or(iy.extend({type:tr("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:tp})).or(iy.extend({type:tr("APP_SYNC_THEME"),payload:tf})).or(iy.extend({type:tr("APP_SYNC_DAPP_DATA"),payload:tg})).or(iy.extend({type:tr("APP_RELOAD")})).or(iy.extend({type:tr("APP_RPC_ABORT")}
897)),frameEvent:iy.extend({type:tr("FRAME_SWITCH_NETWORK_ERROR"),payload:ti}).or(iy.extend({type:tr("FRAME_SWITCH_NETWORK_SUCCESS"),payload:tI})).or(iy.extend({type:tr("FRAME_CONNECT_EMAIL_SUCCESS"),payload:tw})).or(iy.extend({type:tr("FRAME_CONNECT_EMAIL_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:ty})).or(iy.extend({type:tr("FRAME_GET_FARCASTER_URI_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:tb})).or(iy.extend({type:tr("FRAME_CONNECT_FARCASTER_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_CONNECT_OTP_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_CONNECT_OTP_SUCCESS")})).or(iy.extend({type:tr("FRAME_CONNECT_DEVICE_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_CONNECT_DEVICE_SUCCESS")})).or(iy.extend({type:tr("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:tv})).or(iy.extend({type:tr("FRAME_CONNECT_SOCIAL_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_GET_USER_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_GET_USER_SUCCESS"),payload:tE})).or(iy.extend({type:tr("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:tx})).or(iy.extend({type:tr("FRAME_SIGN_OUT_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_SIGN_OUT_SUCCESS")})).or(iy.extend({type:tr("FRAME_IS_CONNECTED_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_IS_CONNECTED_SUCCESS"),payload:tA})).or(iy.extend({type:tr("FRAME_GET_CHAIN_ID_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_GET_CHAIN_ID_SUCCESS"),payload:t_})).or(iy.extend({type:tr("FRAME_RPC_REQUEST_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_RPC_REQUEST_SUCCESS"),payload:tO})).or(iy.extend({type:tr("FRAME_SESSION_UPDATE"),payload:iw})).or(iy.extend({type:tr("FRAME_UPDATE_EMAIL_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_UPDATE_EMAIL_SUCCESS"),payload:tC})).or(iy.extend({type:tr("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(iy.extend({type:tr("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:tS})).or(iy.extend({type:tr("FRAME_SYNC_THEME_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_SYNC_THEME_SUCCESS")})).or(iy.extend({type:tr("FRAME_SYNC_DAPP_DATA_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(iy.extend({type:tr("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:tN})).or(iy.extend({type:tr("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:tT})).or(iy.extend({type:tr("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_READY"),payload:tk})).or(iy.extend({type:tr("FRAME_RELOAD_ERROR"),payload:ti})).or(iy.extend({type:tr("FRAME_RELOAD_SUCCESS")}))};var iv=i(72550);function iC(e,t={}){return"string"==typeof t?.type&&t?.type?.includes(e)}class iE{constructor({projectId:e,isAppClient:t=!1,chainId:i="eip155:1",enableLogger:r=!0,enableCloudAuthAccount:n=!1,rpcUrl:s=u.o.BLOCKCHAIN_API_RPC_URL}){if(this.iframe=null,this.iframeIsReady=!1,this.initFrame=()=>{let e=document.getElementById("w3m-iframe");this.iframe&&!e&&document.body.appendChild(this.iframe)},this.events={registerFrameEventHandler:(e,t,i)=>{function r({data:i}){if(!iC(p.s1.FRAME_EVENT_KEY,i))return;let n=ib.frameEvent.safeParse(i);n.success?n.data?.id===e&&(t(n.data),window.removeEventListener("message",r)):console.warn("W3mFrame: invalid frame event",n.error.message)}f.Q.isClient&&(window.addEventListener("message",r),i.addEventListener("abort",()=>{window.removeEventListener("message",r)}))},onFrameEvent:e=>{f.Q.isClient&&window.addEventListener("message",({data:t})=>{if(!iC(p.s1.FRAME_EVENT_KEY,t))return;let i=ib.frameEvent.safeParse(t);i.success?e(i.data):console.warn("W3mFrame: invalid frame event",i.error.message)})},onAppEvent:e=>{f.Q.isClient&&window.addEventListener("message",({data:t})=>{if(!iC(p.s1.APP_EVENT_KEY,t))return;let i=ib.appEvent.safeParse(t);i.success||console.warn("W3mFrame: invalid app event",i.error.message),e(t)})},postAppEvent:e=>{if(f.Q.isClient){if(!this.iframe?.contentWindow)throw Error("W3mFrame: iframe is not set");this.iframe.contentWindow.postMessage(e,"*")}},postFrameEvent:e=>{if(f.Q.isClient){if(!parent)throw Error("W3mFrame: parent is not set");parent.postMessage(e,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((e,t)=>
897{this.frameLoadPromiseResolver={resolve:e,reject:t}}),this.rpcUrl=s,t&&(this.frameLoadPromise=new Promise((e,t)=>{this.frameLoadPromiseResolver={resolve:e,reject:t}}),f.Q.isClient)){const t=document.createElement("iframe");t.id="w3m-iframe",t.src=function({projectId:e,chainId:t,enableLogger:i,rpcUrl:r=u.o.BLOCKCHAIN_API_RPC_URL,enableCloudAuthAccount:n=!1}){let s=new URL(p.hy);s.searchParams.set("projectId",e),s.searchParams.set("chainId",String(t)),s.searchParams.set("version",p.gS),s.searchParams.set("enableLogger",String(i)),s.searchParams.set("rpcUrl",r);let a=iv.o.get("dapp_smart_account_version");return a&&("v6"===a||"v7"===a)&&(console.warn(">> AppKit - Forcing smart account version",a),s.searchParams.set("smartAccountVersion",a)),n&&s.searchParams.set("enableCloudAuthAccount","true"),s.toString()}({projectId:e,chainId:i,enableLogger:r,rpcUrl:this.rpcUrl,enableCloudAuthAccount:n}),t.name="w3m-secure-iframe",t.style.position="fixed",t.style.zIndex="999999",t.style.display="none",t.style.border="none",t.style.animationDelay="0s, 50ms",t.style.borderBottomLeftRadius="clamp(0px, var(--apkt-borderRadius-8), 44px)",t.style.borderBottomRightRadius="clamp(0px, var(--apkt-borderRadius-8), 44px)",this.iframe=t,this.iframe.onerror=()=>{this.frameLoadPromiseResolver?.reject("Unable to load email login dependency")},this.events.onFrameEvent(e=>{"@w3m-frame/READY"===e.type&&(this.iframeIsReady=!0,this.frameLoadPromiseResolver?.resolve(void 0))})}}get networks(){return Object.assign({},...["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(e=>({[e]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${e}&projectId=${this.projectId}`,chainId:e}})))}}var ix=i(5873);class iA{constructor(e){const t=(0,ix.iP)({level:p.OH}),{logger:i,chunkLoggerController:r}=(0,ix.D5)({opts:t});this.logger=(0,ix.U5)(i,this.constructor.name),this.chunkLoggerController=r,"u">typeof window&&this.chunkLoggerController?.downloadLogsBlobInBrowser&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{this.chunkLoggerController?.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}class i_{constructor({projectId:e,chainId:t,enableLogger:i=!0,onTimeout:r,abortController:n,getActiveCaipNetwork:s,getCaipNetworks:a,enableCloudAuthAccount:o,metadata:l,sdkVersion:c,sdkType:d}){this.openRpcRequests=new Map,this.isInitialized=!1,i&&(this.w3mLogger=new iA(e)),this.abortController=n,this.getActiveCaipNetwork=s,this.getCaipNetworks=a;const h=this.getRpcUrl(t);this.projectId=e,this.sdkVersion=c,this.sdkType=d,this.metadata=l,this.w3mFrame=new iE({projectId:e,isAppClient:!0,chainId:t,enableLogger:i,rpcUrl:h,enableCloudAuthAccount:o}),this.onTimeout=r,this.getLoginEmailUsed()&&this.createFrame()}async createFrame(){this.w3mFrame.initFrame(),this.initPromise=new Promise(e=>{this.w3mFrame.events.onFrameEvent(t=>{t.type===p.s1.FRAME_READY&&setTimeout(()=>{e()},500)})}),await this.initPromise,await this.syncDappData({metadata:this.metadata,projectId:this.projectId,sdkVersion:this.sdkVersion,sdkType:this.sdkType}
897),await this.getSmartAccountEnabledNetworks(),this.isInitialized=!0,this.initPromise=void 0}async init(){if(!this.isInitialized){if(this.initPromise)return void await this.initPromise;await this.createFrame()}}getLoginEmailUsed(){return!!iv.o.get(p.s1.EMAIL_LOGIN_USED_KEY)}getEmail(){return iv.o.get(p.s1.EMAIL)}getUsername(){return iv.o.get(p.s1.SOCIAL_USERNAME)}async reload(){try{await this.appEvent({type:p.s1.APP_RELOAD})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error reloading iframe"),e}}async connectEmail(e){try{f.Q.checkIfAllowedToTriggerEmail(),await this.init();let t=await this.appEvent({type:p.s1.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),t}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting email"),e}}async connectDevice(){try{return this.appEvent({type:p.s1.APP_CONNECT_DEVICE})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting device"),e}}async connectOtp(e){try{return this.appEvent({type:p.s1.APP_CONNECT_OTP,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting otp"),e}}async isConnected(){try{if(!this.getLoginEmailUsed())return{isConnected:!1};let e=await this.appEvent({type:p.s1.APP_IS_CONNECTED});return e?.isConnected||this.deleteAuthLoginCache(),e}catch(e){throw this.deleteAuthLoginCache(),this.w3mLogger?.logger.error({error:e},"Error checking connection"),e}}async getChainId(){try{let e=await this.appEvent({type:p.s1.APP_GET_CHAIN_ID});return this.setLastUsedChainId(e.chainId),e}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error getting chain id"),e}}async getSocialRedirectUri(e){try{return await this.init(),this.appEvent({type:p.s1.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error getting social redirect uri"),e}}async updateEmail(e){try{let t=await this.appEvent({type:p.s1.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),t}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error updating email"),e}}async updateEmailPrimaryOtp(e){try{return this.appEvent({type:p.s1.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error updating email primary otp"),e}}async updateEmailSecondaryOtp(e){try{let t=await this.appEvent({type:p.s1.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(t.newEmail),t}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error updating email secondary otp"),e}}async syncTheme(e){try{return this.appEvent({type:p.s1.APP_SYNC_THEME,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error syncing theme"),e}}async syncDappData(e){try{return this.appEvent({type:p.s1.APP_SYNC_DAPP_DATA,payload:e})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error syncing dapp data"),e}}async getSmartAccountEnabledNetworks(){try{let e=await this.appEvent({type:p.s1.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(e.smartAccountEnabledNetworks),e}catch(e){throw this.persistSmartAccountEnabledNetworks([]),this.w3mLogger?.logger.error({error:e},"Error getting smart account enabled networks"),e}}async setPreferredAccount(e){try{return this.appEvent({type:p.s1.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error setting preferred account"),e}}async connect(e){if(e?.socialUri)try{await this.init();let t=this.getRpcUrl(e.chainId),i=await this.appEvent({type:p.s1.APP_CONNECT_SOCIAL,payload:{uri:e.socialUri,preferredAccountType:e.preferredAccountType,chainId:e.chainId,siwxMessage:e.siwxMessage,rpcUrl:t}});return i.userName&&this.setSocialLoginSuccess(i.userName),this.setLoginSuccess(i.email),this.setLastUsedChainId(i.chainId),this.user=i,i}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting social"),e}try{let t=e?.chainId||this.getLastUsedChainId()||1,i=await this.getUser({chainId:t,preferredAccountType:e?.preferredAccountType,siwxMessage:e?.siwxMessage,rpcUrl:this.getRpcUrl(t)});
897return this.setLoginSuccess(i.email),this.setLastUsedChainId(i.chainId),this.user=i,i}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting"),e}}async getUser(e){try{await this.init();let t=e?.chainId||this.getLastUsedChainId()||1,i=await this.appEvent({type:p.s1.APP_GET_USER,payload:{...e,chainId:t,rpcUrl:this.getRpcUrl(t)}});return this.user=i,i}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting"),e}}async connectSocial({uri:e,chainId:t,preferredAccountType:i}){try{await this.init();let r=this.getRpcUrl(t),n=await this.appEvent({type:p.s1.APP_CONNECT_SOCIAL,payload:{uri:e,chainId:t,rpcUrl:r,preferredAccountType:i}});return n.userName&&this.setSocialLoginSuccess(n.userName),n}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting social"),e}}async getFarcasterUri(){try{return await this.init(),await this.appEvent({type:p.s1.APP_GET_FARCASTER_URI})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error getting farcaster uri"),e}}async connectFarcaster(){try{let e=await this.appEvent({type:p.s1.APP_CONNECT_FARCASTER});return e.userName&&this.setSocialLoginSuccess(e.userName),e}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error connecting farcaster"),e}}async switchNetwork({chainId:e}){try{let t=this.getRpcUrl(e),i=await this.appEvent({type:p.s1.APP_SWITCH_NETWORK,payload:{chainId:e,rpcUrl:t}});return this.setLastUsedChainId(i.chainId),i}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error switching network"),e}}async disconnect(){try{return this.deleteAuthLoginCache(),await new Promise(async e=>{let t=setTimeout(()=>{e()},3e3);await this.appEvent({type:p.s1.APP_SIGN_OUT}),clearTimeout(t),e()})}catch(e){throw this.w3mLogger?.logger.error({error:e},"Error disconnecting"),e}}async request(e){try{if(p.Vl.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();let t=e.chainNamespace||"eip155",i=this.getActiveCaipNetwork(t)?.id;e.chainNamespace=t,e.chainId=i,e.rpcUrl=this.getRpcUrl(i),this.rpcRequestHandler?.(e);let r=await this.appEvent({type:p.s1.APP_RPC_REQUEST,payload:e});return this.rpcSuccessHandler?.(r,e),r}catch(t){throw this.rpcErrorHandler?.(t,e),this.w3mLogger?.logger.error({error:t},"Error requesting"),t}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.s1.FRAME_IS_CONNECTED_SUCCESS&&t.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.s1.FRAME_IS_CONNECTED_ERROR&&e(),t.type!==p.s1.FRAME_IS_CONNECTED_SUCCESS||t.payload.isConnected||e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.s1.FRAME_GET_USER_SUCCESS&&e(t.payload)})}onSocialConnected(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.s1.FRAME_CONNECT_SOCIAL_SUCCESS&&e(t.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(t=>{t.type===p.s1.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(t.payload):t.type===p.s1.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:p.Vl.ACCOUNT_TYPES.EOA})})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}async rejectRpcRequests(){try{await Promise.all(Array.from(this.openRpcRequests.values()).map(async({abortController:e,method:t})=>{p.Vl.SAFE_RPC_METHODS.includes(t)||e.abort(),await this.appEvent({type:p.s1.APP_RPC_ABORT})})),this.openRpcRequests.clear()}catch(e){this.w3mLogger?.logger.error({error:e},"Error aborting RPC request")}}async appEvent(e){let t,i;function r(e){return e.replace("@w3m-app/","")}let n=[p.s1.APP_SYNC_DAPP_DATA,p.s1.APP_SYNC_THEME,p.s1.APP_SET_PREFERRED_ACCOUNT],s=r(e.type);return this.w3mFrame.iframeIsReady||n.includes(e.type)||(i=setTimeout(()=>{this.onTimeout?.("iframe_load_failed"),this.abortController.abort()},2e4)),await this.w3mFrame.frameLoadPromise,clearTimeout(i),[p.s1.APP_CONNECT_EMAIL,p.s1.APP_CONNECT_DEVICE,p.s1.APP_CONNECT_OTP,p.s1.APP_CONNECT_SOCIAL,p.s1.APP_GET_SOCIAL_REDIRECT_URI].map(r).includes(s)&&(t=setTimeout(()=>{this.onTimeout?.("iframe_request_timeout"),this.abortController.abort()},12e4)),new Promise((r,n)=>{let a=Math.random().toString(36).substring(7);this.w3mLogger?.logger.info?.({event:e,id:a},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:a});let o=new AbortController;"RPC_REQUEST"===s&&this.openRpcRequests.set(a,{...e.payload,abortController:o}),o.signal.addEventListener("abort",()=>{"RPC_REQUEST"===s?n(Error("Request was aborted")):"GET_FARCASTER_URI"!==s&&n(Error("Something went wrong"))});let l=(e,o)=>{e.id===a&&(o?.logger.info?.({framEvent:e,id:a},"Received frame response"),this.openRpcRequests.delete(e.id),e.type===`@w3m-frame/${s}_SUCCESS`?(t&&clearTimeout(t),i&&clearTimeout(i),"payload"in e&&r(e.payload),r(void 0)):e.type===`@w3m-frame/${s}_ERROR`&&(t&&clearTimeout(t),i&&clearTimeout(i),"payload"in e&&n(Error(e.payload?.message||"An error occurred")),n(Error("An error occurred"))))};this.w3mFrame.events.registerFrameEventHandler(a,e=>l(e,this.w3mLogger),this.abortController.signal)}
897)}setNewLastEmailLoginTime(){iv.o.set(p.s1.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){iv.o.set(p.s1.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&iv.o.set(p.s1.EMAIL,e),iv.o.set(p.s1.EMAIL_LOGIN_USED_KEY,"true"),iv.o.delete(p.s1.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){iv.o.delete(p.s1.EMAIL_LOGIN_USED_KEY),iv.o.delete(p.s1.EMAIL),iv.o.delete(p.s1.LAST_USED_CHAIN_KEY),iv.o.delete(p.s1.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&iv.o.set(p.s1.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){let e=iv.o.get(p.s1.LAST_USED_CHAIN_KEY)??void 0,t=Number(e);return isNaN(t)?e:t}persistSmartAccountEnabledNetworks(e){iv.o.set(p.s1.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}getRpcUrl(e){let t=void 0===e?void 0:"eip155";"string"==typeof e&&(t=e.includes(":")?h.C.parseCaipNetworkId(e)?.chainNamespace:Number.isInteger(Number(e))?"eip155":"solana");let i=this.getCaipNetworks(t),r=e?i.find(t=>String(t.id)===String(e)||t.caipNetworkId===e):i[0];return r?.rpcUrls.default.http?.[0]}}},25479:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});var r=i(34386);let n={ConnectorExplorerIds:{[r.o.CONNECTOR_ID.COINBASE]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[r.o.CONNECTOR_ID.COINBASE_SDK]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[r.o.CONNECTOR_ID.BASE_ACCOUNT]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[r.o.CONNECTOR_ID.SAFE]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[r.o.CONNECTOR_ID.LEDGER]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927",[r.o.CONNECTOR_ID.OKX]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[r.o.METMASK_CONNECTOR_NAME]:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",[r.o.TRUST_CONNECTOR_NAME]:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",[r.o.SOLFLARE_CONNECTOR_NAME]:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",[r.o.PHANTOM_CONNECTOR_NAME]:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",[r.o.COIN98_CONNECTOR_NAME]:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",[r.o.MAGIC_EDEN_CONNECTOR_NAME]:"8b830a2b724a9c3fbab63af6f55ed29c9dfa8a55e732dc88c80a196a2ba136c6",[r.o.BACKPACK_CONNECTOR_NAME]:"2bd8c14e035c2d48f184aaa168559e86b0e3433228d3c4075900a221785019b0",[r.o.BITGET_CONNECTOR_NAME]:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",[r.o.FRONTIER_CONNECTOR_NAME]:"85db431492aa2e8672e93f4ea7acf10c88b97b867b0d373107af63dc4880f041",[r.o.XVERSE_CONNECTOR_NAME]:"2a87d74ae02e10bdd1f51f7ce6c4e1cc53cd5f2c0b6b5ad0d7b3007d2b13de7b",[r.o.LEATHER_CONNECTOR_NAME]:"483afe1df1df63daf313109971ff3ef8356ddf1cc4e45877d205eee0b7893a13",[r.o.OKX_CONNECTOR_NAME]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[r.o.BINANCE_CONNECTOR_NAME]:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",0xaa36a7:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",0x4e454152:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200","00000008819873e925422c1ff0f99f7c":"b3406e4a-bbfc-44fb-e3a6-89673c78b700","-239":"20f673c0-095e-49b2-07cf-eb5049dcf600","-3":"20f673c0-095e-49b2-07cf-eb5049dcf600","0x2b6653dc":"3502bb86-cc4e-420f-a387-59ea63a28b00","0x94a9059e":"3502bb86-cc4e-420f-a387-59ea63a28b00","0xcd8690dc":"3502bb86-cc4e-420f-a387-59ea63a28b00"},ConnectorImageIds:{[r.o.CONNECTOR_ID.COINBASE]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[r.o.CONNECTOR_ID.COINBASE_SDK]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[r.o.CONNECTOR_ID.BASE_ACCOUNT]:"bba2c8be-7fd1-463e-42b1-796ecb0ad200",[r.o.CONNECTOR_ID.SAFE]:"461db637-8616-43ce-035a-d89b8a1d5800",[r.o.CONNECTOR_ID.LEDGER]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[r.o.CONNECTOR_ID.WALLET_CONNECT]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[r.o.CONNECTOR_ID.INJECTED]:"07ba87ed-43aa-4adf-454
8970-9e6a2b9cae00"},ConnectorNamesMap:{[r.o.CONNECTOR_ID.INJECTED]:"Browser Wallet",[r.o.CONNECTOR_ID.WALLET_CONNECT]:"WalletConnect",[r.o.CONNECTOR_ID.COINBASE]:"Coinbase",[r.o.CONNECTOR_ID.COINBASE_SDK]:"Coinbase",[r.o.CONNECTOR_ID.BASE_ACCOUNT]:"Base Account",[r.o.CONNECTOR_ID.LEDGER]:"Ledger",[r.o.CONNECTOR_ID.SAFE]:"Safe"},ConnectorTypesMap:{[r.o.CONNECTOR_ID.INJECTED]:"INJECTED",[r.o.CONNECTOR_ID.WALLET_CONNECT]:"WALLET_CONNECT",[r.o.CONNECTOR_ID.EIP6963]:"ANNOUNCED",[r.o.CONNECTOR_ID.AUTH]:"AUTH"},WalletConnectRpcChainIds:[1,5,0xaa36a7,10,420,42161,421613,137,80001,42220,0x4e454152,0x4e454153,56,97,43114,43113,100,8453,84531,7777777,999,324,280]}},25663:(e,t,i)=>{"use strict";i.d(t,{h:()=>c});var r=i(92679),n=i(3125),s=i(34386),a=i(51369),o=i(11403);let l=(0,r.BX)({message:"",variant:"info",open:!1}),c=(0,a.X)({state:l,subscribeKey:(e,t)=>(0,n.u$)(l,e,t),open(e,t){let{debug:i}=o.H.state,{code:r,displayMessage:n,debugMessage:a}=e;if(n&&i&&(l.message=n,l.variant=t,l.open=!0),a){if(!s.o.IS_DEVELOPMENT)return;let e="function"==typeof a?a():a,i=r?{code:r}:void 0;"error"===t?console.error(e,i):"warning"===t?console.warn(e,i):console.info(e,i)}},warn(e,t,i){l.open=!0,l.message=e,l.variant="warning",t&&console.warn(t,i)},close(){l.open=!1,l.message="",l.variant="info"}})},25739:(e,t,i)=>{"use strict";i(54623)},26400:(e,t,i)=>{"use strict";i(63270)},26478:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(88364);var s=i(94895),a=i(21736),o=i(69428),l=i(34175);let c=(0,l.AH)`
898  :host {
899    display: block;
900    width: var(--local-width);
901    height: var(--local-height);
902    border-radius: ${({borderRadius:e})=>e[16]};
903    overflow: hidden;
904    position: relative;
905  }
906
907  :host([data-variant='generated']) {
908    --mixed-local-color-1: var(--local-color-1);
909    --mixed-local-color-2: var(--local-color-2);
910    --mixed-local-color-3: var(--local-color-3);
911    --mixed-local-color-4: var(--local-color-4);
912    --mixed-local-color-5: var(--local-color-5);
913  }
914
915  :host([data-variant='generated']) {
916    background: radial-gradient(
917      var(--local-radial-circle),
918      #fff 0.52%,
919      var(--mixed-local-color-5) 31.25%,
920      var(--mixed-local-color-3) 51.56%,
921      var(--mixed-local-color-2) 65.63%,
922      var(--mixed-local-color-1) 82.29%,
923      var(--mixed-local-color-4) 100%
924    );
925  }
926
927  :host([data-variant='default']) {
928    background: radial-gradient(
929      75.29% 75.29% at 64.96% 24.36%,
930      #fff 0.52%,
931      #f5ccfc 31.25%,
932      #dba4f5 51.56%,
933      #9a8ee8 65.63%,
934      #6493da 82.29%,
935      #6ebdea 100%
936    );
937  }
938`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0,this.size="xl"}render(){let e={inherit:"inherit",xxs:"3",xs:"5",sm:"6",md:"8",mdl:"8",lg:"10",xl:"16",xxl:"20"};return this.style.cssText=`
939    --local-width: var(--apkt-spacing-${e[this.size??"xl"]});
940    --local-height: var(--apkt-spacing-${e[this.size??"xl"]});
941    `,(0,r.qy)`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",(0,r.qy)`<wui-image src=${this.imageSrc} alt=${this.alt??"avatar"}></wui-image>`;if(this.address){this.dataset.variant="generated";let e=a.Z.generateAvatarColors(this.address);return this.style.cssText+=`
942 ${e}`,null}return this.dataset.variant="default",null}};h.styles=[s.W5,c],d([(0,n.MZ)()],h.prototype,"imageSrc",void 0),d([(0,n.MZ)()],h.prototype,"alt",void 0),d([(0,n.MZ)()],h.prototype,"address",void 0),d([(0,n.MZ)()],h.prototype,"size",void 0),h=d([(0,o.E)("wui-avatar")],h)},27136:(e,t,i)=>{"use strict";i.d(t,{R:()=>u});var r=i(45795),n=i(15820),s=i(34386),a=i(5820),o=i(1024),l=i(13226);s.o.CONNECTOR_ID.COINBASE,s.o.CONNECTOR_ID.COINBASE_SDK,s.o.CONNECTOR_ID.BASE_ACCOUNT,s.o.CONNECTOR_ID.SAFE,s.o.CONNECTOR_ID.LEDGER,s.o.CONNECTOR_ID.OKX,l.o.METMASK_CONNECTOR_NAME,l.o.TRUST_CONNECTOR_NAME,l.o.SOLFLARE_CONNECTOR_NAME,l.o.PHANTOM_CONNECTOR_NAME,l.o.COIN98_CONNECTOR_NAME,l.o.MAGIC_EDEN_CONNECTOR_NAME,l.o.BACKPACK_CONNECTOR_NAME,l.o.BITGET_CONNECTOR_NAME,l.o.FRONTIER_CONNECTOR_NAME,l.o.XVERSE_CONNECTOR_NAME,l.o.LEATHER_CONNECTOR_NAME,l.o.OKX_CONNECTOR_NAME,l.o.BINANCE_CONNECTOR_NAME;let c={1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",0xaa36a7:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",0x4e454152:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200","00000008819873e925422c1ff0f99f7c":"b3406e4a-bbfc-44fb-e3a6-89673c78b700","-239":"20f673c0-095e-49b2-07cf-eb5049dcf600","-3":"20f673c0-095e-49b2-07cf-eb5049dcf600","0x2b6653dc":"3502bb86-cc4e-420f-a387-59ea63a28b00","0x94a9059e":"3502bb86-cc4e-420f-a387-59ea63a28b00","0xcd8690dc":"3502bb86-cc4e-420f-a387-59ea63a28b00"};function d(e,t){let i=new URL("https://rpc.walletconnect.org/v1/");return i.searchParams.set("chainId",e),i.searchParams.set("projectId",t),i.toString()}s.o.CONNECTOR_ID.COINBASE,s.o.CONNECTOR_ID.COINBASE_SDK,s.o.CONNECTOR_ID.BASE_ACCOUNT,s.o.CONNECTOR_ID.SAFE,s.o.CONNECTOR_ID.LEDGER,s.o.CONNECTOR_ID.WALLET_CONNECT,s.o.CONNECTOR_ID.INJECTED,s.o.CONNECTOR_ID.INJECTED,s.o.CONNECTOR_ID.WALLET_CONNECT,s.o.CONNECTOR_ID.COINBASE,s.o.CONNECTOR_ID.COINBASE_SDK,s.o.CONNECTOR_ID.BASE_ACCOUNT,s.o.CONNECTOR_ID.LEDGER,s.o.CONNECTOR_ID.SAFE,s.o.CONNECTOR_ID.INJECTED,s.o.CONNECTOR_ID.WALLET_CONNECT,s.o.CONNECTOR_ID.EIP6963,s.o.CONNECTOR_ID.AUTH,l.o.CONNECTOR_TYPE_AUTH;let h=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:
94256","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301","eip155:80094","eip155:80069","eip155:560048","eip155:31","eip155:2818","eip155:57054","eip155:911867","eip155:534351","eip155:1112","eip155:534352","eip155:1111","eip155:146","eip155:130","eip155:1284","eip155:30","eip155:2810","eip155:55931","bip122:000000000019d6689c085ae165831e93","bip122:000000000933ea01ad0ee984209779ba"],u={extendRpcUrlWithProjectId(e,t){let i=!1;try{i="rpc.walletconnect.org"===new URL(e).host}catch(e){i=!1}if(i){let i=new URL(e);return i.searchParams.has("projectId")||i.searchParams.set("projectId",t),i.toString()}return e},isCaipNetwork:e=>"chainNamespace"in e&&"caipNetworkId"in e,getChainNamespace(e){return this.isCaipNetwork(e)?e.chainNamespace:s.o.CHAIN.EVM},getCaipNetworkId(e){return this.isCaipNetwork(e)?e.caipNetworkId:`${s.o.CHAIN.EVM}:${e.id}`},getDefaultRpcUrl(e,t,i){let r=e.rpcUrls?.default?.http?.[0];return h.includes(t)?d(t,i):r||""},extendCaipNetwork(e,{customNetworkImageUrls:t,projectId:i,customRpcUrls:r}){let n=this.getChainNamespace(e),s=this.getCaipNetworkId(e),a=e.rpcUrls?.default?.http?.[0],o=this.getDefaultRpcUrl(e,s,i),l=e?.rpcUrls?.chainDefault?.http?.[0]||a,d=r?.[s]?.map(e=>e.url)||[],h=[...d,...o?[o]:[]],u=[...d];return l&&!u.includes(l)&&u.push(l),{...e,chainNamespace:n,caipNetworkId:s,assets:{imageId:c[e.id],imageUrl:t?.[e.id]},rpcUrls:{...e.rpcUrls,default:{http:h},chainDefault:{http:u}}}},extendCaipNetworks:(e,{customNetworkImageUrls:t,projectId:i,customRpcUrls:r})=>e.map(e=>u.extendCaipNetwork(e,{customNetworkImageUrls:t,customRpcUrls:r,projectId:i})),getViemTransport(e,t,i){let s=[];return i?.forEach(e=>{s.push((0,r.L)(e.url,e.config))}),h.includes(e.caipNetworkId)&&s.push((0,r.L)(d(e.caipNetworkId,t),{fetchOptions:{headers:{"Content-Type":"text/plain"}}})),e?.rpcUrls?.default?.http?.forEach(e=>{s.push((0,r.L)(e))}),(0,n.Np)(s)},extendWagmiTransports(e,t,i){if(h.includes(e.caipNetworkId)){let s=this.getDefaultRpcUrl(e,e.caipNetworkId,t);return(0,n.Np)([i,(0,r.L)(s)])}return i},getUnsupportedNetwork:e=>({id:e.split(":")[1],caipNetworkId:e,name:s.o.UNSUPPORTED_NETWORK_NAME,chainNamespace:e.split(":")[0],nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}}),getCaipNetworkFromStorage(e){let t=a.i.getActiveCaipNetworkId(),i=o.W.getAllRequestedCaipNetworks(),r=Array.from(o.W.state.chains?.keys()||[]),n=t?.split(":")[0],s=!!n&&r.includes(n),l=i?.find(e=>e.caipNetworkId===t);return s&&!l&&t?this.getUnsupportedNetwork(t):l||e||i?.[0]}}},27238:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},27510:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});var r=i(41463);let n={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(void 0!==r&&void 0!==r.env?r.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]}},27866:function(e){e.exports=function(){"use strict";var e="millisecond",t="second",i="minute",r="hour",n="week",s="month",a="quarter",o="year",l="date",c="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}
942|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=function(e,t,i){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(i)+e},p="en",f={};f[p]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}};var g="$isDayjsObject",m=function(e){return e instanceof v||!(!e||!e[g])},w=function e(t,i,r){var n;if(!t)return p;if("string"==typeof t){var s=t.toLowerCase();f[s]&&(n=s),i&&(f[s]=i,n=s);var a=t.split("-");if(!n&&a.length>1)return e(a[0])}else{var o=t.name;f[o]=t,n=o}return!r&&n&&(p=n),n||!r&&p},y=function(e,t){if(m(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new v(i)},b={s:u,z:function(e){var t=-e.utcOffset(),i=Math.abs(t);return(t<=0?"+":"-")+u(Math.floor(i/60),2,"0")+":"+u(i%60,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var r=12*(i.year()-t.year())+(i.month()-t.month()),n=t.clone().add(r,s),a=i-n<0,o=t.clone().add(r+(a?-1:1),s);return+(-(r+(i-n)/(a?n-o:o-n))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(c){return({M:s,y:o,w:n,d:"day",D:l,h:r,m:i,s:t,ms:e,Q:a})[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}};b.l=w,b.i=m,b.w=function(e,t){return y(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var v=function(){function u(e){this.$L=w(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[g]=!0}var p=u.prototype;return p.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(b.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(d);if(r){var n=r[2]-1||0,s=(r[7]||"0").substring(0,3);return i?new Date(Date.UTC(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],n,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(t)}(e),this.init()},p.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},p.$utils=function(){return b},p.isValid=function(){return this.$d.toString()!==c},p.isSame=function(e,t){var i=y(e);return this.startOf(t)<=i&&i<=this.endOf(t)},p.isAfter=function(e,t){return y(e)<this.startOf(t)},p.isBefore=function(e,t){return this.endOf(t)<y(e)},p.$g=function(e,t,i){return b.u(e)?this[t]:this.set(i,e)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(e,a){var c=this,d=!!b.u(a)||a,h=b.p(e),u=function(e,t){var i=b.w(c.$u?Date.UTC(c.$y,t,e):new Date(c.$y,t,e),c);return d?i:i.endOf("day")},p=function(e,t){return b.w(c.toDate()[e].apply(c.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(t)),c)},f=this.$W,g=this.$M,m=this.$D,w="set"+(this.$u?"UTC":"");switch(h){case o:return d?u(1,0):u(31,11);case s:return d?u(1,g):u(0,g+1);case n:var y=this.$locale().weekStart||0,v=(f<y?f+7:f)-y;return u(d?m-v:m+(6-v),g);case"day":case l:return p(w+"Hours",0);case r:return p(w+"Minutes",1);case i:return p(w+"Seconds",2);case t:return p(w+"Milliseconds",3);default:return this.clone()}},p.endOf=function(e){return this.startOf(e,!1)},p.$set=function(n,a){var c,d=b.p(n),h="set"+(this.$u?"UTC":""),u=((c={}).day=h+"Date",c[l]=h+"Date",c[s]=h+"Month",c[o]=h+"FullYear",c[r]=h+"Hours",c[i]=h+"Minutes",c[t]=h+"Seconds",c[e]=h+"Milliseconds",c)[d],p="day"===d?this.$D+(a-this.$W):a;if(d===s||d===o){var f=this.clone().set(l,1);f.$d[u](p),f.init(),this.$d=f.set(l,Math.min(this.$D,f.daysInMonth())).$d}else u&&this.$d[u](p);return this.init(),this},p.set=function(e,t){return this.clone().$set(e,t)},p.get=function(e){return this[b.p(e)]()},p.add=function(e,a){var l,c=this;e=Number(e);var d=b.p(a),h=function(t){var i=y(c);return b.w(i.date(i.date()+Math.round(t*e)),c)};if(d===s)return this.set(s,this.$M+e);if(d===o)return this.set(o,this.$y+e);if("day"===d)return h(1);if(d===n)return h(7);var u=((l={})[i]=6e4,l[r]=36e5,l[t]=1e3,l)[d]||1,p=this.$d.getTime()+e*u;return b.w(p,this)},p.subtract=function(e,t){return this.add(-1*e,t)},p.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||c;var r=e||"YYYY-MM-DDTHH:mm:ssZ",n=b.z(this),s=this.$H,a=this.$m,o=this.$M,l=i.weekdays,d=i.months,u=i.meridiem,p=function(e,i,n,s){return e&&(e[i]||e(t,r))||n[i].slice(0,s)},f=function(e){return b.s(s%12||12,e,"0")},g=u||function(e,t,i){var r=e<12?"AM":"PM";return i?r.toLowerCase():r};return r.replace(h,function(e,r){return r||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return b.s(t.$y,4,"0");case"M":return o+1;case"MM":return b.s(o+1,2,"0");case"MMM":return p(i.monthsShort,o,d,3);case"MMMM":return p(d,o);case"D":return t.$D;case"DD":return b.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(i.weekdaysMin,t.$W,l,2);case"ddd":return p(i.weekdaysShort,t.$W,l,3);case"dddd":return l[t.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return g(s,a,!0);case"A":return g(s,a,!1);case"m":return String(a);case"mm":return b.s(a,2,"0");case"s":return String(t.$s);case"ss":return b.s(t.$s,2,"0");case"SSS":return b.s(t.$ms,3,"0");case"Z":return n}return null}(e)||n.replace(":","")})},p.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},p.diff=function(e,l,c){var d,h=this,u=b.p(l),p=y(e),f=(p.utcOffset()-this.utcOffset())*6e4,g=this-p,m=function(){return b.m(h,p)};switch(u){case o:d=m()/12;break;case s:d=m();break;case a:d=m()/3;break;case n:d=(g-f)/6048e5;break;case"day":d=(g-f)/864e5;break;case r:d=g/36e5;break;case i:d=g/6e4;break;case t:d=g/1e3;break;default:d=g}return c?d:b.a(d)},p.daysInMonth=function(){return this.endOf(s).$D},p.$locale=function(){return f[this.$L]},p.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),r=w(e,t,!0);return r&&(i.$L=r),i},p.clone=function(){return b.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},u}(),C=v.prototype;return y.prototype=C,[["$ms",e],["$s",t],["$m",i],["$H",r],["$W","day"],["$M",s],["$y",o],["$D",l]].forEac
942h(function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),y.extend=function(e,t){return e.$i||(e(t,v,y),e.$i=!0),y},y.locale=w,y.isDayjs=m,y.unix=function(e){return y(1e3*e)},y.en=f[p],y.Ls=f,y.p={},y}()},29400:(e,t,i)=>{"use strict";i.d(t,{Db:()=>l,oU:()=>c,tM:()=>o});var r=i(34386),n=i(25479),s=i(41463);let a=(void 0!==s&&void 0!==s.env?s.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",o=[{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],l="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",c={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,FIVE_SEC_MS:5e3,THREE_SEC_MS:3e3,ONE_SEC_MS:1e3,SECURE_SITE:a,SECURE_SITE_DASHBOARD:`${a}/dashboard`,SECURE_SITE_FAVICON:`${a}/images/favicon.png`,SOLANA_NATIVE_TOKEN_ADDRESS:"So11111111111111111111111111111111111111111",RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SUGGESTED_TOKENS_BY_CHAIN:{"eip155:42161":["USD₮0"]},BALANCE_SUPPORTED_CHAINS:[r.o.CHAIN.EVM,r.o.CHAIN.SOLANA],SEND_PARAMS_SUPPORTED_CHAINS:[r.o.CHAIN.EVM],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:[r.o.CHAIN.EVM],ONRAMP_SUPPORTED_CHAIN_NAMESPACES:[r.o.CHAIN.EVM,r.o.CHAIN.SOLANA],PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES:[r.o.CHAIN.EVM,r.o.CHAIN.SOLANA],ACTIVITY_ENABLED_CHAIN_NAMESPACES:[r.o.CHAIN.EVM,r.o.CHAIN.TON],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x",bip122:"0x",cosmos:"0x",sui:"0x",stacks:"0x",ton:"0x",tron:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,CONNECT_LABELS:{MOBILE:"Open and continue in the wallet app",WEB:"Open and continue in the wallet app"},SEND_SUPPORTED_NAMESPACES:[r.o.CHAIN.EVM,r.o.CHAIN.SOLANA],DEFAULT_REMOTE_FEATURES:{swaps:["1inch"],onramp:["meld"],email:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],activity:!0,reownBranding:!0,multiWallet:!1,emailCapture:!1,payWithExchange:!1,payments:!1,reownAuthentication:!1,headless:!1},DEFAULT_REMOTE_FEATURES_DISABLED:{email:!1,socials:!1,swaps:!1,onramp:!1,activity:!1,reownBranding:!1,emailCapture:!1,reownAuthentication:!1,headless:!1},DEFAULT_FEATURES:{receive:!0,send:!0,emailShowWallets:!0,connectorTypeOrder:["walletConnect","recent","injected","featured","custom","external","recommended"],analytics:!0,allWallets:!0,legalCheckbox:!1,smartSessions:!1,collapseWallets:!1,walletFeaturesOrder:["onramp","swaps","receive","send"],connectMethodsOrder:void 0,pay:!1,reownAuthentication:!1,headless:!1},DEFAULT_SOCIALS:["google","x","farcaster","discord","apple","github","facebook"],DEFAULT_ACCOUNT_TYPES:{bip122:"payment",eip155:"smartAccount",polkadot:"eoa",solana:"eoa",ton:"eoa",tron:"eoa"},ADAPTER_TYPES:{UNIVERSAL:"universal",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",BITCOIN:"bitcoin"},SIWX_DEFAULTS:{signOutOnDisconnect:!0},MANDATORY_WALLET_IDS_ON_MOBILE:[n.L.ConnectorExplorerIds[r.o.CONNECTOR_ID.COINBASE],n.L.ConnectorExplorerIds[r.o.CONNECTOR_ID.COINBASE_SDK],n.L.ConnectorExplorerIds[r.o.CONNECTOR_ID.BASE_ACCOUNT],n.L.ConnectorExplorerIds[r.o.SOLFLARE_CONNECTOR_NAME],n.L.ConnectorExplorerIds[r.o.PHANTOM_CONNECTOR_NAME],n.L.ConnectorExplorerIds[r.o.BINANCE_CONNECTOR_NAME]],DEFAULT_CONNECT_METHOD_ORDER:["email","social","wallet"]}},29514:(e,t,i)=>{let r=i(30567),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function s(e){this.mode=r.ALPHANUMERIC,this.data=e}s.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let i=45*n.indexOf(this.data[t]);i+=n.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(n.indexOf(this.data[t]),6)},e.exports=s},29845:(e,t,i)=>{"use strict";
942Object.defineProperty(t,"__esModule",{value:!0});let r=i(83227);r.__exportStar(i(383),t),r.__exportStar(i(27238),t)},30567:(e,t,i)=>{let r=i(64717),n=i(74963);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw Error("Invalid mode: "+e);if(!r.isValid(t))throw Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,i){if(t.isValid(e))return e;try{if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw Error("Unknown mode: "+e)}}catch(e){return i}}},30840:(e,t,i)=>{"use strict";i.d(t,{C:()=>r});let r={validateCaipAddress(e){if(e.split(":")?.length!==3)throw Error("Invalid CAIP Address");return e},parseCaipAddress(e){let t=e.split(":");if(3!==t.length)throw Error(`Invalid CAIP-10 address: ${e}`);let[i,r,n]=t;if(!i||!r||!n)throw Error(`Invalid CAIP-10 address: ${e}`);return{chainNamespace:i,chainId:r,address:n}},parseCaipNetworkId(e){let t=e.split(":");if(2!==t.length)throw Error(`Invalid CAIP-2 network id: ${e}`);let[i,r]=t;if(!i||!r)throw Error(`Invalid CAIP-2 network id: ${e}`);return{chainNamespace:i,chainId:r}}}},31140:(e,t,i)=>{let r=i(66513),n=i(34817),s=i(43738),a=i(30567),o=i(64717),l=r.getBCHDigit(7973);function c(e,t){return a.getCharCountIndicator(e,t)+4}t.from=function(e,t){return o.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,i){if(!o.isValid(e))throw Error("Invalid QR Code version");void 0===i&&(i=a.BYTE);let s=(r.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,t))*8;if(i===a.MIXED)return s;let l=s-c(i,e);switch(i){case a.NUMERIC:return Math.floor(l/10*3);case a.ALPHANUMERIC:return Math.floor(l/11*2);case a.KANJI:return Math.floor(l/13);case a.BYTE:default:return Math.floor(l/8)}},t.getBestVersionForData=function(e,i){let r,n=s.from(i,s.M);if(Array.isArray(e)){if(e.length>1){for(let i=1;i<=40;i++)if(function(e,t){let i=0;return e.forEach(function(e){let r=c(e.mode,t);i+=r+e.getBitsLength()}),i}(e,i)<=t.getCapacity(i,n,a.MIXED))return i;return}if(0===e.length)return 1;r=e[0]}else r=e;return function(e,i,r){for(let n=1;n<=40;n++)if(i<=t.getCapacity(n,r,e))return n}(r.mode,r.getLength(),n)},t.getEncodedBits=function(e){if(!o.isValid(e)||e<7)throw Error("Invalid QR Code version");let t=e<<12;for(;r.getBCHDigit(t)-l>=0;)t^=7973<<r.getBCHDigit(t)-l;return e<<12|t}},31320:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});var r=i(88088);let n=(0,r.JW)`<svg  viewBox="0 0 48 54" fill="none">
943  <path
944    d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
945  />
946</svg>`},32297:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(40859);i(12936);var a=i(94895),o=i(69428);i(86212);var l=i(34175);let c=(0,l.AH)`
947  :host {
948    width: 100%;
949  }
950
951  button {
952    display: flex;
953    align-items: center;
954    justify-content: space-between;
955    padding: ${({spacing:e})=>e[3]};
956    width: 100%;
957    background-color: transparent;
958    border-radius: ${({borderRadius:e})=>e[4]};
959  }
960
961  wui-text {
962    text-transform: capitalize;
963  }
964
965  @media (hover: hover) {
966    button:hover:enabled {
967      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
968    }
969  }
970
971  button:disabled {
972    opacity: 0.5;
973    cursor: not-allowed;
974  }
975`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(...arguments),this.logo="google",this.name="Continue with google",this.disabled=!1}render(){return(0,r.qy)`
976      <button ?disabled=${this.disabled} tabindex=${(0,s.J)(this.tabIdx)}>
977        <wui-flex gap="2" alignItems="center">
978          <wui-image ?boxed=${!0} logo=${this.logo}></wui-image>
979          <wui-text variant="lg-regular" color="primary">${this.name}</wui-text>
980        </wui-flex>
981        <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
982      </button>
983    `}};h.styles=[a.W5,a.fD,c],d([(0,n.MZ)()],h.prototype,"logo",void 0),d([(0,n.MZ)()],h.prototype,"name",void 0),d([(0,n.MZ)()],h.prototype,"tabIdx",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"disabled",void 0),h=d([(0,o.E)("wui-list-social")],h)},32338:(e,t,i)=>{let r=i(66513),n=i(43738),s=i(37808),a=i(61975),o=i(65086),l=i(85291),c=i(53415),d=i(34817),h=i(54439),u=i(31140),p=i(53938),f=i(30567),g=i(70706);function m(e,t,i){let r,n,s=e.size,a=p.getEncodedBits(t,i);for(r=0;r<15;r++)n=(a>>r&1)==1,r<6?e.set(r,8,n,!0):r<8?e.set(r+1,8,n,!0):e.set(s-15+r,8,n,!0),r<8?e.set(8,s-r-1,n,!0):r
983<9?e.set(8,15-r-1+1,n,!0):e.set(8,15-r-1,n,!0);e.set(s-8,8,1,!0)}t.create=function(e,t){let i,p;if(void 0===e||""===e)throw Error("No input text");let w=n.M;return void 0!==t&&(w=n.from(t.errorCorrectionLevel,n.M),i=u.from(t.version),p=c.from(t.maskPattern),t.toSJISFunc&&r.setToSJISFunction(t.toSJISFunc)),function(e,t,i,n){let p;if(Array.isArray(e))p=g.fromArray(e);else if("string"==typeof e){let r=t;if(!r){let t=g.rawSplit(e);r=u.getBestVersionForData(t,i)}p=g.fromString(e,r||40)}else throw Error("Invalid data");let w=u.getBestVersionForData(p,i);if(!w)throw Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<w)throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+w+".\n")}else t=w;let y=function(e,t,i){let n=new s;i.forEach(function(t){n.put(t.mode.bit,4),n.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(n)});let a=(r.getSymbolTotalCodewords(e)-d.getTotalCodewordsCount(e,t))*8;for(n.getLengthInBits()+4<=a&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);let o=(a-n.getLengthInBits())/8;for(let e=0;e<o;e++)n.put(e%2?17:236,8);return function(e,t,i){let n,s,a=r.getSymbolTotalCodewords(t),o=a-d.getTotalCodewordsCount(t,i),l=d.getBlocksCount(t,i),c=a%l,u=l-c,p=Math.floor(a/l),f=Math.floor(o/l),g=f+1,m=p-f,w=new h(m),y=0,b=Array(l),v=Array(l),C=0,E=new Uint8Array(e.buffer);for(let e=0;e<l;e++){let t=e<u?f:g;b[e]=E.slice(y,y+t),v[e]=w.encode(b[e]),y+=t,C=Math.max(C,t)}let x=new Uint8Array(a),A=0;for(n=0;n<C;n++)for(s=0;s<l;s++)n<b[s].length&&(x[A++]=b[s][n]);for(n=0;n<m;n++)for(s=0;s<l;s++)x[A++]=v[s][n];return x}(n,e,t)}(t,i,p),b=new a(r.getSymbolSize(t));!function(e,t){let i=e.size,r=l.getPositions(t);for(let t=0;t<r.length;t++){let n=r[t][0],s=r[t][1];for(let t=-1;t<=7;t++)if(!(n+t<=-1)&&!(i<=n+t))for(let r=-1;r<=7;r++)s+r<=-1||i<=s+r||(t>=0&&t<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===t||6===t)||t>=2&&t<=4&&r>=2&&r<=4?e.set(n+t,s+r,!0,!0):e.set(n+t,s+r,!1,!0))}}(b,t);let v=b.size;for(let e=8;e<v-8;e++){let t=e%2==0;b.set(e,6,t,!0),b.set(6,e,t,!0)}return!function(e,t){let i=o.getPositions(t);for(let t=0;t<i.length;t++){let r=i[t][0],n=i[t][1];for(let t=-2;t<=2;t++)for(let i=-2;i<=2;i++)-2===t||2===t||-2===i||2===i||0===t&&0===i?e.set(r+t,n+i,!0,!0):e.set(r+t,n+i,!1,!0)}}(b,t),m(b,i,0),t>=7&&function(e,t){let i,r,n,s=e.size,a=u.getEncodedBits(t);for(let t=0;t<18;t++)i=Math.floor(t/3),r=t%3+s-8-3,n=(a>>t&1)==1,e.set(i,r,n,!0),e.set(r,i,n,!0)}(b,t),!function(e,t){let i=e.size,r=-1,n=i-1,s=7,a=0;for(let o=i-1;o>0;o-=2)for(6===o&&o--;;){for(let i=0;i<2;i++)if(!e.isReserved(n,o-i)){let r=!1;a<t.length&&(r=(t[a]>>>s&1)==1),e.set(n,o-i,r),-1==--s&&(a++,s=7)}if((n+=r)<0||i<=n){n-=r,r=-r;break}}}(b,y),isNaN(n)&&(n=c.getBestMask(b,m.bind(null,b,i))),c.applyMask(n,b),m(b,i,n),{modules:b,version:t,errorCorrectionLevel:i,maskPattern:n,segments:p}}(e,i,w,p)}},32535:(e,t,i)=>{"use strict";i.d(t,{Ai:()=>u,Hq:()=>h,JR:()=>f,OC:()=>p,tz:()=>d});let r=Symbol(),n=Symbol(),s=Object.getPrototypeOf,a=new WeakMap,o=e=>e&&(a.has(e)?a.get(e):s(e)===Object.prototype||s(e)===Array.prototype),l=e=>"object"==typeof e&&null!==e,c=e=>e[n]||e,d=(e,t,i,a)=>{if(!o(e))return e;let l=a&&a.get(e);if(!l){let t=c(e);l=Object.values(Object.getOwnPropertyDescriptors(t)).some(e=>!e.configurable&&!e.writable)?[t,(e=>{if(Array.isArray(e))return Array.from(e);let t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(e=>{e.configurable=!0}),Object.create(s(e),t)})(t)]:[t],null==a||a.set(e,l)}let[h,u]=l,p=i&&i.get(h);if(!p||!!u!==p[1].f){var f;let e,t,s,a;e={f:f=!!u},t=!1,s=(i,r)=>{if(!t){let t=e.a.get(h);if(t||(t={},e.a.set(h,t)),"w"===i)t.w=!0;else{let e=t[i];e||(e=new Set,t[i]=e),e.add(r)}}},a={get:(t,i)=>i===n?h:(s("k",i),d(Reflect.get(t,i),e.a,e.c,e.t)),has:(i,n)=>n===r?(t=!0,e.a.delete(h),!0):(s("h",n),Reflect.has(i,n)),getOwnPropertyDescriptor:(e,t)=>(s("o",t),Reflect.getOwnPropertyDescriptor(e,t)),ownKeys:e=>(s("w"),Reflect.ownKeys(e))},f&&(a.set=a.deleteProperty=()=>!1),(p=[a,e])[1].p=new Proxy(u||h,p[0]),i&&i.set(h,p)}return p[1].a=t,p[1].c=i,p[1].t=a,p[1].p},h=(e,t,i,r,n=Object.is)=>
983{if(n(e,t))return!1;if(!l(e)||!l(t))return!0;let s=i.get(c(e));if(!s)return!0;if(r){if(r.get(e)===t)return!1;r.set(e,t)}let a=null;for(let i of s.h||[])if(a=Reflect.has(e,i)!==Reflect.has(t,i))return a;if(!0===s.w){let i,r;if(i=Reflect.ownKeys(e),r=Reflect.ownKeys(t),a=i.length!==r.length||i.some((e,t)=>e!==r[t]))return a}else for(let i of s.o||[]){let r=!!Reflect.getOwnPropertyDescriptor(e,i);if(a=!!Reflect.getOwnPropertyDescriptor(t,i)!==r)return a}for(let o of s.k||[])if(a=h(e[o],t[o],i,r,n))return a;if(null===a)throw Error("invalid used");return a},u=e=>o(e)&&e[n]||null,p=(e,t=!0)=>{a.set(e,t)},f=(e,t,i)=>{let r=[],n=new WeakSet,s=(e,a)=>{var o,d,h;if(n.has(e))return;l(e)&&n.add(e);let u=l(e)&&t.get(c(e));if(u){if(null==(o=u.h)||o.forEach(e=>{let t=`:has(${String(e)})`;r.push(a?[...a,t]:[t])}),!0===u.w){let e=":ownKeys";r.push(a?[...a,e]:[e])}else null==(d=u.o)||d.forEach(e=>{let t=`:hasOwn(${String(e)})`;r.push(a?[...a,t]:[t])});null==(h=u.k)||h.forEach(t=>{(!i||"value"in(Object.getOwnPropertyDescriptor(e,t)||{}))&&s(e[t],a?[...a,t]:[t])})}else a&&r.push(a)};return s(e),r}},33452:(e,t,i)=>{"use strict";i.d(t,{K1:()=>s,NH:()=>a,kg:()=>l,lj:()=>o});var r=i(1024),n=i(29400);function s(){let e=r.W.state.activeCaipNetwork?.chainNamespace||"eip155",t=r.W.state.activeCaipNetwork?.id||1,i=n.oU.NATIVE_TOKEN_ADDRESS[e];return`${e}:${t}:${i}`}function a(e){return n.oU.NATIVE_TOKEN_ADDRESS[e]}function o(e){return r.W.getAccountData(e)?.preferredAccountType}function l(e){return e?r.W.state.chains.get(e)?.networkState?.caipNetwork:r.W.state.activeCaipNetwork}},33526:(e,t,i)=>{"use strict";i.d(t,{y:()=>o});var r=i(34386),n=i(11403),s=i(44458),a=i(27510);let o={getTabsByNamespace:e=>e&&e===r.o.CHAIN.EVM?n.H.state.remoteFeatures?.activity===!1?a.o.ACCOUNT_TABS.filter(e=>"Activity"!==e.label):a.o.ACCOUNT_TABS:[],isValidReownName:e=>/^[a-zA-Z0-9]+$/gu.test(e),isValidEmail:e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/gu.test(e),validateReownName:e=>e.replace(/\^/gu,"").toLowerCase().replace(/[^a-zA-Z0-9]/gu,""),hasFooter(){let e=s.I.state.view;if(a.o.VIEWS_WITH_LEGAL_FOOTER.includes(e)){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state,i=n.H.state.features?.legalCheckbox;return(!!e||!!t)&&!i}return a.o.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}}},34175:(e,t,i)=>{"use strict";i.d(t,{AH:()=>c,CV:()=>o,f:()=>l});var r=i(88088),n=i(1756);let s="--apkt";function a(e){if(!e)return{};let t={};return t["font-family"]=e["--apkt-font-family"]??e["--w3m-font-family"]??"KHTeka",t.accent=e["--apkt-accent"]??e["--w3m-accent"]??"#0988F0",t["color-mix"]=e["--apkt-color-mix"]??e["--w3m-color-mix"]??"#000",t["color-mix-strength"]=e["--apkt-color-mix-strength"]??e["--w3m-color-mix-strength"]??0,t["font-size-master"]=e["--apkt-font-size-master"]??e["--w3m-font-size-master"]??"10px",t["border-radius-master"]=e["--apkt-border-radius-master"]??e["--w3m-border-radius-master"]??"4px",void 0!==e["--apkt-z-index"]?t["z-index"]=e["--apkt-z-index"]:void 0!==e["--w3m-z-index"]&&(t["z-index"]=e["--w3m-z-index"]),t}let o={createCSSVariables(e){let t={},i={};return!function e(t,i,r=""){for(let[n,a]of Object.entries(t)){let t=r?`${r}-${n}`:n;a&&"object"==typeof a&&Object.keys(a).length?(i[n]={},e(a,i[n],t)):"string"==typeof a&&(i[n]=`${s}-${t}`)}}(e,t),!function e(t,i){for(let[r,n]of Object.entries(t))n&&"object"==typeof n?(i[r]={},e(n,i[r])):"string"==typeof n&&(i[r]=`var(${n})`)}(t,i),{cssVariables:t,cssVariablesVarPrefix:i}},assignCSSVariables(e,t){let i={};return!function e(t,r,n){for(let[a,o]of Object.entries(t)){let t=n?`${n}-${a}`:a,l=r[a];o&&"object"==typeof o?e(o,l,t):"string"==typeof l&&(i[`${s}-${t}`]=l)}}(e,t),i},createRootStyles(e,t){let i={...n.R7,tokens:{...n.R7.tokens,theme:"light"===e?n.LU.light:n.LU.dark}},{cssVariables:r}=o.createCSSVariables(i),s=o.assignCSSVariables(r,i),a=o.generateW3MVariables(t),l=o.generateW3MOverrides(t),c=o.generateScaledVariables(t),d=o.generateBaseVariables(s),h={...s,...d,...a,...l,...c},u=o.applyColorMixToVariables(t,h),p=Object.entries({...h,...u}).map(([e,t])=>`${e}:${t.replace("/[:;{}</>]/g","")};`).join("");return`:root {${p}}`},generateW3MVariables(e){if(!e)return{};let t=a(e),i={};return i["--w3m-font-family"]=t["font-family"],i["--w3m-accent"]=t.accent,i["--w3m-color-mix"]=t["color-mix"],i["--w3m-color-mix-strength"]=`${t["color-mix-strength"]}%`,i["--w3m-font-size-master"]=t["font-size-master"],i["--w3m-border-radius-master"]=t["border-radius-master"],i},generateW3MOverrides(e){if(!e)return{};let t=a(e),i={};if(e["--apkt-accent"]||e["--w3m-accent"]){let e=t.accent;i["--apkt-tokens-core-iconAccentPrimary"]=e,i["--apkt-tokens-core-borderAccentPrimary"]=e,i["--apkt-tokens-core-textAccentPrimary"]=e,i["--apkt-tokens-core-backgroundAccentPrimary"]=e}return(e["--apkt-font-family"]||e["--w3m-font-family"])&&(i["--apkt-fontFamily-regular"]=t["font-family"]),void 0!==t["z-index"]&&(i["--apkt-tokens-core-zIndex"]=`${t["z-index"]}`),i},generateScaledVariables(e){if(!e)return{};let t=a(e),i={};if(e["--apkt-font-size-master"]||e["--w3m-font-size-master"]){let e=parseFloat(t["font-size-master"].replace("px",""));i["--apkt-textSize-h1"]=`${5*Number(e)}px`,i["--apkt-textSize-h2"]=`${4.4*Number(e)}px`,i["--apkt-textSize-h3"]=`${3.8*Number(e)}px`,i["--apkt-textSize-h4"]=`${3.2*Number(e)}px`,i["--apkt-textSize-h5"]=`${2.6*Number(e)}px`,i["--apkt-textSize-h6"]=`${2*Number(e)}px`,i["--apkt-textSize-large"]=`${1.6*Number(e)}px`,i["--apkt-textSize-medium"]=`${1.4*Number(e)}px`,i["--apkt-textSize-small"]=`${1.2*Number(e)}px`}if(e["--apkt-border-radius-master"]||e["--w3m-border-radius-master"]){let e=parseFloat(t["border-radius-master"].replace("px",""));i["--apkt-borderRadius-1"]=`${Number(e)}px`,i["--apkt-borderRadius-2"]=`${2*Number(e)}px`,i["--apkt-borderRadius-3"]=`${3*Number(e)}px`,i["--apkt-borderRadius-4"]=`${4*Number(e)}px`,i["--apkt-borderRadius-5"]=`${5*Number(e)}px`,i["--apkt-borderRadius-6"]=`${6*Number(e)}px`,i["--apkt-borderRadius-8"]=`${8*Number(e)}px`,i["--apkt-borderRadius-16"]=`${16*Number(e)}px`,i["--apkt-borderRadius-20"]=`${20*Number(e)}px`,i["--apkt-borderRadius-32"]=`${32*Number(e)}px`,i["--apkt-borderRadius-64"]=`${64*Number(e)}px`,i["--apkt-borderRadius-128"]=`${128*Number(e)}px`}return i},generateColorMixCSS(e,t){if(!e?.["--w3m-color-mix"]||!e["--w3m-color-mix-strength"])return"";let i=e["--w3m-color-mix"],r=e["--w3m-color-mix-strength"];if(!r||0===r)return"";let n=Object.keys(t||{}).filter(e=>{let t=e.includes("-tokens-core-background")||e.includes("-tokens-core-text")||e.includes("-tokens-core-border")||e.includes("-tokens-core-foreground")||e.includes("-tokens-core-icon")||e.includes("-tokens-theme-background")||e.includes("-tokens-theme-text")||e.includes("-tokens-theme-border")||e.includes("-tokens-theme-foreground")||e.includes("-tokens-theme-icon"),i=e.includes("-borderRadius-")||e.includes("-spacing-")||e.includes("-textSize-")||e.includes("-fontFamily-")||e.includes("-fontWeight-")||e.includes("-typography-")||e.includes("-duration-")||e.includes("-ease-")||e.includes("-path-")||e.includes("-width-")||e.includes("-height-")||e.includes("-visual-size-")||e.includes("-modal-width")||e.includes("-cover");return t&&!i});if(0===n.length)return"";let s=n.map(e=>{let n=t?.[e]||"";return n.includes("color-mix")||n.startsWith("#")||n.startsWith("rgb")?`${e}: color-mix(in srgb, ${i} ${r}%, ${n});`:`${e}: color-mix(in srgb, ${i} ${r}%, var(${e}-base, ${n}));`}).join("");return` @supports (background: color-mix(in srgb, white 50%, black)) {
984      :root {
985        ${s}
986      }
987    }`},generateBaseVariables(e){let t={},i=e["--apkt-tokens-theme-backgroundPrimary"];i&&(t["--apkt-tokens-theme-backgroundPrimary-base"]=i);let r=e["--apkt-tokens-core-backgroundAccentPrimary"];return r&&(t["--apkt-tokens-core-backgroundAccentPrimary-base"]=r),t},applyColorMixToVariables(e,t){let i={};t?.["--apkt-tokens-theme-backgroundPrimary"]&&(i["--apkt-tokens-theme-backgroundPrimary"]="var(--apkt-tokens-theme-backgroundPrimary-base)"),t?.["--apkt-tokens-core-backgroundAccentPrimary"]&&(i["--apkt-tokens-core-backgroundAccentPrimary"]="var(--apkt-tokens-core-backgroundAccentPrimary-base)");let r=a(e),n=r["color-mix"],s=r["color-mix-strength"];if(!s||0===s)return i;let o=Object.keys(t||{}).filter(e=>{let t=e.includes("-tokens-core-background")||e.includes("-tokens-core-text")||e.includes("-tokens-core-border")||e.includes("-tokens-core-foreground")||e.includes("-tokens-core-icon")||e.includes("-tokens-theme-background")||e.includes("-tokens-theme-text")||e.includes("-tokens-theme-border")||e.includes("-tokens-theme-foreground")||e.includes("-tokens-theme-icon")||e.includes("-tokens-theme-overlay"),i=e.includes("-borderRadius-")||e.includes("-spacing-")||e.includes("-textSize-")||e.includes("-fontFamily-")||e.includes("-fontWeight-")||e.includes("-typography-")||e.includes("-duration-")||e.includes("-ease-")||e.includes("-path-")||e.includes("-width-")||e.includes("-height-")||e.includes("-visual-size-")||e.includes("-modal-width")||e.includes("-cover");return t&&!i});
987return 0===o.length||o.forEach(e=>{let r=t?.[e]||"";e.endsWith("-base")||("--apkt-tokens-theme-backgroundPrimary"===e||"--apkt-tokens-core-backgroundAccentPrimary"===e?i[e]=`color-mix(in srgb, ${n} ${s}%, var(${e}-base))`:r.includes("color-mix")||r.startsWith("#")||r.startsWith("rgb")?i[e]=`color-mix(in srgb, ${n} ${s}%, ${r})`:i[e]=`color-mix(in srgb, ${n} ${s}%, var(${e}-base, ${r}))`)}),i}},{cssVariablesVarPrefix:l}=o.createCSSVariables(n.R7);function c(e,...t){return(0,r.AH)(e,...t.map(e=>"function"==typeof e?(0,r.iz)(e(l)):(0,r.iz)(e)))}},34298:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let r=i(29845);t.toMiliseconds=function(e){return e*r.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/r.ONE_THOUSAND)}},34386:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});var r=i(41463);let n={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CONNECTOR_ID:{WALLET_CONNECT:"walletConnect",INJECTED:"injected",WALLET_STANDARD:"announced",COINBASE:"coinbaseWallet",COINBASE_SDK:"coinbaseWalletSDK",BASE_ACCOUNT:"baseAccount",SAFE:"safe",LEDGER:"ledger",OKX:"okx",EIP6963:"eip6963",AUTH:"AUTH"},CONNECTOR_NAMES:{AUTH:"Auth"},AUTH_CONNECTOR_SUPPORTED_CHAINS:["eip155","solana"],LIMITS:{PENDING_TRANSACTIONS:99},CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot",BITCOIN:"bip122",TON:"ton",TRON:"tron"}
987,CHAIN_NAME_MAP:{eip155:"EVM Networks",solana:"Solana",polkadot:"Polkadot",bip122:"Bitcoin",cosmos:"Cosmos",sui:"Sui",stacks:"Stacks",ton:"TON",tron:"TRON"},ADAPTER_TYPES:{BITCOIN:"bitcoin",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",TON:"ton",TRON:"tron"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"],SOLANA_SPL_TOKEN_ADDRESSES:{SOL:"So11111111111111111111111111111111111111112"},NATIVE_IMAGE_IDS_BY_NAMESPACE:{eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"3e8119e5-2a6f-4818-c50c-1937011d5900",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00"},TOKEN_SYMBOLS_BY_ADDRESS:{"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48":"USDC","0x833589fcd6edb6e08f4c7c32d4f71b54bda02913":"USDC","0x0b2c639c533813f4aa9d7837caf62653d097ff85":"USDC","0xaf88d065e77c8cc2239327c5edb3a432268e5831":"USDC","0x3c499c542cef5e3811e1192ce70d8cc03d5c3359":"USDC","0x2791bca1f2de4661ed88a30c99a7a9449aa84174":"USDC",EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:"USDC","0xdac17f958d2ee523a2206206994597c13d831ec7":"USDT","0x94b008aa00579c1307b0ef2c499ad98a8ce58e58":"USDT","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9":"USDT","0xc2132d05d31c914a87c6611c10748aeb04b58e8f":"USDT",Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB:"USDT"},HTTP_STATUS_CODES:{SERVER_ERROR:500,TOO_MANY_REQUESTS:429,SERVICE_UNAVAILABLE:503,FORBIDDEN:403},UNSUPPORTED_NETWORK_NAME:"Unknown Network",SECURE_SITE_SDK_ORIGIN:(void 0!==r&&void 0!==r.env?r.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",REMOTE_FEATURES_ALERTS:{MULTI_WALLET_NOT_ENABLED:{DEFAULT:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com."},CONNECTIONS_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnections hook."},CONNECTION_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnection hook."}},HEADLESS_NOT_ENABLED:{DEFAULT:{displayMessage:"",debugMessage:"Headless support is not enabled. Please enable it with the features.headless option in the AppKit configuration and make sure your current plan supports it."}}},IS_DEVELOPMENT:void 0!==r&&!1,DEFAULT_ALLOWED_ANCESTORS:["http://localhost:*","https://localhost:*","http://127.0.0.1:*","https://127.0.0.1:*","https://*.pages.dev","https://*.vercel.app","https://*.ngrok-free.app","https://secure-mobile.walletconnect.com","https://secure-mobile.walletconnect.org"],METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",OKX_CONNECTOR_NAME:"OKX Wallet",BINANCE_CONNECTOR_NAME:"Binance Wallet",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"AUTH"}},34817:(e,t,i)=>{let r=i(43738),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],s=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,
987192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case r.L:return n[(e-1)*4+0];case r.M:return n[(e-1)*4+1];case r.Q:return n[(e-1)*4+2];case r.H:return n[(e-1)*4+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case r.L:return s[(e-1)*4+0];case r.M:return s[(e-1)*4+1];case r.Q:return s[(e-1)*4+2];case r.H:return s[(e-1)*4+3];default:return}}},35787:(e,t,i)=>{"use strict";i(20903)},36198:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AppKitAccountButton:()=>x,AppKitButton:()=>N,AppKitConnectButton:()=>U,AppKitNetworkButton:()=>q,W3mAccountButton:()=>E,W3mAccountSettingsView:()=>ea,W3mAccountView:()=>eF,W3mAllWalletsView:()=>tP,W3mButton:()=>S,W3mChooseAccountNameView:()=>iW,W3mConnectButton:()=>$,W3mConnectView:()=>t9,W3mConnectWalletsView:()=>iK,W3mConnectingExternalView:()=>iu,W3mConnectingMultiChainView:()=>im,W3mConnectingWcBasicView:()=>iU,W3mConnectingWcView:()=>iP,W3mDownloadsView:()=>iB,W3mFooter:()=>V.H,W3mFundWalletView:()=>ti,W3mGetWalletView:()=>ij,W3mNetworkButton:()=>H,W3mNetworkSwitchView:()=>i0,W3mNetworksView:()=>i8,W3mProfileWalletsView:()=>te,W3mRouter:()=>z.J,W3mSIWXSignMessageView:()=>ry,W3mSwitchActiveChainView:()=>rt,W3mUnsupportedChainView:()=>ra,W3mWalletCompatibleNetworksView:()=>rh,W3mWhatIsANetworkView:()=>rr,W3mWhatIsAWalletView:()=>iz});var r=i(88088),n=i(53227),s=i(40859),a=i(11403),o=i(1024),l=i(76581),c=i(48789),d=i(37056),h=i(24568),u=i(59306);i(82016),i(88364),i(84915),i(12936),i(47002);var p=i(94895),f=i(21736),g=i(69428);i(26478);var m=i(34175);let w=(0,m.AH)`
988  :host {
989    display: block;
990  }
991
992  button {
993    border-radius: ${({borderRadius:e})=>e["20"]};
994    background: ${({tokens:e})=>e.theme.foregroundPrimary};
995    display: flex;
996    gap: ${({spacing:e})=>e[1]};
997    padding: ${({spacing:e})=>e[1]};
998    color: ${({tokens:e})=>e.theme.textSecondary};
999    border-radius: ${({borderRadius:e})=>e[16]};
1000    height: 32px;
1001    transition: box-shadow ${({durations:e})=>e.lg}
1002      ${({easings:e})=>e["ease-out-power-2"]};
1003    will-change: box-shadow;
1004  }
1005
1006  button wui-flex.avatar-container {
1007    width: 28px;
1008    height: 24px;
1009    position: relative;
1010
1011    wui-flex.network-image-container {
1012      position: absolute;
1013      bottom: 0px;
1014      right: 0px;
1015      width: 12px;
1016      height: 12px;
1017    }
1018
1019    wui-flex.network-image-container wui-icon {
1020      background: ${({tokens:e})=>e.theme.foregroundPrimary};
1021    }
1022
1023    wui-avatar {
1024      width: 24px;
1025      min-width: 24px;
1026      height: 24px;
1027    }
1028
1029    wui-icon {
1030      width: 12px;
1031      height: 12px;
1032    }
1033  }
1034
1035  wui-image,
1036  wui-icon {
1037    border-radius: ${({borderRadius:e})=>e[16]};
1038  }
1039
1040  wui-text {
1041    white-space: nowrap;
1042  }
1043
1044  button wui-flex.balance-container {
1045    height: 100%;
1046    border-radius: ${({borderRadius:e})=>e[16]};
1047    padding-left: ${({spacing:e})=>e[1]};
1048    padding-right: ${({spacing:e})=>e[1]};
1049    background: ${({tokens:e})=>e.theme.foregroundSecondary};
1050    color: ${({tokens:e})=>e.theme.textPrimary};
1051    transition: background-color ${({durations:e})=>e.lg}
1052      ${({easings:e})=>e["ease-out-power-2"]};
1053    will-change: background-color;
1054  }
1055
1056  /* -- Hover & Active states ----------------------------------------------------------- */
1057  button:hover:enabled,
1058  button:focus-visible:enabled,
1059  button:active:enabled {
1060    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.2);
1061
1062    wui-flex.balance-container {
1063      background: ${({tokens:e})=>e.theme.foregroundTertiary};
1064    }
1065  }
1066
1067  /* -- Disabled states --------------------------------------------------- */
1068  button:disabled wui-text,
1069  button:disabled wui-flex.avatar-container {
1070    opacity: 0.3;
1071  }
1072`;var y=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let b=class extends r.WF{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.loading=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return(0,r.qy)`
1073      <button
1074        ?disabled=${this.disabled}
1075        class=${(0,s.J)(this.balance?void 0:"local-no-balance")}
1076        data-error=${(0,s.J)(this.isUnsupportedChain)}
1077      >
1078        ${this.imageTemplate()} ${this.addressTemplate()} ${this.balanceTemplate()}
1079      </button>
1080    `}imageTemplate(){let e=this.networkSrc?(0,r.qy)`<wui-image src=${this.networkSrc}></wui-image>`:(0,r.qy)` <wui-icon size="inherit" color="inherit" name="networkPlaceholder"></wui-icon> `;return(0,r.qy)`<wui-flex class="avatar-container">
1081      <wui-avatar
1082        .imageSrc=${this.avatarSrc}
1083        alt=${this.address}
1084        address=${this.address}
1085      ></wui-avatar>
1086
1087      <wui-flex class="network-image-container">${e}</wui-flex>
1088    </wui-flex>`}addressTemplate(){return(0,r.qy)`<wui-text variant="md-regular" color="inherit">
1089      ${this.address?f.Z.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null}
1090    </wui-text>`}balanceTemplate(){if(this.balance){let e=this.loading?(0,r.qy)`<wui-loading-spinner size="md" color="inherit"></wui-loading-spinner>`:(0,r.qy)`<wui-text variant="md-regular" color="inherit"> ${this.balance}</wui-text>`;return(0,r.qy)`<wui-flex alignItems="center" justifyContent="center" class="balance-container"
1091        >${e}</wui-flex
1092      >`}return null}};b.styles=[p.W5,p.fD,w],y([(0,n.MZ)()],b.prototype,"networkSrc",void 0),y([(0,n.MZ)()],b.prototype,"avatarSrc",void 0),y([(0,n.MZ)()],b.prototype,"balance",void 0),y([(0,n.MZ)({type:Boolean})],b.prototype,"isUnsupportedChain",void 0),y([(0,n.MZ)({type:Boolean})],b.prototype,"disabled",void 0),y([(0,n.MZ)({type:Boolean})],b.prototype,"loading",void 0),y([(0,n.MZ)()],b.prototype,"address",void 0),y([(0,n.MZ)()],b.prototype,"profileName",void 0),y([(0,n.MZ)()],b.prototype,"charsStart",void 0),y([(0,n.MZ)()],b.prototype,"charsEnd",void 0),b=y([(0,g.E)("wui-account-button")],b);var v=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class C extends r.WF{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.namespace=void 0,this.isSupported=!!a.H.state.allowUnsupportedChain||!o.W.state.activeChain||o.W.checkIfSupportedNetwork(o.W.state.activeChain)}connectedCallback(){super.connectedCallback(),this.setAccountData(o.W.getAccountData(this.namespace)),this.setNetworkData(o.W.getNetworkData(this.namespace))}firstUpdated(){let e=this.namespace;e?this.unsubscribe.push(o.W.subscribeChainProp("accountState",e=>{this.setAccountData(e)},e),o.W.subscribeChainProp("networkState",t=>{this.setNetworkData(t),this.isSupported=o.W.checkIfSupportedNetwork(e,t?.caipNetwork?.caipNetworkId)},e)):this.unsubscribe.push(l.j.subscribeNetworkImages(()=>{this.networkImage=c.$.getNetworkImage(this.network)}),o.W.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),o.W.subscribeChainProp("accountState",e=>{this.setAccountData(e)}),o.W.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=c.$.getNetworkImage(e),this.isSupported=!e?.chainNamespace||o.W.checkIfSupportedNetwork(e?.chainNamespace),this.fetchNetworkImage(e)}))}updated(){this.fetchNetworkImage(this.network)}
1092disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!o.W.state.activeChain)return null;let e="show"===this.balance,t="string"!=typeof this.balanceVal,{formattedText:i}=d.w.parseBalance(this.balanceVal,this.balanceSymbol);return(0,r.qy)`
1093      <wui-account-button
1094        .disabled=${!!this.disabled}
1095        .isUnsupportedChain=${!a.H.state.allowUnsupportedChain&&!this.isSupported}
1096        address=${(0,s.J)(d.w.getPlainAddress(this.caipAddress))}
1097        profileName=${(0,s.J)(this.profileName)}
1098        networkSrc=${(0,s.J)(this.networkImage)}
1099        avatarSrc=${(0,s.J)(this.profileImage)}
1100        balance=${e?i:""}
1101        @click=${this.onClick.bind(this)}
1102        data-testid=${`account-button${this.namespace?`-${this.namespace}`:""}`}
1103        .charsStart=${this.charsStart}
1104        .charsEnd=${this.charsEnd}
1105        ?loading=${t}
1106      >
1107      </wui-account-button>
1108    `}onClick(){this.isSupported||a.H.state.allowUnsupportedChain?h.W.open({namespace:this.namespace}):h.W.open({view:"UnsupportedChain"})}async fetchNetworkImage(e){e?.assets?.imageId&&(this.networkImage=await c.$.fetchNetworkImage(e?.assets?.imageId))}setAccountData(e){e&&(this.caipAddress=e.caipAddress,this.balanceVal=e.balance,this.balanceSymbol=e.balanceSymbol,this.profileName=e.profileName,this.profileImage=e.profileImage)}setNetworkData(e){e&&(this.network=e.caipNetwork,this.networkImage=c.$.getNetworkImage(e.caipNetwork))}}v([(0,n.MZ)({type:Boolean})],C.prototype,"disabled",void 0),v([(0,n.MZ)()],C.prototype,"balance",void 0),v([(0,n.MZ)()],C.prototype,"charsStart",void 0),v([(0,n.MZ)()],C.prototype,"charsEnd",void 0),v([(0,n.MZ)()],C.prototype,"namespace",void 0),v([(0,n.wk)()],C.prototype,"caipAddress",void 0),v([(0,n.wk)()],C.prototype,"balanceVal",void 0),v([(0,n.wk)()],C.prototype,"balanceSymbol",void 0),v([(0,n.wk)()],C.prototype,"profileName",void 0),v([(0,n.wk)()],C.prototype,"profileImage",void 0),v([(0,n.wk)()],C.prototype,"network",void 0),v([(0,n.wk)()],C.prototype,"networkImage",void 0),v([(0,n.wk)()],C.prototype,"isSupported",void 0);let E=class extends C{};E=v([(0,u.EM)("w3m-account-button")],E);let x=class extends C{};x=v([(0,u.EM)("appkit-account-button")],x);let A=(0,r.AH)`
1109  :host {
1110    display: block;
1111    width: max-content;
1112  }
1113`;var _=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class I extends r.WF{constructor(){super(...arguments),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.namespace=void 0}firstUpdated(){this.caipAddress=this.namespace?o.W.getAccountData(this.namespace)?.caipAddress:o.W.state.activeCaipAddress,this.namespace?this.unsubscribe.push(o.W.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress},this.namespace)):this.unsubscribe.push(o.W.subscribeKey("activeCaipAddress",e=>this.caipAddress=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.caipAddress?(0,r.qy)`
1114          <appkit-account-button
1115            .disabled=${!!this.disabled}
1116            balance=${(0,s.J)(this.balance)}
1117            .charsStart=${(0,s.J)(this.charsStart)}
1118            .charsEnd=${(0,s.J)(this.charsEnd)}
1119            namespace=${(0,s.J)(this.namespace)}
1120          >
1121          </appkit-account-button>
1122        `:(0,r.qy)`
1123          <appkit-connect-button
1124            size=${(0,s.J)(this.size)}
1125            label=${(0,s.J)(this.label)}
1126            loadingLabel=${(0,s.J)(this.loadingLabel)}
1127            namespace=${(0,s.J)(this.namespace)}
1128          ></appkit-connect-button>
1129        `}}I.styles=A,_([(0,n.MZ)({type:Boolean})],I.prototype,"disabled",void 0),_([(0,n.MZ)()],I.prototype,"balance",void 0),_([(0,n.MZ)()],I.prototype,"size",void 0),_([(0,n.MZ)()],I.prototype,"label",void 0),_([(0,n.MZ)()],I.prototype,"loadingLabel",void 0),_([(0,n.MZ)()],I.prototype,"charsStart",void 0),_([(0,n.MZ)()],I.prototype,"charsEnd",void 0),_([(0,n.MZ)()],I.prototype,"namespace",void 0),_([(0,n.wk)()],I.prototype,"caipAddress",void 0);let S=class extends I{};S=_([(0,u.EM)("w3m-button")],S);let N=class extends I{};N=_([(0,u.EM)("appkit-button")],N);let k=(0,m.AH)`
1130  :host {
1131    position: relative;
1132    display: block;
1133  }
1134
1135  button {
1136    border-radius: ${({borderRadius:e})=>e[2]};
1137  }
1138
1139  button[data-size='sm'] {
1140    padding: ${({spacing:e})=>e[2]};
1141  }
1142
1143  button[data-size='md'] {
1144    padding: ${({spacing:e})=>e[3]};
1145  }
1146
1147  button[data-size='lg'] {
1148    padding: ${({spacing:e})=>e[4]};
1149  }
1150
1151  button[data-variant='primary'] {
1152    background: ${({tokens:e})=>e.core.backgroundAccentPrimary};
1153  }
1154
1155  button[data-variant='secondary'] {
1156    background: ${({tokens:e})=>e.core.foregroundAccent010};
1157  }
1158
1159  button:hover:enabled {
1160    border-radius: ${({borderRadius:e})=>e[3]};
1161  }
1162
1163  button:disabled {
1164    cursor: not-allowed;
1165  }
1166
1167  button[data-loading='true'] {
1168    cursor: not-allowed;
1169  }
1170
1171  button[data-loading='true'][data-size='sm'] {
1172    border-radius: ${({borderRadius:e})=>e[32]};
1173    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]};
1174  }
1175
1176  button[data-loading='true'][data-size='md'] {
1177    border-radius: ${({borderRadius:e})=>e[20]};
1178    padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[4]};
1179  }
1180
1181  button[data-loading='true'][data-size='lg'] {
1182    border-radius: ${({borderRadius:e})=>e[16]};
1183    padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[5]};
1184  }
1185`;var T=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let O=class extends r.WF{constructor(){super(...arguments),this.size="md",this.variant="primary",this.loading=!1,this.text="Connect Wallet"}render(){return(0,r.qy)`
1186      <button
1187        data-loading=${this.loading}
1188        data-variant=${this.variant}
1189        data-size=${this.size}
1190        ?disabled=${this.loading}
1191      >
1192        ${this.contentTemplate()}
1193      </button>
1194    `}contentTemplate(){let e={primary:"invert",secondary:"accent-primary"};return this.loading?(0,r.qy)`<wui-loading-spinner
1195      color=${e[this.variant]}
1196      size=${this.size}
1197    ></wui-loading-spinner>`:(0,r.qy)` <wui-text variant=${({lg:"lg-regular",md:"md-regular",sm:"sm-regular"})[this.size]} color=${e[this.variant]}>
1198        ${this.text}
1199      </wui-text>`}};O.styles=[p.W5,p.fD,k],T([(0,n.MZ)()],O.prototype,"size",void 0),T([(0,n.MZ)()],O.prototype,"variant",void 0),T([(0,n.MZ)({type:Boolean})],O.prototype,"loading",void 0),T([(0,n.MZ)()],O.prototype,"text",void 0),O=T([(0,g.E)("wui-connect-button")],O);var R=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class P extends r.WF{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=h.W.state.open,this.loading=this.namespace?h.W.state.loadingNamespaceMap.get(this.namespace):h.W.state.loading,this.unsubscribe.push(h.W.subscribe(e=>{this.open=e.open,this.loading=this.namespace?e.loadingNamespaceMap.get(this.namespace):e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,r.qy)`
1200      <wui-connect-button
1201        size=${(0,s.J)(this.size)}
1202        .loading=${this.loading}
1203        @click=${this.onClick.bind(this)}
1204        data-testid=${`connect-button${this.namespace?`-${this.namespace}`:""}`}
1205      >
1206        ${this.loading?this.loadingLabel:this.label}
1207      </wui-connect-button>
1208    `}onClick(){this.open?h.W.close():this.loading||h.W.open({view:"Connect",namespace:this.namespace})}}R([(0,n.MZ)()],P.prototype,"size",void 0),R([(0,n.MZ)()],P.prototype,"label",void 0),R([(0,n.MZ)()],P.prototype,"loadingLabel",void 0),R([(0,n.MZ)()],P.prototype,"namespace",void 0),R([(0,n.wk)()],P.prototype,"open",void 0),R([(0,n.wk)()],P.prototype,"loading",void 0);let $=class extends P{};$=R([(0,u.EM)("w3m-connect-button")],$);let U=class extends P{};U=R([(0,u.EM)("appkit-connect-button")],U);var M=i(43242);i(15642);let D=(0,m.AH)`
1209  :host {
1210    display: block;
1211  }
1212
1213  button {
1214    border-radius: ${({borderRadius:e})=>e[32]};
1215    display: flex;
1216    gap: ${({spacing:e})=>e[1]};
1217    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]}
1218      ${({spacing:e})=>e[1]} ${({spacing:e})=>e[1]};
1219    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1220  }
1221
1222  button:disabled {
1223    opacity: 0.5;
1224    cursor: not-allowed;
1225  }
1226
1227  @media (hover: hover) {
1228    button:hover:enabled {
1229      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1230    }
1231  }
1232
1233  button[data-size='sm'] > wui-icon-box,
1234  button[data-size='sm'] > wui-image {
1235    width: 16px;
1236    height: 16px;
1237  }
1238
1239  button[data-size='md'] > wui-icon-box,
1240  button[data-size='md'] > wui-image {
1241    width: 20px;
1242    height: 20px;
1243  }
1244
1245  button[data-size='lg'] > wui-icon-box,
1246  button[data-size='lg'] > wui-image {
1247    width: 24px;
1248    height: 24px;
1249  }
1250
1251  wui-image,
1252  wui-icon-box {
1253    border-radius: ${({borderRadius:e})=>e[32]};
1254  }
1255`;var L=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let W=class extends r.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.size="lg"}render(){return(0,r.qy)`
1256      <button data-size=${this.size} data-testid="wui-network-button" ?disabled=${this.disabled}>
1257        ${this.visualTemplate()}
1258        <wui-text variant=${({sm:"sm-regular",md:"md-regular",lg:"lg-regular"})[this.size]} color="primary">
1259          <slot></slot>
1260        </wui-text>
1261      </button>
1262    `}visualTemplate(){return this.isUnsupportedChain?(0,r.qy)` <wui-icon-box color="error" icon="warningCircle"></wui-icon-box> `:this.imageSrc?(0,r.qy)`<wui-image src=${this.imageSrc}></wui-image>`:(0,r.qy)` <wui-icon size="xl" color="default" name="networkPlaceholder"></wui-icon> `}};W.styles=[p.W5,p.fD,D],L([(0,n.MZ)()],W.prototype,"imageSrc",void 0),L([(0,n.MZ)({type:Boolean})],W.prototype,"isUnsupportedChain",void 0),L([(0,n.MZ)({type:Boolean})],W.prototype,"disabled",void 0),L([(0,n.MZ)()],W.prototype,"size",void 0),W=L([(0,g.E)("wui-network-button")],W);let B=(0,r.AH)`
1263  :host {
1264    display: block;
1265    width: max-content;
1266  }
1267`;var j=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class F extends r.WF{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=o.W.state.activeCaipNetwork,this.networkImage=c.$.getNetworkImage(this.network),this.caipAddress=o.W.state.activeCaipAddress,this.loading=h.W.state.loading,this.isSupported=!!a.H.state.allowUnsupportedChain||!o.W.state.activeChain||o.W.checkIfSupportedNetwork(o.W.state.activeChain),this.unsubscribe.push(l.j.subscribeNetworkImages(()=>{this.networkImage=c.$.getNetworkImage(this.network)}),o.W.subscribeKey("activeCaipAddress",e=>{this.caipAddress=e}),o.W.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=c.$.getNetworkImage(e),this.isSupported=!e?.chainNamespace||o.W.checkIfSupportedNetwork(e.chainNamespace),c.$.fetchNetworkImage(e?.assets?.imageId)}),h.W.subscribeKey("loading",e=>this.loading=e))}firstUpdated(){c.$.fetchNetworkImage(this.network?.assets?.imageId)}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=!this.network||o.W.checkIfSupportedNetwork(this.network.chainNamespace);return(0,r.qy)`
1268      <wui-network-button
1269        .disabled=${!!(this.disabled||this.loading)}
1270        .isUnsupportedChain=${!a.H.state.allowUnsupportedChain&&!e}
1271        imageSrc=${(0,s.J)(this.networkImage)}
1272        @click=${this.onClick.bind(this)}
1273        data-testid="w3m-network-button"
1274      >
1275        ${this.getLabel()}
1276        <slot></slot>
1277      </wui-network-button>
1278    `}getLabel(){return this.network?this.isSupported||a.H.state.allowUnsupportedChain?this.network.name:"Switch Network":this.label?this.label:this.caipAddress?"Unknown Network":"Select Network"}onClick(){this.loading||(M.E.sendEvent({type:"track",event:"CLICK_NETWORKS"}),h.W.open({view:"Networks"}))}}F.styles=B,j([(0,n.MZ)({type:Boolean})],F.prototype,"disabled",void 0),j([(0,n.MZ)({type:String})],F.prototype,"label",void 0),j([(0,n.wk)()],F.prototype,"network",void 0),j([(0,n.wk)()],F.prototype,"networkImage",void 0),j([(0,n.wk)()],F.prototype,"caipAddress",void 0),j([(0,n.wk)()],F.prototype,"loading",void 0),j([(0,n.wk)()],F.prototype,"isSupported",void 0);let H=class extends F{};H=j([(0,u.EM)("w3m-network-button")],H);let q=class extends F{};q=j([(0,u.EM)("appkit-network-button")],q);var z=i(94796),V=i(42854),Z=i(34386),K=i(11446),G=i(29400),Y=i(44963),J=i(44458),X=i(60319);i(74970),i(35787),i(61327),i(82989);let Q=(0,m.AH)`
1279  :host {
1280    display: block;
1281  }
1282
1283  button {
1284    width: 100%;
1285    display: flex;
1286    align-items: center;
1287    justify-content: space-between;
1288    gap: ${({spacing:e})=>e[4]};
1289    padding: ${({spacing:e})=>e[3]};
1290    border-radius: ${({borderRadius:e})=>e[4]};
1291    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
1292  }
1293
1294  wui-flex > wui-icon {
1295    padding: ${({spacing:e})=>e[2]};
1296    color: ${({tokens:e})=>e.theme.textInvert};
1297    background-color: ${({tokens:e})=>e.core.backgroundAccentPrimary};
1298    border-radius: ${({borderRadius:e})=>e[2]};
1299    align-items: center;
1300  }
1301
1302  @media (hover: hover) {
1303    button:hover:enabled {
1304      background-color: ${({tokens:e})=>e.core.foregroundAccent020};
1305    }
1306  }
1307`;var ee=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let et=class extends r.WF{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return(0,r.qy)`
1308      <button>
1309        <wui-flex gap="2" alignItems="center">
1310          <wui-icon weight="fill" size="lg" name=${this.icon} color="inherit"></wui-icon>
1311          <wui-flex flexDirection="column" gap="1">
1312            <wui-text variant="md-medium" color="primary">${this.label}</wui-text>
1313            <wui-text variant="md-regular" color="tertiary">${this.description}</wui-text>
1314          </wui-flex>
1315        </wui-flex>
1316        <wui-icon size="lg" color="accent-primary" name="chevronRight"></wui-icon>
1317      </button>
1318    `}};et.styles=[p.W5,p.fD,Q],ee([(0,n.MZ)()],et.prototype,"label",void 0),ee([(0,n.MZ)()],et.prototype,"description",void 0),ee([(0,n.MZ)()],et.prototype,"icon",void 0),et=ee([(0,g.E)("wui-notice-card")],et),i(3658);var ei=i(5820),er=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let en=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.socialProvider=ei.i.getConnectedSocialProvider(),this.socialUsername=ei.i.getConnectedSocialUsername(),this.namespace=o.W.state.activeChain,this.unsubscribe.push(o.W.subscribeKey("activeChain",e=>{this.namespace=e}))}
1318disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=K.a.getConnectorId(this.namespace),t=K.a.getAuthConnector();if(!t||e!==Z.o.CONNECTOR_ID.AUTH)return this.style.cssText="display: none",null;let i=t.provider.getEmail()??"";return i||this.socialUsername?(0,r.qy)`
1319      <wui-list-item
1320        ?rounded=${!0}
1321        icon=${this.socialProvider??"mail"}
1322        data-testid="w3m-account-email-update"
1323        ?chevron=${!this.socialProvider}
1324        @click=${()=>{this.onGoToUpdateEmail(i,this.socialProvider)}}
1325      >
1326        <wui-text variant="lg-regular" color="primary">${this.getAuthName(i)}</wui-text>
1327      </wui-list-item>
1328    `:(this.style.cssText="display: none",null)}onGoToUpdateEmail(e,t){t||J.I.push("UpdateEmailWallet",{email:e,redirectView:"Account"})}getAuthName(e){return this.socialUsername?"discord"===this.socialProvider&&this.socialUsername.endsWith("0")?this.socialUsername.slice(0,-1):this.socialUsername:e.length>30?`${e.slice(0,-3)}...`:e}};er([(0,n.wk)()],en.prototype,"namespace",void 0),en=er([(0,u.EM)("w3m-account-auth-button")],en);var es=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let ea=class extends r.WF{constructor(){super(),this.usubscribe=[],this.networkImages=l.j.state.networkImages,this.address=o.W.getAccountData()?.address,this.profileImage=o.W.getAccountData()?.profileImage,this.profileName=o.W.getAccountData()?.profileName,this.network=o.W.state.activeCaipNetwork,this.disconnecting=!1,this.remoteFeatures=a.H.state.remoteFeatures,this.usubscribe.push(o.W.subscribeChainProp("accountState",e=>{e&&(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName)}),o.W.subscribeKey("activeCaipNetwork",e=>{e?.id&&(this.network=e)}),a.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){if(!this.address)throw Error("w3m-account-settings-view: No account provided");let e=this.networkImages[this.network?.assets?.imageId??""];return(0,r.qy)`
1329      <wui-flex
1330        flexDirection="column"
1331        alignItems="center"
1332        gap="4"
1333        .padding=${["0","5","3","5"]}
1334      >
1335        <wui-avatar
1336          alt=${this.address}
1337          address=${this.address}
1338          imageSrc=${(0,s.J)(this.profileImage)}
1339          size="lg"
1340        ></wui-avatar>
1341        <wui-flex flexDirection="column" alignItems="center">
1342          <wui-flex gap="1" alignItems="center" justifyContent="center">
1343            <wui-text variant="h5-medium" color="primary" data-testid="account-settings-address">
1344              ${u.Zv.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
1345            </wui-text>
1346            <wui-icon-link
1347              size="md"
1348              icon="copy"
1349              iconColor="default"
1350              @click=${this.onCopyAddress}
1351            ></wui-icon-link>
1352          </wui-flex>
1353        </wui-flex>
1354      </wui-flex>
1355      <wui-flex flexDirection="column" gap="4">
1356        <wui-flex flexDirection="column" gap="2" .padding=${["6","4","3","4"]}>
1357          ${this.authCardTemplate()}
1358          <w3m-account-auth-button></w3m-account-auth-button>
1359          <wui-list-item
1360            imageSrc=${(0,s.J)(e)}
1361            ?chevron=${this.isAllowedNetworkSwitch()}
1362            ?fullSize=${!0}
1363            ?rounded=${!0}
1364            @click=${this.onNetworks.bind(this)}
1365            data-testid="account-switch-network-button"
1366          >
1367            <wui-text variant="lg-regular" color="primary">
1368              ${this.network?.name??"Unknown"}
1369            </wui-text>
1370          </wui-list-item>
1371          ${this.smartAccountSettingsTemplate()} ${this.chooseNameButtonTemplate()}
1372          <wui-list-item
1373            ?rounded=${!0}
1374            icon="power"
1375            iconColor="error"
1376            ?chevron=${!1}
1377            .loading=${this.disconnecting}
1378            @click=${this.onDisconnect.bind(this)}
1379            data-testid="disconnect-button"
1380          >
1381            <wui-text variant="lg-regular" color="primary">Disconnect</wui-text>
1382          </wui-list-item>
1383        </wui-flex>
1384      </wui-flex>
1385    `}chooseNameButtonTemplate(){let e=this.network?.chainNamespace,t=K.a.getConnectorId(e),i=K.a.getAuthConnector();return o.W.checkIfNamesSupported()&&i&&t===Z.o.CONNECTOR_ID.AUTH&&!this.profileName?(0,r.qy)`
1386      <wui-list-item
1387        icon="id"
1388        ?rounded=${!0}
1389        ?chevron=${!0}
1390        @click=${this.onChooseName.bind(this)}
1391        data-testid="account-choose-name-button"
1392      >
1393        <wui-text variant="lg-regular" color="primary">Choose account name </wui-text>
1394      </wui-list-item>
1395    `:null}authCardTemplate(){let e=K.a.getConnectorId(this.network?.chainNamespace),t=K.a.getAuthConnector(),{origin:i}=location;return!t||e!==Z.o.CONNECTOR_ID.AUTH||i.includes(G.oU.SECURE_SITE)?null:(0,r.qy)`
1396      <wui-notice-card
1397        @click=${this.onGoToUpgradeView.bind(this)}
1398        label="Upgrade your wallet"
1399        description="Transition to a self-custodial wallet"
1400        icon="wallet"
1401        data-testid="w3m-wallet-upgrade-card"
1402      ></wui-notice-card>
1403    `}isAllowedNetworkSwitch(){let e=o.W.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,i=e?.find(({id:e})=>e===this.network?.id);return t||!i}onCopyAddress(){try{this.address&&(d.w.copyToClopboard(this.address),Y.P.showSuccess("Address copied"))}catch{Y.P.showError("Failed to copy")}}smartAccountSettingsTemplate(){let e=this.network?.chainNamespace,t=o.W.checkIfSmartAccountEnabled(),i=K.a.getConnectorId(e);return K.a.getAuthConnector()&&i===Z.o.CONNECTOR_ID.AUTH&&t?(0,r.qy)`
1404      <wui-list-item
1405        icon="user"
1406        ?rounded=${!0}
1407        ?chevron=${!0}
1408        @click=${this.onSmartAccountSettings.bind(this)}
1409        data-testid="account-smart-account-settings-button"
1410      >
1411        <wui-text variant="lg-regular" color="primary">Smart Account Settings</wui-text>
1412      </wui-list-item>
1413    `:null}onChooseName(){J.I.push("ChooseAccountName")}onNetworks(){this.isAllowedNetworkSwitch()&&J.I.push("Networks")}async onDisconnect(){try{this.disconnecting=!0;let e=this.network?.chainNamespace,t=X.x.getConnections(e).length>0,i=e&&K.a.state.activeConnectorIds[e],r=this.remoteFeatures?.multiWallet;await X.x.disconnect(r?{id:i,namespace:e}:{}),t&&r&&(J.I.push("ProfileWallets"),Y.P.showSuccess("Wallet deleted"))}catch{M.E.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),Y.P.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){M.E.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),J.I.push("UpgradeEmailWallet")}onSmartAccountSettings(){J.I.push("SmartAccountSettings")}};es([(0,n.wk)()],ea.prototype,"address",void 0),es([(0,n.wk)()],ea.prototype,"profileImage",void 0),es([(0,n.wk)()],ea.prototype,"profileName",void 0),es([(0,n.wk)()],ea.prototype,"network",void 0),es([(0,n.wk)()],ea.prototype,"disconnecting",void 0),es([(0,n.wk)()],ea.prototype,"remoteFeatures",void 0),ea=es([(0,u.EM)("w3m-account-settings-view")],ea);var eo=i(83366),el=i(33452);i(66449),i(94548);let ec=(0,m.AH)`
1414  :host {
1415    flex: 1;
1416    height: 100%;
1417  }
1418
1419  button {
1420    width: 100%;
1421    height: 100%;
1422    display: inline-flex;
1423    align-items: center;
1424    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
1425    column-gap: ${({spacing:e})=>e[1]};
1426    color: ${({tokens:e})=>e.theme.textSecondary};
1427    border-radius: ${({borderRadius:e})=>e[20]};
1428    background-color: transparent;
1429    transition: background-color ${({durations:e})=>e.lg}
1430      ${({easings:e})=>e["ease-out-power-2"]};
1431    will-change: background-color;
1432  }
1433
1434  /* -- Hover & Active states ----------------------------------------------------------- */
1435  button[data-active='true'] {
1436    color: ${({tokens:e})=>e.theme.textPrimary};
1437    background-color: ${({tokens:e})=>e.theme.foregroundTertiary};
1438  }
1439
1440  button:hover:enabled:not([data-active='true']),
1441  button:active:enabled:not([data-active='true']) {
1442    wui-text,
1443    wui-icon {
1444      color: ${({tokens:e})=>e.theme.textPrimary};
1445    }
1446  }
1447`;var ed=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let eh={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},eu={lg:"md",md:"sm",sm:"sm"},ep=class extends r.WF{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return(0,r.qy)`
1448      <button data-active=${this.active}>
1449        ${this.icon?(0,r.qy)`<wui-icon size=${eu[this.size]} name=${this.icon}></wui-icon>`:""}
1450        <wui-text variant=${eh[this.size]}> ${this.label} </wui-text>
1451      </button>
1452    `}};ep.styles=[p.W5,p.fD,ec],ed([(0,n.MZ)()],ep.prototype,"icon",void 0),ed([(0,n.MZ)()],ep.prototype,"size",void 0),ed([(0,n.MZ)()],ep.prototype,"label",void 0),ed([(0,n.MZ)({type:Boolean})],ep.prototype,"active",void 0),ep=ed([(0,g.E)("wui-tab-item")],ep);let ef=(0,m.AH)`
1453  :host {
1454    display: inline-flex;
1455    align-items: center;
1456    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1457    border-radius: ${({borderRadius:e})=>e[32]};
1458    padding: ${({spacing:e})=>e["01"]};
1459    box-sizing: border-box;
1460  }
1461
1462  :host([data-size='sm']) {
1463    height: 26px;
1464  }
1465
1466  :host([data-size='md']) {
1467    height: 36px;
1468  }
1469`;var eg=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let em=class extends r.WF{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map((e,t)=>{let i=t===this.activeTab;return(0,r.qy)`
1470        <wui-tab-item
1471          @click=${()=>this.onTabClick(t)}
1472          icon=${e.icon}
1473          size=${this.size}
1474          label=${e.label}
1475          ?active=${i}
1476          data-active=${i}
1477          data-testid="tab-${e.label?.toLowerCase()}"
1478        ></wui-tab-item>
1479      `})}onTabClick(e){this.activeTab=e,this.onTabChange(e)}};em.styles=[p.W5,p.fD,ef],eg([(0,n.MZ)({type:Array})],em.prototype,"tabs",void 0),eg([(0,n.MZ)()],em.prototype,"onTabChange",void 0),eg([(0,n.MZ)()],em.prototype,"size",void 0),eg([(0,n.wk)()],em.prototype,"activeTab",void 0),em=eg([(0,g.E)("wui-tabs")],em),i(25739),i(94392);var ew=i(67066);let ey=(0,u.AH)`
1480  wui-icon-link {
1481    margin-right: calc(${({spacing:e})=>e["8"]} * -1);
1482  }
1483
1484  wui-notice-card {
1485    margin-bottom: ${({spacing:e})=>e["1"]};
1486  }
1487
1488  wui-list-item > wui-text {
1489    flex: 1;
1490  }
1491
1492  w3m-transactions-view {
1493    max-height: 200px;
1494  }
1495
1496  .balance-container {
1497    display: inline;
1498  }
1499
1500  .tab-content-container {
1501    height: 300px;
1502    overflow-y: auto;
1503    overflow-x: hidden;
1504    scrollbar-width: none;
1505  }
1506
1507  .symbol {
1508    transform: translateY(-2px);
1509  }
1510
1511  .tab-content-container::-webkit-scrollbar {
1512    display: none;
1513  }
1514
1515  .account-button {
1516    width: auto;
1517    border: none;
1518    display: flex;
1519    align-items: center;
1520    justify-content: center;
1521    gap: ${({spacing:e})=>e["3"]};
1522    height: 48px;
1523    padding: ${({spacing:e})=>e["2"]};
1524    padding-right: ${({spacing:e})=>e["3"]};
1525    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
1526    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1527    border-radius: ${({borderRadius:e})=>e[6]};
1528    transition: background-color ${({durations:e})=>e.lg}
1529      ${({easings:e})=>e["ease-out-power-2"]};
1530  }
1531
1532  .account-button:hover {
1533    background-color: ${({tokens:e})=>e.core.glass010};
1534  }
1535
1536  .avatar-container {
1537    position: relative;
1538  }
1539
1540  wui-avatar.avatar {
1541    width: 32px;
1542    height: 32px;
1543    box-shadow: 0 0 0 2px ${({tokens:e})=>e.core.glass010};
1544  }
1545
1546  wui-wallet-switch {
1547    margin-top: ${({spacing:e})=>e["2"]};
1548  }
1549
1550  wui-avatar.network-avatar {
1551    width: 16px;
1552    height: 16px;
1553    position: absolute;
1554    left: 100%;
1555    top: 100%;
1556    transform: translate(-75%, -75%);
1557    box-shadow: 0 0 0 2px ${({tokens:e})=>e.core.glass010};
1558  }
1559
1560  .account-links {
1561    display: flex;
1562    justify-content: space-between;
1563    align-items: center;
1564  }
1565
1566  .account-links wui-flex {
1567    cursor: pointer;
1568    display: flex;
1569    align-items: center;
1570    justify-content: center;
1571    flex: 1;
1572    background: red;
1573    align-items: center;
1574    justify-content: center;
1575    height: 48px;
1576    padding: 10px;
1577    flex: 1 0 0;
1578    border-radius: var(--XS, 16px);
1579    border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
1580    background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
1581    transition:
1582      background-color ${({durations:e})=>e.md}
1583        ${({easings:e})=>e["ease-out-power-1"]},
1584      opacity ${({durations:e})=>e.md} ${({easings:e})=>e["ease-out-power-1"]};
1585    will-change: background-color, opacity;
1586  }
1587
1588  .account-links wui-flex:hover {
1589    background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
1590  }
1591
1592  .account-links wui-flex wui-icon {
1593    width: var(--S, 20px);
1594    height: var(--S, 20px);
1595  }
1596
1597  .account-links wui-flex wui-icon svg path {
1598    stroke: #667dff;
1599  }
1600`;var eb=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let ev=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.caipAddress=o.W.getAccountData()?.caipAddress,this.address=d.w.getPlainAddress(o.W.getAccountData()?.caipAddress),this.profileImage=o.W.getAccountData()?.profileImage,this.profileName=o.W.getAccountData()?.profileName,this.disconnecting=!1,this.balance=o.W.getAccountData()?.balance,this.balanceSymbol=o.W.getAccountData()?.balanceSymbol,this.features=a.H.state.features,this.remoteFeatures=a.H.state.remoteFeatures,this.namespace=o.W.state.activeChain,this.activeConnectorIds=K.a.state.activeConnectorIds,this.unsubscribe.push(o.W.subscribeChainProp("accountState",e=>{this.address=d.w.getPlainAddress(e?.caipAddress),this.caipAddress=e?.caipAddress,this.balance=e?.balance,this.balanceSymbol=e?.balanceSymbol,this.profileName=e?.profileName,this.profileImage=e?.profileImage}),a.H.subscribeKey("features",e=>this.features=e),a.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),K.a.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),o.W.subscribeKey("activeChain",e=>this.namespace=e),o.W.subscribeKey("activeCaipNetwork",e=>{e?.chainNamespace&&(this.namespace=e?.chainNamespace)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.caipAddress||!this.namespace)return null;let e=this.activeConnectorIds[this.namespace],t=e?K.a.getConnectorById(e):void 0,i=c.$.getConnectorImage(t),{value:n,decimals:a,symbol:o}=d.w.parseBalance(this.balance,this.balanceSymbol);return(0,r.qy)`<wui-flex
1601        flexDirection="column"
1602        .padding=${["0","5","4","5"]}
1603        alignItems="center"
1604        gap="3"
1605      >
1606        <wui-avatar
1607          alt=${(0,s.J)(this.caipAddress)}
1608          address=${(0,s.J)(d.w.getPlainAddress(this.caipAddress))}
1609          imageSrc=${(0,s.J)(null===this.profileImage?void 0:this.profileImage)}
1610          data-testid="single-account-avatar"
1611        ></wui-avatar>
1612        <wui-wallet-switch
1613          profileName=${this.profileName}
1614          address=${this.address}
1615          imageSrc=${i}
1616          alt=${t?.name}
1617          @click=${this.onGoToProfileWalletsView.bind(this)}
1618          data-testid="wui-wallet-switch"
1619        ></wui-wallet-switch>
1620        <div class="balance-container">
1621          <wui-text variant="h3-regular" color="primary">${n}</wui-text>
1622          <wui-text variant="h3-regular" color="secondary">.${a}</wui-text>
1623          <wui-text variant="h6-medium" color="primary" class="symbol">${o}</wui-text>
1624        </div>
1625        ${this.explorerBtnTemplate()}
1626      </wui-flex>
1627
1628      <wui-flex flexDirection="column" gap="2" .padding=${["0","3","3","3"]}>
1629        ${this.authCardTemplate()} <w3m-account-auth-button></w3m-account-auth-button>
1630        ${this.orderedFeaturesTemplate()} ${this.activityTemplate()}
1631        <wui-list-item
1632          .rounded=${!0}
1633          icon="power"
1634          iconColor="error"
1635          ?chevron=${!1}
1636          .loading=${this.disconnecting}
1637          .rightIcon=${!1}
1638          @click=${this.onDisconnect.bind(this)}
1639          data-testid="disconnect-button"
1640        >
1641          <wui-text variant="lg-regular" color="primary">Disconnect</wui-text>
1642        </wui-list-item>
1643      </wui-flex>`}fundWalletTemplate(){if(!this.namespace)return null;let e=G.oU.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),t=!!this.features?.receive,i=this.remoteFeatures?.onramp&&e,n=eo.g.isPayWithExchangeEnabled();return i||t||n?(0,r.qy)`
1644      <wui-list-item
1645        .rounded=${!0}
1646        data-testid="w3m-account-default-fund-wallet-button"
1647        iconVariant="blue"
1648        icon="dollar"
1649        ?chevron=${!0}
1650        @click=${this.handleClickFundWallet.bind(this)}
1651      >
1652        <wui-text variant="lg-regular" color="primary">Fund wallet</wui-text>
1653      </wui-list-item>
1654    `:null}orderedFeaturesTemplate(){return(this.features?.walletFeaturesOrder||G.oU.DEFAULT_FEATURES.walletFeaturesOrder).map(e=>{switch(e){case"onramp":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}activityTemplate(){return this.namespace&&this.remoteFeatures?.activity&&G.oU.ACTIVITY_ENABLED_CHAIN_NAMESPACES.includes(this.namespace)?(0,r.qy)` <wui-list-item
1655          .rounded=${!0}
1656          icon="clock"
1657          ?chevron=${!0}
1658          @click=${this.onTransactions.bind(this)}
1659          data-testid="w3m-account-default-activity-button"
1660        >
1661          <wui-text variant="lg-regular" color="primary">Activity</wui-text>
1662        </wui-list-item>`:null}swapsTemplate(){let e=this.remoteFeatures?.swaps,t=o.W.state.activeChain===Z.o.CHAIN.EVM;return e&&t?(0,r.qy)`
1663      <wui-list-item
1664        .rounded=${!0}
1665        icon="recycleHorizontal"
1666        ?chevron=${!0}
1667        @click=${this.handleClickSwap.bind(this)}
1668        data-testid="w3m-account-default-swaps-button"
1669      >
1670        <wui-text variant="lg-regular" color="primary">Swap</wui-text>
1671      </wui-list-item>
1672    `:null}sendTemplate(){let e=this.features?.send,t=o.W.state.activeChain;if(!t)throw Error("SendController:sendTemplate - namespace is required");let i=G.oU.SEND_SUPPORTED_NAMESPACES.includes(t);return e&&i?(0,r.qy)`
1673      <wui-list-item
1674        .rounded=${!0}
1675        icon="send"
1676        ?chevron=${!0}
1677        @click=${this.handleClickSend.bind(this)}
1678        data-testid="w3m-account-default-send-button"
1679      >
1680        <wui-text variant="lg-regular" color="primary">Send</wui-text>
1681      </wui-list-item>
1682    `:null}authCardTemplate(){let e=o.W.state.activeChain;if(!e)throw Error("AuthCardTemplate:authCardTemplate - namespace is required");let t=K.a.getConnectorId(e),i=K.a.getAuthConnector(),{origin:n}=location;return!i||t!==Z.o.CONNECTOR_ID.AUTH||n.includes(G.oU.SECURE_SITE)?null:(0,r.qy)`
1683      <wui-notice-card
1684        @click=${this.onGoToUpgradeView.bind(this)}
1685        label="Upgrade your wallet"
1686        description="Transition to a self-custodial wallet"
1687        icon="wallet"
1688        data-testid="w3m-wallet-upgrade-card"
1689      ></wui-notice-card>
1690    `}handleClickFundWallet(){J.I.push("FundWallet")}handleClickSwap(){J.I.push("Swap")}handleClickSend(){J.I.push("WalletSend")}explorerBtnTemplate(){return o.W.getAccountData()?.addressExplorerUrl?(0,r.qy)`
1691      <wui-button size="md" variant="accent-primary" @click=${this.onExplorer.bind(this)}>
1692        <wui-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wui-icon>
1693        Block Explorer
1694        <wui-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wui-icon>
1695      </wui-button>
1696    `:null}onTransactions(){M.E.sendEvent({type:"track",event:"CLICK_TRANSACTIONS",properties:{isSmartAccount:(0,el.lj)(o.W.state.activeChain)===ew.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),J.I.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0;let e=X.x.getConnections(this.namespace).length>0,t=this.namespace&&K.a.state.activeConnectorIds[this.namespace],i=this.remoteFeatures?.multiWallet;await X.x.disconnect(i?{id:t,namespace:this.namespace}:{}),e&&i&&(J.I.push("ProfileWallets"),Y.P.showSuccess("Wallet deleted"))}catch{M.E.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),Y.P.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){let e=o.W.getAccountData()?.addressExplorerUrl;e&&d.w.openHref(e,"_blank")}onGoToUpgradeView(){M.E.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),J.I.push("UpgradeEmailWallet")}onGoToProfileWalletsView(){J.I.push("ProfileWallets")}};ev.styles=ey,eb([(0,n.wk)()],ev.prototype,"caipAddress",void 0),eb([(0,n.wk)()],ev.prototype,"address",void 0),eb([(0,n.wk)()],ev.prototype,"profileImage",void 0),eb([(0,n.wk)()],ev.prototype,"profileName",void 0),eb([(0,n.wk)()],ev.prototype,"disconnecting",void 0),eb([(0,n.wk)()],ev.prototype,"balance",void 0),eb([(0,n.wk)()],ev.prototype,"balanceSymbol",void 0),eb([(0,n.wk)()],ev.prototype,"features",void 0),eb([(0,n.wk)()],ev.prototype,"remoteFeatures",void 0),eb([(0,n.wk)()],ev.prototype,"namespace",void 0),eb([(0,n.wk)()],ev.prototype,"activeConnectorIds",void 0),ev=eb([(0,u.EM)("w3m-account-default-widget")],ev);var eC=i(88570);let eE=(0,m.AH)`
1697  span {
1698    font-weight: 500;
1699    font-size: 38px;
1700    color: ${({tokens:e})=>e.theme.textPrimary};
1701    line-height: 38px;
1702    letter-spacing: -2%;
1703    text-align: center;
1704    font-family: var(--apkt-fontFamily-regular);
1705  }
1706
1707  .pennies {
1708    color: ${({tokens:e})=>e.theme.textSecondary};
1709  }
1710`;var ex=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let eA=class extends r.WF{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return(0,r.qy)`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`}};eA.styles=[p.W5,eE],ex([(0,n.MZ)()],eA.prototype,"dollars",void 0),ex([(0,n.MZ)()],eA.prototype,"pennies",void 0),eA=ex([(0,g.E)("wui-balance")],eA);let e_=(0,m.AH)`
1711  :host {
1712    display: inline-flex;
1713    justify-content: center;
1714    align-items: center;
1715    position: relative;
1716  }
1717
1718  wui-icon {
1719    position: absolute;
1720    width: 12px !important;
1721    height: 4px !important;
1722  }
1723
1724  /* -- Variants --------------------------------------------------------- */
1725  :host([data-variant='fill']) {
1726    background-color: ${({colors:e})=>e.neutrals100};
1727  }
1728
1729  :host([data-variant='shade']) {
1730    background-color: ${({colors:e})=>e.neutrals900};
1731  }
1732
1733  :host([data-variant='fill']) > wui-text {
1734    color: ${({colors:e})=>e.black};
1735  }
1736
1737  :host([data-variant='shade']) > wui-text {
1738    color: ${({colors:e})=>e.white};
1739  }
1740
1741  :host([data-variant='fill']) > wui-icon {
1742    color: ${({colors:e})=>e.neutrals100};
1743  }
1744
1745  :host([data-variant='shade']) > wui-icon {
1746    color: ${({colors:e})=>e.neutrals900};
1747  }
1748
1749  /* -- Sizes --------------------------------------------------------- */
1750  :host([data-size='sm']) {
1751    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
1752    border-radius: ${({borderRadius:e})=>e[2]};
1753  }
1754
1755  :host([data-size='md']) {
1756    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]};
1757    border-radius: ${({borderRadius:e})=>e[3]};
1758  }
1759
1760  /* -- Placements --------------------------------------------------------- */
1761  wui-icon[data-placement='top'] {
1762    bottom: 0px;
1763    left: 50%;
1764    transform: translate(-50%, 95%);
1765  }
1766
1767  wui-icon[data-placement='bottom'] {
1768    top: 0;
1769    left: 50%;
1770    transform: translate(-50%, -95%) rotate(180deg);
1771  }
1772
1773  wui-icon[data-placement='right'] {
1774    top: 50%;
1775    left: 0;
1776    transform: translate(-65%, -50%) rotate(90deg);
1777  }
1778
1779  wui-icon[data-placement='left'] {
1780    top: 50%;
1781    right: 0%;
1782    transform: translate(65%, -50%) rotate(270deg);
1783  }
1784`;var eI=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let eS={sm:"sm-regular",md:"md-regular"},eN=class extends r.WF{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.size="md",this.message=""}render(){return this.dataset.variant=this.variant,this.dataset.size=this.size,(0,r.qy)`<wui-icon data-placement=${this.placement} size="inherit" name="cursor"></wui-icon>
1785      <wui-text variant=${eS[this.size]}>${this.message}</wui-text>`}};eN.styles=[p.W5,p.fD,e_],eI([(0,n.MZ)()],eN.prototype,"placement",void 0),eI([(0,n.MZ)()],eN.prototype,"variant",void 0),eI([(0,n.MZ)()],eN.prototype,"size",void 0),eI([(0,n.MZ)()],eN.prototype,"message",void 0),eN=eI([(0,g.E)("wui-tooltip")],eN);var ek=i(33526);i(47232);let eT=(0,r.AH)`
1786  :host {
1787    width: 100%;
1788    max-height: 280px;
1789    overflow: scroll;
1790    scrollbar-width: none;
1791  }
1792
1793  :host::-webkit-scrollbar {
1794    display: none;
1795  }
1796`,eO=class extends r.WF{render(){return(0,r.qy)`<w3m-activity-list page="account"></w3m-activity-list>`}};eO.styles=eT,eO=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-account-activity-widget")],eO),i(54623);let eR=(0,m.AH)`
1797  :host {
1798    width: 100%;
1799  }
1800
1801  button {
1802    width: 100%;
1803    display: flex;
1804    justify-content: space-between;
1805    align-items: center;
1806    gap: ${({spacing:e})=>e[4]};
1807    padding: ${({spacing:e})=>e[4]};
1808    background-color: transparent;
1809    border-radius: ${({borderRadius:e})=>e[4]};
1810  }
1811
1812  wui-text {
1813    max-width: 174px;
1814  }
1815
1816  .tag-container {
1817    width: fit-content;
1818  }
1819
1820  @media (hover: hover) {
1821    button:hover:enabled {
1822      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1823    }
1824  }
1825`;var eP=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let e$=class extends r.WF{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.disabled=!1}render(){return(0,r.qy)`
1826      <button ?disabled=${this.disabled}>
1827        <wui-flex alignItems="center" gap="3">
1828          <wui-icon-box padding="2" color="secondary" icon=${this.icon} size="lg"></wui-icon-box>
1829          <wui-flex flexDirection="column" gap="1">
1830            <wui-text variant="md-medium" color="primary">${this.text}</wui-text>
1831            ${this.description?(0,r.qy)`<wui-text variant="md-regular" color="secondary">
1832                  ${this.description}</wui-text
1833                >`:null}
1834          </wui-flex>
1835        </wui-flex>
1836
1837        <wui-flex class="tag-container" alignItems="center" gap="1" justifyContent="flex-end">
1838          ${this.tag?(0,r.qy)`<wui-tag tagType="main" size="sm">${this.tag}</wui-tag>`:null}
1839          <wui-icon size="md" name="chevronRight" color="default"></wui-icon>
1840        </wui-flex>
1841      </button>
1842    `}};e$.styles=[p.W5,p.fD,eR],eP([(0,n.MZ)()],e$.prototype,"icon",void 0),eP([(0,n.MZ)()],e$.prototype,"text",void 0),eP([(0,n.MZ)()],e$.prototype,"description",void 0),eP([(0,n.MZ)()],e$.prototype,"tag",void 0),eP([(0,n.MZ)({type:Boolean})],e$.prototype,"disabled",void 0),e$=eP([(0,g.E)("wui-list-description")],e$),i(3356);let eU=(0,r.AH)`
1843  :host {
1844    width: 100%;
1845  }
1846
1847  wui-flex {
1848    width: 100%;
1849  }
1850
1851  .contentContainer {
1852    max-height: 280px;
1853    overflow: scroll;
1854    scrollbar-width: none;
1855  }
1856
1857  .contentContainer::-webkit-scrollbar {
1858    display: none;
1859  }
1860`;var eM=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let eD=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.tokenBalance=o.W.getAccountData()?.tokenBalance,this.remoteFeatures=a.H.state.remoteFeatures,this.unsubscribe.push(o.W.subscribeChainProp("accountState",e=>{this.tokenBalance=e?.tokenBalance}),a.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,r.qy)`${this.tokenTemplate()}`}tokenTemplate(){return this.tokenBalance&&this.tokenBalance?.length>0?(0,r.qy)`<wui-flex class="contentContainer" flexDirection="column" gap="2">
1861        ${this.tokenItemTemplate()}
1862      </wui-flex>`:(0,r.qy)` <wui-flex flexDirection="column">
1863      ${this.onRampTemplate()}
1864      <wui-list-description
1865        @click=${this.onReceiveClick.bind(this)}
1866        text="Receive funds"
1867        description="Scan the QR code and receive funds"
1868        icon="qrCode"
1869        iconColor="fg-200"
1870        iconBackgroundColor="fg-200"
1871        data-testid="w3m-account-receive-button"
1872      ></wui-list-description
1873    ></wui-flex>`}onRampTemplate(){return this.remoteFeatures?.onramp?(0,r.qy)`<wui-list-description
1874        @click=${this.onBuyClick.bind(this)}
1875        text="Buy Crypto"
1876        description="Easy with card or bank account"
1877        icon="card"
1878        iconColor="success-100"
1879        iconBackgroundColor="success-100"
1880        tag="popular"
1881        data-testid="w3m-account-onramp-button"
1882      ></wui-list-description>`:(0,r.qy)``}tokenItemTemplate(){return this.tokenBalance?.map(e=>(0,r.qy)`<wui-list-token
1883          tokenName=${e.name}
1884          tokenImageUrl=${e.iconUrl}
1885          tokenAmount=${e.quantity.numeric}
1886          tokenValue=${e.value}
1887          tokenCurrency=${e.symbol}
1888        ></wui-list-token>`)}onReceiveClick(){J.I.push("WalletReceive")}onBuyClick(){M.E.sendEvent({type:"track",event:"SELECT_BUY_CRYPTO",properties:{isSmartAccount:(0,el.lj)(o.W.state.activeChain)===ew.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),J.I.push("OnRampProviders")}};eD.styles=eU,eM([(0,n.wk)()],eD.prototype,"tokenBalance",void 0),eM([(0,n.wk)()],eD.prototype,"remoteFeatures",void 0),eD=eM([(0,u.EM)("w3m-account-tokens-widget")],eD),i(78920),i(74203);let eL=(0,u.AH)`
1889  wui-flex {
1890    width: 100%;
1891  }
1892
1893  wui-promo {
1894    position: absolute;
1895    top: -32px;
1896  }
1897
1898  wui-profile-button {
1899    margin-top: calc(-1 * ${({spacing:e})=>e["4"]});
1900  }
1901
1902  wui-promo + wui-profile-button {
1903    margin-top: ${({spacing:e})=>e["4"]};
1904  }
1905
1906  wui-tabs {
1907    width: 100%;
1908  }
1909
1910  .contentContainer {
1911    height: 280px;
1912  }
1913
1914  .contentContainer > wui-icon-box {
1915    width: 40px;
1916    height: 40px;
1917    border-radius: ${({borderRadius:e})=>e["3"]};
1918  }
1919
1920  .contentContainer > .textContent {
1921    width: 65%;
1922  }
1923`;var eW=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let eB=class extends r.WF{constructor(){super(...arguments),this.unsubscribe=[],this.network=o.W.state.activeCaipNetwork,this.profileName=o.W.getAccountData()?.profileName,this.address=o.W.getAccountData()?.address,this.currentTab=o.W.getAccountData()?.currentTab,this.tokenBalance=o.W.getAccountData()?.tokenBalance,this.features=a.H.state.features,this.namespace=o.W.state.activeChain,this.activeConnectorIds=K.a.state.activeConnectorIds,this.remoteFeatures=a.H.state.remoteFeatures}firstUpdated(){o.W.fetchTokenBalance(),this.unsubscribe.push(o.W.subscribeChainProp("accountState",e=>{e?.address?(this.address=e.address,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance):h.W.close()}),K.a.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),o.W.subscribeKey("activeChain",e=>this.namespace=e),o.W.subscribeKey("activeCaipNetwork",e=>this.network=e),a.H.subscribeKey("features",e=>this.features=e),a.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.watchSwapValues()}
1923disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearInterval(this.watchTokenBalance)}render(){if(!this.address)throw Error("w3m-account-features-widget: No account provided");if(!this.namespace)return null;let e=this.activeConnectorIds[this.namespace],t=e?K.a.getConnectorById(e):void 0,{icon:i,iconSize:n}=this.getAuthData();return(0,r.qy)`<wui-flex
1924      flexDirection="column"
1925      .padding=${["0","3","4","3"]}
1926      alignItems="center"
1927      gap="4"
1928      data-testid="w3m-account-wallet-features-widget"
1929    >
1930      <wui-flex flexDirection="column" justifyContent="center" alignItems="center" gap="2">
1931        <wui-wallet-switch
1932          profileName=${this.profileName}
1933          address=${this.address}
1934          icon=${i}
1935          iconSize=${n}
1936          alt=${t?.name}
1937          @click=${this.onGoToProfileWalletsView.bind(this)}
1938          data-testid="wui-wallet-switch"
1939        ></wui-wallet-switch>
1940
1941        ${this.tokenBalanceTemplate()}
1942      </wui-flex>
1943      ${this.orderedWalletFeatures()} ${this.tabsTemplate()} ${this.listContentTemplate()}
1944    </wui-flex>`}orderedWalletFeatures(){let e=this.features?.walletFeaturesOrder||G.oU.DEFAULT_FEATURES.walletFeaturesOrder;if(e.every(e=>"send"===e||"receive"===e?!this.features?.[e]:"swaps"!==e&&"onramp"!==e||!this.remoteFeatures?.[e]))return null;let t=[...new Set(e.map(e=>"receive"===e||"onramp"===e?"fund":e))];return(0,r.qy)`<wui-flex gap="2">
1945      ${t.map(e=>{switch(e){case"fund":return this.fundWalletTemplate();case"swaps":return this.swapsTemplate();case"send":return this.sendTemplate();default:return null}})}
1946    </wui-flex>`}fundWalletTemplate(){if(!this.namespace)return null;let e=G.oU.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.namespace),t=this.features?.receive,i=this.remoteFeatures?.onramp&&e,n=eo.g.isPayWithExchangeEnabled();return i||t||n?(0,r.qy)`
1947      <w3m-tooltip-trigger text="Fund wallet">
1948        <wui-button
1949          data-testid="wallet-features-fund-wallet-button"
1950          @click=${this.onFundWalletClick.bind(this)}
1951          variant="accent-secondary"
1952          size="lg"
1953          fullWidth
1954        >
1955          <wui-icon name="dollar"></wui-icon>
1956        </wui-button>
1957      </w3m-tooltip-trigger>
1958    `:null}swapsTemplate(){let e=this.remoteFeatures?.swaps,t=o.W.state.activeChain===Z.o.CHAIN.EVM;return e&&t?(0,r.qy)`
1959      <w3m-tooltip-trigger text="Swap">
1960        <wui-button
1961          fullWidth
1962          data-testid="wallet-features-swaps-button"
1963          @click=${this.onSwapClick.bind(this)}
1964          variant="accent-secondary"
1965          size="lg"
1966        >
1967          <wui-icon name="recycleHorizontal"></wui-icon>
1968        </wui-button>
1969      </w3m-tooltip-trigger>
1970    `:null}sendTemplate(){let e=this.features?.send,t=o.W.state.activeChain,i=G.oU.SEND_SUPPORTED_NAMESPACES.includes(t);return e&&i?(0,r.qy)`
1971      <w3m-tooltip-trigger text="Send">
1972        <wui-button
1973          fullWidth
1974          data-testid="wallet-features-send-button"
1975          @click=${this.onSendClick.bind(this)}
1976          variant="accent-secondary"
1977          size="lg"
1978        >
1979          <wui-icon name="send"></wui-icon>
1980        </wui-button>
1981      </w3m-tooltip-trigger>
1982    `:null}watchSwapValues(){this.watchTokenBalance=setInterval(()=>o.W.fetchTokenBalance(e=>this.onTokenBalanceError(e)),1e4)}onTokenBalanceError(e){e instanceof Error&&e.cause instanceof Response&&e.cause.status===Z.o.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE&&clearInterval(this.watchTokenBalance)}listContentTemplate(){return 0===this.currentTab?(0,r.qy)`<w3m-account-tokens-widget></w3m-account-tokens-widget>`:1===this.currentTab?(0,r.qy)`<w3m-account-activity-widget></w3m-account-activity-widget>`:(0,r.qy)`<w3m-account-tokens-widget></w3m-account-tokens-widget>`}tokenBalanceTemplate(){if(this.tokenBalance&&this.tokenBalance?.length>=0){let e=d.w.calculateBalance(this.tokenBalance),{dollars:t="0",pennies:i="00"}=d.w.formatTokenBalance(e);return(0,r.qy)`<wui-balance dollars=${t} pennies=${i}></wui-balance>`}return(0,r.qy)`<wui-balance dollars="0" pennies="00"></wui-balance>`}tabsTemplate(){let e=ek.y.getTabsByNamespace(o.W.state.activeChain);return 0===e.length?null:(0,r.qy)`<wui-tabs
1983      .onTabChange=${this.onTabChange.bind(this)}
1984      .activeTab=${this.currentTab}
1985      .tabs=${e}
1986    ></wui-tabs>`}onTabChange(e){o.W.setAccountProp("currentTab",e,this.namespace)}onFundWalletClick(){J.I.push("FundWallet")}onSwapClick(){this.network?.caipNetworkId&&!G.oU.SWAP_SUPPORTED_NETWORKS.includes(this.network?.caipNetworkId)?J.I.push("UnsupportedChain",{swapUnsupportedChain:!0}):(M.E.sendEvent({type:"track",event:"OPEN_SWAP",properties:{network:this.network?.caipNetworkId||"",isSmartAccount:(0,el.lj)(o.W.state.activeChain)===ew.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),J.I.push("Swap"))}getAuthData(){let e=ei.i.getConnectedSocialProvider(),t=ei.i.getConnectedSocialUsername(),i=K.a.getAuthConnector(),r=i?.provider.getEmail()??"";return{name:eC.g.getAuthName({email:r,socialUsername:t,socialProvider:e}),icon:e??"mail",iconSize:e?"xl":"md"}}onGoToProfileWalletsView(){J.I.push("ProfileWallets")}onSendClick(){M.E.sendEvent({type:"track",event:"OPEN_SEND",properties:{network:this.network?.caipNetworkId||"",isSmartAccount:(0,el.lj)(o.W.state.activeChain)===ew.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),J.I.push("WalletSend")}};eB.styles=eL,eW([(0,n.wk)()],eB.prototype,"watchTokenBalance",void 0),eW([(0,n.wk)()],eB.prototype,"network",void 0),eW([(0,n.wk)()],eB.prototype,"profileName",void 0),eW([(0,n.wk)()],eB.prototype,"address",void 0),eW([(0,n.wk)()],eB.prototype,"currentTab",void 0),eW([(0,n.wk)()],eB.prototype,"tokenBalance",void 0),eW([(0,n.wk)()],eB.prototype,"features",void 0),eW([(0,n.wk)()],eB.prototype,"namespace",void 0),eW([(0,n.wk)()],eB.prototype,"activeConnectorIds",void 0),eW([(0,n.wk)()],eB.prototype,"remoteFeatures",void 0),eB=eW([(0,u.EM)("w3m-account-wallet-features-widget")],eB);var ej=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let eF=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.namespace=o.W.state.activeChain,this.unsubscribe.push(o.W.subscribeKey("activeChain",e=>{this.namespace=e}))}
1986render(){if(!this.namespace)return null;let e=K.a.getConnectorId(this.namespace),t=K.a.getAuthConnector();return(0,r.qy)`
1987      ${t&&e===Z.o.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()}
1988    `}walletFeaturesTemplate(){return(0,r.qy)`<w3m-account-wallet-features-widget></w3m-account-wallet-features-widget>`}defaultTemplate(){return(0,r.qy)`<w3m-account-default-widget></w3m-account-default-widget>`}};ej([(0,n.wk)()],eF.prototype,"namespace",void 0),eF=ej([(0,u.EM)("w3m-account-view")],eF);var eH=i(74897),eq=i(30840),ez=i(22787);i(20903),i(19690);let eV=(0,m.AH)`
1989  wui-image {
1990    width: 24px;
1991    height: 24px;
1992    border-radius: ${({borderRadius:e})=>e[2]};
1993  }
1994
1995  wui-image,
1996  .icon-box {
1997    width: 32px;
1998    height: 32px;
1999    border-radius: ${({borderRadius:e})=>e[2]};
2000  }
2001
2002  wui-icon:not(.custom-icon, .icon-badge) {
2003    cursor: pointer;
2004  }
2005
2006  .icon-box {
2007    position: relative;
2008    border-radius: ${({borderRadius:e})=>e[2]};
2009    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2010  }
2011
2012  .icon-badge {
2013    position: absolute;
2014    top: 18px;
2015    left: 23px;
2016    z-index: 3;
2017    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2018    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
2019    border-radius: 50%;
2020    padding: ${({spacing:e})=>e["01"]};
2021  }
2022
2023  .icon-badge {
2024    width: 8px;
2025    height: 8px;
2026  }
2027`;var eZ=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let eK=class extends r.WF{constructor(){super(...arguments),this.address="",this.profileName="",this.content=[],this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadge=void 0,this.iconBadgeSize="md",this.buttonVariant="neutral-primary",this.enableMoreButton=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,r.qy)`
2028      <wui-flex flexDirection="column" rowgap="2">
2029        ${this.topTemplate()} ${this.bottomTemplate()}
2030      </wui-flex>
2031    `}topTemplate(){return(0,r.qy)`
2032      <wui-flex alignItems="flex-start" justifyContent="space-between">
2033        ${this.imageOrIconTemplate()}
2034        <wui-icon-link
2035          variant="secondary"
2036          size="md"
2037          icon="copy"
2038          @click=${this.dispatchCopyEvent}
2039        ></wui-icon-link>
2040        <wui-icon-link
2041          variant="secondary"
2042          size="md"
2043          icon="externalLink"
2044          @click=${this.dispatchExternalLinkEvent}
2045        ></wui-icon-link>
2046        ${this.enableMoreButton?(0,r.qy)`<wui-icon-link
2047              variant="secondary"
2048              size="md"
2049              icon="threeDots"
2050              @click=${this.dispatchMoreButtonEvent}
2051              data-testid="wui-active-profile-wallet-item-more-button"
2052            ></wui-icon-link>`:null}
2053      </wui-flex>
2054    `}bottomTemplate(){return(0,r.qy)` <wui-flex flexDirection="column">${this.contentTemplate()}</wui-flex> `}imageOrIconTemplate(){return this.icon?(0,r.qy)`
2055        <wui-flex flexGrow="1" alignItems="center">
2056          <wui-flex alignItems="center" justifyContent="center" class="icon-box">
2057            <wui-icon size="lg" color="default" name=${this.icon} class="custom-icon"></wui-icon>
2058
2059            ${this.iconBadge?(0,r.qy)`<wui-icon
2060                  color="accent-primary"
2061                  size="inherit"
2062                  name=${this.iconBadge}
2063                  class="icon-badge"
2064                ></wui-icon>`:null}
2065          </wui-flex>
2066        </wui-flex>
2067      `:(0,r.qy)`
2068      <wui-flex flexGrow="1" alignItems="center">
2069        <wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>
2070      </wui-flex>
2071    `}contentTemplate(){return 0===this.content.length?null:(0,r.qy)`
2072      <wui-flex flexDirection="column" rowgap="3">
2073        ${this.content.map(e=>this.labelAndTagTemplate(e))}
2074      </wui-flex>
2075    `}labelAndTagTemplate({address:e,profileName:t,label:i,description:n,enableButton:s,buttonType:a,buttonLabel:o,buttonVariant:l,tagVariant:c,tagLabel:d,alignItems:h="flex-end"}){return(0,r.qy)`
2076      <wui-flex justifyContent="space-between" alignItems=${h} columngap="1">
2077        <wui-flex flexDirection="column" rowgap="01">
2078          ${i?(0,r.qy)`<wui-text variant="sm-medium" color="secondary">${i}</wui-text>`:null}
2079
2080          <wui-flex alignItems="center" columngap="1">
2081            <wui-text variant="md-regular" color="primary">
2082              ${f.Z.getTruncateString({string:t||e,charsStart:t?16:this.charsStart,charsEnd:t?0:this.charsEnd,truncate:t?"end":"middle"})}
2083            </wui-text>
2084
2085            ${c&&d?(0,r.qy)`<wui-tag variant=${c} size="sm">${d}</wui-tag>`:null}
2086          </wui-flex>
2087
2088          ${n?(0,r.qy)`<wui-text variant="sm-regular" color="secondary">${n}</wui-text>`:null}
2089        </wui-flex>
2090
2091        ${s?this.buttonTemplate({buttonType:a,buttonLabel:o,buttonVariant:l}):null}
2092      </wui-flex>
2093    `}buttonTemplate({buttonType:e,buttonLabel:t,buttonVariant:i}){return(0,r.qy)`
2094      <wui-button
2095        size="sm"
2096        variant=${i}
2097        @click=${"disconnect"===e?this.dispatchDisconnectEvent.bind(this):this.dispatchSwitchEvent.bind(this)}
2098        data-testid=${"disconnect"===e?"wui-active-profile-wallet-item-disconnect-button":"wui-active-profile-wallet-item-switch-button"}
2099      >
2100        ${t}
2101      </wui-button>
2101
2102    `}dispatchDisconnectEvent(){this.dispatchEvent(new CustomEvent("disconnect",{bubbles:!0,composed:!0}))}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("switch",{bubbles:!0,composed:!0}))}dispatchExternalLinkEvent(){this.dispatchEvent(new CustomEvent("externalLink",{bubbles:!0,composed:!0}))}dispatchMoreButtonEvent(){this.dispatchEvent(new CustomEvent("more",{bubbles:!0,composed:!0}))}dispatchCopyEvent(){this.dispatchEvent(new CustomEvent("copy",{bubbles:!0,composed:!0}))}};eK.styles=[p.W5,p.fD,eV],eZ([(0,n.MZ)()],eK.prototype,"address",void 0),eZ([(0,n.MZ)()],eK.prototype,"profileName",void 0),eZ([(0,n.MZ)({type:Array})],eK.prototype,"content",void 0),eZ([(0,n.MZ)()],eK.prototype,"alt",void 0),eZ([(0,n.MZ)()],eK.prototype,"imageSrc",void 0),eZ([(0,n.MZ)()],eK.prototype,"icon",void 0),eZ([(0,n.MZ)()],eK.prototype,"iconSize",void 0),eZ([(0,n.MZ)()],eK.prototype,"iconBadge",void 0),eZ([(0,n.MZ)()],eK.prototype,"iconBadgeSize",void 0),eZ([(0,n.MZ)()],eK.prototype,"buttonVariant",void 0),eZ([(0,n.MZ)({type:Boolean})],eK.prototype,"enableMoreButton",void 0),eZ([(0,n.MZ)({type:Number})],eK.prototype,"charsStart",void 0),eZ([(0,n.MZ)({type:Number})],eK.prototype,"charsEnd",void 0),eK=eZ([(0,g.E)("wui-active-profile-wallet-item")],eK),i(37132);let eG=(0,m.AH)`
2103  wui-image,
2104  .icon-box {
2105    width: 32px;
2106    height: 32px;
2107    border-radius: ${({borderRadius:e})=>e[2]};
2108  }
2109
2110  .right-icon {
2111    cursor: pointer;
2112  }
2113
2114  .icon-box {
2115    position: relative;
2116    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2117  }
2118
2119  .icon-badge {
2120    position: absolute;
2121    top: 18px;
2122    left: 23px;
2123    z-index: 3;
2124    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2125    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
2126    border-radius: 50%;
2127    padding: ${({spacing:e})=>e["01"]};
2128  }
2129
2130  .icon-badge {
2131    width: 8px;
2132    height: 8px;
2133  }
2134`;var eY=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let eJ=class extends r.WF{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.buttonLabel="",this.buttonVariant="accent-primary",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.iconBadgeSize="md",this.rightIcon="signOut",this.rightIconSize="md",this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,r.qy)`
2135      <wui-flex alignItems="center" columngap="2">
2136        ${this.imageOrIconTemplate()} ${this.labelAndDescriptionTemplate()}
2137        ${this.buttonActionTemplate()}
2138      </wui-flex>
2139    `}imageOrIconTemplate(){return this.icon?(0,r.qy)`
2140        <wui-flex alignItems="center" justifyContent="center" class="icon-box">
2141          <wui-flex alignItems="center" justifyContent="center" class="icon-box">
2142            <wui-icon size="lg" color="default" name=${this.icon} class="custom-icon"></wui-icon>
2143
2144            ${this.iconBadge?(0,r.qy)`<wui-icon
2145                  color="default"
2146                  size="inherit"
2147                  name=${this.iconBadge}
2148                  class="icon-badge"
2149                ></wui-icon>`:null}
2150          </wui-flex>
2151        </wui-flex>
2152      `:(0,r.qy)`<wui-image objectFit="contain" src=${this.imageSrc} alt=${this.alt}></wui-image>`}labelAndDescriptionTemplate(){return(0,r.qy)`
2153      <wui-flex
2154        flexDirection="column"
2155        flexGrow="1"
2156        justifyContent="flex-start"
2157        alignItems="flex-start"
2158      >
2159        <wui-text variant="lg-regular" color="primary">
2160          ${f.Z.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
2161        </wui-text>
2162      </wui-flex>
2163    `}buttonActionTemplate(){return(0,r.qy)`
2164      <wui-flex columngap="1" alignItems="center" justifyContent="center">
2165        <wui-button
2166          size="sm"
2167          variant=${this.buttonVariant}
2168          .loading=${this.loading}
2169          @click=${this.handleButtonClick}
2170          data-testid="wui-inactive-profile-wallet-item-button"
2171        >
2172          ${this.buttonLabel}
2173        </wui-button>
2173
2174
2175        <wui-icon-link
2176          variant="secondary"
2177          size="md"
2178          icon=${(0,s.J)(this.rightIcon)}
2179          class="right-icon"
2180          @click=${this.handleIconClick}
2181        ></wui-icon-link>
2182      </wui-flex>
2183    `}handleButtonClick(){this.dispatchEvent(new CustomEvent("buttonClick",{bubbles:!0,composed:!0}))}handleIconClick(){this.dispatchEvent(new CustomEvent("iconClick",{bubbles:!0,composed:!0}))}};eJ.styles=[p.W5,p.fD,eG],eY([(0,n.MZ)()],eJ.prototype,"address",void 0),eY([(0,n.MZ)()],eJ.prototype,"profileName",void 0),eY([(0,n.MZ)()],eJ.prototype,"alt",void 0),eY([(0,n.MZ)()],eJ.prototype,"buttonLabel",void 0),eY([(0,n.MZ)()],eJ.prototype,"buttonVariant",void 0),eY([(0,n.MZ)()],eJ.prototype,"imageSrc",void 0),eY([(0,n.MZ)()],eJ.prototype,"icon",void 0),eY([(0,n.MZ)()],eJ.prototype,"iconSize",void 0),eY([(0,n.MZ)()],eJ.prototype,"iconBadge",void 0),eY([(0,n.MZ)()],eJ.prototype,"iconBadgeSize",void 0),eY([(0,n.MZ)()],eJ.prototype,"rightIcon",void 0),eY([(0,n.MZ)()],eJ.prototype,"rightIconSize",void 0),eY([(0,n.MZ)({type:Boolean})],eJ.prototype,"loading",void 0),eY([(0,n.MZ)({type:Number})],eJ.prototype,"charsStart",void 0),eY([(0,n.MZ)({type:Number})],eJ.prototype,"charsEnd",void 0),eJ=eY([(0,g.E)("wui-inactive-profile-wallet-item")],eJ),i(52589);var eX=i(60890);let eQ={getAuthData(e){let t=e.connectorId===Z.o.CONNECTOR_ID.AUTH;if(!t)return{isAuth:!1,icon:void 0,iconSize:void 0,name:void 0};let i=e?.auth?.name??ei.i.getConnectedSocialProvider(),r=e?.auth?.username??ei.i.getConnectedSocialUsername(),n=K.a.getAuthConnector(),s=n?.provider.getEmail()??"";return{isAuth:!0,icon:i??"mail",iconSize:i?"xl":"md",name:t?eC.g.getAuthName({email:s,socialUsername:r,socialProvider:i}):void 0}}},e0=(0,u.AH)`
2184  :host {
2185    --connect-scroll--top-opacity: 0;
2186    --connect-scroll--bottom-opacity: 0;
2187  }
2188
2189  .balance-amount {
2190    flex: 1;
2191  }
2192
2193  .wallet-list {
2194    scrollbar-width: none;
2195    overflow-y: scroll;
2196    overflow-x: hidden;
2197    transition: opacity ${({easings:e})=>e["ease-out-power-1"]}
2198      ${({durations:e})=>e.md};
2199    will-change: opacity;
2200    mask-image: linear-gradient(
2201      to bottom,
2202      rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
2203      rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
2204      black 40px,
2205      black calc(100% - 40px),
2206      rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
2207      rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
2208    );
2209  }
2210
2211  .active-wallets {
2212    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2213    border-radius: ${({borderRadius:e})=>e["4"]};
2214  }
2215
2216  .active-wallets-box {
2217    height: 330px;
2218  }
2219
2220  .empty-wallet-list-box {
2221    height: 400px;
2222  }
2223
2224  .empty-box {
2225    width: 100%;
2226    padding: ${({spacing:e})=>e["4"]};
2227    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2228    border-radius: ${({borderRadius:e})=>e["4"]};
2229  }
2230
2231  wui-separator {
2232    margin: ${({spacing:e})=>e["2"]} 0 ${({spacing:e})=>e["2"]} 0;
2233  }
2234
2235  .active-connection {
2236    padding: ${({spacing:e})=>e["2"]};
2237  }
2238
2239  .recent-connection {
2240    padding: ${({spacing:e})=>e["2"]} 0 ${({spacing:e})=>e["2"]} 0;
2241  }
2242
2243  @media (max-width: 430px) {
2244    .active-wallets-box,
2245    .empty-wallet-list-box {
2246      height: auto;
2247      max-height: clamp(360px, 470px, 80vh);
2248    }
2249  }
2250`;var e1=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let e2=4,e3=6,e5="md",e4="lightbulb",e6=[0,1],e8={eip155:"ethereum",solana:"solana",bip122:"bitcoin",ton:"ton",tron:"tron"},e9=[{namespace:"eip155",icon:e8.eip155,label:"EVM"},{namespace:"solana",icon:e8.solana,label:"Solana"},{namespace:"bip122",icon:e8.bip122,label:"Bitcoin"},{namespace:"ton",icon:e8.ton,label:"Ton"},{namespace:"tron",icon:e8.tron,label:"Tron"}],e7={eip155:{title:"Add EVM Wallet",description:"Add your first EVM wallet"},solana:{title:"Add Solana Wallet",description:"Add your first Solana wallet"},bip122:{title:"Add Bitcoin Wallet",description:"Add your first Bitcoin wallet"},ton:{title:"Add TON Wallet",description:"Add your first TON wallet"},tron:{title:"Add TRON Wallet",description:"Add your first TRON wallet"}},te=class extends r.WF{constructor(){super(),this.unsubscribers=[],this.currentTab=0,this.namespace=o.W.state.activeChain,this.namespaces=Array.from(o.W.state.chains.keys()),this.caipAddress=void 0,this.profileName=void 0,this.activeConnectorIds=K.a.state.activeConnectorIds,this.lastSelectedAddress="",this.lastSelectedConnectorId="",this.isSwitching=!1,this.caipNetwork=o.W.state.activeCaipNetwork,this.user=o.W.getAccountData()?.user,this.remoteFeatures=a.H.state.remoteFeatures,this.currentTab=this.namespace?this.namespaces.indexOf(this.namespace):0,this.caipAddress=o.W.getAccountData(this.namespace)?.caipAddress,this.profileName=o.W.getAccountData(this.namespace)?.profileName,this.unsubscribers.push(X.x.subscribeKey("connections",()=>this.onConnectionsChange()),X.x.subscribeKey("recentConnections",()=>this.requestUpdate()),K.a.subscribeKey("activeConnectorIds",e=>{this.activeConnectorIds=e}),o.W.subscribeKey("activeCaipNetwork",e=>this.caipNetwork=e),o.W.subscribeChainProp("accountState",e=>{this.user=e?.user}),a.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e)),this.chainListener=o.W.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress,this.profileName=e?.profileName},this.namespace)}
2250disconnectedCallback(){this.unsubscribers.forEach(e=>e()),this.resizeObserver?.disconnect(),this.removeScrollListener(),this.chainListener?.()}firstUpdated(){let e=this.shadowRoot?.querySelector(".wallet-list");if(!e)return;let t=()=>this.updateScrollOpacity(e);requestAnimationFrame(t),e.addEventListener("scroll",t),this.resizeObserver=new ResizeObserver(t),this.resizeObserver.observe(e),t()}render(){let e=this.namespace;if(!e)throw Error("Namespace is not set");return(0,r.qy)`
2251      <wui-flex flexDirection="column" .padding=${["0","4","4","4"]} gap="4">
2252        ${this.renderTabs()} ${this.renderHeader(e)} ${this.renderConnections(e)}
2253        ${this.renderAddConnectionButton(e)}
2254      </wui-flex>
2255    `}renderTabs(){let e=this.namespaces.map(e=>e9.find(t=>t.namespace===e)).filter(Boolean);return e.length>1?(0,r.qy)`
2256        <wui-tabs
2257          .onTabChange=${e=>this.handleTabChange(e)}
2258          .activeTab=${this.currentTab}
2259          .tabs=${e}
2260        ></wui-tabs>
2261      `:null}renderHeader(e){let t=this.getActiveConnections(e).flatMap(({accounts:e})=>e).length+ +!!this.caipAddress;return(0,r.qy)`
2262      <wui-flex alignItems="center" columngap="1">
2263        <wui-icon
2264          size="sm"
2265          name=${e8[e]??e8.eip155}
2266        ></wui-icon>
2267        <wui-text color="secondary" variant="lg-regular"
2268          >${t>1?"Wallets":"Wallet"}</wui-text
2269        >
2270        <wui-text
2271          color="primary"
2272          variant="lg-regular"
2273          class="balance-amount"
2274          data-testid="balance-amount"
2275        >
2276          ${t}
2277        </wui-text>
2278        <wui-link
2279          color="secondary"
2280          variant="secondary"
2281          @click=${()=>X.x.disconnect({namespace:e})}
2282          ?disabled=${!this.hasAnyConnections(e)}
2283          data-testid="disconnect-all-button"
2284        >
2285          Disconnect All
2286        </wui-link>
2287      </wui-flex>
2288    `}renderConnections(e){let t=this.hasAnyConnections(e);return(0,r.qy)`
2289      <wui-flex flexDirection="column" class=${(0,eH.H)({"wallet-list":!0,"active-wallets-box":t,"empty-wallet-list-box":!t})} rowgap="3">
2290        ${t?this.renderActiveConnections(e):this.renderEmptyState(e)}
2291      </wui-flex>
2292    `}renderActiveConnections(e){let t=this.getActiveConnections(e),i=this.activeConnectorIds[e],n=this.getPlainAddress();return(0,r.qy)`
2293      ${n||i||t.length>0?(0,r.qy)`<wui-flex
2294            flexDirection="column"
2295            .padding=${["4","0","4","0"]}
2296            class="active-wallets"
2297          >
2298            ${this.renderActiveProfile(e)} ${this.renderActiveConnectionsList(e)}
2299          </wui-flex>`:null}
2300      ${this.renderRecentConnections(e)}
2301    `}renderActiveProfile(e){let t=this.activeConnectorIds[e];if(!t)return null;let{connections:i}=ez.b.getConnectionsData(e),n=K.a.getConnectorById(t),s=c.$.getConnectorImage(n),a=this.getPlainAddress();if(!a)return null;let o=e===Z.o.CHAIN.BITCOIN,l=eQ.getAuthData({connectorId:t,accounts:[]}),d=this.getActiveConnections(e).flatMap(e=>e.accounts).length>0,h=i.find(e=>e.connectorId===t),u=h?.accounts.filter(e=>!eX.y.isLowerCaseMatch(e.address,a));return(0,r.qy)`
2302      <wui-flex flexDirection="column" .padding=${["0","4","0","4"]}>
2303        <wui-active-profile-wallet-item
2304          address=${a}
2305          alt=${n?.name}
2306          .content=${this.getProfileContent({address:a,connections:i,connectorId:t,namespace:e})}
2307          .charsStart=${e2}
2308          .charsEnd=${e3}
2309          .icon=${l.icon}
2310          .iconSize=${l.iconSize}
2311          .iconBadge=${this.isSmartAccount(a)?e4:void 0}
2312          .iconBadgeSize=${this.isSmartAccount(a)?e5:void 0}
2313          imageSrc=${s}
2314          ?enableMoreButton=${l.isAuth}
2315          @copy=${()=>this.handleCopyAddress(a)}
2316          @disconnect=${()=>this.handleDisconnect(e,t)}
2317          @switch=${()=>{o&&h&&u?.[0]&&this.handleSwitchWallet(h,u[0].address,e)}}
2318          @externalLink=${()=>this.handleExternalLink(a)}
2319          @more=${()=>this.handleMore()}
2320          data-testid="wui-active-profile-wallet-item"
2321        ></wui-active-profile-wallet-item>
2322        ${d?(0,r.qy)`<wui-separator></wui-separator>`:null}
2323      </wui-flex>
2324    `}renderActiveConnectionsList(e){let t=this.getActiveConnections(e);return 0===t.length?null:(0,r.qy)`
2325      <wui-flex flexDirection="column" .padding=${["0","2","0","2"]}>
2326        ${this.renderConnectionList(t,!1,e)}
2327      </wui-flex>
2328    `}renderRecentConnections(e){let{recentConnections:t}=ez.b.getConnectionsData(e);return 0===t.flatMap(e=>e.accounts).length?null:(0,r.qy)`
2329      <wui-flex flexDirection="column" .padding=${["0","2","0","2"]} rowGap="2">
2330        <wui-text color="secondary" variant="sm-medium" data-testid="recently-connected-text"
2331          >RECENTLY CONNECTED</wui-text
2332        >
2333        <wui-flex flexDirection="column" .padding=${["0","2","0","2"]}>
2334          ${this.renderConnectionList(t,!0,e)}
2335        </wui-flex>
2336      </wui-flex>
2337    `}renderConnectionList(e,t,i){return e.filter(e=>e.accounts.length>0).map((e,n)=>{let s=K.a.getConnectorById(e.connectorId),a=c.$.getConnectorImage(s)??"",o=eQ.getAuthData(e);return e.accounts.map((s,l)=>{let c=this.isAccountLoading(e.connectorId,s.address);return(0,r.qy)`
2338            <wui-flex flexDirection="column">
2339              ${0!==n||0!==l?(0,r.qy)`<wui-separator></wui-separator>`:null}
2340              <wui-inactive-profile-wallet-item
2341                address=${s.address}
2342                alt=${e.connectorId}
2343                buttonLabel=${t?"Connect":"Switch"}
2344                buttonVariant=${t?"neutral-secondary":"accent-secondary"}
2345                rightIcon=${t?"bin":"power"}
2346                rightIconSize="sm"
2347                class=${t?"recent-connection":"active-connection"}
2348                data-testid=${t?"recent-connection":"active-connection"}
2349                imageSrc=${a}
2350                .iconBadge=${this.isSmartAccount(s.address)?e4:void 0}
2351                .iconBadgeSize=${this.isSmartAccount(s.address)?e5:void 0}
2352                .icon=${o.icon}
2353                .iconSize=${o.iconSize}
2354                .loading=${c}
2355                .showBalance=${!1}
2356                .charsStart=${e2}
2357                .charsEnd=${e3}
2358                @buttonClick=${()=>this.handleSwitchWallet(e,s.address,i)}
2359                @iconClick=${()=>this.handleWalletAction({connection:e,address:s.address,isRecentConnection:t,namespace:i})}
2360              ></wui-inactive-profile-wallet-item>
2361            </wui-flex>
2362          `})})}renderAddConnectionButton(e){if(!this.isMultiWalletEnabled()&&this.caipAddress||!this.hasAnyConnections(e))return null;let{title:t}=this.getChainLabelInfo(e);return(0,r.qy)`
2363      <wui-list-item
2364        variant="icon"
2365        iconVariant="overlay"
2366        icon="plus"
2367        iconSize="sm"
2368        ?chevron=${!0}
2369        @click=${()=>this.handleAddConnection(e)}
2370        data-testid="add-connection-button"
2371      >
2372        <wui-text variant="md-medium" color="secondary">${t}</wui-text>
2373      </wui-list-item>
2374    `}renderEmptyState(e){let{title:t,description:i}=this.getChainLabelInfo(e);return(0,r.qy)`
2375      <wui-flex alignItems="flex-start" class="empty-template" data-testid="empty-template">
2376        <wui-flex
2377          flexDirection="column"
2378          alignItems="center"
2379          justifyContent="center"
2380          rowgap="3"
2381          class="empty-box"
2382        >
2383          <wui-icon-box size="xl" icon="wallet" color="secondary"></wui-icon-box>
2384
2385          <wui-flex flexDirection="column" alignItems="center" justifyContent="center" gap="1">
2386            <wui-text color="primary" variant="lg-regular" data-testid="empty-state-text"
2387              >No wallet connected</wui-text
2388            >
2389            <wui-text color="secondary" variant="md-regular" data-testid="empty-state-description"
2390              >${i}</wui-text
2391            >
2392          </wui-flex>
2393
2394          <wui-link
2395            @click=${()=>this.handleAddConnection(e)}
2396            data-testid="empty-state-button"
2397            icon="plus"
2398          >
2399            ${t}
2400          </wui-link>
2401        </wui-flex>
2402      </wui-flex>
2403    `}handleTabChange(e){let t=this.namespaces[e];t&&(this.chainListener?.(),this.currentTab=this.namespaces.indexOf(t),this.namespace=t,this.caipAddress=o.W.getAccountData(t)?.caipAddress,this.profileName=o.W.getAccountData(t)?.profileName,this.chainListener=o.W.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress},t))}async handleSwitchWallet(e,t,i){try{this.isSwitching=!0,this.lastSelectedConnectorId=e.connectorId,this.lastSelectedAddress=t,this.caipNetwork?.chainNamespace!==i&&e?.caipNetwork&&(K.a.setFilterByNamespace(i),await o.W.switchActiveNetwork(e?.caipNetwork)),await X.x.switchConnection({connection:e,address:t,namespace:i,closeModalOnConnect:!1,onChange({hasSwitchedAccount:e,hasSwitchedWallet:t}){t?Y.P.showSuccess("Wallet switched"):e&&Y.P.showSuccess("Account switched")}})}catch(e){Y.P.showError("Failed to switch wallet")}finally{this.isSwitching=!1}}
2403handleWalletAction(e){let{connection:t,address:i,isRecentConnection:r,namespace:n}=e;r?(ei.i.deleteAddressFromConnection({connectorId:t.connectorId,address:i,namespace:n}),X.x.syncStorageConnections(),Y.P.showSuccess("Wallet deleted")):this.handleDisconnect(n,t.connectorId)}async handleDisconnect(e,t){try{await X.x.disconnect({id:t,namespace:e}),Y.P.showSuccess("Wallet disconnected")}catch{Y.P.showError("Failed to disconnect wallet")}}handleCopyAddress(e){d.w.copyToClopboard(e),Y.P.showSuccess("Address copied")}handleMore(){J.I.push("AccountSettings")}handleExternalLink(e){let t=this.caipNetwork?.blockExplorers?.default.url;t&&d.w.openHref(`${t}/address/${e}`,"_blank")}handleAddConnection(e){K.a.setFilterByNamespace(e),J.I.push("Connect",{addWalletForNamespace:e})}getChainLabelInfo(e){return e7[e]??{title:"Add Wallet",description:"Add your first wallet"}}isSmartAccount(e){if(!this.namespace)return!1;let t=this.user?.accounts?.find(e=>"smartAccount"===e.type);return!!t&&!!e&&eX.y.isLowerCaseMatch(t.address,e)}getPlainAddress(){return this.caipAddress?d.w.getPlainAddress(this.caipAddress):void 0}getActiveConnections(e){let t=this.activeConnectorIds[e],{connections:i}=ez.b.getConnectionsData(e),[r]=i.filter(e=>eX.y.isLowerCaseMatch(e.connectorId,t));if(!t)return i;let n=e===Z.o.CHAIN.BITCOIN,{address:s}=this.caipAddress?eq.C.parseCaipAddress(this.caipAddress):{},a=[...s?[s]:[]];return n&&r&&(a=r.accounts.map(e=>e.address)||[]),ez.b.excludeConnectorAddressFromConnections({connectorId:t,addresses:a,connections:i})}hasAnyConnections(e){let t=this.getActiveConnections(e),{recentConnections:i}=ez.b.getConnectionsData(e);return!!this.caipAddress||t.length>0||i.length>0}isAccountLoading(e,t){return eX.y.isLowerCaseMatch(this.lastSelectedConnectorId,e)&&eX.y.isLowerCaseMatch(this.lastSelectedAddress,t)&&this.isSwitching}getProfileContent(e){let{address:t,connections:i,connectorId:r,namespace:n}=e,[s]=i.filter(e=>eX.y.isLowerCaseMatch(e.connectorId,r));if(n===Z.o.CHAIN.BITCOIN&&s?.accounts.every(e=>"string"==typeof e.type))return this.getBitcoinProfileContent(s.accounts,t);let a=eQ.getAuthData({connectorId:r,accounts:[]});return[{address:t,tagLabel:"Active",tagVariant:"success",enableButton:!0,profileName:this.profileName,buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary",...a.isAuth?{description:this.isSmartAccount(t)?"Smart Account":"EOA Account"}:{}}]}getBitcoinProfileContent(e,t){let i=e.length>1,r=this.getPlainAddress();return e.map(e=>{let n=eX.y.isLowerCaseMatch(e.address,r),s="PAYMENT";return"ordinal"===e.type&&(s="ORDINALS"),{address:e.address,tagLabel:eX.y.isLowerCaseMatch(e.address,t)?"Active":void 0,tagVariant:eX.y.isLowerCaseMatch(e.address,t)?"success":void 0,enableButton:!0,...i?{label:s,alignItems:"flex-end",buttonType:n?"disconnect":"switch",buttonLabel:n?"Disconnect":"Switch",buttonVariant:n?"neutral-secondary":"accent-secondary"}:{alignItems:"center",buttonType:"disconnect",buttonLabel:"Disconnect",buttonVariant:"neutral-secondary"}}})}removeScrollListener(){let e=this.shadowRoot?.querySelector(".wallet-list");e&&e.removeEventListener("scroll",()=>this.handleConnectListScroll())}handleConnectListScroll(){let e=this.shadowRoot?.querySelector(".wallet-list");e&&this.updateScrollOpacity(e)}isMultiWalletEnabled(){return!!this.remoteFeatures?.multiWallet}updateScrollOpacity(e){e.style.setProperty("--connect-scroll--top-opacity",u.z8.interpolate([0,50],e6,e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",u.z8.interpolate([0,50],e6,e.scrollHeight-e.scrollTop-e.offsetHeight).toString())}onConnectionsChange(){if(this.isMultiWalletEnabled()&&this.namespace){let{connections:e}=ez.b.getConnectionsData(this.namespace);0===e.length&&J.I.reset("ProfileWallets")}this.requestUpdate()}};te.styles=e0,e1([(0,n.wk)()],te.prototype,"currentTab",void 0),e1([(0,n.wk)()],te.prototype,"namespace",void 0),e1([(0,n.wk)()],te.prototype,"namespaces",void 0),e1([(0,n.wk)()],te.prototype,"caipAddress",void 0),e1([(0,n.wk)()],te.prototype,"profileName",void 0),e1([(0,n.wk)()],te.prototype,"activeConnectorIds",void 0),e1([(0,n.wk)()],te.prototype,"lastSelectedAddress",void 0),e1([(0,n.wk)()],te.prototype,"lastSelectedConnectorId",void 0),e1([(0,n.wk)()],te.prototype,"isSwitching",void 0),e1([(0,n.wk)()],te.prototype,"caipNetwork",void 0),e1([(0,n.wk)()],te.prototype,"user",void 0),e1([(0,n.wk)()],te.prototype,"remoteFeatures",void 0),te=e1([(0,u.EM)("w3m-profile-wallets-view")],te);var tt=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let ti=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.activeCaipNetwork=o.W.state.activeCaipNetwork,this.features=a.H.state.features,this.remoteFeatures=a.H.state.remoteFeatures,this.exchangesLoading=eo.g.state.isLoading,this.exchanges=eo.g.state.exchanges,this.unsubscribe.push(a.H.subscribeKey("features",e=>this.features=e),a.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),o.W.subscribeKey("activeCaipNetwork",e=>{this.activeCaipNetwork=e,this.setDefaultPaymentAsset()}),eo.g.subscribeKey("isLoading",e=>this.exchangesLoading=e),eo.g.subscribeKey("exchanges",e=>this.exchanges=e))}
2403disconnectedCallback(){this.unsubscribe.forEach(e=>e())}async firstUpdated(){eo.g.isPayWithExchangeSupported()&&(await this.setDefaultPaymentAsset(),await eo.g.fetchExchanges())}render(){return(0,r.qy)`
2404      <wui-flex flexDirection="column" .padding=${["1","3","3","3"]} gap="2">
2405        ${this.onrampTemplate()} ${this.receiveTemplate()} ${this.depositFromExchangeTemplate()}
2406      </wui-flex>
2407    `}async setDefaultPaymentAsset(){if(!this.activeCaipNetwork)return;let e=await eo.g.getAssetsForNetwork(this.activeCaipNetwork.caipNetworkId),t=e.find(e=>"USDC"===e.metadata.symbol)||e[0];t&&eo.g.setPaymentAsset(t)}onrampTemplate(){if(!this.activeCaipNetwork)return null;let e=this.remoteFeatures?.onramp,t=G.oU.ONRAMP_SUPPORTED_CHAIN_NAMESPACES.includes(this.activeCaipNetwork.chainNamespace);return e&&t?(0,r.qy)`
2408      <wui-list-item
2409        @click=${this.onBuyCrypto.bind(this)}
2410        icon="card"
2411        data-testid="wallet-features-onramp-button"
2412      >
2413        <wui-text variant="lg-regular" color="primary">Buy crypto</wui-text>
2414      </wui-list-item>
2415    `:null}depositFromExchangeTemplate(){return this.activeCaipNetwork&&eo.g.isPayWithExchangeSupported()?(0,r.qy)`
2416      <wui-list-item
2417        @click=${this.onDepositFromExchange.bind(this)}
2418        icon="arrowBottomCircle"
2419        data-testid="wallet-features-deposit-from-exchange-button"
2420        ?loading=${this.exchangesLoading}
2421        ?disabled=${this.exchangesLoading||!this.exchanges.length}
2422      >
2423        <wui-text variant="lg-regular" color="primary">Deposit from exchange</wui-text>
2424      </wui-list-item>
2425    `:null}receiveTemplate(){return this.features?.receive?(0,r.qy)`
2426      <wui-list-item
2427        @click=${this.onReceive.bind(this)}
2428        icon="qrCode"
2429        data-testid="wallet-features-receive-button"
2430      >
2431        <wui-text variant="lg-regular" color="primary">Receive funds</wui-text>
2432      </wui-list-item>
2433    `:null}onBuyCrypto(){J.I.push("OnRampProviders")}onReceive(){J.I.push("WalletReceive")}onDepositFromExchange(){eo.g.reset(),J.I.push("PayWithExchange",{redirectView:J.I.state.data?.redirectView})}};tt([(0,n.wk)()],ti.prototype,"activeCaipNetwork",void 0),tt([(0,n.wk)()],ti.prototype,"features",void 0),tt([(0,n.wk)()],ti.prototype,"remoteFeatures",void 0),tt([(0,n.wk)()],ti.prototype,"exchangesLoading",void 0),tt([(0,n.wk)()],ti.prototype,"exchanges",void 0),ti=tt([(0,u.EM)("w3m-fund-wallet-view")],ti);var tr=i(67786);let tn=(0,m.AH)`
2434  :host {
2435    display: flex;
2436    align-items: center;
2437    justify-content: center;
2438  }
2439
2440  label {
2441    position: relative;
2442    display: inline-block;
2443    user-select: none;
2444    transition:
2445      background-color ${({durations:e})=>e.lg}
2446        ${({easings:e})=>e["ease-out-power-2"]},
2447      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2448      border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2449      box-shadow ${({durations:e})=>e.lg}
2450        ${({easings:e})=>e["ease-out-power-2"]},
2451      width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2452      height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2453      transform ${({durations:e})=>e.lg}
2454        ${({easings:e})=>e["ease-out-power-2"]},
2455      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
2456    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
2457  }
2458
2459  input {
2460    width: 0;
2461    height: 0;
2462    opacity: 0;
2463  }
2464
2465  span {
2466    position: absolute;
2467    cursor: pointer;
2468    top: 0;
2469    left: 0;
2470    right: 0;
2471    bottom: 0;
2472    background-color: ${({colors:e})=>e.neutrals300};
2473    border-radius: ${({borderRadius:e})=>e.round};
2474    border: 1px solid transparent;
2475    will-change: border;
2476    transition:
2477      background-color ${({durations:e})=>e.lg}
2478        ${({easings:e})=>e["ease-out-power-2"]},
2479      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2480      border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2481      box-shadow ${({durations:e})=>e.lg}
2482        ${({easings:e})=>e["ease-out-power-2"]},
2483      width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2484      height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2485      transform ${({durations:e})=>e.lg}
2486        ${({easings:e})=>e["ease-out-power-2"]},
2487      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
2488    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
2489  }
2490
2491  span:before {
2492    content: '';
2493    position: absolute;
2494    background-color: ${({colors:e})=>e.white};
2495    border-radius: 50%;
2496  }
2497
2498  /* -- Sizes --------------------------------------------------------- */
2499  label[data-size='lg'] {
2500    width: 48px;
2501    height: 32px;
2502  }
2503
2504  label[data-size='md'] {
2505    width: 40px;
2506    height: 28px;
2507  }
2508
2509  label[data-size='sm'] {
2510    width: 32px;
2511    height: 22px;
2512  }
2513
2514  label[data-size='lg'] > span:before {
2515    height: 24px;
2516    width: 24px;
2517    left: 4px;
2518    top: 3px;
2519  }
2520
2521  label[data-size='md'] > span:before {
2522    height: 20px;
2523    width: 20px;
2524    left: 4px;
2525    top: 3px;
2526  }
2527
2528  label[data-size='sm'] > span:before {
2529    height: 16px;
2530    width: 16px;
2531    left: 3px;
2532    top: 2px;
2533  }
2534
2535  /* -- Focus states --------------------------------------------------- */
2536  input:focus-visible:not(:checked) + span,
2537  input:focus:not(:checked) + span {
2538    border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
2539    background-color: ${({tokens:e})=>e.theme.textTertiary};
2540    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
2541  }
2542
2543  input:focus-visible:checked + span,
2544  input:focus:checked + span {
2545    border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
2546    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
2547  }
2548
2549  /* -- Checked states --------------------------------------------------- */
2550  input:checked + span {
2551    background-color: ${({tokens:e})=>e.core.iconAccentPrimary};
2552  }
2553
2554  label[data-size='lg'] > input:checked + span:before {
2555    transform: translateX(calc(100% - 9px));
2556  }
2557
2558  label[data-size='md'] > input:checked + span:before {
2559    transform: translateX(calc(100% - 9px));
2560  }
2561
2562  label[data-size='sm'] > input:checked + span:before {
2563    transform: translateX(calc(100% - 7px));
2564  }
2565
2566  /* -- Hover states ------------------------------------------------------- */
2567  label:hover > input:not(:checked):not(:disabled) + span {
2568    background-color: ${({colors:e})=>e.neutrals400};
2569  }
2570
2571  label:hover > input:checked:not(:disabled) + span {
2572    background-color: ${({colors:e})=>e.accent080};
2573  }
2574
2575  /* -- Disabled state --------------------------------------------------- */
2576  label:has(input:disabled) {
2577    pointer-events: none;
2578    user-select: none;
2579  }
2580
2581  input:not(:checked):disabled + span {
2582    background-color: ${({colors:e})=>e.neutrals700};
2583  }
2584
2585  input:checked:disabled + span {
2586    background-color: ${({colors:e})=>e.neutrals700};
2587  }
2588
2589  input:not(:checked):disabled + span::before {
2590    background-color: ${({colors:e})=>e.neutrals400};
2591  }
2592
2593  input:checked:disabled + span::before {
2594    background-color: ${({tokens:e})=>e.theme.textTertiary};
2595  }
2596`;var ts=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let ta=class extends r.WF{constructor(){super(...arguments),this.inputElementRef=(0,tr._)(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return(0,r.qy)`
2597      <label data-size=${this.size}>
2598        <input
2599          ${(0,tr.K)(this.inputElementRef)}
2600          type="checkbox"
2601          ?checked=${this.checked}
2602          ?disabled=${this.disabled}
2603          @change=${this.dispatchChangeEvent.bind(this)}
2604        />
2605        <span></span>
2606      </label>
2607    `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};ta.styles=[p.W5,p.fD,tn],ts([(0,n.MZ)({type:Boolean})],ta.prototype,"checked",void 0),ts([(0,n.MZ)({type:Boolean})],ta.prototype,"disabled",void 0),ts([(0,n.MZ)()],ta.prototype,"size",void 0),ta=ts([(0,g.E)("wui-toggle")],ta);let to=(0,m.AH)`
2608  :host {
2609    height: auto;
2610  }
2611
2612  :host > wui-flex {
2613    height: 100%;
2614    display: flex;
2615    align-items: center;
2616    justify-content: center;
2617    column-gap: ${({spacing:e})=>e["2"]};
2618    padding: ${({spacing:e})=>e["2"]} ${({spacing:e})=>e["3"]};
2619    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2620    border-radius: ${({borderRadius:e})=>e["4"]};
2621    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
2622    transition: background-color ${({durations:e})=>e.lg}
2623      ${({easings:e})=>e["ease-out-power-2"]};
2624    will-change: background-color;
2625    cursor: pointer;
2626  }
2627
2628  wui-switch {
2629    pointer-events: none;
2630  }
2631`;var tl=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tc=class extends r.WF{constructor(){super(...arguments),this.checked=!1}
2631render(){return(0,r.qy)`
2632      <wui-flex>
2633        <wui-icon size="xl" name="walletConnectBrown"></wui-icon>
2634        <wui-toggle
2635          ?checked=${this.checked}
2636          size="sm"
2637          @switchChange=${this.handleToggleChange.bind(this)}
2638        ></wui-toggle>
2639      </wui-flex>
2640    `}handleToggleChange(e){e.stopPropagation(),this.checked=e.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};tc.styles=[p.W5,p.fD,to],tl([(0,n.MZ)({type:Boolean})],tc.prototype,"checked",void 0),tc=tl([(0,g.E)("wui-certified-switch")],tc),i(19493);let td=(0,m.AH)`
2641  :host {
2642    position: relative;
2643    display: inline-block;
2644    width: 100%;
2645  }
2646
2647  wui-icon {
2648    position: absolute;
2649    top: 50%;
2650    transform: translateY(-50%);
2651    right: ${({spacing:e})=>e[3]};
2652    color: ${({tokens:e})=>e.theme.iconDefault};
2653    cursor: pointer;
2654    padding: ${({spacing:e})=>e[2]};
2655    background-color: transparent;
2656    border-radius: ${({borderRadius:e})=>e[4]};
2657    transition: background-color ${({durations:e})=>e.lg}
2658      ${({easings:e})=>e["ease-out-power-2"]};
2659  }
2660
2661  @media (hover: hover) {
2662    wui-icon:hover {
2663      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2664    }
2665  }
2666`;var th=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tu=class extends r.WF{constructor(){super(...arguments),this.inputComponentRef=(0,tr._)(),this.inputValue=""}render(){return(0,r.qy)`
2667      <wui-input-text
2668        ${(0,tr.K)(this.inputComponentRef)}
2669        placeholder="Search wallet"
2670        icon="search"
2671        type="search"
2672        enterKeyHint="search"
2673        size="sm"
2674        @inputChange=${this.onInputChange}
2675      >
2676        ${this.inputValue?(0,r.qy)`<wui-icon
2677              @click=${this.clearValue}
2678              color="inherit"
2679              size="sm"
2680              name="close"
2681            ></wui-icon>`:null}
2682      </wui-input-text>
2683    `}onInputChange(e){this.inputValue=e.detail||""}clearValue(){let e=this.inputComponentRef.value,t=e?.inputElementRef.value;t&&(t.value="",this.inputValue="",t.focus(),t.dispatchEvent(new Event("input")))}};tu.styles=[p.W5,td],th([(0,n.MZ)()],tu.prototype,"inputValue",void 0),tu=th([(0,g.E)("wui-search-bar")],tu);var tp=i(92929),tf=i(7046),tg=i(31320);i(63270);let tm=(0,m.AH)`
2684  :host {
2685    display: flex;
2686    flex-direction: column;
2687    justify-content: center;
2688    align-items: center;
2689    height: 104px;
2690    width: 104px;
2691    row-gap: ${({spacing:e})=>e[2]};
2692    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2693    border-radius: ${({borderRadius:e})=>e[5]};
2694    position: relative;
2695  }
2696
2697  wui-shimmer[data-type='network'] {
2698    border: none;
2699    -webkit-clip-path: var(--apkt-path-network);
2700    clip-path: var(--apkt-path-network);
2701  }
2702
2703  svg {
2704    position: absolute;
2705    width: 48px;
2706    height: 54px;
2707    z-index: 1;
2708  }
2709
2710  svg > path {
2711    stroke: ${({tokens:e})=>e.theme.foregroundSecondary};
2712    stroke-width: 1px;
2713  }
2714
2715  @media (max-width: 350px) {
2716    :host {
2717      width: 100%;
2718    }
2719  }
2720`;var tw=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let ty=class extends r.WF{constructor(){super(...arguments),this.type="wallet"}render(){return(0,r.qy)`
2721      ${this.shimmerTemplate()}
2722      <wui-shimmer width="80px" height="20px"></wui-shimmer>
2723    `}shimmerTemplate(){return"network"===this.type?(0,r.qy)` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
2724        ${tg.a}`:(0,r.qy)`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}};ty.styles=[p.W5,p.fD,tm],tw([(0,n.MZ)()],ty.prototype,"type",void 0),ty=tw([(0,g.E)("wui-card-select-loader")],ty);let tb=(0,r.AH)`
2725  :host {
2726    display: grid;
2727    width: inherit;
2728    height: inherit;
2729  }
2730`;var tv=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tC=class extends r.WF{render(){return this.style.cssText=`
2731      grid-template-rows: ${this.gridTemplateRows};
2732      grid-template-columns: ${this.gridTemplateColumns};
2733      justify-items: ${this.justifyItems};
2734      align-items: ${this.alignItems};
2735      justify-content: ${this.justifyContent};
2736      align-content: ${this.alignContent};
2737      column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
2738      row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
2739      gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
2740      padding-top: ${this.padding&&f.Z.getSpacingStyles(this.padding,0)};
2741      padding-right: ${this.padding&&f.Z.getSpacingStyles(this.padding,1)};
2742      padding-bottom: ${this.padding&&f.Z.getSpacingStyles(this.padding,2)};
2743      padding-left: ${this.padding&&f.Z.getSpacingStyles(this.padding,3)};
2744      margin-top: ${this.margin&&f.Z.getSpacingStyles(this.margin,
27440)};
2745      margin-right: ${this.margin&&f.Z.getSpacingStyles(this.margin,1)};
2746      margin-bottom: ${this.margin&&f.Z.getSpacingStyles(this.margin,2)};
2747      margin-left: ${this.margin&&f.Z.getSpacingStyles(this.margin,3)};
2748    `,(0,r.qy)`<slot></slot>`}};tC.styles=[p.W5,tb],tv([(0,n.MZ)()],tC.prototype,"gridTemplateRows",void 0),tv([(0,n.MZ)()],tC.prototype,"gridTemplateColumns",void 0),tv([(0,n.MZ)()],tC.prototype,"justifyItems",void 0),tv([(0,n.MZ)()],tC.prototype,"alignItems",void 0),tv([(0,n.MZ)()],tC.prototype,"justifyContent",void 0),tv([(0,n.MZ)()],tC.prototype,"alignContent",void 0),tv([(0,n.MZ)()],tC.prototype,"columnGap",void 0),tv([(0,n.MZ)()],tC.prototype,"rowGap",void 0),tv([(0,n.MZ)()],tC.prototype,"gap",void 0),tv([(0,n.MZ)()],tC.prototype,"padding",void 0),tv([(0,n.MZ)()],tC.prototype,"margin",void 0),tC=tv([(0,g.E)("wui-grid")],tC),i(26400),i(18128);let tE=(0,u.AH)`
2749  button {
2750    display: flex;
2751    flex-direction: column;
2752    justify-content: center;
2753    align-items: center;
2754    cursor: pointer;
2755    width: 104px;
2756    row-gap: ${({spacing:e})=>e["2"]};
2757    padding: ${({spacing:e})=>e["3"]} ${({spacing:e})=>e["0"]};
2758    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2759    border-radius: clamp(0px, ${({borderRadius:e})=>e["4"]}, 20px);
2760    transition:
2761      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]},
2762      background-color ${({durations:e})=>e.lg}
2763        ${({easings:e})=>e["ease-out-power-1"]},
2764      border-radius ${({durations:e})=>e.lg}
2765        ${({easings:e})=>e["ease-out-power-1"]};
2766    will-change: background-color, color, border-radius;
2767    outline: none;
2768    border: none;
2769  }
2770
2771  button > wui-flex > wui-text {
2772    color: ${({tokens:e})=>e.theme.textPrimary};
2773    max-width: 86px;
2774    white-space: nowrap;
2775    overflow: hidden;
2776    text-overflow: ellipsis;
2777    justify-content: center;
2778  }
2779
2780  button > wui-flex > wui-text.certified {
2781    max-width: 66px;
2782  }
2783
2784  @media (hover: hover) and (pointer: fine) {
2785    button:hover:enabled {
2786      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2787    }
2788  }
2789
2790  button:disabled > wui-flex > wui-text {
2791    color: ${({tokens:e})=>e.core.glass010};
2792  }
2793
2794  [data-selected='true'] {
2795    background-color: ${({colors:e})=>e.accent020};
2796  }
2797
2798  @media (hover: hover) and (pointer: fine) {
2799    [data-selected='true']:hover:enabled {
2800      background-color: ${({colors:e})=>e.accent010};
2801    }
2802  }
2803
2804  [data-selected='true']:active:enabled {
2805    background-color: ${({colors:e})=>e.accent010};
2806  }
2807
2808  @media (max-width: 350px) {
2809    button {
2810      width: 100%;
2811    }
2812  }
2813`;var tx=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tA=class extends r.WF{constructor(){super(),this.observer=new IntersectionObserver(()=>void 0),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.isImpressed=!1,this.explorerId="",this.walletQuery="",this.certified=!1,this.displayIndex=0,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(this.visible=!0,this.fetchImageSrc(),this.sendImpressionEvent()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){let e=this.wallet?.badge_type==="certified";return(0,r.qy)`
2814      <button>
2815        ${this.imageTemplate()}
2816        <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
2817          <wui-text
2818            variant="md-regular"
2819            color="inherit"
2820            class=${(0,s.J)(e?"certified":void 0)}
2821            >${this.wallet?.name}</wui-text
2822          >
2823          ${e?(0,r.qy)`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
2824        </wui-flex>
2825      </button>
2826    `}imageTemplate(){return(this.visible||this.imageSrc)&&!this.imageLoading?(0,r.qy)`
2827      <wui-wallet-image
2828        size="lg"
2829        imageSrc=${(0,s.J)(this.imageSrc)}
2830        name=${(0,s.J)(this.wallet?.name)}
2831        .installed=${this.wallet?.installed??!1}
2832        badgeSize="sm"
2833      >
2834      </wui-wallet-image>
2835    `:this.shimmerTemplate()}shimmerTemplate(){return(0,r.qy)`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}async fetchImageSrc(){!this.wallet||(this.imageSrc=c.$.getWalletImage(this.wallet),this.imageSrc||(this.imageLoading=!0,this.imageSrc=await c.$.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}sendImpressionEvent(){this.wallet&&!this.isImpressed&&(this.isImpressed=!0,M.E.sendWalletImpressionEvent({name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.explorerId,view:J.I.state.view,query:this.walletQuery,certified:this.certified,displayIndex:this.displayIndex}))}};tA.styles=tE,tx([(0,n.wk)()],tA.prototype,"visible",void 0),tx([(0,n.wk)()],tA.prototype,"imageSrc",void 0),tx([(0,n.wk)()],tA.prototype,"imageLoading",void 0),tx([(0,n.wk)()],tA.prototype,"isImpressed",void 0),tx([(0,n.MZ)()],tA.prototype,"explorerId",void 0),tx([(0,n.MZ)()],tA.prototype,"walletQuery",void 0),tx([(0,n.MZ)()],tA.prototype,"certified",void 0),tx([(0,n.MZ)()],tA.prototype,"displayIndex",void 0),tx([(0,n.MZ)({type:Object})],tA.prototype,"wallet",void 0),tA=tx([(0,u.EM)("w3m-all-wallets-list-item")],tA);let t_=(0,u.AH)`
2836  wui-grid {
2837    max-height: clamp(360px, 400px, 80vh);
2838    overflow: scroll;
2839    scrollbar-width: none;
2840    grid-auto-rows: min-content;
2841    grid-template-columns: repeat(auto-fill, 104px);
2842  }
2843
2844  :host([data-mobile-fullscreen='true']) wui-grid {
2845    max-height: none;
2846  }
2847
2848  @media (max-width: 350px) {
2849    wui-grid {
2850      grid-template-columns: repeat(2, 1fr);
2851    }
2852  }
2853
2854  wui-grid[data-scroll='false'] {
2855    overflow: hidden;
2856  }
2857
2858  wui-grid::-webkit-scrollbar {
2859    display: none;
2860  }
2861
2862  w3m-all-wallets-list-item {
2863    opacity: 0;
2864    animation-duration: ${({durations:e})=>e.xl};
2865    animation-timing-function: ${({easings:e})=>e["ease-inout-power-2"]};
2866    animation-name: fade-in;
2867    animation-fill-mode: forwards;
2868  }
2869
2870  @keyframes fade-in {
2871    from {
2872      opacity: 0;
2873    }
2874    to {
2875      opacity: 1;
2876    }
2877  }
2878
2879  wui-loading-spinner {
2880    padding-top: ${({spacing:e})=>e["4"]};
2881    padding-bottom: ${({spacing:e})=>e["4"]};
2882    justify-content: center;
2883    grid-column: 1 / span 4;
2884  }
2885`;var tI=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tS="local-paginator",tN=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!tp.N.state.wallets.length,this.wallets=tp.N.state.wallets,this.mobileFullScreen=a.H.state.enableMobileFullScreen,this.unsubscribe.push(tp.N.subscribeKey("wallets",e=>this.wallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.paginationObserver?.disconnect()}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),(0,r.qy)`
2886      <wui-grid
2887        data-scroll=${!this.loading}
2888        .padding=${["0","3","3","3"]}
2889        gap="2"
2890        justifyContent="space-between"
2891      >
2892        ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
2893        ${this.paginationLoaderTemplate()}
2894      </wui-grid>
2895    `}async initialFetch(){this.loading=!0;let e=this.shadowRoot?.querySelector("wui-grid");e&&(await tp.N.fetchWalletsByPage({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,t){return[...Array(e)].map(()=>(0,r.qy)`
2896        <wui-card-select-loader type="wallet" id=${(0,s.J)(t)}></wui-card-select-loader>
2897      `)}walletsTemplate(){return tf.A.getWalletConnectWallets(this.wallets).map((e,t)=>(0,r.qy)`
2898        <w3m-all-wallets-list-item
2899          data-testid="wallet-search-item-${e.id}"
2900          @click=${()=>this.onConnectWallet(e)}
2901          .wallet=${e}
2902          explorerId=${e.id}
2903          certified=${"certified"===this.badge}
2904          displayIndex=${t}
2905        ></w3m-all-wallets-list-item>
2906      `)}paginationLoaderTemplate(){let{wallets:e,recommended:t,featured:i,count:r,mobileFilteredOutWalletsLength:n}=tp.N.state,s=window.innerWidth<352?3:4,a=e.length+t.length,o=Math.ceil(a/s)*s-a+s;return(o-=e.length?i.length%s:0,0===r&&i.length>0)?null:0===r||[...i,...e,...t].length<r-(n??0)?this.shimmerTemplate(o,tS):null}createPaginationObserver(){let e=this.shadowRoot?.querySelector(`#${tS}`);e&&(this.paginationObserver=new IntersectionObserver(([e])=>{if(e?.isIntersecting&&!this.loading){let{page:e,count:t,wallets:i}=tp.N.state;i.length<t&&tp.N.fetchWalletsByPage({page:e+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){K.a.selectWalletConnector(e)}};tN.styles=t_,tI([(0,n.wk)()],tN.prototype,"loading",void 0),tI([(0,n.wk)()],tN.prototype,"wallets",void 0),tI([(0,n.wk)()],tN.prototype,"badge",void 0),tI([(0,n.wk)()],tN.prototype,"mobileFullScreen",void 0),tN=tI([(0,u.EM)("w3m-all-wallets-list")],tN),i(66463);let tk=(0,r.AH)`
2907  wui-grid,
2908  wui-loading-spinner,
2909  wui-flex {
2910    height: 360px;
2911  }
2912
2913  wui-grid {
2914    overflow: scroll;
2915    scrollbar-width: none;
2916    grid-auto-rows: min-content;
2917    grid-template-columns: repeat(auto-fill, 104px);
2918  }
2919
2920  :host([data-mobile-fullscreen='true']) wui-grid {
2921    max-height: none;
2922    height: auto;
2923  }
2924
2925  wui-grid[data-scroll='false'] {
2926    overflow: hidden;
2927  }
2928
2929  wui-grid::-webkit-scrollbar {
2930    display: none;
2931  }
2932
2933  wui-loading-spinner {
2934    justify-content: center;
2935    align-items: center;
2936  }
2937
2938  @media (max-width: 350px) {
2939    wui-grid {
2940      grid-template-columns: repeat(2, 1fr);
2941    }
2942  }
2943`;var tT=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tO=class extends r.WF{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.mobileFullScreen=a.H.state.enableMobileFullScreen,this.query=""}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.onSearch(),this.loading?(0,r.qy)`<wui-loading-spinner color="accent-primary"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await tp.N.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){let{search:e}=tp.N.state,t=tf.A.markWalletsAsInstalled(e),i=tf.A.filterWalletsByWcSupport(t);return i.length?(0,r.qy)`
2944      <wui-grid
2945        data-testid="wallet-list"
2946        .padding=${["0","3","3","3"]}
2947        rowGap="4"
2948        columngap="2"
2949        justifyContent="space-between"
2950      >
2951        ${i.map((e,t)=>(0,r.qy)`
2952            <w3m-all-wallets-list-item
2953              @click=${()=>this.onConnectWallet(e)}
2954              .wallet=${e}
2955              data-testid="wallet-search-item-${e.id}"
2956              explorerId=${e.id}
2957              certified=${"certified"===this.badge}
2958              walletQuery=${this.query}
2959              displayIndex=${t}
2960            ></w3m-all-wallets-list-item>
2961          `)}
2962      </wui-grid>
2963    `:(0,r.qy)`
2964        <wui-flex
2965          data-testid="no-wallet-found"
2966          justifyContent="center"
2967          alignItems="center"
2968          gap="3"
2969          flexDirection="column"
2970        >
2971          <wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
2972          <wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
2973            No Wallet found
2974          </wui-text>
2975        </wui-flex>
2976      `}onConnectWallet(e){K.a.selectWalletConnector(e)}};tO.styles=tk,tT([(0,n.wk)()],tO.prototype,"loading",void 0),tT([(0,n.wk)()],tO.prototype,"mobileFullScreen",void 0),tT([(0,n.MZ)()],tO.prototype,"query",void 0),tT([(0,n.MZ)()],tO.prototype,"badge",void 0),tO=tT([(0,u.EM)("w3m-all-wallets-search")],tO);var tR=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tP=class extends r.WF{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=d.w.debounce(e=>{this.search=e})}render(){let e=this.search.length>=2;return(0,r.qy)`
2977      <wui-flex .padding=${["1","3","3","3"]} gap="2" alignItems="center">
2978        <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
2979        <wui-certified-switch
2980          ?checked=${"certified"===this.badge}
2981          @certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
2982          data-testid="wui-certified-switch"
2983        ></wui-certified-switch>
2984        ${this.qrButtonTemplate()}
2985      </wui-flex>
2986      ${e||this.badge?(0,r.qy)`<w3m-all-wallets-search
2987            query=${this.search}
2988            .badge=${this.badge}
2989          ></w3m-all-wallets-search>`:(0,r.qy)`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
2990    `}onInputChange(e){this.onDebouncedSearch(e.detail)}onCertifiedSwitchChange(e){e.detail?(this.badge="certified",Y.P.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return d.w.isMobile()?(0,r.qy)`
2991        <wui-icon-box
2992          size="xl"
2993          iconSize="xl"
2994          color="accent-primary"
2995          icon="qrCode"
2996          border
2997          borderColor="wui-accent-glass-010"
2998          @click=${this.onWalletConnectQr.bind(this)}
2999        ></wui-icon-box>
3000      `:null}onWalletConnectQr(){J.I.push("ConnectingWalletConnect")}};tR([(0,n.wk)()],tP.prototype,"search",void 0),tR([(0,n.wk)()],tP.prototype,"badge",void 0),tP=tR([(0,u.EM)("w3m-all-wallets-view")],tP);var t$=i(97734),tU=i(74016);let tM=(0,m.AH)`
3001  button {
3002    display: flex;
3003    gap: ${({spacing:e})=>e[1]};
3004    padding: ${({spacing:e})=>e[4]};
3005    width: 100%;
3006    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3007    border-radius: ${({borderRadius:e})=>e[4]};
3008    justify-content: center;
3009    align-items: center;
3010  }
3011
3012  :host([data-size='sm']) button {
3013    padding: ${({spacing:e})=>e[2]};
3014    border-radius: ${({borderRadius:e})=>e[2]};
3015  }
3016
3017  :host([data-size='md']) button {
3018    padding: ${({spacing:e})=>e[3]};
3019    border-radius: ${({borderRadius:e})=>e[3]};
3020  }
3021
3022  button:hover {
3023    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
3024  }
3025
3026  button:disabled {
3027    opacity: 0.5;
3028  }
3029`;var tD=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tL=class extends r.WF{constructor(){super(...arguments),this.text="",this.disabled=!1,this.size="lg",this.icon="copy",this.tabIdx=void 0}render(){this.dataset.size=this.size;let e=`${this.size}-regular`;return(0,r.qy)`
3030      <button ?disabled=${this.disabled} tabindex=${(0,s.J)(this.tabIdx)}>
3031        <wui-icon name=${this.icon} size=${this.size} color="default"></wui-icon>
3032        <wui-text align="center" variant=${e} color="primary">${this.text}</wui-text>
3033      </button>
3034    `}};tL.styles=[p.W5,p.fD,tM],tD([(0,n.MZ)()],tL.prototype,"text",void 0),tD([(0,n.MZ)({type:Boolean})],tL.prototype,"disabled",void 0),tD([(0,n.MZ)()],tL.prototype,"size",void 0),tD([(0,n.MZ)()],tL.prototype,"icon",void 0),tD([(0,n.MZ)()],tL.prototype,"tabIdx",void 0),tL=tD([(0,g.E)("wui-list-button")],tL),i(97745);var tW=i(13226),tB=i(25663);i(48657);var tj=i(60945);let tF=(0,u.AH)`
3035  wui-separator {
3036    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1);
3037    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
3038  }
3039
3040  wui-email-input {
3041    width: 100%;
3042  }
3043
3044  form {
3045    width: 100%;
3046    display: block;
3047    position: relative;
3048  }
3049
3050  wui-icon-link,
3051  wui-loading-spinner {
3052    position: absolute;
3053    top: 50%;
3054    transform: translateY(-50%);
3055  }
3056
3057  wui-icon-link {
3058    right: ${({spacing:e})=>e["2"]};
3059  }
3060
3061  wui-loading-spinner {
3062    right: ${({spacing:e})=>e["3"]};
3063  }
3064
3065  wui-text {
3066    margin: ${({spacing:e})=>e["2"]} ${({spacing:e})=>e["3"]}
3067      ${({spacing:e})=>e["0"]} ${({spacing:e})=>e["3"]};
3068  }
3069`;var tH=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tq=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.formRef=(0,tr._)(),this.email="",this.loading=!1,this.error="",this.remoteFeatures=a.H.state.remoteFeatures,this.hasExceededUsageLimit=tp.N.state.plan.hasExceededUsageLimit,this.unsubscribe.push(a.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}),tp.N.subscribeKey("plan",e=>this.hasExceededUsageLimit=e.hasExceededUsageLimit))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.formRef.value?.addEventListener("keydown",e=>{"Enter"===e.key&&this.onSubmitEmail(e)})}render(){let e=X.x.hasAnyConnection(Z.o.CONNECTOR_ID.AUTH);return(0,r.qy)`
3070      <form ${(0,tr.K)(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
3071        <wui-email-input
3072          @focus=${this.onFocusEvent.bind(this)}
3073          .disabled=${this.loading}
3074          @inputChange=${this.onEmailInputChange.bind(this)}
3075          tabIdx=${(0,s.J)(this.tabIdx)}
3076          ?disabled=${e||this.hasExceededUsageLimit}
3077        >
3078        </wui-email-input>
3079
3080        ${this.submitButtonTemplate()}${this.loadingTemplate()}
3081        <input type="submit" hidden />
3082      </form>
3083      ${this.templateError()}
3084    `}submitButtonTemplate(){return!this.loading&&this.email.length>3?(0,r.qy)`
3085          <wui-icon-link
3086            size="lg"
3087            icon="chevronRight"
3088            iconcolor="accent-100"
3089            @click=${this.onSubmitEmail.bind(this)}
3090          >
3091          </wui-icon-link>
3092        `:null}loadingTemplate(){return this.loading?(0,r.qy)`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:null}templateError(){return this.error?(0,r.qy)`<wui-text variant="sm-medium" color="error">${this.error}</wui-text>`:null}onEmailInputChange(e){this.email=e.detail.trim(),this.error=""}async onSubmitEmail(e){if(!ek.y.isValidEmail(this.email))return void tB.h.open({displayMessage:tj.R.ALERT_WARNINGS.INVALID_EMAIL.displayMessage},"warning");if(!Z.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>e===o.W.state.activeChain)){let e=o.W.getFirstCaipNetworkSupportsAuthConnector();if(e)return void J.I.push("SwitchNetwork",{network:e})}try{if(this.loading)return;this.loading=!0,e.preventDefault();let t=K.a.getAuthConnector();if(!t)throw Error("w3m-email-login-widget: Auth connector not found");let{action:i}=await t.provider.connectEmail({email:this.email});if(M.E.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),"VERIFY_OTP"===i)M.E.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),J.I.push("EmailVerifyOtp",{email:this.email});
3092else if("VERIFY_DEVICE"===i)J.I.push("EmailVerifyDevice",{email:this.email});else if("CONNECT"===i){let e=this.remoteFeatures?.multiWallet;await X.x.connectExternal(t,o.W.state.activeChain),e?(J.I.replace("ProfileWallets"),Y.P.showSuccess("New Wallet Added")):J.I.replace("Account")}}catch(t){let e=d.w.parseError(t);e?.includes("Invalid email")?this.error="Invalid email. Try again.":Y.P.showError(t)}finally{this.loading=!1}}onFocusEvent(){M.E.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};tq.styles=tF,tH([(0,n.MZ)()],tq.prototype,"tabIdx",void 0),tH([(0,n.wk)()],tq.prototype,"email",void 0),tH([(0,n.wk)()],tq.prototype,"loading",void 0),tH([(0,n.wk)()],tq.prototype,"error",void 0),tH([(0,n.wk)()],tq.prototype,"remoteFeatures",void 0),tH([(0,n.wk)()],tq.prototype,"hasExceededUsageLimit",void 0),tq=tH([(0,u.EM)("w3m-email-login-widget")],tq),i(73989);var tz=i(89373);i(32297),i(86212);let tV=(0,m.AH)`
3093  :host {
3094    display: block;
3095    width: 100%;
3096  }
3097
3098  button {
3099    width: 100%;
3100    height: 52px;
3101    display: flex;
3102    align-items: center;
3103    justify-content: center;
3104    background: ${({tokens:e})=>e.theme.foregroundPrimary};
3105    border-radius: ${({borderRadius:e})=>e[4]};
3106  }
3107
3108  @media (hover: hover) {
3109    button:hover:enabled {
3110      background: ${({tokens:e})=>e.theme.foregroundSecondary};
3111    }
3112  }
3113
3114  button:disabled {
3115    cursor: not-allowed;
3116    opacity: 0.5;
3117  }
3118`;var tZ=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tK=class extends r.WF{constructor(){super(...arguments),this.logo="google",this.disabled=!1,this.tabIdx=void 0}render(){return(0,r.qy)`
3119      <button ?disabled=${this.disabled} tabindex=${(0,s.J)(this.tabIdx)}>
3120        <wui-icon size="xxl" name=${this.logo}></wui-icon>
3121      </button>
3122    `}};tK.styles=[p.W5,p.fD,tV],tZ([(0,n.MZ)()],tK.prototype,"logo",void 0),tZ([(0,n.MZ)({type:Boolean})],tK.prototype,"disabled",void 0),tZ([(0,n.MZ)()],tK.prototype,"tabIdx",void 0),tK=tZ([(0,g.E)("wui-logo-select")],tK);var tG=i(24859);let tY=(0,u.AH)`
3123  wui-separator {
3124    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1)
3125      ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1);
3126    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
3127  }
3128`;var tJ=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let tX=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.walletGuide="get-started",this.tabIdx=void 0,this.connectors=K.a.state.connectors,this.remoteFeatures=a.H.state.remoteFeatures,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.isPwaLoading=!1,this.hasExceededUsageLimit=tp.N.state.plan.hasExceededUsageLimit,this.unsubscribe.push(K.a.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type)}),a.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e),tp.N.subscribeKey("plan",e=>this.hasExceededUsageLimit=e.hasExceededUsageLimit))}connectedCallback(){super.connectedCallback(),this.handlePwaFrameLoad()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,r.qy)`
3129      <wui-flex
3130        class="container"
3131        flexDirection="column"
3132        gap="2"
3133        data-testid="w3m-social-login-widget"
3134      >
3135        ${this.topViewTemplate()}${this.bottomViewTemplate()}
3136      </wui-flex>
3137    `}topViewTemplate(){let e="explore"===this.walletGuide,t=this.remoteFeatures?.socials;return!t&&e?(t=G.oU.DEFAULT_SOCIALS,this.renderTopViewContent(t)):t?this.renderTopViewContent(t):null}renderTopViewContent(e){return 2===e.length?(0,r.qy)` <wui-flex gap="2">
3138        ${e.slice(0,2).map(e=>(0,r.qy)`<wui-logo-select
3139              data-testid=${`social-selector-${e}`}
3140              @click=${()=>{this.onSocialClick(e)}}
3141              logo=${e}
3142              tabIdx=${(0,s.J)(this.tabIdx)}
3143              ?disabled=${this.isPwaLoading||this.hasConnection()}
3144            ></wui-logo-select>`)}
3145      </wui-flex>`:(0,r.qy)` <wui-list-button
3146      data-testid=${`social-selector-${e[0]}`}
3147      @click=${()=>{this.onSocialClick(e[0])}}
3148      size="lg"
3149      icon=${(0,s.J)(e[0])}
3150      text=${`Continue with ${u.Zv.capitalize(e[0])}`}
3151      tabIdx=${(0,s.J)(this.tabIdx)}
3152      ?disabled=${this.isPwaLoading||this.hasConnection()}
3153    ></wui-list-button>`}bottomViewTemplate(){let e=this.remoteFeatures?.socials,t="explore"===this.walletGuide;return(this.authConnector&&e&&0!==e.length||!t||(e=G.oU.DEFAULT_SOCIALS),!e||e.length<=2)?null:e&&e.length>6?(0,r.qy)`<wui-flex gap="2">
3154        ${e.slice(1,5).map(e=>(0,r.qy)`<wui-logo-select
3155              data-testid=${`social-selector-${e}`}
3156              @click=${()=>{this.onSocialClick(e)}}
3157              logo=${e}
3158              tabIdx=${(0,s.J)(this.tabIdx)}
3159              ?focusable=${void 0!==this.tabIdx&&this.tabIdx>=0}
3160              ?disabled=${this.isPwaLoading||this.hasConnection()}
3161            ></wui-logo-select>`)}
3162        <wui-logo-select
3163          logo="more"
3164          tabIdx=${(0,s.J)(this.tabIdx)}
3165          @click=${this.onMoreSocialsClick.bind(this)}
3166          ?disabled=${this.isPwaLoading||this.hasConnection()}
3167          data-testid="social-selector-more"
3168        ></wui-logo-select>
3169      </wui-flex>`:e?(0,r.qy)`<wui-flex gap="2">
3170      ${e.slice(1,e.length).map(e=>(0,r.qy)`<wui-logo-select
3171            data-testid=${`social-selector-${e}`}
3172            @click=${()=>{this.onSocialClick(e)}}
3173            logo=${e}
3174            tabIdx=${(0,s.J)(this.tabIdx)}
3175            ?focusable=${void 0!==this.tabIdx&&this.tabIdx>=0}
3176            ?disabled=${this.isPwaLoading||this.hasConnection()}
3177          ></wui-logo-select>`)}
3178    </wui-flex>`:null}onMoreSocialsClick(){J.I.push("ConnectSocials")}async onSocialClick(e){if(this.hasExceededUsageLimit)return void J.I.push("UsageExceeded");if(!Z.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>e===o.W.state.activeChain)){let e=o.W.getFirstCaipNetworkSupportsAuthConnector();if(e)return void J.I.push("SwitchNetwork",{network:e})}e&&await (0,tz.Up)(e)}async handlePwaFrameLoad(){if(d.w.isPWA()){this.isPwaLoading=!0;try{this.authConnector?.provider instanceof tG.Y&&await this.authConnector.provider.init()}catch(e){tB.h.open({displayMessage:"Error loading embedded wallet in PWA",debugMessage:e.message},"error")}finally{this.isPwaLoading=!1}}}hasConnection(){return X.x.hasAnyConnection(Z.o.CONNECTOR_ID.AUTH)}};tX.styles=tY,tJ([(0,n.MZ)()],tX.prototype,"walletGuide",void 0),tJ([(0,n.MZ)()],tX.prototype,"tabIdx",void 0),tJ([(0,n.wk)()],tX.prototype,"connectors",void 0),tJ([(0,n.wk)()],tX.prototype,"remoteFeatures",void 0),tJ([(0,n.wk)()],tX.prototype,"authConnector",void 0),tJ([(0,n.wk)()],tX.prototype,"isPwaLoading",void 0),tJ([(0,n.wk)()],tX.prototype,"hasExceededUsageLimit",void 0),tX=tJ([(0,u.EM)("w3m-social-login-widget")],tX),i(37082);var tQ=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let t0=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=K.a.state.connectors,this.count=tp.N.state.count,this.filteredCount=tp.N.state.filteredWallets.length,this.isFetchingRecommendedWallets=tp.N.state.isFetchingRecommendedWallets,this.unsubscribe.push(K.a.subscribeKey("connectors",e=>this.connectors=e),tp.N.subscribeKey("count",e=>this.count=e),tp.N.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),tp.N.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}
3178disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.find(e=>"walletConnect"===e.id),{allWallets:t}=a.H.state;if(!e||"HIDE"===t||"ONLY_MOBILE"===t&&!d.w.isMobile())return null;let i=tp.N.state.featured.length,n=this.count+i,o=n<10?n:10*Math.floor(n/10),l=this.filteredCount>0?this.filteredCount:o,c=`${l}`;this.filteredCount>0?c=`${this.filteredCount}`:l<n&&(c=`${l}+`);let h=X.x.hasAnyConnection(Z.o.CONNECTOR_ID.WALLET_CONNECT);return(0,r.qy)`
3179      <wui-list-wallet
3180        name="Search Wallet"
3181        walletIcon="search"
3182        showAllWallets
3183        @click=${this.onAllWallets.bind(this)}
3184        tagLabel=${c}
3185        tagVariant="info"
3186        data-testid="all-wallets"
3187        tabIdx=${(0,s.J)(this.tabIdx)}
3188        .loading=${this.isFetchingRecommendedWallets}
3189        ?disabled=${h}
3190        size="sm"
3191      ></wui-list-wallet>
3192    `}onAllWallets(){M.E.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),J.I.push("AllWallets",{redirectView:J.I.state.data?.redirectView})}};tQ([(0,n.MZ)()],t0.prototype,"tabIdx",void 0),tQ([(0,n.wk)()],t0.prototype,"connectors",void 0),tQ([(0,n.wk)()],t0.prototype,"count",void 0),tQ([(0,n.wk)()],t0.prototype,"filteredCount",void 0),tQ([(0,n.wk)()],t0.prototype,"isFetchingRecommendedWallets",void 0),t0=tQ([(0,u.EM)("w3m-all-wallets-widget")],t0);let t1=(0,u.AH)`
3193  :host {
3194    margin-top: ${({spacing:e})=>e["1"]};
3195  }
3196  wui-separator {
3197    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1)
3198      ${({spacing:e})=>e["2"]} calc(${({spacing:e})=>e["3"]} * -1);
3199    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
3200  }
3201`;var t2=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let t3=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.explorerWallets=tp.N.state.explorerWallets,this.connections=X.x.state.connections,this.connectorImages=l.j.state.connectorImages,this.loadingTelegram=!1,this.unsubscribe.push(X.x.subscribeKey("connections",e=>this.connections=e),l.j.subscribeKey("connectorImages",e=>this.connectorImages=e),tp.N.subscribeKey("explorerFilteredWallets",e=>{this.explorerWallets=e?.length?e:tp.N.state.explorerWallets}),tp.N.subscribeKey("explorerWallets",e=>{this.explorerWallets?.length||(this.explorerWallets=e)})),d.w.isTelegram()&&d.w.isIos()&&(this.loadingTelegram=!X.x.state.wcUri,this.unsubscribe.push(X.x.subscribeKey("wcUri",e=>this.loadingTelegram=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,r.qy)`
3202      <wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
3203    `}connectorListTemplate(){return eC.g.connectorList().map((e,t)=>"connector"===e.kind?this.renderConnector(e,t):this.renderWallet(e,t))}getConnectorNamespaces(e){return"walletConnect"===e.subtype?[]:"multiChain"===e.subtype?e.connector.connectors?.map(e=>e.chain)||[]:[e.connector.chain]}renderConnector(e,t){let i,n,a=e.connector,o=c.$.getConnectorImage(a)||this.connectorImages[a?.imageId??""],l=(this.connections.get(a.chain)??[]).some(e=>eX.y.isLowerCaseMatch(e.connectorId,a.id));"walletConnect"===e.subtype?(i="qr code",n="accent"):"injected"===e.subtype||"announced"===e.subtype?(i=l?"connected":"installed",n=l?"info":"success"):(i=void 0,n=void 0);let d=X.x.hasAnyConnection(Z.o.CONNECTOR_ID.WALLET_CONNECT),h=("walletConnect"===e.subtype||"external"===e.subtype)&&d;return(0,r.qy)`
3204      <w3m-list-wallet
3205        displayIndex=${t}
3206        imageSrc=${(0,s.J)(o)}
3207        .installed=${!0}
3208        name=${a.name??"Unknown"}
3209        .tagVariant=${n}
3210        tagLabel=${(0,s.J)(i)}
3211        data-testid=${`wallet-selector-${a.id.toLowerCase()}`}
3212        size="sm"
3213        @click=${()=>this.onClickConnector(e)}
3214        tabIdx=${(0,s.J)(this.tabIdx)}
3215        ?disabled=${h}
3216        rdnsId=${(0,s.J)(a.explorerWallet?.rdns||void 0)}
3217        walletRank=${(0,s.J)(a.explorerWallet?.order)}
3218        .namespaces=${this.getConnectorNamespaces(e)}
3219      >
3220      </w3m-list-wallet>
3221    `}onClickConnector(e){let t=J.I.state.data?.redirectView;if("walletConnect"===e.subtype){K.a.setActiveConnector(e.connector),d.w.isMobile()?J.I.push("AllWallets"):J.I.push("ConnectingWalletConnect",{redirectView:t});return}if("multiChain"===e.subtype){K.a.setActiveConnector(e.connector),J.I.push("ConnectingMultiChain",{redirectView:t});return}if("injected"===e.subtype){K.a.setActiveConnector(e.connector),J.I.push("ConnectingExter
3221nal",{connector:e.connector,redirectView:t,wallet:e.connector.explorerWallet});return}if("announced"===e.subtype)return"walletConnect"===e.connector.id?void(d.w.isMobile()?J.I.push("AllWallets"):J.I.push("ConnectingWalletConnect",{redirectView:t})):(J.I.push("ConnectingExternal",{connector:e.connector,redirectView:t,wallet:e.connector.explorerWallet}),void 0);J.I.push("ConnectingExternal",{connector:e.connector,redirectView:t})}renderWallet(e,t){let i=e.wallet,n=c.$.getWalletImage(i),a=X.x.hasAnyConnection(Z.o.CONNECTOR_ID.WALLET_CONNECT),o=this.loadingTelegram,l="recent"===e.subtype?"recent":void 0,d="recent"===e.subtype?"info":void 0;return(0,r.qy)`
3222      <w3m-list-wallet
3223        displayIndex=${t}
3224        imageSrc=${(0,s.J)(n)}
3225        name=${i.name??"Unknown"}
3226        @click=${()=>this.onClickWallet(e)}
3227        size="sm"
3228        data-testid=${`wallet-selector-${i.id}`}
3229        tabIdx=${(0,s.J)(this.tabIdx)}
3230        ?loading=${o}
3231        ?disabled=${a}
3232        rdnsId=${(0,s.J)(i.rdns||void 0)}
3233        walletRank=${(0,s.J)(i.order)}
3234        tagLabel=${(0,s.J)(l)}
3235        .tagVariant=${d}
3236      >
3237      </w3m-list-wallet>
3238    `}onClickWallet(e){let t=J.I.state.data?.redirectView,i=o.W.state.activeChain;if("featured"===e.subtype)return void K.a.selectWalletConnector(e.wallet);if("recent"===e.subtype){if(this.loadingTelegram)return;K.a.selectWalletConnector(e.wallet);return}if("custom"===e.subtype){if(this.loadingTelegram)return;J.I.push("ConnectingWalletConnect",{wallet:e.wallet,redirectView:t});return}if(this.loadingTelegram)return;let r=i?K.a.getConnector({id:e.wallet.id,namespace:i}):void 0;r?J.I.push("ConnectingExternal",{connector:r,redirectView:t}):J.I.push("ConnectingWalletConnect",{wallet:e.wallet,redirectView:t})}};t3.styles=t1,t2([(0,n.MZ)({type:Number})],t3.prototype,"tabIdx",void 0),t2([(0,n.wk)()],t3.prototype,"explorerWallets",void 0),t2([(0,n.wk)()],t3.prototype,"connections",void 0),t2([(0,n.wk)()],t3.prototype,"connectorImages",void 0),t2([(0,n.wk)()],t3.prototype,"loadingTelegram",void 0),t3=t2([(0,u.EM)("w3m-connector-list")],t3);var t5=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let t4=class extends r.WF{constructor(){super(...arguments),this.tabIdx=void 0}render(){return(0,r.qy)`
3239      <wui-flex flexDirection="column" gap="2">
3240        <w3m-connector-list tabIdx=${(0,s.J)(this.tabIdx)}></w3m-connector-list>
3241        <w3m-all-wallets-widget tabIdx=${(0,s.J)(this.tabIdx)}></w3m-all-wallets-widget>
3242      </wui-flex>
3243    `}};t5([(0,n.MZ)()],t4.prototype,"tabIdx",void 0),t4=t5([(0,u.EM)("w3m-wallet-login-list")],t4);let t6=(0,u.AH)`
3244  :host {
3245    --connect-scroll--top-opacity: 0;
3246    --connect-scroll--bottom-opacity: 0;
3247    --connect-mask-image: none;
3248  }
3249
3250  .connect {
3251    max-height: clamp(360px, 470px, 80vh);
3252    scrollbar-width: none;
3253    overflow-y: scroll;
3254    overflow-x: hidden;
3255    transition: opacity ${({durations:e})=>e.lg}
3256      ${({easings:e})=>e["ease-out-power-2"]};
3257    will-change: opacity;
3258    mask-image: var(--connect-mask-image);
3259  }
3260
3261  .guide {
3262    transition: opacity ${({durations:e})=>e.lg}
3263      ${({easings:e})=>e["ease-out-power-2"]};
3264    will-change: opacity;
3265  }
3266
3267  .connect::-webkit-scrollbar {
3268    display: none;
3269  }
3270
3271  .all-wallets {
3272    flex-flow: column;
3273  }
3274
3275  .connect.disabled,
3276  .guide.disabled {
3277    opacity: 0.3;
3278    pointer-events: none;
3279    user-select: none;
3280  }
3281
3282  wui-separator {
3283    margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1);
3284    width: calc(100% + ${({spacing:e})=>e["3"]} * 2);
3285  }
3286`;var t8=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let t9=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.connectors=K.a.state.connectors,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.features=a.H.state.features,this.remoteFeatures=a.H.state.remoteFeatures,this.enableWallets=a.H.state.enableWallets,this.noAdapters=o.W.state.noAdapters,this.walletGuide="get-started",this.checked=tU.o.state.isLegalCheckboxChecked,this.isEmailEnabled=this.remoteFeatures?.email&&!o.W.state.noAdapters,this.isSocialEnabled=this.remoteFeatures?.socials&&this.remoteFeatures.socials.length>0&&!o.W.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(K.a.subscribeKey("connectors",e=>{this.connectors=e,this.authConnector=this.connectors.find(e=>"AUTH"===e.type),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),a.H.subscribeKey("features",e=>{this.features=e}),a.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),a.H.subscribeKey("enableWallets",e=>this.enableWallets=e),o.W.subscribeKey("noAdapters",e=>this.setEmailAndSocialEnableCheck(e,this.remoteFeatures)),tU.o.subscribeKey("isLegalCheckboxChecked",e=>this.checked=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.resizeObserver?.disconnect();let e=this.shadowRoot?.querySelector(".connect");e?.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){let e=this.shadowRoot?.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e?.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),this.resizeObserver?.observe(e),this.handleConnectListScroll())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=a.H.state,i=a.H.state.features?.legalCheckbox,n=!!(e||t)&&!!i&&"get-started"===this.walletGuide&&!this.checked,s=a.H.state.enableWalletGuide,o=this.enableWallets,l=this.isSocialEnabled||this.authConnector;return(0,r.qy)`
3287      <wui-flex flexDirection="column">
3288        ${this.legalCheckboxTemplate()}
3289        <wui-flex
3290          data-testid="w3m-connect-scroll-view"
3291          flexDirection="column"
3292          .padding=${["0","0","4","0"]}
3293          class=${(0,eH.H)({connect:!0,disabled:n})}
3294        >
3295          <wui-flex
3296            class="connect-methods"
3297            flexDirection="column"
3298            gap="2"
3299            .padding=${l&&o&&s&&"get-started"===this.walletGuide?["0","3","0","3"]:["0","3","3","3"]}
3300          >
3301            ${this.renderConnectMethod(n?-1:void 0)}
3302          </wui-flex>
3303        </wui-flex>
3304        ${this.reownBrandingTemplate()}
3305      </wui-flex>
3306    `}reownBrandingTemplate(){return ek.y.hasFooter()||!this.remoteFeatures?.reownBranding?null:(0,r.qy)`<wui-ux-by-reown></wui-ux-by-reown>`}setEmailAndSocialEnableCheck(e,t){this.isEmailEnabled=t?.email&&!e,this.isSocialEnabled=t?.socials&&t.socials.length>0&&!e,this.remoteFeatures=t,this.noAdapters=e}checkIfAuthEnabled(e){let t=e.filter(e=>e.type===tW.o.CONNECTOR_TYPE_AUTH).map(e=>e.chain);return Z.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(e=>t.includes(e))}renderConnectMethod(e){let t=tf.A.getConnectOrderMethod(this.features,this.connectors);return(0,r.qy)`${t.map((t,i)=>{switch(t){case"email":return(0,r.qy)`${this.emailTemplate(e)} ${this.separatorTemplate(i,"email")}`;case"social":return(0,r.qy)`${this.socialListTemplate(e)}
3307          ${this.separatorTemplate(i,"social")}`;case"wallet":return(0,r.qy)`${this.walletListTemplate(e)}
3308          ${this.separatorTemplate(i,"wallet")}`;default:return null}})}`}checkMethodEnabled(e){switch(e){case"wallet":return this.enableWallets;case"social":return this.isSocialEnabled&&this.isAuthEnabled;case"email":return this.isEmailEnabled&&this.isAuthEnabled;default:return null}}checkIsThereNextMethod(e){let t=tf.A.getConnectOrderMethod(this.features,this.connectors)[e+1];return t?this.checkMethodEnabled(t)?t:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,t){let i=this.checkIsThereNextMethod(e),n="explore"===this.walletGuide;switch(t){case"wallet":return this.enableWallets&&i&&!n?(0,r.qy)`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;case"email":return this.isAuthEnabled&&this.isEmailEnabled&&"social"!==i&&i?(0,r.qy)`<wui-separator
3309              data-testid="w3m-email-login-or-separator"
3310              text="or"
3311            ></wui-separator>`:null;case"social":return this.isAuthEnabled&&this.isSocialEnabled&&"email"!==i&&i?(0,r.qy)`<wui-separator data-testid="wui-separator" text="or"></wui-separator>`:null;default:return null}}emailTemplate(e){return this.isEmailEnabled&&this.isAuthEnabled?(0,r.qy)`<w3m-email-login-widget tabIdx=${(0,s.J)(e)}></w3m-email-login-widget>`:null}socialListTemplate(e){return this.isSocialEnabled&&this.isAuthEnabled?(0,r.qy)`<w3m-social-login-widget
3312      walletGuide=${this.walletGuide}
3313      tabIdx=${(0,s.J)(e)}
3314    ></w3m-social-login-widget>`:null}walletListTemplate(e){let t=this.enableWallets,i=this.features?.emailShowWallets===!1,n=this.features?.collapseWallets;return t?(d.w.isTelegram()&&(d.w.isSafari()||d.w.isIos())&&X.x.connectWalletConnect().catch(e=>({})),"explore"===this.walletGuide)?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&(i||n)?(0,r.qy)`<wui-list-button
3315        data-testid="w3m-collapse-wallets-button"
3316        tabIdx=${(0,s.J)(e)}
3317        @click=${this.onContinueWalletClick.bind(this)}
3318        text="Continue with a wallet"
3319        icon="wallet"
3320      ></wui-list-button>`:(0,r.qy)`<w3m-wallet-login-list tabIdx=${(0,s.J)(e)}></w3m-wallet-login-list>`:null}legalCheckboxTemplate(){return"explore"===this.walletGuide?null:(0,r.qy)`<w3m-legal-checkbox data-testid="w3m-legal-checkbox"></w3m-legal-checkbox>`}handleConnectListScroll(){let e=this.shadowRoot?.querySelector(".connect");e&&(e.scrollHeight>470?(e.style.setProperty("--connect-mask-image",`linear-gradient(
3321          to bottom,
3322          rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
3323          rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
3324          black 100px,
3325          black calc(100% - 100px),
3326          rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
3327          rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
3328        )`),e.style.setProperty("--connect-scroll--top-opacity",u.z8.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",u.z8.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--connect-mask-image","none"),e.style.setProperty("--connect-scroll--top-opacity","0"),e.style.setProperty("--connect-scroll--bottom-opacity","0")))}onContinueWalletClick(){J.I.push("ConnectWallets")}};t9.styles=t6,t8([(0,t$.w)()],t9.prototype,"connectors",void 0),t8([(0,t$.w)()],t9.prototype,"authConnector",void 0),t8([(0,t$.w)()],t9.prototype,"features",void 0),t8([(0,t$.w)()],t9.prototype,"remoteFeatures",void 0),t8([(0,t$.w)()],t9.prototype,"enableWallets",void 0),t8([(0,t$.w)()],t9.prototype,"noAdapters",void 0),t8([(0,n.MZ)()],t9.prototype,"walletGuide",void 0),t8([(0,t$.w)()],t9.prototype,"checked",void 0),t8([(0,t$.w)()],t9.prototype,"isEmailEnabled",void 0),t8([(0,t$.w)()],t9.prototype,"isSocialEnabled",void 0),t8([(0,t$.w)()],t9.prototype,"isAuthEnabled",void 0),t9=t8([(0,u.EM)("w3m-connect-view")],t9);var t7=i(93849),ie=i(51369),it=i(69148);i(45667),i(15762);let ii=(0,m.AH)`
3329  wui-flex {
3330    width: 100%;
3331    height: 52px;
3332    box-sizing: border-box;
3333    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3334    border-radius: ${({borderRadius:e})=>e[5]};
3335    padding-left: ${({spacing:e})=>e[3]};
3336    padding-right: ${({spacing:e})=>e[3]};
3337    display: flex;
3338    align-items: center;
3339    justify-content: space-between;
3340    gap: ${({spacing:e})=>e[6]};
3341  }
3342
3343  wui-text {
3344    color: ${({tokens:e})=>e.theme.textSecondary};
3345  }
3346
3347  wui-icon {
3348    width: 12px;
3349    height: 12px;
3350  }
3351`;var ir=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let is=class extends r.WF{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return(0,r.qy)`
3352      <wui-flex justifyContent="space-between" alignItems="center">
3353        <wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
3354        <wui-button variant="accent-secondary" size="sm">
3355          ${this.buttonLabel}
3356          <wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
3357        </wui-button>
3357
3358      </wui-flex>
3359    `}};is.styles=[p.W5,p.fD,ii],ir([(0,n.MZ)({type:Boolean})],is.prototype,"disabled",void 0),ir([(0,n.MZ)()],is.prototype,"label",void 0),ir([(0,n.MZ)()],is.prototype,"buttonLabel",void 0),is=ir([(0,g.E)("wui-cta-button")],is);let ia=(0,u.AH)`
3360  :host {
3361    display: block;
3362    padding: 0 ${({spacing:e})=>e["5"]} ${({spacing:e})=>e["5"]};
3363  }
3364`;var io=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let il=class extends r.WF{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;let{name:e,app_store:t,play_store:i,chrome_store:n,homepage:s}=this.wallet,a=d.w.isMobile(),o=d.w.isIos(),l=d.w.isAndroid(),c=[t,i,s,n].filter(Boolean).length>1,h=u.Zv.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return c&&!a?(0,r.qy)`
3365        <wui-cta-button
3366          label=${`Don't have ${h}?`}
3367          buttonLabel="Get"
3368          @click=${()=>J.I.push("Downloads",{wallet:this.wallet})}
3369        ></wui-cta-button>
3370      `:!c&&s?(0,r.qy)`
3371        <wui-cta-button
3372          label=${`Don't have ${h}?`}
3373          buttonLabel="Get"
3374          @click=${this.onHomePage.bind(this)}
3375        ></wui-cta-button>
3376      `:t&&o?(0,r.qy)`
3377        <wui-cta-button
3378          label=${`Don't have ${h}?`}
3379          buttonLabel="Get"
3380          @click=${this.onAppStore.bind(this)}
3381        ></wui-cta-button>
3382      `:i&&l?(0,r.qy)`
3383        <wui-cta-button
3384          label=${`Don't have ${h}?`}
3385          buttonLabel="Get"
3386          @click=${this.onPlayStore.bind(this)}
3387        ></wui-cta-button>
3388      `:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&d.w.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&d.w.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&d.w.openHref(this.wallet.homepage,"_blank")}};il.styles=[ia],io([(0,n.MZ)({type:Object})],il.prototype,"wallet",void 0),il=io([(0,u.EM)("w3m-mobile-download-links")],il);let ic=(0,u.AH)`
3389  @keyframes shake {
3390    0% {
3391      transform: translateX(0);
3392    }
3393    25% {
3394      transform: translateX(3px);
3395    }
3396    50% {
3397      transform: translateX(-3px);
3398    }
3399    75% {
3400      transform: translateX(3px);
3401    }
3402    100% {
3403      transform: translateX(0);
3404    }
3405  }
3406
3407  wui-flex:first-child:not(:only-child) {
3408    position: relative;
3409  }
3410
3411  wui-wallet-image {
3412    width: 56px;
3413    height: 56px;
3414  }
3415
3416  wui-loading-thumbnail {
3417    position: absolute;
3418  }
3419
3420  wui-icon-box {
3421    position: absolute;
3422    right: calc(${({spacing:e})=>e["1"]} * -1);
3423    bottom: calc(${({spacing:e})=>e["1"]} * -1);
3424    opacity: 0;
3425    transform: scale(0.5);
3426    transition-property: opacity, transform;
3427    transition-duration: ${({durations:e})=>e.lg};
3428    transition-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
3429    will-change: opacity, transform;
3430  }
3431
3432  wui-text[align='center'] {
3433    width: 100%;
3434    padding: 0px ${({spacing:e})=>e["4"]};
3435  }
3436
3437  [data-error='true'] wui-icon-box {
3438    opacity: 1;
3439    transform: scale(1);
3440  }
3441
3442  [data-error='true'] > wui-flex:first-child {
3443    animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both;
3444  }
3445
3446  [data-retry='false'] wui-link {
3447    display: none;
3448  }
3449
3450  [data-retry='true'] wui-link {
3451    display: block;
3452    opacity: 1;
3453  }
3454
3455  w3m-mobile-download-links {
3456    padding: 0px;
3457    width: 100%;
3458  }
3459`;var id=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class ih extends r.WF{constructor(){super(),this.wallet=J.I.state.data?.wallet,this.connector=J.I.state.data?.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=c.$.getConnectorImage(this.connector)??c.$.getWalletImage(this.wallet),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=X.x.state.wcUri,this.error=X.x.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(X.x.subscribeKey("wcUri",e=>{this.uri=e,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),X.x.subscribeKey("wcError",e=>this.error=e)),(d.w.isTelegram()||d.w.isSafari())&&d.w.isIos()&&X.x.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}
3459disconnectedCallback(){this.unsubscribe.forEach(e=>e()),X.x.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();let e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel,t="";return this.label?t=this.label:(t=`Continue in ${this.name}`,this.error&&(t="Connection declined")),(0,r.qy)`
3460      <wui-flex
3461        data-error=${(0,s.J)(this.error)}
3462        data-retry=${this.showRetry}
3463        flexDirection="column"
3464        alignItems="center"
3465        .padding=${["10","5","5","5"]}
3466        gap="6"
3467      >
3468        <wui-flex gap="2" justifyContent="center" alignItems="center">
3469          <wui-wallet-image size="lg" imageSrc=${(0,s.J)(this.imageSrc)}></wui-wallet-image>
3470
3471          ${this.error?null:this.loaderTemplate()}
3472
3473          <wui-icon-box
3474            color="error"
3475            icon="close"
3476            size="sm"
3477            border
3478            borderColor="wui-color-bg-125"
3479          ></wui-icon-box>
3480        </wui-flex>
3481
3482        <wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
3483          flexDirection="column"
3484          alignItems="center"
3485          gap="2"
3486          .padding=${["2","0","0","0"]}
3487        >
3488          <wui-text align="center" variant="lg-medium" color=${this.error?"error":"primary"}>
3489            ${t}
3490          </wui-text>
3491          <wui-text align="center" variant="lg-regular" color="secondary">${e}</wui-text>
3492        </wui-flex>
3493
3494        ${this.secondaryBtnLabel?(0,r.qy)`
3495                <wui-button
3496                  variant="neutral-secondary"
3497                  size="md"
3498                  ?disabled=${this.isRetrying||this.isLoading}
3499                  @click=${this.onTryAgain.bind(this)}
3500                  data-testid="w3m-connecting-widget-secondary-button"
3501                >
3502                  <wui-icon
3503                    color="inherit"
3504                    slot="iconLeft"
3505                    name=${this.secondaryBtnIcon}
3506                  ></wui-icon>
3507                  ${this.secondaryBtnLabel}
3508                </wui-button>
3509              `:null}
3510      </wui-flex>
3511
3512      ${this.isWalletConnect?(0,r.qy)`
3513              <wui-flex .padding=${["0","5","5","5"]} justifyContent="center">
3514                <wui-link
3515                  @click=${this.onCopyUri}
3516                  variant="secondary"
3517                  icon="copy"
3518                  data-testid="wui-link-copy"
3519                >
3520                  Copy link
3521                </wui-link>
3522              </wui-flex>
3523            `:null}
3524
3525      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
3526      </wui-flex>
3527    `}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){X.x.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){let e=it.W.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return(0,r.qy)`<wui-loading-thumbnail radius=${9*t}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(d.w.copyToClopboard(this.uri),Y.P.showSuccess("Link copied"))}catch{Y.P.showError("Failed to copy")}}}ih.styles=ic,id([(0,n.wk)()],ih.prototype,"isRetrying",void 0),id([(0,n.wk)()],ih.prototype,"uri",void 0),id([(0,n.wk)()],ih.prototype,"error",void 0),id([(0,n.wk)()],ih.prototype,"ready",void 0),id([(0,n.wk)()],ih.prototype,"showRetry",void 0),id([(0,n.wk)()],ih.prototype,"label",void 0),id([(0,n.wk)()],ih.prototype,"secondaryBtnLabel",void 0),id([(0,n.wk)()],ih.prototype,"secondaryLabel",void 0),id([(0,n.wk)()],ih.prototype,"isLoading",void 0),id([(0,n.MZ)({type:Boolean})],ih.prototype,"isMobile",void 0),id([(0,n.MZ)()],ih.prototype,"onRetry",void 0);let iu=class extends ih{constructor(){if(super(),this.externalViewUnsubscribe=[],this.connectionsByNamespace=X.x.getConnections(this.connector?.chain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.remoteFeatures=a.H.state.remoteFeatures,this.currentActiveConnectorId=K.a.state.activeConnectorIds[this.connector?.chain],!this.connector)throw Error("w3m-connecting-view: No connector provided");const e=this.connector?.chain;this.isAlreadyConnected(this.connector)&&(this.secondaryBtnLabel=void 0,this.label=`This account is already linked, change your account in ${this.connector.name}`,this.secondaryLabel=`To link a new account, open ${this.connector.name} and switch to the account you want to link`),M.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser",dis
3527playIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:J.I.state.view}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(K.a.subscribeKey("activeConnectorIds",t=>{let i=t[e],r=this.remoteFeatures?.multiWallet,{redirectView:n}=J.I.state.data??{};i!==this.currentActiveConnectorId&&(this.hasMultipleConnections&&r?(J.I.replace("ProfileWallets"),Y.P.showSuccess("New Wallet Added")):n?J.I.replace(n):h.W.close())}),X.x.subscribeKey("connections",this.onConnectionsChange.bind(this)))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{if(this.error=!1,this.connector){if(this.isAlreadyConnected(this.connector))return;this.connector.id===Z.o.CONNECTOR_ID.COINBASE_SDK&&this.error||await X.x.connectExternal(this.connector,this.connector.chain)}}catch(e){e instanceof ie.A&&e.originalName===t7.RQ.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?M.E.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):M.E.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}onConnectionsChange(e){if(this.connector?.chain&&e.get(this.connector.chain)&&this.isAlreadyConnected(this.connector)){let t=e.get(this.connector.chain)??[],i=this.remoteFeatures?.multiWallet;if(0===t.length)J.I.replace("Connect");else{let e=ez.b.getConnectionsByConnectorId(this.connectionsByNamespace,this.connector.id).flatMap(e=>e.accounts),r=ez.b.getConnectionsByConnectorId(t,this.connector.id).flatMap(e=>e.accounts);0===r.length?this.hasMultipleConnections&&i?(J.I.replace("ProfileWallets"),Y.P.showSuccess("Wallet deleted")):h.W.close():!e.every(e=>r.some(t=>eX.y.isLowerCaseMatch(e.address,t.address)))&&i&&J.I.replace("ProfileWallets")}}}isAlreadyConnected(e){return!!e&&this.connectionsByNamespace.some(t=>eX.y.isLowerCaseMatch(t.connectorId,e.id))}};iu=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-connecting-external-view")],iu);let ip=(0,r.AH)`
3528  wui-flex,
3529  wui-list-wallet {
3530    width: 100%;
3531  }
3532`;var ig=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let im=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.activeConnector=K.a.state.activeConnector,this.unsubscribe.push(K.a.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,r.qy)`
3533      <wui-flex
3534        flexDirection="column"
3535        alignItems="center"
3536        .padding=${["3","5","5","5"]}
3537        gap="5"
3538      >
3539        <wui-flex justifyContent="center" alignItems="center">
3540          <wui-wallet-image
3541            size="lg"
3542            imageSrc=${(0,s.J)(c.$.getConnectorImage(this.activeConnector))}
3543          ></wui-wallet-image>
3544        </wui-flex>
3545        <wui-flex
3546          flexDirection="column"
3547          alignItems="center"
3548          gap="2"
3549          .padding=${["0","3","0","3"]}
3550        >
3551          <wui-text variant="lg-medium" color="primary">
3552            Select Chain for ${this.activeConnector?.name}
3553          </wui-text>
3554          <wui-text align="center" variant="lg-regular" color="secondary"
3555            >Select which chain to connect to your multi chain wallet</wui-text
3556          >
3557        </wui-flex>
3558        <wui-flex
3559          flexGrow="1"
3560          flexDirection="column"
3561          alignItems="center"
3562          gap="2"
3563          .padding=${["2","0","2","0"]}
3564        >
3565          ${this.networksTemplate()}
3566        </wui-flex>
3567      </wui-flex>
3568    `}networksTemplate(){return this.activeConnector?.connectors?.map((e,t)=>e.name?(0,r.qy)`
3569            <w3m-list-wallet
3570              displayIndex=${t}
3571              imageSrc=${(0,s.J)(c.$.getChainImage(e.chain))}
3572              name=${Z.o.CHAIN_NAME_MAP[e.chain]}
3573              @click=${()=>this.onConnector(e)}
3574              size="sm"
3575              data-testid="wui-list-chain-${e.chain}"
3576              rdnsId=${e.explorerWallet?.rdns}
3577            ></w3m-list-wallet>
3578          `:null)}onConnector(e){let t=this.activeConnector?.connectors?.find(t=>t.chain===e.chain),i=J.I.state.data?.redirectView;t?"walletConnect"===t.id?d.w.isMobile()?J.I.push("AllWallets"):J.I.push("ConnectingWalletConnect",{redirectView:i}
3578):J.I.push("ConnectingExternal",{connector:t,redirectView:i,wallet:this.activeConnector?.explorerWallet}):Y.P.showError("Failed to find connector")}};im.styles=ip,ig([(0,n.wk)()],im.prototype,"activeConnector",void 0),im=ig([(0,u.EM)("w3m-connecting-multi-chain-view")],im);var iw=i(39564),iy=i(27136),ib=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iv=class extends r.WF{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.generateTabs();return(0,r.qy)`
3579      <wui-flex justifyContent="center" .padding=${["0","0","4","0"]}>
3580        <wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
3581      </wui-flex>
3582    `}generateTabs(){let e=this.platforms.map(e=>{if("browser"===e)return{label:"Browser",icon:"extension",platform:"browser"};if("mobile"===e)return{label:"Mobile",icon:"mobile",platform:"mobile"};if("qrcode"===e)return{label:"Mobile",icon:"mobile",platform:"qrcode"};if("web"===e)return{label:"Webapp",icon:"browser",platform:"web"};if("desktop"===e)return{label:"Desktop",icon:"desktop",platform:"desktop"};return{label:"Browser",icon:"extension",platform:"unsupported"}});return this.platformTabs=e.map(({platform:e})=>e),e}onTabChange(e){let t=this.platformTabs[e];t&&this.onSelectPlatfrom?.(t)}};ib([(0,n.MZ)({type:Array})],iv.prototype,"platforms",void 0),ib([(0,n.MZ)()],iv.prototype,"onSelectPlatfrom",void 0),iv=ib([(0,u.EM)("w3m-connecting-header")],iv);let iC=class extends ih{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),M.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:J.I.state.view}})}async onConnectProxy(){try{this.error=!1;let{connectors:e}=K.a.state,t=e.find(e=>"ANNOUNCED"===e.type&&e.info?.rdns===this.wallet?.rdns||"INJECTED"===e.type||e.name===this.wallet?.name);if(t)await X.x.connectExternal(t,t.chain);else throw Error("w3m-connecting-wc-browser: No connector found");h.W.close()}catch(e){e instanceof ie.A&&e.originalName===t7.RQ.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?M.E.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):M.E.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};iC=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-connecting-wc-browser")],iC);let iE=class extends ih{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),M.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:J.I.state.view}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.desktop_link&&this.uri)try{this.error=!1;let{desktop_link:e,name:t}=this.wallet,{redirect:i,href:r}=d.w.formatNativeUrl(e,this.uri);X.x.setWcLinking({name:t,href:r}),X.x.setRecentWallet(this.wallet),d.w.openHref(i,"_blank")}catch{this.error=!0}}};iE=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-connecting-wc-desktop")],iE);var ix=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iA=class extends ih{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=a.H.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{ez.b.onConnectMobile(this.wallet)},!this.wallet)throw Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=G.oU.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(X.x.subscribeKey("wcUri",()=>{this.onHandleURI()})),M.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:J.I.state.view}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){X.x.setWcError(!1),this.onConnect?.()}};ix([(0,n.wk)()],iA.prototype,"redirectDeeplink",void 0),ix([(0,n.wk)()],iA.prototype,"redirectUniversalLink",void 0),ix([(0,n.wk)()],iA.prototype,"target",void 0),ix([(0,n.wk)()],iA.prototype,"preferUniversalLinks",void 0),ix([(0,n.wk)()],iA.prototype,"isLoading",void 0),iA=ix([(0,u.EM)("w3m-connecting-wc-mobile")],iA),i(92122);let i_=(0,u.AH)`
3583  wui-shimmer {
3584    width: 100%;
3585    aspect-ratio: 1 / 1;
3586    border-radius: ${({borderRadius:e})=>e[4]};
3587  }
3588
3589  wui-qr-code {
3590    opacity: 0;
3591    animation-duration: ${({durations:e})=>e.xl};
3592    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
3593    animation-name: fade-in;
3594    animation-fill-mode: forwards;
3595  }
3596
3597  @keyframes fade-in {
3598    from {
3599      opacity: 0;
3600    }
3601    to {
3602      opacity: 1;
3603    }
3604  }
3605`;var iI=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iS=class extends ih{constructor(){super(),this.basic=!1}firstUpdated(){this.basic||M.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode",dis
3605playIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:J.I.state.view}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach(e=>e())}render(){return this.onRenderProxy(),(0,r.qy)`
3606      <wui-flex
3607        flexDirection="column"
3608        alignItems="center"
3609        .padding=${["0","5","5","5"]}
3610        gap="5"
3611      >
3612        <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
3613        <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
3614        ${this.copyTemplate()}
3615      </wui-flex>
3616      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
3617    `}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0)}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let e=this.wallet?this.wallet.name:void 0;X.x.setWcLinking(void 0),X.x.setRecentWallet(this.wallet);let t=it.W.state.themeVariables["--apkt-qr-color"]??it.W.state.themeVariables["--w3m-qr-color"];return(0,r.qy)` <wui-qr-code
3618      theme=${it.W.state.themeMode}
3619      uri=${this.uri}
3620      imageSrc=${(0,s.J)(c.$.getWalletImage(this.wallet))}
3621      color=${(0,s.J)(t)}
3622      alt=${(0,s.J)(e)}
3623      data-testid="wui-qr-code"
3624    ></wui-qr-code>`}copyTemplate(){let e=!this.uri||!this.ready;return(0,r.qy)`<wui-button
3625      .disabled=${e}
3626      @click=${this.onCopyUri}
3627      variant="neutral-secondary"
3628      size="sm"
3629      data-testid="copy-wc2-uri"
3630    >
3631      Copy link
3632      <wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
3633    </wui-button>`}};iS.styles=i_,iI([(0,n.MZ)({type:Boolean})],iS.prototype,"basic",void 0),iS=iI([(0,u.EM)("w3m-connecting-wc-qrcode")],iS);let iN=class extends r.WF{constructor(){if(super(),this.wallet=J.I.state.data?.wallet,!this.wallet)throw Error("w3m-connecting-wc-unsupported: No wallet provided");M.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:J.I.state.view}})}render(){return(0,r.qy)`
3634      <wui-flex
3635        flexDirection="column"
3636        alignItems="center"
3637        .padding=${["10","5","5","5"]}
3638        gap="5"
3639      >
3640        <wui-wallet-image
3641          size="lg"
3642          imageSrc=${(0,s.J)(c.$.getWalletImage(this.wallet))}
3643        ></wui-wallet-image>
3644
3645        <wui-text variant="md-regular" color="primary">Not Detected</wui-text>
3646      </wui-flex>
3647
3648      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
3649    `}};iN=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-connecting-wc-unsupported")],iN);var ik=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iT=class extends ih{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=G.oU.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(X.x.subscribeKey("wcUri",()=>{this.updateLoadingState()})),M.E.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:J.I.state.view}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;let{webapp_link:e,name:t}=this.wallet,{redirect:i,href:r}=d.w.formatUniversalUrl(e,this.uri);X.x.setWcLinking({name:t,href:r}),X.x.setRecentWallet(this.wallet),d.w.openHref(i,"_blank")}catch{this.error=!0}}};ik([(0,n.wk)()],iT.prototype,"isLoading",void 0),iT=ik([(0,u.EM)("w3m-connecting-wc-web")],iT);let iO=(0,u.AH)`
3650  :host([data-mobile-fullscreen='true']) {
3651    height: 100%;
3652    display: flex;
3653    flex-direction: column;
3654  }
3655
3656  :host([data-mobile-fullscreen='true']) wui-ux-by-reown {
3657    margin-top: auto;
3658  }
3659`;var iR=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iP=class extends r.WF{constructor(){super(),this.wallet=J.I.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!a.H.state.siwx,this.remoteFeatures=a.H.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(a.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}
3659disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return a.H.state.enableMobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),(0,r.qy)`
3660      ${this.headerTemplate()}
3661      <div class="platform-container">${this.platformTemplate()}</div>
3662      ${this.reownBrandingTemplate()}
3663    `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding&&this.displayBranding?(0,r.qy)`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(e=!1){if("browser"!==this.platform&&(!a.H.state.manualWCControl||e))try{let{wcPairingExpiry:t,status:i}=X.x.state,{redirectView:r}=J.I.state.data??{};if(e||a.H.state.enableEmbedded||d.w.isPairingExpired(t)||"connecting"===i){let e=X.x.getConnections(o.W.state.activeChain),t=this.remoteFeatures?.multiWallet,i=e.length>0;await X.x.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(i&&t?(J.I.replace("ProfileWallets"),Y.P.showSuccess("New Wallet Added")):r?J.I.replace(r):h.W.close())}}catch(e){if(e instanceof Error&&e.message.includes("An error occurred when attempting to switch chain")&&!a.H.state.enableNetworkSwitch&&o.W.state.activeChain){o.W.setActiveCaipNetwork(iy.R.getUnsupportedNetwork(`${o.W.state.activeChain}:${o.W.state.activeCaipNetwork?.id}`)),o.W.showUnsupportedChainUI();return}e instanceof ie.A&&e.originalName===t7.RQ.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?M.E.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):M.E.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),X.x.setWcError(!0),Y.P.showError(e.message??"Connection error"),X.x.resetWcConnection(),J.I.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;let{mobile_link:e,desktop_link:t,webapp_link:i,injected:r,rdns:n}=this.wallet,s=r?.map(({injected_id:e})=>
3663e).filter(Boolean),l=[...n?[n]:s??[]],c=!a.H.state.isUniversalProvider&&l.length,h=X.x.checkInstalled(l),u=c&&h,p=t&&!d.w.isMobile();u&&!o.W.state.noAdapters&&this.platforms.push("browser"),e&&this.platforms.push(d.w.isMobile()?"mobile":"qrcode"),i&&this.platforms.push("web"),p&&this.platforms.push("desktop");let f=iw.W.isCustomDeeplinkWallet(this.wallet.id,o.W.state.activeChain);u||!c||o.W.state.noAdapters||f||this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return(0,r.qy)`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return(0,r.qy)`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return(0,r.qy)`
3664          <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
3665          </w3m-connecting-wc-desktop>
3666        `;case"mobile":return(0,r.qy)`
3667          <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
3668          </w3m-connecting-wc-mobile>
3669        `;case"qrcode":return(0,r.qy)`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;default:return(0,r.qy)`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?(0,r.qy)`
3670      <w3m-connecting-header
3671        .platforms=${this.platforms}
3672        .onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
3673      >
3674      </w3m-connecting-header>
3675    `:null}async onSelectPlatform(e){let t=this.shadowRoot?.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};iP.styles=iO,iR([(0,n.wk)()],iP.prototype,"platform",void 0),iR([(0,n.wk)()],iP.prototype,"platforms",void 0),iR([(0,n.wk)()],iP.prototype,"isSiwxEnabled",void 0),iR([(0,n.wk)()],iP.prototype,"remoteFeatures",void 0),iR([(0,n.MZ)({type:Boolean})],iP.prototype,"displayBranding",void 0),iR([(0,n.MZ)({type:Boolean})],iP.prototype,"basic",void 0),iP=iR([(0,u.EM)("w3m-connecting-wc-view")],iP);var i$=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iU=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.isMobile=d.w.isMobile(),this.remoteFeatures=a.H.state.remoteFeatures,this.unsubscribe.push(a.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(this.isMobile){let{featured:e,recommended:t}=tp.N.state,{customWallets:i}=a.H.state,n=ei.i.getRecentWallets(),s=e.length||t.length||i?.length||n.length;return(0,r.qy)`<wui-flex flexDirection="column" gap="2" .margin=${["1","3","3","3"]}>
3676        ${s?(0,r.qy)`<w3m-connector-list></w3m-connector-list>`:null}
3677        <w3m-all-wallets-widget></w3m-all-wallets-widget>
3678      </wui-flex>`}return(0,r.qy)`<wui-flex flexDirection="column" .padding=${["0","0","4","0"]}>
3679        <w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
3680        <wui-flex flexDirection="column" .padding=${["0","3","0","3"]}>
3681          <w3m-all-wallets-widget></w3m-all-wallets-widget>
3682        </wui-flex>
3683      </wui-flex>
3684      ${this.reownBrandingTemplate()} `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?(0,r.qy)` <wui-flex flexDirection="column" .padding=${["1","0","1","0"]}>
3685      <wui-ux-by-reown></wui-ux-by-reown>
3686    </wui-flex>`:null}};i$([(0,n.wk)()],iU.prototype,"isMobile",void 0),i$([(0,n.wk)()],iU.prototype,"remoteFeatures",void 0),iU=i$([(0,u.EM)("w3m-connecting-wc-basic-view")],iU);var iM=i(39591);let iD=(0,r.AH)`
3687  .continue-button-container {
3688    width: 100%;
3689  }
3690`;var iL=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iW=class extends r.WF{constructor(){super(...arguments),this.loading=!1}render(){return(0,r.qy)`
3691      <wui-flex
3692        flexDirection="column"
3693        alignItems="center"
3694        gap="6"
3695        .padding=${["0","0","4","0"]}
3696      >
3697        ${this.onboardingTemplate()} ${this.buttonsTemplate()}
3698        <wui-link
3699          @click=${()=>{d.w.openHref(iM.T.URLS.FAQ,"_blank")}}
3700        >
3701          Learn more about names
3702          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
3703        </wui-link>
3704      </wui-flex>
3705    `}onboardingTemplate(){return(0,r.qy)` <wui-flex
3706      flexDirection="column"
3707      gap="6"
3708      alignItems="center"
3709      .padding=${["0","6","0","6"]}
3710    >
3711      <wui-flex gap="3" alignItems="center" justifyContent="center">
3712        <wui-icon-box icon="id" size="xl" iconSize="xxl" color="default"></wui-icon-box>
3713      </wui-flex>
3714      <wui-flex flexDirection="column" alignItems="center" gap="3">
3715        <wui-text align="center" variant="lg-medium" color="primary">
3716          Choose your account name
3717        </wui-text>
3718        <wui-text align="center" variant="md-regular" color="primary">
3719          Finally say goodbye to 0x addresses, name your account to make it easier to exchange
3720          assets
3721        </wui-text>
3722      </wui-flex>
3723    </wui-flex>`}buttonsTemplate(){return(0,r.qy)`<wui-flex
3724      .padding=${["0","8","0","8"]}
3725      gap="3"
3726      class="continue-button-container"
3727    >
3728      <wui-button
3729        fullWidth
3730        .loading=${this.loading}
3731        size="lg"
3732        borderRadius="xs"
3733        @click=${this.handleContinue.bind(this)}
3734        >Choose name
3735      </wui-button>
3735
3736    </wui-flex>`}handleContinue(){J.I.push("RegisterAccountName"),M.E.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:(0,el.lj)(o.W.state.activeChain)===ew.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}};iW.styles=iD,iL([(0,n.wk)()],iW.prototype,"loading",void 0),iW=iL([(0,u.EM)("w3m-choose-account-name-view")],iW);let iB=class extends r.WF{constructor(){super(...arguments),this.wallet=J.I.state.data?.wallet}render(){if(!this.wallet)throw Error("w3m-downloads-view");return(0,r.qy)`
3737      <wui-flex gap="2" flexDirection="column" .padding=${["3","3","4","3"]}>
3738        ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
3739        ${this.homepageTemplate()}
3740      </wui-flex>
3741    `}chromeTemplate(){return this.wallet?.chrome_store?(0,r.qy)`<wui-list-item
3742      variant="icon"
3743      icon="chromeStore"
3744      iconVariant="square"
3745      @click=${this.onChromeStore.bind(this)}
3746      chevron
3747    >
3748      <wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
3749    </wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?(0,r.qy)`<wui-list-item
3750      variant="icon"
3751      icon="appStore"
3752      iconVariant="square"
3753      @click=${this.onAppStore.bind(this)}
3754      chevron
3755    >
3756      <wui-text variant="md-medium" color="primary">iOS App</wui-text>
3757    </wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?(0,r.qy)`<wui-list-item
3758      variant="icon"
3759      icon="playStore"
3760      iconVariant="square"
3761      @click=${this.onPlayStore.bind(this)}
3762      chevron
3763    >
3764      <wui-text variant="md-medium" color="primary">Android App</wui-text>
3765    </wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?(0,r.qy)`
3766      <wui-list-item
3767        variant="icon"
3768        icon="browser"
3769        iconVariant="square-blue"
3770        @click=${this.onHomePage.bind(this)}
3771        chevron
3772      >
3773        <wui-text variant="md-medium" color="primary">Website</wui-text>
3774      </wui-list-item>
3775    `:null}openStore(e){e.href&&this.wallet&&(M.E.sendEvent({type:"track",event:"GET_WALLET",properties:{name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.wallet.id,type:e.type}}),d.w.openHref(e.href,"_blank"))}onChromeStore(){this.wallet?.chrome_store&&this.openStore({href:this.wallet.chrome_store,type:"chrome_store"})}onAppStore(){this.wallet?.app_store&&this.openStore({href:this.wallet.app_store,type:"app_store"})}onPlayStore(){this.wallet?.play_store&&this.openStore({href:this.wallet.play_store,type:"play_store"})}onHomePage(){this.wallet?.homepage&&this.openStore({href:this.wallet.homepage,type:"homepage"})}};iB=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-downloads-view")],iB);let ij=class extends r.WF{render(){return(0,r.qy)`
3776      <wui-flex flexDirection="column" .padding=${["0","3","3","3"]} gap="2">
3777        ${this.recommendedWalletsTemplate()}
3778        <w3m-list-wallet
3779          name="Explore all"
3780          showAllWallets
3781          walletIcon="allWallets"
3782          icon="externalLink"
3783          size="sm"
3784          @click=${()=>{d.w.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
3785        ></w3m-list-wallet>
3786      </wui-flex>
3787    `}recommendedWalletsTemplate(){let{recommended:e,featured:t}=tp.N.state,{customWallets:i}=a.H.state;return[...t,...i??[],...e].slice(0,4).map((e,t)=>(0,r.qy)`
3788        <w3m-list-wallet
3789          displayIndex=${t}
3790          name=${e.name??"Unknown"}
3791          tagVariant="accent"
3792          size="sm"
3793          imageSrc=${(0,s.J)(c.$.getWalletImage(e))}
3794          @click=${()=>{this.onWalletClick(e)}}
3795        ></w3m-list-wallet>
3796      `)}onWalletClick(e){M.E.sendEvent({type:"track",event:"GET_WALLET",properties:{name:e.name,walletRank:void 0,explorerId:e.id,type:"homepage"}}),d.w.openHref(e.homepage??"https://walletconnect.com/explorer","_blank")}};ij=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-get-wallet-view")],ij),i(77206);var iF=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iH=class extends r.WF{constructor(){super(...arguments),this.data=[]}render(){return(0,r.qy)`
3797      <wui-flex flexDirection="column" alignItems="center" gap="4">
3798        ${this.data.map(e=>(0,r.qy)`
3799            <wui-flex flexDirection="column" alignItems="center" gap="5">
3800              <wui-flex flexDirection="row" justifyContent="center" gap="1">
3801                ${e.images.map(e=>(0,r.qy)`<wui-visual size="sm" name=${e}></wui-visual>`)}
3802              </wui-flex>
3803            </wui-flex>
3804            <wui-flex flexDirection="column" alignItems="center" gap="1">
3805              <wui-text variant="md-regular" color="primary" align="center">${e.title}</wui-text>
3806              <wui-text variant="sm-regular" color="secondary" align="center"
3807                >${e.text}</wui-text
3808              >
3809            </wui-flex>
3810          `)}
3811      </wui-flex>
3812    `}};iF([(0,n.MZ)({type:Array})],iH.prototype,"data",void 0),iH=iF([(0,u.EM)("w3m-help-widget")],iH);let iq=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}],iz=class extends r.WF{render(){return(0,r.qy)`
3813      <wui-flex
3814        flexDirection="column"
3815        .padding=${["6","5","5","5"]}
3816        alignItems="center"
3817        gap="5"
3818      >
3819        <w3m-help-widget .data=${iq}></w3m-help-widget>
3820        <wui-button variant="accent-primary" size="md" @click=${this.onGetWallet.bind(this)}>
3821          <wui-icon color="inherit" slot="iconLeft" name="wallet"></wui-icon>
3822          Get a wallet
3823        </wui-button>
3823
3824      </wui-flex>
3825    `}onGetWallet(){M.E.sendEvent({type:"track",event:"CLICK_GET_WALLET_HELP"}),J.I.push("GetWallet")}};iz=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-what-is-a-wallet-view")],iz);let iV=(0,u.AH)`
3826  wui-flex {
3827    max-height: clamp(360px, 540px, 80vh);
3828    overflow: scroll;
3829    scrollbar-width: none;
3830    transition: opacity ${({durations:e})=>e.lg}
3831      ${({easings:e})=>e["ease-out-power-2"]};
3832    will-change: opacity;
3833  }
3834  wui-flex::-webkit-scrollbar {
3835    display: none;
3836  }
3837  wui-flex.disabled {
3838    opacity: 0.3;
3839    pointer-events: none;
3840    user-select: none;
3841  }
3842`;var iZ=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let iK=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.checked=tU.o.state.isLegalCheckboxChecked,this.unsubscribe.push(tU.o.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=a.H.state,i=a.H.state.features?.legalCheckbox,n=!!(e||t)&&!!i,o=n&&!this.checked;return(0,r.qy)`
3843      <w3m-legal-checkbox></w3m-legal-checkbox>
3844      <wui-flex
3845        flexDirection="column"
3846        .padding=${n?["0","3","3","3"]:"3"}
3847        gap="2"
3848        class=${(0,s.J)(o?"disabled":void 0)}
3849      >
3850        <w3m-wallet-login-list tabIdx=${(0,s.J)(o?-1:void 0)}></w3m-wallet-login-list>
3851      </wui-flex>
3852    `}};iK.styles=iV,iZ([(0,n.wk)()],iK.prototype,"checked",void 0),iK=iZ([(0,u.EM)("w3m-connect-wallets-view")],iK);var iG=i(41300);let iY=(0,m.AH)`
3853  :host {
3854    display: block;
3855    width: 120px;
3856    height: 120px;
3857  }
3858
3859  svg {
3860    width: 120px;
3861    height: 120px;
3862    fill: none;
3863    stroke: transparent;
3864    stroke-linecap: round;
3865  }
3866
3867  use {
3868    stroke: ${e=>e.colors.accent100};
3869    stroke-width: 2px;
3870    stroke-dasharray: 54, 118;
3871    stroke-dashoffset: 172;
3872    animation: dash 1s linear infinite;
3873  }
3874
3875  @keyframes dash {
3876    to {
3877      stroke-dashoffset: 0px;
3878    }
3879  }
3880`,iJ=class extends r.WF{render(){return(0,r.qy)`
3881      <svg viewBox="0 0 54 59">
3882        <path
3883          id="wui-loader-path"
3884          d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"
3885        />
3886        <use xlink:href="#wui-loader-path"></use>
3887      </svg>
3888    `}};iJ.styles=[p.W5,iY],iJ=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,g.E)("wui-loading-hexagon")],iJ),i(19341);let iX=(0,r.AH)`
3889  @keyframes shake {
3890    0% {
3891      transform: translateX(0);
3892    }
3893    25% {
3894      transform: translateX(3px);
3895    }
3896    50% {
3897      transform: translateX(-3px);
3898    }
3899    75% {
3900      transform: translateX(3px);
3901    }
3902    100% {
3903      transform: translateX(0);
3904    }
3905  }
3906
3907  wui-flex:first-child:not(:only-child) {
3908    position: relative;
3909  }
3910
3911  wui-loading-hexagon {
3912    position: absolute;
3913  }
3914
3915  wui-icon-box {
3916    position: absolute;
3917    right: 4px;
3918    bottom: 0;
3919    opacity: 0;
3920    transform: scale(0.5);
3921    z-index: 1;
3922  }
3923
3924  wui-button {
3925    display: none;
3926  }
3927
3928  [data-error='true'] wui-icon-box {
3929    opacity: 1;
3930    transform: scale(1);
3931  }
3932
3933  [data-error='true'] > wui-flex:first-child {
3934    animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
3935  }
3936
3937  wui-button[data-retry='true'] {
3938    display: block;
3939    opacity: 1;
3940  }
3941`;var iQ=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let i0=class extends r.WF{constructor(){super(),this.network=J.I.state.data?.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}
3941disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw Error("w3m-network-switch-view: No network provided");this.onShowRetry();let e=this.getLabel(),t=this.getSubLabel();return(0,r.qy)`
3942      <wui-flex
3943        data-error=${this.error}
3944        flexDirection="column"
3945        alignItems="center"
3946        .padding=${["10","5","10","5"]}
3947        gap="7"
3948      >
3949        <wui-flex justifyContent="center" alignItems="center">
3950          <wui-network-image
3951            size="lg"
3952            imageSrc=${(0,s.J)(c.$.getNetworkImage(this.network))}
3953          ></wui-network-image>
3954
3955          ${this.error?null:(0,r.qy)`<wui-loading-hexagon></wui-loading-hexagon>`}
3956
3957          <wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
3958        </wui-flex>
3959
3960        <wui-flex flexDirection="column" alignItems="center" gap="2">
3961          <wui-text align="center" variant="h6-regular" color="primary">${e}</wui-text>
3962          <wui-text align="center" variant="md-regular" color="secondary">${t}</wui-text>
3963        </wui-flex>
3964
3965        <wui-button
3966          data-retry=${this.showRetry}
3967          variant="accent-primary"
3968          size="md"
3969          .disabled=${!this.error}
3970          @click=${this.onSwitchNetwork.bind(this)}
3971        >
3972          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
3973          Try again
3974        </wui-button>
3975      </wui-flex>
3976    `}getSubLabel(){let e=K.a.getConnectorId(o.W.state.activeChain);return K.a.getAuthConnector()&&e===Z.o.CONNECTOR_ID.AUTH?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){let e=K.a.getConnectorId(o.W.state.activeChain);return K.a.getAuthConnector()&&e===Z.o.CONNECTOR_ID.AUTH?`Switching to ${this.network?.name??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,o.W.state.activeChain!==this.network?.chainNamespace&&o.W.setIsSwitchingNamespace(!0),this.network&&(await o.W.switchActiveNetwork(this.network),await iG.U.isAuthenticated()&&J.I.goBack())}catch(e){this.error=!0}}};i0.styles=iX,iQ([(0,n.wk)()],i0.prototype,"showRetry",void 0),iQ([(0,n.wk)()],i0.prototype,"error",void 0),i0=iQ([(0,u.EM)("w3m-network-switch-view")],i0);var i1=i(48075);i(77241);let i2=(0,m.AH)`
3977  :host {
3978    width: 100%;
3979  }
3980
3981  button {
3982    display: flex;
3983    align-items: center;
3984    justify-content: space-between;
3985    padding: ${({spacing:e})=>e[3]};
3986    width: 100%;
3987    background-color: transparent;
3988    border-radius: ${({borderRadius:e})=>e[4]};
3989  }
3990
3991  wui-text {
3992    text-transform: capitalize;
3993  }
3994
3995  @media (hover: hover) {
3996    button:hover:enabled {
3997      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3998    }
3999  }
4000
4001  button:disabled {
4002    opacity: 0.5;
4003    cursor: not-allowed;
4004  }
4005`;var i3=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let i5=class extends r.WF{constructor(){super(...arguments),this.imageSrc=void 0,this.name="Ethereum",this.disabled=!1}render(){return(0,r.qy)`
4006      <button ?disabled=${this.disabled} tabindex=${(0,s.J)(this.tabIdx)}>
4007        <wui-flex gap="2" alignItems="center">
4008          ${this.imageTemplate()}
4009          <wui-text variant="lg-regular" color="primary">${this.name}</wui-text>
4010        </wui-flex>
4011        <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
4012      </button>
4013    `}imageTemplate(){return this.imageSrc?(0,r.qy)`<wui-image ?boxed=${!0} src=${this.imageSrc}></wui-image>`:(0,r.qy)`<wui-image
4014      ?boxed=${!0}
4015      icon="networkPlaceholder"
4016      size="lg"
4017      iconColor="default"
4018    ></wui-image>`}};i5.styles=[p.W5,p.fD,i2],i3([(0,n.MZ)()],i5.prototype,"imageSrc",void 0),i3([(0,n.MZ)()],i5.prototype,"name",void 0),i3([(0,n.MZ)()],i5.prototype,"tabIdx",void 0),i3([(0,n.MZ)({type:Boolean})],i5.prototype,"disabled",void 0),i5=i3([(0,g.E)("wui-list-network")],i5);let i4=(0,r.AH)`
4019  .container {
4020    max-height: 360px;
4021    overflow: auto;
4022  }
4023
4024  .container::-webkit-scrollbar {
4025    display: none;
4026  }
4027`;var i6=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let i8=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.network=o.W.state.activeCaipNetwork,this.requestedCaipNetworks=o.W.getCaipNetworks(),this.search="",this.onDebouncedSearch=d.w.debounce(e=>{this.search=e},100),this.unsubscribe.push(l.j.subscribeNetworkImages(()=>this.requestUpdate()),o.W.subscribeKey("activeCaipNetwork",e=>this.network=e),o.W.subscribe(()=>{this.requestedCaipNetworks=o.W.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,r.qy)`
4028      ${this.templateSearchInput()}
4029      <wui-flex
4030        class="container"
4031        .padding=${["0","3","3","3"]}
4032        flexDirection="column"
4033        gap="2"
4034      >
4035        ${this.networksTemplate()}
4036      </wui-flex>
4037    `}templateSearchInput(){return(0,r.qy)`
4038      <wui-flex gap="2" .padding=${["0","3","3","3"]}>
4039        <wui-input-text
4040          @inputChange=${this.onInputChange.bind(this)}
4041          class="network-search-input"
4042          size="md"
4043          placeholder="Search network"
4044          icon="search"
4045        ></wui-input-text>
4046      </wui-flex>
4047    `}onInputChange(e){this.onDebouncedSearch(e.detail)}networksTemplate(){let e=o.W.getAllApprovedCaipNetworkIds(),t=d.w.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=t?.filter(e=>e?.name?.toLowerCase().includes(this.search.toLowerCase())):this.filteredNetworks=t,this.filteredNetworks?.map(e=>(0,r.qy)`
4048        <wui-list-network
4049          .selected=${this.network?.id===e.id}
4050          imageSrc=${(0,s.J)(c.$.getNetworkImage(e))}
4051          type="network"
4052          name=${e.name??e.id}
4053          @click=${()=>this.onSwitchNetwork(e)}
4054          .disabled=${o.W.isCaipNetworkDisabled(e)}
4055          data-testid=${`w3m-network-switch-${e.name??e.id}`}
4056        ></wui-list-network>
4057      `)}onSwitchNetwork(e){i1.L.onSwitchNetwork({network:e})}};i8.styles=i4,i6([(0,n.wk)()],i8.prototype,"network",void 0),i6([(0,n.wk)()],i8.prototype,"requestedCaipNetworks",void 0),i6([(0,n.wk)()],i8.prototype,"filteredNetworks",void 0),i6([(0,n.wk)()],i8.prototype,"search",void 0),i8=i6([(0,u.EM)("w3m-networks-view")],i8);let i9=(0,u.AH)`
4058  @keyframes shake {
4059    0% {
4060      transform: translateX(0);
4061    }
4062    25% {
4063      transform: translateX(3px);
4064    }
4065    50% {
4066      transform: translateX(-3px);
4067    }
4068    75% {
4069      transform: translateX(3px);
4070    }
4071    100% {
4072      transform: translateX(0);
4073    }
4074  }
4075
4076  wui-flex:first-child:not(:only-child) {
4077    position: relative;
4078  }
4079
4080  wui-loading-thumbnail {
4081    position: absolute;
4082  }
4083
4084  wui-visual {
4085    border-radius: calc(
4086      ${({borderRadius:e})=>e["1"]} * 9 - ${({borderRadius:e})=>e["3"]}
4087    );
4088    position: relative;
4089    overflow: hidden;
4090  }
4091
4092  wui-visual::after {
4093    content: '';
4094    display: block;
4095    width: 100%;
4096    height: 100%;
4097    position: absolute;
4098    inset: 0;
4099    border-radius: calc(
4100      ${({borderRadius:e})=>e["1"]} * 9 - ${({borderRadius:e})=>e["3"]}
4101    );
4102    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.core.glass010};
4103  }
4104
4105  wui-icon-box {
4106    position: absolute;
4107    right: calc(${({spacing:e})=>e["1"]} * -1);
4108    bottom: calc(${({spacing:e})=>e["1"]} * -1);
4109    opacity: 0;
4110    transform: scale(0.5);
4111    transition:
4112      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
4113      transform ${({durations:e})=>e.lg}
4114        ${({easings:e})=>e["ease-out-power-2"]};
4115    will-change: opacity, transform;
4116  }
4117
4118  wui-text[align='center'] {
4119    width: 100%;
4120    padding: 0px ${({spacing:e})=>e["4"]};
4121  }
4122
4123  [data-error='true'] wui-icon-box {
4124    opacity: 1;
4125    transform: scale(1);
4126  }
4127
4128  [data-error='true'] > wui-flex:first-child {
4129    animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both;
4130  }
4131
4132  [data-retry='false'] wui-link {
4133    display: none;
4134  }
4135
4136  [data-retry='true'] wui-link {
4137    display: block;
4138    opacity: 1;
4139  }
4140
4141  wui-link {
4142    padding: ${({spacing:e})=>e["01"]} ${({spacing:e})=>e["2"]};
4143  }
4144
4145  .capitalize {
4146    text-transform: capitalize;
4147  }
4148`;var i7=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let re={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0},rt=class extends r.WF{constructor(){super(...arguments),this.unsubscribe=[],this.switchToChain=J.I.state.data?.switchToChain,this.caipNetwork=J.I.state.data?.network,this.activeChain=o.W.state.activeChain}firstUpdated(){this.unsubscribe.push(o.W.subscribeKey("activeChain",e=>this.activeChain=e))}
4148disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.switchToChain?Z.o.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;let t=Z.o.CHAIN_NAME_MAP[this.switchToChain];return(0,r.qy)`
4149      <wui-flex
4150        flexDirection="column"
4151        alignItems="center"
4152        .padding=${["4","2","2","2"]}
4153        gap="4"
4154      >
4155        <wui-flex justifyContent="center" flexDirection="column" alignItems="center" gap="2">
4156          <wui-visual
4157            size="md"
4158            name=${(0,s.J)(re[this.switchToChain])}
4159          ></wui-visual>
4160          <wui-flex gap="2" flexDirection="column" alignItems="center">
4161            <wui-text
4162              data-testid=${`w3m-switch-active-chain-to-${t}`}
4163              variant="lg-regular"
4164              color="primary"
4165              align="center"
4166              >Switch to <span class="capitalize">${t}</span></wui-text
4167            >
4168            <wui-text variant="md-regular" color="secondary" align="center">
4169              Connected wallet doesn't support connecting to ${e} chain. You
4170              need to connect with a different wallet.
4171            </wui-text>
4172          </wui-flex>
4173          <wui-button
4174            data-testid="w3m-switch-active-chain-button"
4175            size="md"
4176            @click=${this.switchActiveChain.bind(this)}
4177            >Switch</wui-button
4178          >
4179        </wui-flex>
4180      </wui-flex>
4181    `}async switchActiveChain(){this.switchToChain&&(o.W.setIsSwitchingNamespace(!0),K.a.setFilterByNamespace(this.switchToChain),this.caipNetwork?await o.W.switchActiveNetwork(this.caipNetwork):o.W.setActiveNamespace(this.switchToChain),J.I.reset("Connect"))}};rt.styles=i9,i7([(0,n.MZ)()],rt.prototype,"activeChain",void 0),rt=i7([(0,u.EM)("w3m-switch-active-chain-view")],rt);let ri=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}],rr=class extends r.WF{render(){return(0,r.qy)`
4182      <wui-flex
4183        flexDirection="column"
4184        .padding=${["6","5","5","5"]}
4185        alignItems="center"
4186        gap="5"
4187      >
4188        <w3m-help-widget .data=${ri}></w3m-help-widget>
4189        <wui-button
4190          variant="accent-primary"
4191          size="md"
4192          @click=${()=>{d.w.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
4193        >
4194          Learn more
4195          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
4196        </wui-button>
4197      </wui-flex>
4198    `}};rr=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-what-is-a-network-view")],rr);let rn=(0,r.AH)`
4199  :host > wui-flex {
4200    max-height: clamp(360px, 540px, 80vh);
4201    overflow: scroll;
4202    scrollbar-width: none;
4203  }
4204
4205  :host > wui-flex::-webkit-scrollbar {
4206    display: none;
4207  }
4208`;var rs=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let ra=class extends r.WF{constructor(){super(),this.swapUnsupportedChain=J.I.state.data?.swapUnsupportedChain,this.unsubscribe=[],this.disconnecting=!1,this.remoteFeatures=a.H.state.remoteFeatures,this.unsubscribe.push(l.j.subscribeNetworkImages(()=>this.requestUpdate()),a.H.subscribeKey("remoteFeatures",e=>{this.remoteFeatures=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,r.qy)`
4209      <wui-flex class="container" flexDirection="column" gap="0">
4210        <wui-flex
4211          class="container"
4212          flexDirection="column"
4213          .padding=${["3","5","2","5"]}
4214          alignItems="center"
4215          gap="5"
4216        >
4217          ${this.descriptionTemplate()}
4218        </wui-flex>
4219
4220        <wui-flex flexDirection="column" padding="3" gap="2"> ${this.networksTemplate()} </wui-flex>
4221
4222        <wui-separator text="or"></wui-separator>
4223        <wui-flex flexDirection="column" padding="3" gap="2">
4224          <wui-list-item
4225            variant="icon"
4226            iconVariant="overlay"
4227            icon="signOut"
4228            ?chevron=${!1}
4229            .loading=${this.disconnecting}
4230            @click=${this.onDisconnect.bind(this)}
4231            data-testid="disconnect-button"
4232          >
4233            <wui-text variant="md-medium" color="secondary">Disconnect</wui-text>
4234          </wui-list-item>
4235        </wui-flex>
4236      </wui-flex>
4237    `}descriptionTemplate(){return this.swapUnsupportedChain?(0,r.qy)`
4238        <wui-text variant="sm-regular" color="secondary" align="center">
4239          The swap feature doesn’t support your current network. Switch to an available option to
4240          continue.
4241        </wui-text>
4242      `:(0,r.qy)`
4243      <wui-text variant="sm-regular" color="secondary" align="center">
4244        This app doesn’t support your current network. Switch to an available option to continue.
4245      </wui-text>
4246    `}networksTemplate(){let e=o.W.getAllRequestedCaipNetworks(),t=o.W.getAllApprovedCaipNetworkIds(),i=d.w.sortRequestedNetworks(t,e);return(this.swapUnsupportedChain?i.filter(e=>G.oU.SWAP_SUPPORTED_NETWORKS.includes(e.caipNetworkId)):i).map(e=>(0,r.qy)`
4247        <wui-list-network
4248          imageSrc=${(0,s.J)(c.$.getNetworkImage(e))}
4249          name=${e.name??"Unknown"}
4250          @click=${()=>this.onSwitchNetwork(e)}
4251        >
4252        </wui-list-network>
4253      `)}async onDisconnect(){try{this.disconnecting=!0;let e=o.W.state.activeChain,t=X.x.getConnections(e).length>0,i=e&&K.a.state.activeConnectorIds[e],r=this.remoteFeatures?.multiWallet;await X.x.disconnect(r?{id:i,namespace:e}:{}),t&&r&&(J.I.push("ProfileWallets"),Y.P.showSuccess("Wallet deleted"))}catch{M.E.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),Y.P.showError("Failed to disconnect")}finally{this.disconnecting=!1}}async onSwitchNetwork(e){let t=o.W.getActiveCaipAddress(),i=o.W.getAllApprovedCaipNetworkIds(),r=(o.W.getNetworkProp("supportsAllNetworks",e.chainNamespace),J.I.state.data);t?i?.includes(e.caipNetworkId)?await o.W.switchActiveNetwork(e):J.I.push("SwitchNetwork",{...r,network:e}):t||(o.W.setActiveCaipNetwork(e),J.I.push("Connect"))}};ra.styles=rn,rs([(0,n.wk)()],ra.prototype,"disconnecting",void 0),rs([(0,n.wk)()],ra.prototype,"remoteFeatures",void 0),ra=rs([(0,u.EM)("w3m-unsupported-chain-view")],ra);let ro=(0,m.AH)`
4254  wui-flex {
4255    width: 100%;
4256    display: flex;
4257    align-items: center;
4258    justify-content: center;
4259    gap: ${({spacing:e})=>e[2]};
4260    border-radius: ${({borderRadius:e})=>e[4]};
4261    padding: ${({spacing:e})=>e[3]};
4262  }
4263
4264  /* -- Types --------------------------------------------------------- */
4265  wui-flex[data-type='info'] {
4266    color: ${({tokens:e})=>e.theme.textSecondary};
4267    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4268  }
4269
4270  wui-flex[data-type='success'] {
4271    color: ${({tokens:e})=>e.core.textSuccess};
4272    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
4273  }
4274
4275  wui-flex[data-type='error'] {
4276    color: ${({tokens:e})=>e.core.textError};
4277    background-color: ${({tokens:e})=>e.core.backgroundError};
4278  }
4279
4280  wui-flex[data-type='warning'] {
4281    color: ${({tokens:e})=>e.core.textWarning};
4282    background-color: ${({tokens:e})=>e.core.backgroundWarning};
4283  }
4284
4285  wui-flex[data-type='info'] wui-icon-box {
4286    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4287  }
4288
4289  wui-flex[data-type='success'] wui-icon-box {
4290    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
4291  }
4292
4293  wui-flex[data-type='error'] wui-icon-box {
4294    background-color: ${({tokens:e})=>e.core.backgroundError};
4295  }
4296
4297  wui-flex[data-type='warning'] wui-icon-box {
4298    background-color: ${({tokens:e})=>e.core.backgroundWarning};
4299  }
4300
4301  wui-text {
4302    flex: 1;
4303  }
4304`;var rl=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let rc=class extends r.WF{constructor(){super(...arguments),this.icon="externalLink",this.text="",this.type="info"}render(){return(0,r.qy)`
4305      <wui-flex alignItems="center" data-type=${this.type}>
4306        <wui-icon-box size="sm" color="inherit" icon=${this.icon}></wui-icon-box>
4307        <wui-text variant="md-regular" color="inherit">${this.text}</wui-text>
4308      </wui-flex>
4309    `}};rc.styles=[p.W5,p.fD,ro],rl([(0,n.MZ)()],rc.prototype,"icon",void 0),rl([(0,n.MZ)()],rc.prototype,"text",void 0),rl([(0,n.MZ)()],rc.prototype,"type",void 0),rc=rl([(0,g.E)("wui-banner")],rc);let rd=(0,r.AH)`
4310  :host > wui-flex {
4311    max-height: clamp(360px, 540px, 80vh);
4312    overflow: scroll;
4313    scrollbar-width: none;
4314  }
4315
4316  :host > wui-flex::-webkit-scrollbar {
4317    display: none;
4318  }
4319`,rh=class extends r.WF{constructor(){super(),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,r.qy)` <wui-flex flexDirection="column" .padding=${["2","3","3","3"]} gap="2">
4320      <wui-banner
4321        icon="warningCircle"
4322        text="You can only receive assets on these networks"
4323      ></wui-banner>
4324      ${this.networkTemplate()}
4325    </wui-flex>`}networkTemplate(){let e=o.W.getAllRequestedCaipNetworks(),t=o.W.getAllApprovedCaipNetworkIds(),i=o.W.state.activeCaipNetwork,n=o.W.checkIfSmartAccountEnabled(),a=d.w.sortRequestedNetworks(t,e);if(n&&(0,el.lj)(i?.chainNamespace)===ew.Vl.ACCOUNT_TYPES.SMART_ACCOUNT){if(!i)return null;a=[i]}return a.filter(e=>e.chainNamespace===i?.chainNamespace).map(e=>(0,r.qy)`
4326        <wui-list-network
4327          imageSrc=${(0,s.J)(c.$.getNetworkImage(e))}
4328          name=${e.name??"Unknown"}
4329          ?transparent=${!0}
4330        >
4331        </wui-list-network>
4332      `)}};rh.styles=rd,rh=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-wallet-compatible-networks-view")],rh);let ru=(0,m.AH)`
4333  :host {
4334    display: flex;
4335    justify-content: center;
4336    align-items: center;
4337    width: 56px;
4338    height: 56px;
4339    box-shadow: 0 0 0 8px ${({tokens:e})=>e.theme.borderPrimary};
4340    border-radius: ${({borderRadius:e})=>e[4]};
4341    overflow: hidden;
4342  }
4343
4344  :host([data-border-radius-full='true']) {
4345    border-radius: 50px;
4346  }
4347
4348  wui-icon {
4349    width: 32px;
4350    height: 32px;
4351  }
4352`;var rp=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let rf=class extends r.WF{render(){return this.dataset.borderRadiusFull=this.borderRadiusFull?"true":"false",(0,r.qy)`${this.templateVisual()}`}templateVisual(){return this.imageSrc?(0,r.qy)`<wui-image src=${this.imageSrc} alt=${this.alt??""}></wui-image>`:(0,r.qy)`<wui-icon
4353      data-parent-size="md"
4354      size="inherit"
4355      color="inherit"
4356      name="wallet"
4357    ></wui-icon>`}};rf.styles=[p.W5,ru],rp([(0,n.MZ)()],rf.prototype,"imageSrc",void 0),rp([(0,n.MZ)()],rf.prototype,"alt",void 0),rp([(0,n.MZ)({type:Boolean})],rf.prototype,"borderRadiusFull",void 0),rf=rp([(0,g.E)("wui-visual-thumbnail")],rf);let rg=(0,u.AH)`
4358  :host {
4359    display: flex;
4360    justify-content: center;
4361    gap: ${({spacing:e})=>e["4"]};
4362  }
4363
4364  wui-visual-thumbnail:nth-child(1) {
4365    z-index: 1;
4366  }
4367`,rm=class extends r.WF{constructor(){super(...arguments),this.dappImageUrl=a.H.state.metadata?.icons,this.walletImageUrl=o.W.getAccountData()?.connectedWalletInfo?.icon}firstUpdated(){let e=this.shadowRoot?.querySelectorAll("wui-visual-thumbnail");e?.[0]&&this.createAnimation(e[0],"translate(18px)"),e?.[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){return(0,r.qy)`
4368      <wui-visual-thumbnail
4369        ?borderRadiusFull=${!0}
4370        .imageSrc=${this.dappImageUrl?.[0]}
4371      ></wui-visual-thumbnail>
4372      <wui-visual-thumbnail .imageSrc=${this.walletImageUrl}></wui-visual-thumbnail>
4373    `}createAnimation(e,t){e.animate([{transform:"translateX(0px)"},{transform:t}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};rm.styles=rg,rm=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,u.EM)("w3m-siwx-sign-message-thumbnails")],rm);var rw=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let ry=class extends r.WF{constructor(){super(...arguments),this.dappName=a.H.state.metadata?.name,this.isCancelling=!1,this.isSigning=!1}render(){return(0,r.qy)`
4374      <wui-flex justifyContent="center" .padding=${["8","0","6","0"]}>
4375        <w3m-siwx-sign-message-thumbnails></w3m-siwx-sign-message-thumbnails>
4376      </wui-flex>
4377      <wui-flex .padding=${["0","20","5","20"]} gap="3" justifyContent="space-between">
4378        <wui-text variant="lg-medium" align="center" color="primary"
4379          >${this.dappName??"Dapp"} needs to connect to your wallet</wui-text
4380        >
4381      </wui-flex>
4382      <wui-flex .padding=${["0","10","4","10"]} gap="3" justifyContent="space-between">
4383        <wui-text variant="md-regular" align="center" color="secondary"
4384          >Sign this message to prove you own this wallet and proceed. Canceling will disconnect
4385          you.</wui-text
4386        >
4387      </wui-flex>
4388      <wui-flex .padding=${["4","5","5","5"]} gap="3" justifyContent="space-between">
4389        <wui-button
4390          size="lg"
4391          borderRadius="xs"
4392          fullWidth
4393          variant="neutral-secondary"
4394          ?loading=${this.isCancelling}
4395          @click=${this.onCancel.bind(this)}
4396          data-testid="w3m-connecting-siwe-cancel"
4397        >
4398          ${this.isCancelling?"Cancelling...":"Cancel"}
4399        </wui-button>
4399
4400        <wui-button
4401          size="lg"
4402          borderRadius="xs"
4403          fullWidth
4404          variant="neutral-primary"
4405          @click=${this.onSign.bind(this)}
4406          ?loading=${this.isSigning}
4407          data-testid="w3m-connecting-siwe-sign"
4408        >
4409          ${this.isSigning?"Signing...":"Sign"}
4410        </wui-button>
4411      </wui-flex>
4412    `}async onSign(){this.isSigning=!0;try{await iG.U.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){Y.P.showError({message:"Something went wrong. We need to verify your account again."}),J.I.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await iG.U.cancelSignMessage().finally(()=>this.isCancelling=!1)}};rw([(0,n.wk)()],ry.prototype,"isCancelling",void 0),rw([(0,n.wk)()],ry.prototype,"isSigning",void 0),ry=rw([(0,u.EM)("w3m-siwx-sign-message-view")],ry)},36424:(e,t,i)=>{"use strict";i.d(t,{mN:()=>A,AH:()=>c,W3:()=>C,Ec:()=>E,iz:()=>l});let r=globalThis,n=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),a=new WeakMap;class o{constructor(e,t,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(n&&void 0===e){let i=void 0!==t&&1===t.length;i&&(e=a.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&a.set(t,e))}return e}toString(){return this.cssText}}let l=e=>new o("string"==typeof e?e:e+"",void 0,s),c=(e,...t)=>new o(1===e.length?e[0]:t.reduce((t,i,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[r+1],e[0]),e,s),d=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return l(t)})(e):e,{is:h,defineProperty:u,getOwnPropertyDescriptor:p,getOwnPropertyNames:f,getOwnPropertySymbols:g,getPrototypeOf:m}=Object,w=globalThis,y=w.trustedTypes,b=y?y.emptyScript:"",v=w.reactiveElementPolyfillSupport,C={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},E=(e,t)=>!h(e,t),x={attribute:!0,type:String,converter:C,reflect:!1,useDefault:!1,hasChanged:E};Symbol.metadata??=Symbol("metadata"),w.litPropertyMetadata??=new WeakMap;class A extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=x){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,t);void 0!==r&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:n}=p(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let s=r?.call(this);n?.call(this,t),this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??x}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=m(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...f(e),...g(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,i]of t)this.elementProperties.set(e,i)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let i of new Set(e.flat(1/0).reverse()))t.unshift(d(i));else void 0!==e&&t.push(d(e));return t}static _$Eu(e,t){let i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e
4412=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(n)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let i of t){let t=document.createElement("style"),n=r.litNonce;void 0!==n&&t.setAttribute("nonce",n),t.textContent=i.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$ET(e,t){let i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(void 0!==r&&!0===i.reflect){let n=(void 0!==i.converter?.toAttribute?i.converter:C).toAttribute(t,i.type);this._$Em=e,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(e,t){let i=this.constructor,r=i._$Eh.get(e);if(void 0!==r&&this._$Em!==r){let e=i.getPropertyOptions(r),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:C;this._$Em=r;let s=n.fromAttribute(t,e.type);this[r]=s??this._$Ej?.get(r)??s,this._$Em=null}}requestUpdate(e,t,i,r=!1,n){if(void 0!==e){let s=this.constructor;if(!1===r&&(n=this[e]),!(((i??=s.getPropertyOptions(e)).hasChanged??E)(n,t)||i.useDefault&&i.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:r,wrapped:n},s){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,s??t??this[e]),!0!==n||void 0!==s)||(this._$AL.has(e)||(this.hasUpdated||i||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,i]of e){let{wrapped:e}=i,r=this[t];!0!==e||this._$AL.has(t)||void 0===r||this.C(t,void 0,i,r)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A.elementProperties=new Map,A.finalized=new Map,v?.({ReactiveElement:A}),(w.reactiveElementVersions??=[]).push("2.1.2")},37056:(e,t,i)=>{"use strict";i.d(t,{w:()=>o});var r=i(34386),n=i(30840),s=i(29400),a=i(5820);let o={getWindow(){if("u">typeof window)return window},isMobile(){return!!this.isClient()&&!!(window?.matchMedia&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer:coarse)")?.matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent))},checkCaipNetwork:(e,t="")=>e?.caipNetworkId.toLocaleLowerCase().includes(t.toLowerCase()),isAndroid(){if(!this.isMobile())return!1;let e=window?.navigator.userAgent.toLowerCase();return o.isMobile()&&e.includes("android")},isIos(){if(!this.isMobile())return!1;let e=window?.navigator.userAgent.toLowerCase();return e.includes("iphone")||e.includes("ipad")},isSafari(){return!!this.isClient()&&(window?.navigator.userAgent.toLowerCase()).includes("safari")}
4412,isClient:()=>"u">typeof window,isPairingExpired:e=>!e||e-Date.now()<=s.oU.TEN_SEC_MS,isAllowedRetry:(e,t=s.oU.ONE_SEC_MS)=>Date.now()-e>=t,copyToClopboard(e){navigator.clipboard.writeText(e)},isIframe(){try{return window?.self!==window?.top}catch(e){return!1}},isSafeApp(){if(o.isClient()&&window.self!==window.top)try{let e=window?.location?.ancestorOrigins?.[0];if(e){let t=new URL(e),i=new URL("https://app.safe.global");return t.hostname===i.hostname}}catch{}return!1},getPairingExpiry:()=>Date.now()+s.oU.FOUR_MINUTES_MS,getNetworkId:e=>e?.split(":")[1],getPlainAddress:e=>e?.split(":")[2],wait:async e=>new Promise(t=>{setTimeout(t,e)}),debounce(e,t=500){let i;return(...r)=>{i&&clearTimeout(i),i=setTimeout(function(){e(...r)},t)}},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),formatNativeUrl(e,t,i=null){if(o.isHttpUrl(e))return this.formatUniversalUrl(e,t);let r=e,n=i;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),n&&!n?.endsWith("/")&&(n=`${n}/`),this.isTelegram()&&this.isAndroid()&&(t=encodeURIComponent(t));let s=encodeURIComponent(t);return{redirect:`${r}wc?uri=${s}`,redirectUniversalLink:n?`${n}wc?uri=${s}`:void 0,href:r}},formatUniversalUrl(e,t){if(!o.isHttpUrl(e))return this.formatNativeUrl(e,t);let i=e;i.endsWith("/")||(i=`${i}/`);let r=encodeURIComponent(t);return{redirect:`${i}wc?uri=${r}`,href:i}},getOpenTargetForPlatform(e){return"popupWindow"===e?e:this.isTelegram()?a.i.getTelegramSocialProvider()?"_top":"_blank":e},openHref(e,t,i){window?.open(e,this.getOpenTargetForPlatform(t),i||"noreferrer noopener")},returnOpenHref(e,t,i){return window?.open(e,this.getOpenTargetForPlatform(t),i||"noreferrer noopener")},isTelegram:()=>"u">typeof window&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto),isPWA(){if("u"<typeof window)return!1;let e=!!window?.matchMedia&&"function"==typeof window.matchMedia&&window.matchMedia("(display-mode: standalone)")?.matches,t=window?.navigator?.standalone;return!!(e||t)},preloadImage:async e=>Promise.race([new Promise((t,i)=>{let r=new Image;r.onload=t,r.onerror=i,r.crossOrigin="anonymous",r.src=e}),o.wait(2e3)]),parseBalance(e,t){let i="0.000";if("string"==typeof e){let t=Number(e);if(!isNaN(t)){let e=(Math.floor(1e3*t)/1e3).toFixed(3);e&&(i=e)}}let[r,n]=i.split("."),s=r||"0",a=n||"000";return{formattedText:`${s}.${a}${t?` ${t}`:""}`,value:s,decimals:a,symbol:t}},getApiUrl:()=>r.o.W3M_API_URL,getBlockchainApiUrl:()=>r.o.BLOCKCHAIN_API_RPC_URL,getAnalyticsUrl:()=>r.o.PULSE_API_URL,getUUID:()=>crypto?.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),parseError:e=>"string"==typeof e?e:"string"==typeof e?.issues?.[0]?.message?e.issues[0].message:e instanceof Error?e.message:"Unknown error",sortRequestedNetworks(e,t=[]){let i={};return t&&e&&(e.forEach((e,t)=>{i[e]=t}),t.sort((e,t)=>{let r=i[e.id],n=i[t.id];return void 0!==r&&void 0!==n?r-n:void 0!==r?-1:1*(void 0!==n)})),t},calculateBalance(e){let t=0;for(let i of e)t+=i.value??0;return t},formatTokenBalance(e){let[t,i]=e.toFixed(2).split(".");return{dollars:t,pennies:i}},isAddress(e,t="eip155"){switch(t){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(e)&&(/^(?:0x)?[0-9a-f]{40}$/iu.test(e)||/^(?:0x)?[0-9A-F]{40}$/iu.test(e)))return!0;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(e);case"bip122":{let t=/^[1][a-km-zA-HJ-NP-Z1-9]{25,34}$/u.test(e),i=/^[3][a-km-zA-HJ-NP-Z1-9]{25,34}$/u.test(e),r=/^bc1[a-z0-9]{39,87}$/u.test(e),n=/^bc1p[a-z0-9]{58}$/u.test(e);return t||i||r||n}default:return!1}},uniqueBy(e,t){let i=new Set;return e.filter(e=>{let r=e[t];return!i.has(r)&&(i.add(r),!0)})},generateSdkVersion(e,t,i){let r=0===e.length?s.oU.ADAPTER_TYPES.UNIVERSAL:e.map(e=>e.adapterType).join(",");return`${t}-${r}-${i}`},createAccount(e){let{chainNamespace:t,chainId:i,address:r}=n.C.parseCaipAddress(e.caipAddress);return{namespace:t,address:r,chainId:i,caipAddress:e.caipAddress,type:e.type,publicKey:e.publicKey,path:e.path}},isCaipAddress(e){if("string"!=typeof e)return!1;let t=e.split(":"),i=t[0];return 3===t.filter(Boolean).length&&i in r.o.CHAIN_NAME_MAP},getAccount:e=>e?"string"==typeof e?{address:e,chainId:void 0}:{address:e.address,chainId:e.chainId}:{address:void 0,chainId:void 0},isMac(){let e=window?.navigator.userAgent.toLowerCase();return e.includes("macintosh")&&!e.includes("safari")},formatTelegramSocialLoginUrl(e){let t=`--${encodeURIComponent(window?.location.href)}`,i="state=";if("auth.magic.link"===new URL(e).host){let r="provider_authorization_url=",n=e.substring(e.indexOf(r)+r.length),s=this.injectIntoUrl(decodeURIComponent(n),i,t);return e.replace(n,encodeURIComponent(s))}return this.injectIntoUrl(e,i,t)},injectIntoUrl(e,t,i){let r=e.indexOf(t);if(-1===r)throw Error(`${t} parameter not found in the URL: ${e}`);let n=e.indexOf("&",r),s=t.length,a=-1!==n?n:e.length;return e.substring(0,r+s)+(e.substring(r+s,a)+i)+e.substring(n)},isNumber:e=>("number"==typeof e||"string"==typeof e)&&!isNaN(Number(e)),appendPayToUri:(e,t)=>t?`${e}&pay=${encodeURIComponent(t)}`:e}},37082:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(40859);i(82016),i(12936),i(15642);var a=i(94895),o=i(69428);i(19690);var l=i(34175);let c=(0,l.AH)`
4413  :host {
4414    position: relative;
4415    border-radius: ${({borderRadius:e})=>e[2]};
4416    width: 40px;
4417    height: 40px;
4418    overflow: hidden;
4419    background: ${({tokens:e})=>e.theme.foregroundPrimary};
4420    display: flex;
4421    justify-content: center;
4422    align-items: center;
4423    flex-wrap: wrap;
4424    column-gap: ${({spacing:e})=>e[1]};
4425    padding: ${({spacing:e})=>e[1]};
4426  }
4427
4428  :host > wui-wallet-image {
4429    width: 14px;
4430    height: 14px;
4431    border-radius: 2px;
4432  }
4433`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(...arguments),this.walletImages=[]}render(){let e=this.walletImages.length<4;return(0,r.qy)`${this.walletImages.slice(0,4).map(({src:e,walletName:t})=>(0,r.qy)`
4434          <wui-wallet-image
4435            size="sm"
4436            imageSrc=${e}
4437            name=${(0,s.J)(t)}
4438          ></wui-wallet-image>
4439        `)}
4440    ${e?[...Array(4-this.walletImages.length)].map(()=>(0,r.qy)` <wui-wallet-image size="sm" name=""></wui-wallet-image>`):null} `}};h.styles=[a.W5,c],d([(0,n.MZ)({type:Array})],h.prototype,"walletImages",void 0),h=d([(0,o.E)("wui-all-wallets-image")],h),i(54623);let u=(0,l.AH)`
4441  :host {
4442    width: 100%;
4443  }
4444
4445  button {
4446    column-gap: ${({spacing:e})=>e[2]};
4447    padding: ${({spacing:e})=>e[3]};
4448    width: 100%;
4449    background-color: transparent;
4450    border-radius: ${({borderRadius:e})=>e[4]};
4451    color: ${({tokens:e})=>e.theme.textPrimary};
4452  }
4453
4454  button > wui-wallet-image {
4455    background: ${({tokens:e})=>e.theme.foregroundSecondary};
4456  }
4457
4458  button > wui-text:nth-child(2) {
4459    display: flex;
4460    flex: 1;
4461  }
4462
4463  button:hover:enabled {
4464    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4465  }
4466
4467  button[data-all-wallets='true'] {
4468    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4469  }
4470
4471  button[data-all-wallets='true']:hover:enabled {
4472    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4473  }
4474
4475  button:focus-visible:enabled {
4476    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4477    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
4478  }
4479
4480  button:disabled {
4481    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4482    opacity: 0.5;
4483    cursor: not-allowed;
4484  }
4485
4486  button:disabled > wui-tag {
4487    background-color: ${({tokens:e})=>e.core.glass010};
4488    color: ${({tokens:e})=>e.theme.foregroundTertiary};
4489  }
4490
4491  wui-flex.namespace-icon {
4492    width: 16px;
4493    height: 16px;
4494    border-radius: ${({borderRadius:e})=>e.round};
4495    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4496    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.backgroundPrimary};
4497    transition: box-shadow var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2);
4498  }
4499
4500  button:hover:enabled wui-flex.namespace-icon {
4501    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.foregroundPrimary};
4502  }
4503
4504  wui-flex.namespace-icon > wui-icon {
4505    width: 10px;
4506    height: 10px;
4507  }
4508
4509  wui-flex.namespace-icon:not(:first-child) {
4510    margin-left: -4px;
4511  }
4512`;var p=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let f={eip155:"ethereum",solana:"solana",bip122:"bitcoin",polkadot:void 0,cosmos:void 0,sui:void 0,stacks:void 0,ton:"ton",tron:"tron"},g=class extends r.WF{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.size="md",this.tabIdx=void 0,this.namespaces=[],this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return this.dataset.size=this.size,(0,r.qy)`
4513      <button
4514        ?disabled=${this.disabled}
4515        data-all-wallets=${this.showAllWallets}
4516        tabindex=${(0,s.J)(this.tabIdx)}
4517      >
4518        ${this.templateAllWallets()} ${this.templateWalletImage()}
4519        <wui-flex flexDirection="column" justifyContent="center" alignItems="flex-start" gap="1">
4520          <wui-text variant="lg-regular" color="inherit">${this.name}</wui-text>
4521          ${this.templateNamespaces()}
4522        </wui-flex>
4523        ${this.templateStatus()}
4524        <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
4525      </button>
4526    `}templateNamespaces(){return this.namespaces?.length?(0,r.qy)`<wui-flex alignItems="center" gap="0">
4527        ${this.namespaces.map((e,t)=>(0,r.qy)`<wui-flex
4528              alignItems="center"
4529              justifyContent="center"
4530              zIndex=${(this.namespaces?.length??0)*2-t}
4531              class="namespace-icon"
4532            >
4533              <wui-icon
4534                name=${(0,s.J)(f[e])}
4535                size="sm"
4536                color="default"
4537              ></wui-icon>
4538            </wui-flex>`)}
4539      </wui-flex>`:null}templateAllWallets(){return this.showAllWallets&&this.imageSrc?(0,r.qy)` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?(0,r.qy)` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?(0,r.qy)`<wui-wallet-image
4540        size=${(0,s.J)("sm"===this.size?"sm":"md")}
4541        imageSrc=${this.imageSrc}
4542        name=${this.name}
4543      ></wui-wallet-image>`:this.showAllWallets||this.imageSrc?null:(0,r.qy)`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`}templateStatus(){return this.loading?(0,r.qy)`<wui-loading-spinner size="lg" color="accent-primary"></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?(0,r.qy)`<wui-tag size="sm" variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:null}};g.styles=[a.W5,a.fD,u],p([(0,n.MZ)({type:Array})],g.prototype,"walletImages",void 0),p([(0,n.MZ)()],g.prototype,"imageSrc",void 0),p([(0,n.MZ)()],g.prototype,"name",void 0),p([(0,n.MZ)()],g.prototype,"size",void 0),p([(0,n.MZ)()],g.prototype,"tagLabel",void 0),p([(0,n.MZ)()],g.prototype,"tagVariant",void 0),p([(0,n.MZ)()],g.prototype,"walletIcon",void 0),p([(0,n.MZ)()],g.prototype,"tabIdx",void 0),p([(0,n.MZ)({type:Array})],g.prototype,"namespaces",void 0),p([(0,n.MZ)({type:Boolean})],g.prototype,"disabled",void 0),p([(0,n.MZ)({type:Boolean})],g.prototype,"showAllWallets",void 0),p([(0,n.MZ)({type:Boolean})],g.prototype,"loading",void 0),p([(0,n.MZ)({type:String})],g.prototype,"loadingSpinnerColor",void 0),g=p([(0,o.E)("wui-list-wallet")],g)},37132:(e,t,i)=>{"use strict";i(15642)},37633:(e,t,i)=>{"use strict";i.d(t,{L:()=>n,P:()=>s});var r=i(34386);let n={caipNetworkIdToNumber:e=>e?Number(e.split(":")[1]):void 0,parseEvmChainId(e){return"string"==typeof e?this.caipNetworkIdToNumber(e):e},getNetworksByNamespace:(e,t)=>e?.filter(e=>e.chainNamespace===t)||[],getFirstNetworkByNamespace(e,t){return this.getNetworksByNamespace(e,t)[0]},getNetworkNameByCaipNetworkId(e,t){if(!t)return;let i=e.find(e=>e.caipNetworkId===t);if(i)return i.name;let[n]=t.split(":");return r.o.CHAIN_NAME_MAP?.[n]||void 0}},s=["eip155","solana","polkadot","bip122","cosmos","sui","stacks"]},37808:e=>{function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let i=0;i<t;i++)this.putBit((e>>>t-i-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},37837:(e,t,i)=>{var r="u">typeof globalThis&&globalThis||"u">typeof self&&self||void 0!==i.g&&i.g,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t=void 0!==n&&n||"u">typeof self&&self||void 0!==i.g&&i.g||{},r={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(r.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){if(2!=e.length)throw TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function h(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}}function u(e){return new Promise(function(t,i){e.onload=function(){t(e.result)},e.onerror=function(){i(e.error)}})}function p(e){var t=new FileReader,i=u(t);return t.readAsArrayBuffer(e),i}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){if(this.bodyUsed=this.bodyUsed,this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(r.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(r.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var t;r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=f(e):this._bodyText=e=Object.prototype.toString.call(e)}else this._noBody=!0,this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=h(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(r.blob)return this.blob().then(p);throw Error("could not read as ArrayBuffer")},this.text=function(){var e,t,i,r,n,s=h(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,i=u(t=new FileReader),n=(r=/charset=([A-Za-z0-9_-]+)/.exec(e.type))?r[1]:"utf-8",t.readAsText(e,n),i;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),i=Array(t.length),r=0;r<t.length;r++)i[r]=String.fromCharCode(t[r]);return i.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},r.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=o(e),t=l(t);var i=this.map[e];this.map[e]=i?i+", "+t:t},d.prototype.delete=function(e){delete this.map[o(e)]},d.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},d.prototype.set=function(e,t){this.map[o(e)]=l(t)},d.prototype.forEach=function(e,t){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(t,this.map[i],i,this)},d.prototype.keys=function(){var e=[];return this.forEach(function(t,i){e.push(i)}),c(e)},d.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),c(e)},d.prototype.entries=function(){var e=[];return this.forEach(function(t,i){e.push([i,t])}),c(e)},r.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function w(e,i){if(!(this instanceof w))throw TypeError('Please use the "new" operator, this DOM object c
4543onstructor cannot be called as a function.');var r,n,s=(i=i||{}).body;if(e instanceof w){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,i.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,s||null==e._bodyInit||(s=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new d(i.headers)),this.method=(n=(r=i.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in t)return new AbortController().signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),("GET"===this.method||"HEAD"===this.method)&&("no-store"===i.cache||"no-cache"===i.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var i=e.split("="),r=i.shift().replace(/\+/g," "),n=i.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(n))}}),t}function b(e,t){if(!(this instanceof b))throw TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},g.call(w.prototype),g.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var v=[301,302,303,307,308];b.redirect=function(e,t){if(-1===v.indexOf(t))throw RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var i=Error(e);this.stack=i.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function C(i,n){return new Promise(function(s,a){var c=new w(i,n);if(c.signal&&c.signal.aborted)return a(new e.DOMException("Aborted","AbortError"));var h=new XMLHttpRequest;function u(){h.abort()}if(h.onload=function(){var e,t,i={statusText:h.statusText,headers:(e=h.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var i=e.split(":"),r=i.shift().trim();if(r){var n=i.join(":").trim();try{t.append(r,n)}catch(e){console.warn("Response "+e.message)}}}),t)};0===c.url.indexOf("file://")&&(h.status<200||h.status>599)?i.status=200:i.status=h.status,i.url="responseURL"in h?h.responseURL:i.headers.get("X-Request-URL");var r="response"in h?h.response:h.responseText;setTimeout(function(){s(new b(r,i))},0)},h.onerror=function(){setTimeout(function(){a(TypeError("Network request failed"))},0)},h.ontimeout=function(){setTimeout(function(){a(TypeError("Network request timed out"))},0)},h.onabort=function(){setTimeout(function(){a(new e.DOMException("Aborted","AbortError"))},0)},h.open(c.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(t){return e}}(c.url),!0),"include"===c.credentials?h.withCredentials=!0:"omit"===c.credentials&&(h.withCredentials=!1),"responseType"in h&&(r.blob?h.responseType="blob":r.arrayBuffer&&(h.responseType="arraybuffer")),n&&"object"==typeof n.headers&&!(n.headers instanceof d||t.Headers&&n.headers instanceof t.Headers)){var p=[];
4543Object.getOwnPropertyNames(n.headers).forEach(function(e){p.push(o(e)),h.setRequestHeader(e,l(n.headers[e]))}),c.headers.forEach(function(e,t){-1===p.indexOf(t)&&h.setRequestHeader(t,e)})}else c.headers.forEach(function(e,t){h.setRequestHeader(t,e)});c.signal&&(c.signal.addEventListener("abort",u),h.onreadystatechange=function(){4===h.readyState&&c.signal.removeEventListener("abort",u)}),h.send(void 0===c._bodyInit?null:c._bodyInit)})}C.polyfill=!0,t.fetch||(t.fetch=C,t.Headers=d,t.Request=w,t.Response=b),e.Headers=d,e.Request=w,e.Response=b,e.fetch=C,Object.defineProperty(e,"__esModule",{value:!0})})({}),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=r.fetch?r:n;(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},38618:(e,t,i)=>{"use strict";i.d(t,{f:()=>f});var r=i(92679),n=i(3125);let s={convertEVMChainIdToCoinType(e){if(e>=0x80000000)throw Error("Invalid chainId");return(0x80000000|e)>>>0}};var a=i(5820),o=i(51369),l=i(18715),c=i(1024),d=i(60319),h=i(11446),u=i(44458);let p=(0,r.BX)({suggestions:[],loading:!1}),f=(0,o.X)({state:p,subscribe:e=>(0,r.B1)(p,()=>e(p)),subscribeKey:(e,t)=>(0,n.u$)(p,e,t),async resolveName(e){try{return await l.T.lookupEnsName(e)}catch(e){throw Error(e?.reasons?.[0]?.description||"Error resolving name")}},async isNameRegistered(e){try{return await l.T.lookupEnsName(e),!0}catch{return!1}},async getSuggestions(e){try{return p.loading=!0,p.suggestions=[],p.suggestions=(await l.T.getEnsNameSuggestions(e)).suggestions||[],p.suggestions}catch(e){throw Error(f.parseEnsApiError(e,"Error fetching name suggestions"))}finally{p.loading=!1}},async getNamesForAddress(e){try{if(!c.W.state.activeCaipNetwork)return[];let t=a.i.getEnsFromCacheForAddress(e);if(t)return t;let i=await l.T.reverseLookupEnsName({address:e});return a.i.updateEnsCache({address:e,ens:i,timestamp:Date.now()}),i}catch(e){throw Error(f.parseEnsApiError(e,"Error fetching names for address"))}},async registerName(e){let t=c.W.state.activeCaipNetwork,i=c.W.getAccountData(t?.chainNamespace)?.address,r=h.a.getAuthConnector();if(!t)throw Error("Network not found");if(!i||!r)throw Error("Address or auth connector not found");p.loading=!0;try{let r=JSON.stringify({name:e,attributes:{},timestamp:Math.floor(Date.now()/1e3)});u.I.pushTransactionStack({onCancel(){u.I.replace("RegisterAccountName")}});let n=await d.x.signMessage(r);p.loading=!1;let o=t.id;if(!o)throw Error("Network not found");let h=s.convertEVMChainIdToCoinType(Number(o));await l.T.registerEnsName({coinType:h,address:i,signature:n,message:r}),c.W.setAccountProp("profileName",e,t.chainNamespace),a.i.updateEnsCache({address:i,ens:[{name:e,registered_at:new Date().toISOString(),updated_at:void 0,addresses:{},attributes:[]}],timestamp:Date.now()}),u.I.replace("RegisterAccountNameSuccess")}catch(i){let t=f.parseEnsApiError(i,`Error registering name ${e}`);throw u.I.replace("RegisterAccountName"),Error(t)}finally{p.loading=!1}},validateName:e=>/^[a-zA-Z0-9-]{4,}$/u.test(e),parseEnsApiError:(e,t)=>e?.reasons?.[0]?.description||t})},39564:(e,t,i)=>{"use strict";i.d(t,{O:()=>a,W:()=>o});var r=i(34386),n=i(1024),s=i(37056);let a={PHANTOM:{id:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",url:"https://phantom.app",androidPackage:"app.phantom"},SOLFLARE:{id:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",url:"https://solflare.com"},COINBASE:{id:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",url:"https://go.cb-w.com",evmDeeplink:"cbwallet://miniapp"},BINANCE:{id:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25",appId:"yFK5FCqYprrXDiVFbhyRx7",deeplink:"bnc://app.binance.com/mp/app",url:"https://app.binance.com/en/download"}},o={isCustomDeeplinkWallet:(e,t)=>e===a.PHANTOM.id?t===r.o.CHAIN.SOLANA||t===r.o.CHAIN.EVM||t===r.o.CHAIN.BITCOIN:e===a.SOLFLARE.id?t===r.o.CHAIN.SOLANA:e===a.COINBASE.id?t===r.o.CHAIN.SOLANA||t===r.o.CHAIN.EVM:e===a.BINANCE.id&&t===r.o.CHAIN.BITCOIN,handleMobileDeeplinkRedirect(e,t,i){let o=window.location.href,l=encodeURIComponent(o),c=i?.isCoinbaseDisabled??!1;if(e===a.PHANTOM.id&&!("phantom"in window)){let e=o.startsWith("https")?"https":"http",t=o.split("/")[2],i=encodeURIComponent(`${e}://${t}`),r=`${a.PHANTOM.url}/ul/browse/${l}?ref=${i}`;if(s.w.isAndroid()){let e=`intent://browse/${l}?ref=${i}#Intent;scheme=phantom;package=${a.PHANTOM.androidPackage};end`;window.location.href=e}else window.location.href=r}if(e!==a.SOLFLARE.id||t!==r.o.CHAIN.SOLANA||"solflare"in window||(window.location.href=`${a.SOLFLARE.url}/ul/v1/browse/${l}?ref=${l}
4543`),t!==r.o.CHAIN.SOLANA||e!==a.COINBASE.id||!c&&"coinbaseSolana"in window||(window.location.href=`${a.COINBASE.url}/dapp?cb_url=${l}`),t!==r.o.CHAIN.EVM||e!==a.COINBASE.id||!c&&"coinbaseWalletExtension"in window||(window.location.href=`${a.COINBASE.evmDeeplink}?url=${l}`),t===r.o.CHAIN.BITCOIN&&e===a.BINANCE.id&&!("binancew3w"in window)){let e=n.W.state.activeCaipNetwork,t=window.btoa("/pages/browser/index"),i=window.btoa(`url=${l}&defaultChainId=${e?.id??1}`),r=new URL(a.BINANCE.deeplink);r.searchParams.set("appId",a.BINANCE.appId),r.searchParams.set("startPagePath",t),r.searchParams.set("startPageQuery",i);let s=new URL(a.BINANCE.url);s.searchParams.set("_dp",window.btoa(r.toString())),window.location.href=s.toString()}}}},39591:(e,t,i)=>{"use strict";i.d(t,{T:()=>r});let r={URLS:{FAQ:"https://walletconnect.com/faq"}}},40859:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});var r=i(87850);let n=e=>e??r.s6},41300:(e,t,i)=>{"use strict";i.d(t,{U:()=>w}),i(45027);var r=i(30840),n=i(34386),s=i(67066),a=i(1024),o=i(60319),l=i(11446),c=i(43242),d=i(24568),h=i(11403),u=i(44458),p=i(44963),f=i(33452),g=i(37056);let m=null,w={getSIWX:()=>h.H.state.siwx,async initializeIfEnabled(e=a.W.getActiveCaipAddress()){let t=h.H.state.siwx;if(!(t&&e))return;let[i,r,n]=e.split(":");if(a.W.checkIfSupportedNetwork(i,`${i}:${r}`))try{if(h.H.state.remoteFeatures?.emailCapture){let e=a.W.getAccountData(i)?.user;await d.W.open({view:"DataCapture",data:{email:e?.email??void 0}});return}if(m&&await m,(await t.getSessions(`${i}:${r}`,n)).length)return;await d.W.open({view:"SIWXSignMessage"})}catch(e){console.error("SIWXUtil:initializeIfEnabled",e),c.E.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties(e)}),await o.x._getClient()?.disconnect().catch(console.error),u.I.reset("Connect"),p.P.showError("A problem occurred while trying initialize authentication")}},async isAuthenticated(e=a.W.getActiveCaipAddress()){if(!h.H.state.siwx||!e)return!0;let{chainNamespace:t,chainId:i,address:n}=r.C.parseCaipAddress(e),s=`${t}:${i}`;return(await w.getSessions({address:n,caipNetworkId:s})).length>0},async requestSignMessage(){let e=h.H.state.siwx,t=g.w.getPlainAddress(a.W.getActiveCaipAddress()),i=(0,f.kg)();if(!e)throw Error("SIWX is not enabled");if(!t)throw Error("No ActiveCaipAddress found");if(!i)throw Error("No ActiveCaipNetwork or client found");try{let r=await e.createMessage({chainId:i.caipNetworkId,accountAddress:t}),s=r.toString(),h="";e.signMessage?h=await e.signMessage({message:s,chainId:i.caipNetworkId,accountAddress:t}):(l.a.getConnectorId(i.chainNamespace)===n.o.CONNECTOR_ID.AUTH&&u.I.pushTransactionStack({}),h=await o.x.signMessage(s)||""),await e.addSession({data:r,message:s,signature:h}),a.W.setLastConnectedSIWECaipNetwork(i),d.W.close(),c.E.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:this.getSIWXEventProperties()})}catch(e){d.W.state.open&&"ApproveTransaction"!==u.I.state.view||await d.W.open({view:"SIWXSignMessage"}),p.P.showError("Error signing message"),c.E.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties(e)}),console.error("SWIXUtil:requestSignMessage",e)}},async cancelSignMessage(){try{let e=this.getSIWX();if(e?.getRequired?.()){let t=a.W.getLastConnectedSIWECaipNetwork();if(t){let i=await e?.getSessions(t?.caipNetworkId,g.w.getPlainAddress(a.W.getActiveCaipAddress())||"");i&&i.length>0?await a.W.switchActiveNetwork(t):await o.x.disconnect()}else await o.x.disconnect()}else d.W.close();d.W.close(),c.E.sendEvent({event:"CLICK_CANCEL_SIWX",type:"track",properties:this.getSIWXEventProperties()})}catch(e){console.error("SIWXUtil:cancelSignMessage",e)}},async getAllSessions(){let e=this.getSIWX(),t=a.W.getAllRequestedCaipNetworks(),i=[];return await Promise.all(t.map(async t=>{let r=await e?.getSessions(t.caipNetworkId,g.w.getPlainAddress(a.W.getActiveCaipAddress())||"");r&&i.push(...r)})),i},async getSessions(e){let t=h.H.state.siwx,i=e?.address;if(!i){let e=a.W.getActiveCaipAddress();i=g.w.getPlainAddress(e)}let r=e?.caipNetworkId;if(!r){let e=a.W.getActiveCaipNetwork();r=e?.caipNetworkId}return t&&i&&r?t.getSessions(r,i):[]},async isSIWXCloseDisabled(){let e=this.getSIWX();if(e){let t="ApproveTransaction"===u.I.state.view,i="SIWXSignMessage"===u.I.state.view;
4543if(t||i)return e.getRequired?.()&&0===(await this.getSessions()).length}return!1},async authConnectorAuthenticate({authConnector:e,chainId:t,socialUri:i,preferredAccountType:r,chainNamespace:s}){let o=w.getSIWX(),l=(0,f.kg)();if(!o||!s.includes(n.o.CHAIN.EVM)||h.H.state.remoteFeatures?.emailCapture){let n=await e.connect({chainId:t,socialUri:i,preferredAccountType:r});return{address:n.address,chainId:n.chainId,accounts:n.accounts}}let c=`${s}:${t}`,d=await o.createMessage({chainId:c,accountAddress:"<<AccountAddress>>"}),u={accountAddress:d.accountAddress,chainId:d.chainId,domain:d.domain,uri:d.uri,version:d.version,nonce:d.nonce,notBefore:d.notBefore,statement:d.statement,resources:d.resources,requestId:d.requestId,issuedAt:d.issuedAt,expirationTime:d.expirationTime,serializedMessage:d.toString()},p=await e.connect({chainId:t,socialUri:i,siwxMessage:u,preferredAccountType:r});if(u.accountAddress=p.address,u.serializedMessage=p.message||"",p.signature&&p.message){let e=w.addEmbeddedWalletSession(u,p.message,p.signature);await e}return a.W.setLastConnectedSIWECaipNetwork(l),{address:p.address,chainId:p.chainId,accounts:p.accounts}},async addEmbeddedWalletSession(e,t,i){if(m)return m;let r=w.getSIWX();return r?m=r.addSession({data:e,message:t,signature:i}).finally(()=>{m=null}):Promise.resolve()},async universalProviderAuthenticate({universalProvider:e,chains:t,methods:i}){let r=w.getSIWX(),n=(0,f.kg)(),s=new Set(t.map(e=>e.split(":")[0]));if(!r||1!==s.size||!s.has("eip155"))return!1;let o=await r.createMessage({chainId:(0,f.kg)()?.caipNetworkId||"",accountAddress:""}),l=await e.authenticate({nonce:o.nonce,domain:o.domain,uri:o.uri,exp:o.expirationTime,iat:o.issuedAt,nbf:o.notBefore,requestId:o.requestId,version:o.version,resources:o.resources,statement:o.statement,chainId:o.chainId,methods:i,chains:[o.chainId,...t.filter(e=>e!==o.chainId)]});p.P.showLoading("Authenticating...",{autoClose:!1});let d={...l.session.peer.metadata,name:l.session.peer.metadata.name,icon:l.session.peer.metadata.icons?.[0],type:"WALLET_CONNECT"};if(a.W.setAccountProp("connectedWalletInfo",d,Array.from(s)[0]),l?.auths?.length){let t=l.auths.map(t=>{let i=e.client.formatAuthMessage({request:t.p,iss:t.p.iss});return{data:{...t.p,accountAddress:t.p.iss.split(":").slice(-1).join(""),chainId:t.p.iss.split(":").slice(2,4).join(":"),uri:t.p.aud??"",version:t.p.version||o.version,expirationTime:t.p.exp,issuedAt:t.p.iat,notBefore:t.p.nbf},message:i,signature:t.s.s,cacao:t}});try{await r.setSessions(t),n&&a.W.setLastConnectedSIWECaipNetwork(n),c.E.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:w.getSIWXEventProperties()})}catch(t){throw console.error("SIWX:universalProviderAuth - failed to set sessions",t),c.E.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:w.getSIWXEventProperties(t)}),await e.disconnect().catch(console.error),t}finally{p.P.hide()}}return!0},getSIWXEventProperties(e){let t=a.W.state.activeChain;if(!t)throw Error("SIWXUtil:getSIWXEventProperties - namespace is required");return{network:a.W.state.activeCaipNetwork?.caipNetworkId||"",isSmartAccount:(0,f.lj)(t)===s.Vl.ACCOUNT_TYPES.SMART_ACCOUNT,message:e?g.w.parseError(e):void 0}},async clearSessions(){let e=this.getSIWX();e&&await e.setSessions([])}}},42608:(e,t,i)=>{"use strict";i.d(t,{M:()=>s});var r=i(36424);let n={attribute:!0,type:String,converter:r.W3,reflect:!1,hasChanged:r.Ec};function s(e){return(t,i)=>{let r;return"object"==typeof i?((e=n,t,i)=>{let{kind:r,metadata:s}=i,a=globalThis.litPropertyMetadata.get(s);if(void 0===a&&globalThis.litPropertyMetadata.set(s,a=new Map),"setter"===r&&((e=Object.create(e)).wrapped=!0),a.set(i.name,e),"accessor"===r){let{name:r}=i;return{set(i){let n=t.get.call(this);t.set.call(this,i),this.requestUpdate(r,n,e,!0,i)},init(t){return void 0!==t&&this.C(r,void 0,e,t),t}}}if("setter"===r){let{name:r}=i;return function(i){let n=this[r];t.call(this,i),this.requestUpdate(r,n,e,!0,i)}}throw Error("Unsupported decorator location: "+r)})(e,t,i):(r=t.hasOwnProperty(i),t.constructor.createProperty(i,e),r?Object.getOwnPropertyDescriptor(t,i):void 0)}}},42854:(e,t,i)=>{"use strict";i.d(t,{H:()=>h});var r=i(88088),n=i(53227),s=i(44458),a=i(43242),o=i(59306);i(62791),i(80912);var l=i(33526);let c=(0,o.AH)`
4544  :host {
4545    display: block;
4546  }
4547
4548  div.container {
4549    position: absolute;
4550    bottom: 0;
4551    left: 0;
4552    right: 0;
4553    overflow: hidden;
4554    height: auto;
4555    display: block;
4556  }
4557
4558  div.container[status='hide'] {
4559    animation: fade-out;
4560    animation-duration: var(--apkt-duration-dynamic);
4561    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
4562    animation-fill-mode: both;
4563    animation-delay: 0s;
4564  }
4565
4566  div.container[status='show'] {
4567    animation: fade-in;
4568    animation-duration: var(--apkt-duration-dynamic);
4569    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
4570    animation-fill-mode: both;
4571    animation-delay: var(--apkt-duration-dynamic);
4572  }
4573
4574  @keyframes fade-in {
4575    from {
4576      opacity: 0;
4577      filter: blur(6px);
4578    }
4579    to {
4580      opacity: 1;
4581      filter: blur(0px);
4582    }
4583  }
4584
4585  @keyframes fade-out {
4586    from {
4587      opacity: 1;
4588      filter: blur(0px);
4589    }
4590    to {
4591      opacity: 0;
4592      filter: blur(6px);
4593    }
4594  }
4595`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=s.I.state.view}firstUpdated(){this.status=l.y.hasFooter()?"show":"hide",this.unsubscribe.push(s.I.subscribeKey("view",e=>{this.view=e,this.status=l.y.hasFooter()?"show":"hide","hide"===this.status&&document.documentElement.style.setProperty("--apkt-footer-height","0px")})),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target===this.getWrapper()){let e=`${t.contentRect.height}px`;document.documentElement.style.setProperty("--apkt-footer-height",e)}}),this.resizeObserver.observe(this.getWrapper())}render(){return(0,r.qy)`
4596      <div class="container" status=${this.status}>${this.templatePageContainer()}</div>
4597    `}templatePageContainer(){return l.y.hasFooter()?(0,r.qy)` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return(0,r.qy)`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return(0,r.qy)`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return(0,r.qy)` <wui-flex
4598      class="footer-in"
4599      padding="3"
4600      flexDirection="column"
4601      gap="3"
4602      alignItems="center"
4603    >
4604      <wui-text variant="md-regular" color="secondary" align="center">
4605        Your connected wallet may not support some of the networks available for this dApp
4606      </wui-text>
4607      <wui-link @click=${this.onNetworkHelp.bind(this)}>
4608        <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
4609        What is a network
4610      </wui-link>
4611    </wui-flex>`}onNetworkHelp(){a.E.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),s.I.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};h.styles=[c],d([(0,n.wk)()],h.prototype,"status",void 0),d([(0,n.wk)()],h.prototype,"view",void 0),h=d([(0,o.EM)("w3m-footer")],h)},43242:(e,t,i)=>{"use strict";i.d(t,{E:()=>u});var r=i(92679),n=i(37056),s=i(75821),a=i(1024),o=i(11403);let l=n.w.getAnalyticsUrl(),c=new s.Z({baseUrl:l,clientId:null}),d=["MODAL_CREATED"],h=(0,r.BX)({timestamp:Date.now(),lastFlush:Date.now(),reportedErrors:{},data:{type:"track",event:"MODAL_CREATED"},pendingEvents:[],subscribedToVisibilityChange:!1,walletImpressions:[]}),u={state:h,subscribe:e=>(0,r.B1)(h,()=>e(h)),getSdkProperties(){let{projectId:e,sdkType:t,sdkVersion:i}=o.H.state;return{projectId:e,st:t,sv:i||"html-wagmi-4.2.2"}},shouldFlushEvents(){let e=JSON.stringify(h.pendingEvents).length/1024>45,t=h.lastFlush+1e4<Date.now();return e||t},_setPendingEvent(e){try{let t=a.W.getAccountData()?.address;if("address"in e.data&&e.data.address&&(t=e.data.address),d.includes(e.data.event)||"u"<typeof window)return;let i=a.W.getActiveCaipNetwork()?.caipNetworkId;this.state.pendingEvents.push({eventId:n.w.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:e.timestamp,props:{...e.data,address:t,properties:{..."properties"in e.data?e.data.properties:{},caipNetworkId:i}}}),h.reportedErrors.FORBIDDEN=!1,u.shouldFlushEvents()&&u._submitPendingEvents()}catch(e){console.warn("_setPendingEvent",e)}},sendEvent(e){h.timestamp=Date.now(),h.data=e,(o.H.state.features?.anal
4611ytics||["INITIALIZE","CONNECT_SUCCESS","SOCIAL_LOGIN_SUCCESS"].includes(e.event))&&u._setPendingEvent(h),this.subscribeToFlushTriggers()},sendWalletImpressionEvent(e){h.walletImpressions.push(e)},_transformPendingEventsForBatch(e){try{return e.filter(e=>{let t=e.props.event;return"WALLET_IMPRESSION_V2"!==t})}catch{return e}},_submitPendingEvents(){if(h.lastFlush=Date.now(),0!==h.pendingEvents.length||0!==h.walletImpressions.length)try{let e=u._transformPendingEventsForBatch(h.pendingEvents);h.walletImpressions.length&&e.push({eventId:n.w.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:Date.now(),props:{type:"track",event:"WALLET_IMPRESSION_V2",items:[...h.walletImpressions]}}),c.sendBeacon({path:"/batch",params:u.getSdkProperties(),body:e}),h.reportedErrors.FORBIDDEN=!1,h.pendingEvents=[],h.walletImpressions=[]}catch(e){h.reportedErrors.FORBIDDEN=!0}},subscribeToFlushTriggers(){h.subscribedToVisibilityChange||"u">typeof document&&(h.subscribedToVisibilityChange=!0,document?.addEventListener?.("visibilitychange",()=>{"hidden"===document.visibilityState&&u._submitPendingEvents()}),document?.addEventListener?.("freeze",()=>{u._submitPendingEvents()}),window?.addEventListener?.("pagehide",()=>{u._submitPendingEvents()}),setInterval(()=>{u._submitPendingEvents()},1e4))}}},43587:(e,t,i)=>{"use strict";i.d(t,{k:()=>o});var r=i(30840),n=i(38618);function s(e){try{return new URL(e)}catch{return null}}let a={ton:["ton_sendMessage","ton_signData"],solana:["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"],eip155:["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_showCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],bip122:["sendTransfer","signMessage","signPsbt","getAccountAddresses"],tron:["tron_signMessage","tron_signTransaction"]},o={RPC_ERROR_CODE:{USER_REJECTED:5e3,USER_REJECTED_METHODS:5002},getMethodsByChainNamespace:e=>a[e]||[],createDefaultNamespace(e){return{methods:this.getMethodsByChainNamespace(e),events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}}},applyNamespaceOverrides(e,t){if(!t)return{...e};let i={...e},r=new Set;if(t.methods&&Object.keys(t.methods).forEach(e=>r.add(e)),t.chains&&Object.keys(t.chains).forEach(e=>r.add(e)),t.events&&Object.keys(t.events).forEach(e=>r.add(e)),t.rpcMap&&Object.keys(t.rpcMap).forEach(e=>{let[t]=e.split(":");t&&r.add(t)}),r.forEach(e=>{i[e]||(i[e]=this.createDefaultNamespace(e))}),t.methods&&Object.entries(t.methods).forEach(([e,t])=>{i[e]&&(i[e].methods=t)}),t.chains&&Object.entries(t.chains).forEach(([e,t])=>{i[e]&&(i[e].chains=t)}),t.events&&Object.entries(t.events).forEach(([e,t])=>{i[e]&&(i[e].events=t)}),t.rpcMap){let e=new Set;Object.entries(t.rpcMap).forEach(([t,r])=>{let[n,s]=t.split(":");n&&s&&i[n]&&(i[n].rpcMap||(i[n].rpcMap={}),e.has(n)||(i[n].rpcMap={},e.add(n)),i[n].rpcMap[s]=r)})}return i},createNamespaces(e,t){let i=e.reduce((e,t)=>{let{id:i,chainNamespace:r,rpcUrls:n}=t,s=n.default.http[0];e[r]||(e[r]=this.createDefaultNamespace(r));let a=`${r}:${i}`,o=e[r];switch(o.chains.push(a),a){case"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":o.chains.push("solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ");break;case"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1":o.chains.push("solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K")}return o?.rpcMap&&s&&(o.rpcMap[i]=s),e},{});return this.applyNamespaceOverrides(i,t)},resolveReownName:async e=>{let t=await n.f.resolveName(e),i=t?.addresses?Object.values(t.addresses):[];return i[0]?.address||!1},getChainsFromNamespaces:(e={})=>Object.values(e).flatMap(e=>Array.from(new Set([...e.chains||[],...e.accounts.map(e=>{let[t,i]=e.split(":");return`${t}:${i}`})]))),isSessionEventData:e=>"object"==typeof e&&null!==e&&"id"in e&&"topic"in e&&"params"in e&&"object"==typeof e.params&&null!==e.params&&"chainId"in e.params&&"event"in e.params&&"object"==typeof e.params.event&&null!==e.params.event,isUserRejectedRequestError(e){try{if("object"==typeof e&&null!==e){let t="number"==typeof e.code,i=t&&e.code===o.RPC_ERROR_CODE.USER_REJECTED_METHODS,r=t&&e.code===o.RPC_ERROR_CODE.USER_REJECTED;return i||r}return!1}catch{return!1}},isOriginAllowed(e,t,i){let r=[...t,...i];if(0===t.length)return!0;let n=s(e);if(!n)return r.some(t=>!t.includes("*")&&t===e);if("localhost"===n.hostname||"127.0.0.1"===n.hostname)return!0;for(let t of r)if(t.includes("*")){if(function(e,t,i){let r,n,s=i,a=s.indexOf("://");-1!==a&&(r=s.slice(0,a),s=s.slice(a+3));let o=s.indexOf("/");-1!==o&&(s=s.slice(0,o));let l=s,c=l.lastIndexOf(":");-1!==c&&(n=l.slice(c+1),l=l.slice(0,c));let d=l.split(".");for(let e of d)if(e.includes("*")&&"*"!==e)return!1;let h=e.protocol.replace(/:$/u,"");if(r&&r!==h||void 0!==n&&"*"!==n&&n!==e.port)return!1;let u=function(e){let t=e.indexOf("://");if(-1===t)return null;let i=e.slice(0,t),r=t+3,n=e.indexOf("/",r);-1===n&&(n=e.length);let s=e.slice(r,n),a=s.lastIndexOf(":");return -1===a?{scheme:i,host:s}:{scheme:i,host:s.slice(0,a),port:s.slice(a+1)}}(t),p=(u?u.host:e.hostname).split(".");if(d.length!==p.length)return!1;for(let e=d.length-1;e>=0;e-=1){let t=d[e],i=p[e];if("*"!==t&&t!==i)return!1}return!0}(n,e,t))return!0}else if(function(e,t){let i,r,n;if(t.includes("://")){let i=s(t);return!!i&&i.origin===e}let{host:a,port:o}=-1===(n=(r=(i=t.split("/")).length>0&&void 0!==i[0]?i[0]:"").lastIndexOf(":"))?{host:r}:{host:r.slice(0,n),port:r.slice(n+1)},l=e.indexOf("://");if(-1!==l){let t=l+3,i=e.indexOf("/",t);-1===i&&(i=e.length);let r=e.slice(t,i);return void 0!==o?`${a}:${o}`===r:a===r.split(":")[0]}let c=s(e);return!!c&&(void 0!==o?a===c.hostname&&o===(c.port||void 0):a===c.hostname)}(e,t))return!0;return!1},listenWcProvider({universalProvider:e,namespace:t,onConnect:i,onDisconnect:n,onAccountsChanged:s,onChainChanged:a,onDisplayUri:l}){i&&e.on("connect",()=>{i(o.getWalletConnectAccounts(e,t))}),n&&e.on("disconnect",()=>{n()}),s&&e.on("accountsChanged",i=>{try{let n=e.session?.namespaces?.[t]?.accounts||[],a=e.rpcProviders?.[t]?.getDefaultChain(),o=i.map(e=>{let i=n.find(i=>i.includes(`${t}:${a}:${e}`));if(!i)return;let{chainId:s,chainNamespace:o}=r.C.parseCaipAddress(i);return{address:e,chainId:s,chainNamespace:o}}).filter(e=>void 0!==e);o.length>0&&s(o)}catch(e){console.warn("Failed to parse accounts for namespace on accountsChanged event",t,i,e)}}),a&&e.on("chainChanged",e=>{a(e)}),l&&e.on("display_uri",e=>{l(e)})},getWalletConnectAccounts(e,t){let i=new Set,n=e?.session?.namespaces?.[t]?.accounts?.map(e=>r.C.parseCaipAddress(e)).filter(({address:e})=>!i.has(e.toLowerCase())&&(i.add(e.toLowerCase()),!0));return n&&n.length>0?n:[]}}},43738:(e,t)=>
4611{t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,i){if(t.isValid(e))return e;try{if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw Error("Unknown EC Level: "+e)}}catch(e){return i}}},44458:(e,t,i)=>{"use strict";i.d(t,{I:()=>p});var r=i(92679),n=i(3125),s=i(51369),a=i(92929),o=i(1024),l=i(11446),c=i(24568),d=i(11403);let h=["ConnectingExternal","ConnectingMultiChain","ConnectingSocial","ConnectingFarcaster"],u=(0,r.BX)({view:"Connect",history:["Connect"],transactionStack:[]}),p=(0,s.X)({state:u,subscribeKey:(e,t)=>(0,n.u$)(u,e,t),pushTransactionStack(e){u.transactionStack.push(e)},popTransactionStack(e){let t=u.transactionStack.pop();if(!t)return;let{onSuccess:i,onError:r,onCancel:n}=t;switch(e){case"success":i?.();break;case"error":r?.(),p.goBack();break;case"cancel":n?.(),p.goBack()}},push(e,t){let i=e,r=t;a.N.state.plan.hasExceededUsageLimit&&h.includes(e)&&(i="UsageExceeded",r=void 0),i!==u.view&&(u.view=i,u.history.push(i),u.data=r)},reset(e,t){u.view=e,u.history=[e],u.data=t},replace(e,t){u.history.at(-1)!==e&&(u.view=e,u.history[u.history.length-1]=e,u.data=t)},goBack(){let e=o.W.state.activeCaipAddress,t="ConnectingFarcaster"===p.state.view,i=!e&&t;if(u.history.length>1){u.history.pop();let[t]=u.history.slice(-1);t&&(e&&"Connect"===t?u.view="Account":u.view=t)}else c.W.close();u.data?.wallet&&(u.data.wallet=void 0),u.data?.redirectView&&(u.data.redirectView=void 0),setTimeout(()=>{if(i){o.W.setAccountProp("farcasterUrl",void 0,o.W.state.activeChain);let e=l.a.getAuthConnector();e?.provider?.reload();let t=(0,r.P9)(d.H.state);e?.provider?.syncDappData?.({metadata:t.metadata,sdkVersion:t.sdkVersion,projectId:t.projectId,sdkType:t.sdkType})}},100)},goBackToIndex(e){if(u.history.length>1){u.history=u.history.slice(0,e+1);let[t]=u.history.slice(-1);t&&(u.view=t)}},goBackOrCloseModal(){p.state.history.length>1?p.goBack():c.W.close()}})},44963:(e,t,i)=>{"use strict";i.d(t,{P:()=>l});var r=i(92679),n=i(3125),s=i(37056);let a=Object.freeze({message:"",variant:"success",svg:void 0,open:!1,autoClose:!0}),o=(0,r.BX)({...a}),l={state:o,subscribeKey:(e,t)=>(0,n.u$)(o,e,t),showLoading(e,t={}){this._showMessage({message:e,variant:"loading",...t})},showSuccess(e){this._showMessage({message:e,variant:"success"})},showSvg(e,t){this._showMessage({message:e,svg:t})},showError(e){let t=s.w.parseError(e);this._showMessage({message:t,variant:"error"})},hide(){o.message=a.message,o.variant=a.variant,o.svg=a.svg,o.open=a.open,o.autoClose=a.autoClose},_showMessage({message:e,svg:t,variant:i="success",autoClose:r=a.autoClose}){o.open?(o.open=!1,setTimeout(()=>{o.message=e,o.variant=i,o.svg=t,o.open=!0,o.autoClose=r},150)):(o.message=e,o.variant=i,o.svg=t,o.open=!0,o.autoClose=r)}}},45027:(e,t,i)=>{"use strict";let r,n,s,a,o,l,c,d;i.d(t,{A:()=>gh});var h,u,p,f={};i.r(f),i.d(f,{identity:()=>rV});var g={};i.r(g),i.d(g,{base2:()=>rZ});var m={};i.r(m),i.d(m,{base8:()=>rK});var w={};i.r(w),i.d(w,{base10:()=>rG});var y={};i.r(y),i.d(y,{base16:()=>rY,base16upper:()=>rJ});var b={};i.r(b),i.d(b,{base32:()=>rX,base32hex:()=>r2,base32hexpad:()=>r5,base32hexpadupper:()=>r4,base32hexupper:()=>r3,base32pad:()=>r0,base32padupper:()=>r1,base32upper:()=>rQ,base32z:()=>r6});var v={};i.r(v),i.d(v,{base36:()=>r8,base36upper:()=>r9});var C={};i.r(C),i.d(C,{base58btc:()=>r7,base58flickr:()=>ne});var E={};i.r(E),i.d(E,{base64:()=>nt,base64pad:()=>ni,base64url:()=>nr,base64urlpad:()=>nn});var x={};i.r(x),i.d(x,{base256emoji:()=>nl});var A={};i.r(A),i.d(A,{sha256:()=>nw,sha512:()=>ny});var _={};i.r(_),i.d(_,{identity:()=>nb});var I={};
4611i.r(I),i.d(I,{code:()=>nC,decode:()=>nx,encode:()=>nE,name:()=>nv});var S={};i.r(S),i.d(S,{code:()=>nS,decode:()=>nk,encode:()=>nN,name:()=>nI});var N=i(16096),k=i.n(N),T=i(68939);class O{}class R extends O{constructor(e){super()}}let P=T.FIVE_SECONDS,$="heartbeat_pulse";class U extends R{constructor(e){super(e),this.events=new N.EventEmitter,this.interval=P,this.interval=e?.interval||P}static async init(e){let t=new U(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,T.toMiliseconds)(this.interval))}pulse(){this.events.emit($)}}let M=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,D=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,L=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function W(e,t){var i;return"__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t?void(i=e,console.warn(`[destr] Dropping "${i}" key to prevent prototype pollution.`)):t}function B(e,t={}){if("string"!=typeof e)return e;if('"'===e[0]&&'"'===e[e.length-1]&&-1===e.indexOf("\\"))return e.slice(1,-1);let i=e.trim();if(i.length<=9)switch(i.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return NaN;case"infinity":return 1/0;case"-infinity":return-1/0}if(!L.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(M.test(e)||D.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,W)}return JSON.parse(e)}catch(i){if(t.strict)throw i;return e}}var j=i(49304).hp;function F(e,...t){try{var i;return(i=e(...t))&&"function"==typeof i.then?i:Promise.resolve(i)}catch(e){return Promise.reject(e)}}function H(e){let t,i;if(t=typeof e,null===e||"object"!==t&&"function"!==t)return String(e);if(!(i=Object.getPrototypeOf(e))||i.isPrototypeOf(Object)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return H(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}let q="base64:";function z(e){return e&&e.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function V(e){return(e=z(e))?e+":":""}function Z(e,t,i){return e.watch?e.watch((e,r)=>t(e,i+r)):()=>{}}async function K(e){"function"==typeof e.dispose&&await F(e.dispose)}var G=i(53973);function Y(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return JSON.parse(e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t)}catch(t){return e}}function J(e){return"string"==typeof e?e:JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t)||""}class X{constructor(){this.indexedDb=function(e={}){let t,i={mounts:{"":e.driver||(t=new Map,{name:"memory",getInstance:()=>t,hasItem:e=>t.has(e),getItem:e=>t.get(e)??null,getItemRaw:e=>t.get(e)??null,setItem(e,i){t.set(e,i)},setItemRaw(e,i){t.set(e,i)},removeItem(e){t.delete(e)},getKeys:()=>[...t.keys()],clear(){t.clear()},dispose(){t.clear()}})},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(let t of i.mountpoints)if(e.startsWith(t))return{base:t,relativeKey:e.slice(t.length),driver:i.mounts[t]};return{base:"",relativeKey:e,driver:i.mounts[""]}},n=(e,t)=>i.mountpoints.filter(i=>i.startsWith(e)||t&&e.startsWith(i)).map(t=>({relativeBase:e.length>t.length?e.slice(t.length):void 0,mountpoint:t,driver:i.mounts[t]})),s=(e,t)=>{if(i.watching)for(let r of(t=z(t),i.watchListeners))r(e,t)},a=async()=>
4611{if(!i.watching)for(let e in i.watching=!0,i.mounts)i.unwatch[e]=await Z(i.mounts[e],s,e)},o=async()=>{if(i.watching){for(let e in i.unwatch)await i.unwatch[e]();i.unwatch={},i.watching=!1}},l=(e,t,i)=>{let n=new Map,s=e=>{let t=n.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},n.set(e.base,t)),t};for(let i of e){let e="string"==typeof i,n=z(e?i:i.key),a=e?void 0:i.value,o=e||!i.options?t:{...t,...i.options},l=r(n);s(l).items.push({key:n,value:a,relativeKey:l.relativeKey,options:o})}return Promise.all([...n.values()].map(e=>i(e))).then(e=>e.flat())},c={hasItem(e,t={}){let{relativeKey:i,driver:n}=r(e=z(e));return F(n.hasItem,i,t)},getItem(e,t={}){let{relativeKey:i,driver:n}=r(e=z(e));return F(n.getItem,i,t).then(e=>B(e))},getItems:(e,t={})=>l(e,t,e=>e.driver.getItems?F(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:function(...e){return z(e.join(":"))}(e.base,t.key),value:B(t.value)}))):Promise.all(e.items.map(t=>F(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:B(e)}))))),getItemRaw(e,t={}){let{relativeKey:i,driver:n}=r(e=z(e));return n.getItemRaw?F(n.getItemRaw,i,t):F(n.getItem,i,t).then(e=>{var t;return"string"==typeof e&&e.startsWith(q)?(t=e.slice(q.length),globalThis.Buffer?j.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))):e})},async setItem(e,t,i={}){if(void 0===t)return c.removeItem(e);let{relativeKey:n,driver:a}=r(e=z(e));a.setItem&&(await F(a.setItem,n,H(t),i),a.watch||s("update",e))},async setItems(e,t){await l(e,t,async e=>{if(e.driver.setItems)return F(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:H(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>F(e.driver.setItem,t.relativeKey,H(t.value),t.options)))})},async setItemRaw(e,t,i={}){if(void 0===t)return c.removeItem(e,i);let{relativeKey:n,driver:a}=r(e=z(e));if(a.setItemRaw)await F(a.setItemRaw,n,t,i);else{var o;if(!a.setItem)return;await F(a.setItem,n,"string"==typeof t?t:q+(o=t,globalThis.Buffer?j.from(o).toString("base64"):globalThis.btoa(String.fromCodePoint(...o))),i)}a.watch||s("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:i,driver:n}=r(e=z(e));n.removeItem&&(await F(n.removeItem,i,t),(t.removeMeta||t.removeMata)&&await F(n.removeItem,i+"$",t),n.watch||s("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:i,driver:n}=r(e=z(e)),s=Object.create(null);if(n.getMeta&&Object.assign(s,await F(n.getMeta,i,t)),!t.nativeOnly){let e=await F(n.getItem,i+"$",t).then(e=>B(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(s,e))}return s},setMeta(e,t,i={}){return this.setItem(e+"$",t,i)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let i=n(e=V(e),!0),r=[],s=[],a=!0;for(let e of i){for(let i of(e.driver.flags?.maxDepth||(a=!1),await F(e.driver.getKeys,e.relativeBase,t))){let t=e.mountpoint+z(i);r.some(e=>t.startsWith(e))||s.push(t)}r=[e.mountpoint,...r.filter(t=>!t.startsWith(e.mountpoint))]}let o=void 0!==t.maxDepth&&!a;return s.filter(i=>{var r;return(!o||function(e,t){if(void 0===t)return!0;let i=0,r=e.indexOf(":");for(;r>-1;)i++,r=e.indexOf(":",r+1);return i<=t}(i,t.maxDepth))&&((r=e)?i.startsWith(r)&&"$"!==i[i.length-1]:"$"!==i[i.length-1])})},async clear(e,t={}){e=V(e),await Promise.all(n(e,!1).map(async e=>e.driver.clear?F(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(i=>e.driver.removeItem(i,t))):void 0))},async dispose(){await Promise.all(Object.values(i.mounts).map(e=>K(e)))},watch:async e=>(await a(),i.watchListeners.push(e),async()=>{i.watchListeners=i.watchListeners.filter(t=>t!==e),0===i.watchListeners.length&&await o()}),async unwatch(){i.watchListeners=[],await o()},mount(e,t){if((e=V(e))&&i.mounts[e])throw Error(`already mounted at ${e}`);return e&&(i.mountpoints.push(e),i.mountpoints.sort((e,t)=>t.length-e.length)),i.mounts[e]=t,i.watching&&Promise.resolve(Z(t,s,e)).then(t=>{i.unwatch[e]=t}).catch(console.error),c},async unmount(e,t=!0){(e=V(e))&&i.mounts[e]&&(i.watching&&e in i.unwatch&&(i.unwatch[e]?.(),delete i.unwatch[e]),t&&await K(i.mounts[e]),i.mountpoints=i.mountpoints.filter(t=>t!==e),delete i.mounts[e])},getMount(e=""){let t=r(e=z(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>n(e=z(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint})),keys:(e,t={})=>c.getKeys(e,t),get:(e,t={})=>c.getItem(e,t),set:(e,t,i={})=>c.setItem(e,t,i),has:(e,t={})=>c.hasItem(e,t),del:(e,t={})=>c.removeItem(e,t),remove:(e,t={})=>c.removeItem(e,t)};return c}({driver:((e={})=>{let t,i=e.base&&e.base.length>0?`${e.base}:`:"";return e.dbName&&e.storeName&&(t=(0,G.y$)(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await (0,G.Jt)(i+e,t)>"u"),getItem:async e=>await (0,G.Jt)(i+e,t)??null,setItem:(e,r)=>(0,G.hZ)(i+e,r,t),removeItem:e=>(0,G.yH)(i+e,t),getKeys:()=>(0,G.HP)(t),clear:()=>(0,G.IU)(t)}})({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,J(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Q="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof i.g?i.g:"u">typeof self?self:{},ee={exports:{}};function et(e){var t;return[e[0],Y(null!=(t=e[1])?t:"")]}function ei(){}ei.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},ei.prototype.setItem=function(e,t){this[e]=String(t)},ei.prototype.removeItem=function(e){delete this[e]},ei.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},ei.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},ei.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof Q&&Q.localStorage?ee.exports=Q.localStorage:"u">typeof window&&window.localStorage?ee.exports=window.localStorage:ee.exports=new ei;class er{constructor(){this.localStorage=ee.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(et)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return Y(t)}async setItem(e,t){this.localStorage.setItem(e,J(t))}async removeItem(e){this.localStorage.removeItem(e)}}let en=async(e,t,i)=>{let r="wc_storage_version",n=await t.getItem(r);if(n&&n>=1)return void i(t);let s=await e.getKeys();if(!s.length)return void i(t);let a=[];for(;s.length;){let i=s.shift();if(!i)continue;let r=i.toLowerCase();if(r.includes("wc@")||r.includes("walletconnect")||r.includes("wc_")||r.includes("wallet_connect")){let r=await e.getItem(i);await t.setItem(i,r),a.push(i)}}await t.setItem(r,1),i(t),es(e,a)},es=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class ea{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};const e=new er;this.storage=e;try{const t=new X;en(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}
4611var eo=i(5873),el=Object.defineProperty,ec=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?el(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class ed extends O{constructor(e){super(),this.opts=e,ec(this,"protocol","wc"),ec(this,"version",2)}}var eh=Object.defineProperty;class eu extends O{constructor(e,t){super(),this.core=e,this.logger=t,((e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?eh(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i})(this,"records",new Map)}}class ep{constructor(e,t){this.logger=e,this.core=t}}class ef extends O{constructor(e,t){super(),this.relayer=e,this.logger=t}}class eg extends O{constructor(e){super()}}class em{constructor(e,t,i,r){this.core=e,this.logger=t,this.name=i}}class ew extends O{constructor(e,t){super(),this.relayer=e,this.logger=t}}class ey extends O{constructor(e,t){super(),this.core=e,this.logger=t}}class eb{constructor(e,t,i){this.core=e,this.logger=t,this.store=i}}class ev{constructor(e,t){this.projectId=e,this.logger=t}}class eC{constructor(e,t,i){this.core=e,this.logger=t,this.telemetryEnabled=i}}var eE=Object.defineProperty,ex=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?eE(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};k();class eA{constructor(e){this.opts=e,ex(this,"protocol","wc"),ex(this,"version",2)}}N.EventEmitter;class e_{constructor(e){this.client=e}}function eI(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function eS(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}let eN="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,ek=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function eT(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}(e)),eI(e),e}class eO{clone(){return this._cloneInto()}}function eR(e=32){if(eN&&"function"==typeof eN.getRandomValues)return eN.getRandomValues(new Uint8Array(e));if(eN&&"function"==typeof eN.randomBytes)return eN.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}class eP extends eO{constructor(e,t,i,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=i,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ek(this.buffer)}update(e){eS(this);let{view:t,buffer:i,blockLen:r}=this,n=(e=eT(e)).length;for(let s=0;s<n;){let a=Math.min(r-this.pos,n-s);if(a===r){let t=ek(e);for(;r<=n-s;s+=r)this.process(t,s);continue}i.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){eS(this),function(e,t){eI(e);let i=t.outputLen;if(e.length<i)throw Error("digestInto() expects output buffer of length at least "+i)}(e,this),this.finished=!0;let{buffer:t,view:i,blockLen:r,isLE:n}=this,{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>r-s&&(this.process(i,0),s=0);for(let e=s;e<r;e++)t[e]=0;(function(e,t,i,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,i,r);let n=BigInt(32),s=BigInt(0xffffffff),a=Number(i>>n&s),o=Number(i&s),l=4*!!r,c=4*!r;e.setUint32(t+l,a,r),e.setUint32(t+c,o,r)})(i,r-8,BigInt(8*this.length),n),this.process(i,0);let a=ek(e),o=this.outputLen;if(o%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=o/4,c=this.get();if(l>c.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)a.setUint32(4*e,c[e],n)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let i=e.slice(0,t);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:i,length:r,finished:n,destroyed:s,pos:a}=this;return e.length=r,e.pos=a,e.finished=n,e.destroyed=s,r%t&&e.buffer.set(i),e}}let e$=BigInt(0x100000000-1),eU=BigInt(32),eM=(e,t,i)=>e>>>i,eD=(e,t,i)=>e<<32-i|t>>>i,eL=(e,t,i)=>e>>>i|t<<32-i,eW=(e,t,i)=>e<<32-i|t>>>i,eB=(e,t,i)=>e<<64-i|t>>>i-32,ej=(e,t,i)=>e>>>i-32|t<<64-i,eF=function(e,t,i,r){let n=(t>>
4611>0)+(r>>>0);return{h:e+i+(n/0x100000000|0)|0,l:0|n}},eH=(e,t,i)=>(e>>>0)+(t>>>0)+(i>>>0),eq=(e,t,i,r)=>t+i+r+(e/0x100000000|0)|0,ez=(e,t,i,r)=>(e>>>0)+(t>>>0)+(i>>>0)+(r>>>0),eV=(e,t,i,r,n)=>t+i+r+n+(e/0x100000000|0)|0,eZ=(e,t,i,r,n,s)=>t+i+r+n+s+(e/0x100000000|0)|0,eK=(e,t,i,r,n)=>(e>>>0)+(t>>>0)+(i>>>0)+(r>>>0)+(n>>>0),[eG,eY]=function(e,t=!1){let i=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let n=0;n<e.length;n++){let{h:s,l:a}=function(e,t=!1){return t?{h:Number(e&e$),l:Number(e>>eU&e$)}:{h:0|Number(e>>eU&e$),l:0|Number(e&e$)}}(e[n],t);[i[n],r[n]]=[s,a]}return[i,r]}(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
46115771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),eJ=new Uint32Array(80),eX=new Uint32Array(80);class eQ extends eP{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:i,Bl:r,Ch:n,Cl:s,Dh:a,Dl:o,Eh:l,El:c,Fh:d,Fl:h,Gh:u,Gl:p,Hh:f,Hl:g}=this;return[e,t,i,r,n,s,a,o,l,c,d,h,u,p,f,g]}set(e,t,i,r,n,s,a,o,l,c,d,h,u,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|i,this.Bl=0|r,this.Ch=0|n,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|l,this.El=0|c,this.Fh=0|d,this.Fl=0|h,this.Gh=0|u,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let i=0;i<16;i++,t+=4)eJ[i]=e.getUint32(t),eX[i]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|eJ[e-15],i=0|eX[e-15],r=eL(t,i,1)^eL(t,i,8)^eM(t,i,7),n=eW(t,i,1)^eW(t,i,8)^eD(t,i,7),s=0|eJ[e-2],a=0|eX[e-2],o=eL(s,a,19)^eB(s,a,61)^eM(s,a,6),l=ez(n,eW(s,a,19)^ej(s,a,61)^eD(s,a,6),eX[e-7],eX[e-16]),c=eV(l,r,o,eJ[e-7],eJ[e-16]);eJ[e]=0|c,eX[e]=0|l}let{Ah:i,Al:r,Bh:n,Bl:s,Ch:a,Cl:o,Dh:l,Dl:c,Eh:d,El:h,Fh:u,Fl:p,Gh:f,Gl:g,Hh:m,Hl:w}=this;for(let e=0;e<80;e++){let t=eL(d,h,14)^eL(d,h,18)^eB(d,h,41),y=eW(d,h,14)^eW(d,h,18)^ej(d,h,41),b=d&u^~d&f,v=eK(w,y,h&p^~h&g,eY[e],eX[e]),C=eZ(v,m,t,b,eG[e],eJ[e]),E=0|v,x=eL(i,r,28)^eB(i,r,34)^eB(i,r,39),A=eW(i,r,28)^ej(i,r,34)^ej(i,r,39),_=i&n^i&a^n&a,I=r&s^r&o^s&o;m=0|f,w=0|g,f=0|u,g=0|p,u=0|d,p=0|h,({h:d,l:h}=eF(0|l,0|c,0|C,0|E)),l=0|a,c=0|o,a=0|n,o=0|s,n=0|i,s=0|r;let S=eH(E,A,I);i=eq(S,C,x,_),r=0|S}({h:i,l:r}=eF(0|this.Ah,0|this.Al,0|i,0|r)),({h:n,l:s}=eF(0|this.Bh,0|this.Bl,0|n,0|s)),({h:a,l:o}=eF(0|this.Ch,0|this.Cl,0|a,0|o)),({h:l,l:c}=eF(0|this.Dh,0|this.Dl,0|l,0|c)),({h:d,l:h}=eF(0|this.Eh,0|this.El,0|d,0|h)),({h:u,l:p}=eF(0|this.Fh,0|this.Fl,0|u,0|p)),({h:f,l:g}=eF(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:w}=eF(0|this.Hh,0|this.Hl,0|m,0|w)),this.set(i,r,n,s,a,o,l,c,d,h,u,p,f,g,m,w)}roundClean(){eJ.fill(0),eX.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let e0=(h=()=>new eQ,(n=e=>h().update(eT(e)).digest()).outputLen=(s=h()).outputLen,n.blockLen=s.blockLen,n.create=()=>h(),n),e1=BigInt(0),e2=BigInt(1),e3=BigInt(2);function e5(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function e4(e){if(!e5(e))throw Error("Uint8Array expected")}function e6(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}let e8=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function e9(e){e4(e);let t="";for(let i=0;i<e.length;i++)t+=e8[e[i]];return t}function e7(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?e1:BigInt("0x"+e)}function te(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function tt(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,i=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(i);for(let t=0,n=0;t<i;t++,n+=2){let i=te(e.charCodeAt(n)),s=te(e.charCodeAt(n+1));if(void 0===i||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[n]+e[n+1])+'" at index '+n);r[t]=16*i+s}return r}function ti(e){return e4(e),e7(e9(Uint8Array.from(e).reverse()))}function tr(e,t){return tt(e.toString(16).padStart(2*t,"0"))}function tn(e,t){return tr(e,t).reverse()}function ts(e,t,i){let r;if("string"==typeof t)try{r=tt(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(e5(t))r=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let n=r.length;if("number"==typeof i&&n!==i)throw Error(e+" of length "+i+" expected, got "+n);return r}function ta(...e){let t=0;for(let i=0;i<e.length;i++){let r=e[i];e4(r),t+=r.length}let i=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let n=e[t];i.set(n,r),r+=n.length}return i}let to=e=>"bigint"==typeof e&&e1<=e;function tl(e,t,i,r){if(!(to(t)&&to(i)&&to(r))||!(i<=t)||!(t<r))throw Error("expected valid "+e+": "+i+" <= n < "+r+", got "+t)}let tc={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e5(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function td(e,t,i={}){let r=(t,i,r)=>{let n=tc[i];if("function"!=typeof n)throw Error("invalid validator function");let s=e[t];if(!(r&&void 0===s)&&!n(s,e))throw Error("param "+String(t)+" is invali
4611d. Expected "+i+", got "+s)};for(let[e,i]of Object.entries(t))r(e,i,!1);for(let[e,t]of Object.entries(i))r(e,t,!0);return e}function th(e){let t=new WeakMap;return(i,...r)=>{let n=t.get(i);if(void 0!==n)return n;let s=e(i,...r);return t.set(i,s),s}}let tu=BigInt(0),tp=BigInt(1),tf=BigInt(2),tg=BigInt(3),tm=BigInt(4),tw=BigInt(5),ty=BigInt(8);function tb(e,t){let i=e%t;return i>=tu?i:t+i}function tv(e,t,i){let r=e;for(;t-- >tu;)r*=r,r%=i;return r}function tC(e,t){if(e===tu)throw Error("invert: expected non-zero number");if(t<=tu)throw Error("invert: expected positive modulus, got "+t);let i=tb(e,t),r=t,n=tu,s=tp;for(;i!==tu;){let e=r/i,t=r%i,a=n-s*e;r=i,i=t,n=s,s=a}if(r!==tp)throw Error("invert: does not exist");return tb(n,t)}let tE=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tx(e,t){let i=void 0!==t?t:e.toString(2).length,r=Math.ceil(i/8);return{nBitLength:i,nByteLength:r}}function tA(e,t,i=!1,r={}){let n;if(e<=tu)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:s,nByteLength:a}=tx(e,t);if(a>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let o=Object.freeze({ORDER:e,isLE:i,BITS:s,BYTES:a,MASK:(e3<<BigInt(s-1))-e2,ZERO:tu,ONE:tp,create:t=>tb(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return tu<=t&&t<e},is0:e=>e===tu,isOdd:e=>(e&tp)===tp,neg:t=>tb(-t,e),eql:(e,t)=>e===t,sqr:t=>tb(t*t,e),add:(t,i)=>tb(t+i,e),sub:(t,i)=>tb(t-i,e),mul:(t,i)=>tb(t*i,e),pow:(e,t)=>(function(e,t,i){if(i<tu)throw Error("invalid exponent, negatives unsupported");if(i===tu)return e.ONE;if(i===tp)return t;let r=e.ONE,n=t;for(;i>tu;)i&tp&&(r=e.mul(r,n)),n=e.sqr(n),i>>=tp;return r})(o,e,t),div:(t,i)=>tb(t*tC(i,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>tC(t,e),sqrt:r.sqrt||(t=>(n||(n=function(e){if(e%tm===tg){let t=(e+tp)/tm;return function(e,i){let r=e.pow(i,t);if(!e.eql(e.sqr(r),i))throw Error("Cannot find square root");return r}}if(e%ty===tw){let t=(e-tw)/ty;return function(e,i){let r=e.mul(i,tf),n=e.pow(r,t),s=e.mul(i,n),a=e.mul(e.mul(s,tf),n),o=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),i))throw Error("Cannot find square root");return o}}return function(e){let t,i,r,n=(e-tp)/tf;for(t=e-tp,i=0;t%tf===tu;t/=tf,i++);for(r=tf;r<e&&function(e,t,i){if(t<tu)throw Error("invalid exponent, negatives unsupported");if(i<=tu)throw Error("invalid modulus");if(i===tp)return tu;let r=tp;for(;t>tu;)t&tp&&(r=r*e%i),e=e*e%i,t>>=tp;return r}(r,n,e)!==e-tp;r++)if(r>1e3)throw Error("Cannot find square root: likely non-prime P");if(1===i){let t=(e+tp)/tm;return function(e,i){let r=e.pow(i,t);if(!e.eql(e.sqr(r),i))throw Error("Cannot find square root");return r}}let s=(t+tp)/tf;return function(e,a){if(e.pow(a,n)===e.neg(e.ONE))throw Error("Cannot find square root");let o=i,l=e.pow(e.mul(e.ONE,r),t),c=e.pow(a,s),d=e.pow(a,t);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let i=e.sqr(d);t<o&&!e.eql(i,e.ONE);t++)i=e.sqr(i);let i=e.pow(l,tp<<BigInt(o-t-1));l=e.sqr(i),c=e.mul(c,i),d=e.mul(d,l),o=t}return c}}(e)}(e)),n(o,t))),invertBatch:e=>{let t,i,r;return t=Array(e.length),i=e.reduce((e,i,r)=>o.is0(i)?e:(t[r]=e,o.mul(e,i)),o.ONE),r=o.inv(i),e.reduceRight((e,i,r)=>o.is0(i)?e:(t[r]=o.mul(e,t[r]),o.mul(e,i)),r),t},cmov:(e,t,i)=>i?t:e,toBytes:e=>i?tn(e,a):tr(e,a),fromBytes:e=>{if(e.length!==a)throw Error("Field.fromBytes: expected "+a+" bytes, got "+e.length);return i?ti(e):e7(e9(e))}});return Object.freeze(o)}let t_=BigInt(0),tI=BigInt(1);function tS(e,t){let i=t.negate();return e?i:t}function tN(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function tk(e,t){return tN(e,t),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}let tT=new WeakMap,tO=new WeakMap;function tR(e){return tO.get(e)||1}let tP=BigInt(0),t$=BigInt(1),tU=BigInt(2),tM=BigInt(8),tD={zip215:!0};BigInt(0),BigInt(1);let tL=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),tW=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);let tB=BigInt(1),tj=BigInt(2);BigInt(3);let tF=BigInt(5),tH=BigInt(8),tq=tA(tL,void 0,!0),tz=function(e){var t;let i,r=(td(e.Fp,tE.reduce((e,t)=>
4611(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),td(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),i=Object.freeze({...tx(e.n,e.nBitLength),...e,p:e.Fp.ORDER}),td(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...i})),{Fp:n,n:s,prehash:a,hash:o,randomBytes:l,nByteLength:c,h:d}=r,h=tU<<BigInt(8*c)-t$,u=n.create,p=tA(r.n,r.nBitLength),f=r.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch{return{isValid:!1,value:tP}}}),g=r.adjustScalarBytes||(e=>e),m=r.domain||((e,t,i)=>{if(e6("phflag",i),t.length||i)throw Error("Contexts/pre-hash are not supported");return e});function w(e,t){tl("coordinate "+e,t,tP,h)}function y(e){if(!(e instanceof C))throw Error("ExtendedPoint expected")}let b=th((e,t)=>{let{ex:i,ey:r,ez:s}=e,a=e.is0();null==t&&(t=a?tM:n.inv(s));let o=u(i*t),l=u(r*t),c=u(s*t);if(a)return{x:tP,y:t$};if(c!==t$)throw Error("invZ was invalid");return{x:o,y:l}}),v=th(e=>{let{a:t,d:i}=r;if(e.is0())throw Error("bad point: ZERO");let{ex:n,ey:s,ez:a,et:o}=e,l=u(n*n),c=u(s*s),d=u(a*a),h=u(d*d),p=u(l*t);if(u(d*u(p+c))!==u(h+u(i*u(l*c))))throw Error("bad point: equation left != right (1)");if(u(n*s)!==u(a*o))throw Error("bad point: equation left != right (2)");return!0});class C{constructor(e,t,i,r){this.ex=e,this.ey=t,this.ez=i,this.et=r,w("x",e),w("y",t),w("z",i),w("t",r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof C)throw Error("extended point not allowed");let{x:t,y:i}=e||{};return w("x",t),w("y",i),new C(t,i,t$,u(t*i))}static normalizeZ(e){let t=n.invertBatch(e.map(e=>e.ez));return e.map((e,i)=>e.toAffine(t[i])).map(C.fromAffine)}static msm(e,t){return function(e,t,i,r){if(function(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,i)=>{if(!(e instanceof t))throw Error("invalid point at index "+i)})}(i,e),function(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,i)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+i)})}(r,t),i.length!==r.length)throw Error("arrays of points and scalars must have equal length");let n=e.ZERO,s=function(e){let t;for(t=0;e>e1;e>>=e2,t+=1);return t}(BigInt(i.length)),a=s>12?s-3:s>4?s-2:s?2:1,o=(1<<a)-1,l=Array(o+1).fill(n),c=Math.floor((t.BITS-1)/a)*a,d=n;for(let e=c;e>=0;e-=a){l.fill(n);for(let t=0;t<r.length;t++){let n=Number(r[t]>>BigInt(e)&BigInt(o));l[n]=l[n].add(i[t])}let t=n;for(let e=l.length-1,i=n;e>0;e--)i=i.add(l[e]),t=t.add(i);if(d=d.add(t),0!==e)for(let e=0;e<a;e++)d=d.double()}return d}(C,p,e,t)}_setWindowSize(e){A.setWindowSize(this,e)}assertValidity(){v(this)}equals(e){y(e);let{ex:t,ey:i,ez:r}=this,{ex:n,ey:s,ez:a}=e,o=u(t*a),l=u(n*r),c=u(i*a),d=u(s*r);return o===l&&c===d}is0(){return this.equals(C.ZERO)}negate(){return new C(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:e}=r,{ex:t,ey:i,ez:n}=this,s=u(t*t),a=u(i*i),o=u(tU*u(n*n)),l=u(e*s),c=t+i,d=u(u(c*c)-s-a),h=l+a,p=h-o,f=l-a,g=u(d*p),m=u(h*f),w=u(d*f);return new C(g,m,u(p*h),w)}add(e){y(e);let{a:t,d:i}=r,{ex:n,ey:s,ez:a,et:o}=this,{ex:l,ey:c,ez:d,et:h}=e;if(t===BigInt(-1)){let e=u((s-n)*(c+l)),t=u((s+n)*(c-l)),i=u(t-e);if(i===tP)return this.double();let r=u(a*tU*h),p=u(o*tU*d),f=p+r,g=t+e,m=p-r,w=u(f*i),y=u(g*m),b=u(f*m);return new C(w,y,u(i*g),b)}let p=u(n*l),f=u(s*c),g=u(o*i*h),m=u(a*d),w=u((n+s)*(l+c)-p-f),b=m-g,v=m+g,E=u(f-t*p),x=u(w*b),A=u(v*E),_=u(w*E);return new C(x,A,u(b*v),_)}subtract(e){return this.add(e.negate())}wNAF(e){return A.wNAFCached(this,e,C.normalizeZ)}multiply(e){tl("scalar",e,t$,s);let{p:t,f:i}=this.wNAF(e);return C.normalizeZ([t,i])[0]}multiplyUnsafe(e,t=C.ZERO){return tl("scalar",e,tP,s),e===tP?x:this.is0()||e===t$?this:A.wNAFCachedUnsafe(this,e,C.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(d).is0()}isTorsionFree(){return A.unsafeLadder(this,s).is0()}toAffine(e){return b(this,e)}clearCofactor(){let{h:e}=r;return e===t$?this:this.multiplyUnsafe(e)}static fromHex(e,t=!1){let{d:i,a:s}=r,a=n.BYTES;e=ts("pointHex",e,a),e6("zip215",t);let o=e.slice(),l=e[a-1];o[a-1]=-129&l;let c=ti(o);tl("pointHex.y",c,tP,t?h:n.ORDER);let d=u(c*c),{isValid:p,value:g}=f(u(d-t$),u(i*d-s));
4611if(!p)throw Error("Point.fromHex: invalid y coordinate");let m=(g&t$)===t$,w=(128&l)!=0;if(!t&&g===tP&&w)throw Error("Point.fromHex: x=0 and x_0=1");return w!==m&&(g=u(-g)),C.fromAffine({x:g,y:c})}static fromPrivateKey(e){return _(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),i=tn(t,n.BYTES);return i[i.length-1]|=e&t$?128:0,i}toHex(){return e9(this.toRawBytes())}}C.BASE=new C(r.Gx,r.Gy,t$,u(r.Gx*r.Gy)),C.ZERO=new C(tP,t$,t$,tP);let{BASE:E,ZERO:x}=C,A=(t=8*c,{constTimeNegate:tS,hasPrecomputes:e=>1!==tR(e),unsafeLadder(e,t,i=C.ZERO){let r=e;for(;t>t_;)t&tI&&(i=i.add(r)),r=r.double(),t>>=tI;return i},precomputeWindow(e,i){let{windows:r,windowSize:n}=tk(i,t),s=[],a=e,o=a;for(let e=0;e<r;e++){o=a,s.push(o);for(let e=1;e<n;e++)o=o.add(a),s.push(o);a=o.double()}return s},wNAF(e,i,r){let{windows:n,windowSize:s}=tk(e,t),a=C.ZERO,o=C.BASE,l=BigInt(2**e-1),c=2**e,d=BigInt(e);for(let e=0;e<n;e++){let t=e*s,n=Number(r&l);r>>=d,n>s&&(n-=c,r+=tI);let h=t+Math.abs(n)-1,u=e%2!=0,p=n<0;0===n?o=o.add(tS(u,i[t])):a=a.add(tS(p,i[h]))}return{p:a,f:o}},wNAFUnsafe(e,i,r,n=C.ZERO){let{windows:s,windowSize:a}=tk(e,t),o=BigInt(2**e-1),l=2**e,c=BigInt(e);for(let e=0;e<s;e++){let t=e*a;if(r===t_)break;let s=Number(r&o);if(r>>=c,s>a&&(s-=l,r+=tI),0===s)continue;let d=i[t+Math.abs(s)-1];s<0&&(d=d.negate()),n=n.add(d)}return n},getPrecomputes(e,t,i){let r=tT.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&tT.set(t,i(r))),r},wNAFCached(e,t,i){let r=tR(e);
4611return this.wNAF(r,this.getPrecomputes(r,e,i),t)},wNAFCachedUnsafe(e,t,i,r){let n=tR(e);return 1===n?this.unsafeLadder(e,t,r):this.wNAFUnsafe(n,this.getPrecomputes(n,e,i),t,r)},setWindowSize(e,i){tN(i,t),tO.set(e,i),tT.delete(e)}});function _(e){let t=n.BYTES;e=ts("private key",e,t);let i=ts("hashed private key",o(e),2*t),r=g(i.slice(0,t)),a=i.slice(t,2*t),l=tb(ti(r),s),c=E.multiply(l),d=c.toRawBytes();return{head:r,prefix:a,scalar:l,point:c,pointBytes:d}}function I(e=new Uint8Array,...t){return tb(ti(o(m(ta(...t),ts("context",e),!!a))),s)}return E._setWindowSize(8),{CURVE:r,getPublicKey:function(e){return _(e).pointBytes},sign:function(e,t,i={}){e=ts("message",e),a&&(e=a(e));let{prefix:r,scalar:o,pointBytes:l}=_(t),c=I(i.context,r,e),d=E.multiply(c).toRawBytes(),h=tb(c+I(i.context,d,l,e)*o,s);return tl("signature.s",h,tP,s),ts("result",ta(d,tn(h,n.BYTES)),2*n.BYTES)},verify:function(e,t,i,r=tD){let s,o,l,{context:c,zip215:d}=r,h=n.BYTES;e=ts("signature",e,2*h),t=ts("message",t),i=ts("publicKey",i,h),void 0!==d&&e6("zip215",d),a&&(t=a(t));let u=ti(e.slice(h,2*h));try{s=C.fromHex(i,d),o=C.fromHex(e.slice(0,h),d),l=E.multiplyUnsafe(u)}catch{return!1}if(!d&&s.isSmallOrder())return!1;let p=I(c,o.toRawBytes(),s.toRawBytes(),t);return o.add(s.multiplyUnsafe(p)).subtract(l).clearCofactor().equals(C.ZERO)},ExtendedPoint:C,utils:{getExtendedPublicKey:_,randomPrivateKey:()=>l(n.BYTES),precompute:(e=8,t=C.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:tq,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:tH,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:e0,randomBytes:eR,adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e},uvRatio:function(e,t){var i;let r,n,s,a,o,l,c,d,h,u,p,f,g,m,w=tb(t*t*t,tL),y=(i=e*tb(w*w*t,tL),r=BigInt(10),n=BigInt(20),s=BigInt(40),a=BigInt(80),l=tv(o=i*i%tL*i%tL,tj,tL)*o%tL,c=tv(l,tB,tL)*i%tL,d=tv(c,tF,tL)*c%tL,h=tv(d,r,tL)*d%tL,u=tv(h,n,tL)*h%tL,p=tv(u,s,tL)*u%tL,f=tv(p,a,tL)*p%tL,g=tv(f,a,tL)*p%tL,m=tv(g,r,tL)*d%tL,{pow_p_5_8:tv(m,tj,tL)*i%tL,b2:o}).pow_p_5_8,b=tb(e*w*y,tL),v=tb(t*b*b,tL),C=b,E=tb(b*tW,tL),x=v===e,A=v===tb(-e,tL),_=v===tb(-e*tW,tL);return x&&(b=C),(A||_)&&(b=E),(tb(b,tL)&tp)===tp&&(b=tb(-b,tL)),{isValid:x||A,value:b}}}),tV="base64url",tZ="utf8",tK="utf8",tG="base58btc";function tY(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function tJ(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?tY(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function tX(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let i=tJ(t),r=0;for(let t of e)i.set(t,r),r+=t.length;return tY(i)}var tQ=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var i=new Uint8Array(256),r=0;r<i.length;r++)i[r]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),a=s.charCodeAt(0);if(255!==i[a])throw TypeError(s+" is ambiguous");i[a]=n}var o=e.length,l=e.charAt(0),c=Math.log(o)/Math.log(256),d=Math.log(256)/Math.log(o);function h(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var r=0,n=0;e[t]===l;)r++,t++;for(var s=(e.length-t)*c+1>>>0,a=new Uint8Array(s);e[t];){var d=i[e.charCodeAt(t)];if(255===d)return;for(var h=0,u=s-1;(0!==d||h<n)&&-1!==u;u--,h++)d+=o*a[u]>>>0,a[u]=d%256>>>0,d=d/256>>>0;if(0!==d)throw Error("Non-zero carry");n=h,t++}if(" "!==e[t]){for(var p=s-n;p!==s&&0===a[p];)p++;for(var f=new Uint8Array(r+(s-p)),g=r;p!==s;)f[g++]=a[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var i=0,r=0,n=0,s=t.length;n!==s&&0===t[n];)n++,i++;for(var a=(s-n)*d+1>>>0,c=new Uint8Array(a);n!==s;){for(var h=t[n],u=0,p=a-1;(0!==h||u<r)&&-1!==p;p--,u++)h+=256*c[p]>>>0,c[p]=h%o>>>0,h=h/o>>>0;if(0!==h)throw Error("Non-zero carry");r=u,n++}for(var f=a-r;f!==a&&0===c[f];)f++;for(var g=l.repeat(i);f<a;++f)g+=e.charAt(c[f]);return g},decodeUnsafe:h,decode:function(e){var i=h(e);if(i)return i;throw Error(`Non-${t} character`)}}};let t0=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")};class t1{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class t2{constructor(e,t,i){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
4611 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return t5(this,e)}}class t3{constructor(e){this.decoders=e}or(e){return t5(this,e)}decode(e){let t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let t5=(e,t)=>new t3({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class t4{constructor(e,t,i,r){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=r,this.encoder=new t1(e,t,i),this.decoder=new t2(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let t6=({name:e,prefix:t,encode:i,decode:r})=>new t4(e,t,i,r),t8=({prefix:e,name:t,alphabet:i})=>{let{encode:r,decode:n}=tQ(i,t);return t6({prefix:e,name:t,encode:r,decode:e=>t0(n(e))})},t9=({name:e,prefix:t,bitsPerChar:i,alphabet:r})=>t6({prefix:t,name:e,encode:e=>((e,t,i)=>{let r="="===t[t.length-1],n=(1<<i)-1,s="",a=0,o=0;for(let r=0;r<e.length;++r)for(o=o<<8|e[r],a+=8;a>i;)a-=i,s+=t[n&o>>a];if(a&&(s+=t[n&o<<i-a]),r)for(;s.length*i&7;)s+="=";return s})(e,r,i),decode:t=>((e,t,i,r)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let a=new Uint8Array(s*i/8|0),o=0,l=0,c=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${r} character`);l=l<<i|s,(o+=i)>=8&&(o-=8,a[c++]=255&l>>o)}if(o>=i||255&l<<8-o)throw SyntaxError("Unexpected end of data");return a})(t,r,i,e)});var t7=Object.freeze({__proto__:null,identity:t6({prefix:"\0",name:"identity",encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)})}),ie=Object.freeze({__proto__:null,base2:t9({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),it=Object.freeze({__proto__:null,base8:t9({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),ii=Object.freeze({__proto__:null,base10:t8({prefix:"9",name:"base10",alphabet:"0123456789"})}),ir=Object.freeze({__proto__:null,base16:t9({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:t9({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}),is=Object.freeze({__proto__:null,base32:t9({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper:t9({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad:t9({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper:t9({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex:t9({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper:t9({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad:t9({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:t9({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:t9({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),ia=Object.freeze({__proto__:null,base36:t8({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:t8({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),io=Object.freeze({__proto__:null,base58btc:t8({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:t8({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}),il=Object.freeze({__proto__:null,base64:t9({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad:t9({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:t9({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:t9({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let ic=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),id=ic.reduce((e,t,i)=>(e[i]=t,e),[]),ih=ic.reduce((e,t,i)=>(e[t.codePointAt(0)]=i,e),[]);var iu=Object.freeze({__proto__:null,base256emoji:t6({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
4611e+=id[t],"")},decode:function(e){let t=[];for(let i of e){let e=ih[i.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${i}`);t.push(e)}return new Uint8Array(t)}})});function ip(e,t,i){t=t||[],i=i||0;for(var r=i;e>=0x80000000;)t[i++]=255&e|128,e/=128;for(;-128&e;)t[i++]=255&e|128,e>>>=7;return t[i]=0|e,ip.bytes=i-r+1,t}var ig=function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10};let im=(e,t,i=0)=>(ip(e,t,i),t),iw=(e,t)=>{let i=t.byteLength,r=ig(e),n=r+ig(i),s=new Uint8Array(n+i);return im(e,s,0),im(i,s,r),s.set(t,n),new iy(e,i,t,s)};class iy{constructor(e,t,i,r){this.code=e,this.size=t,this.digest=i,this.bytes=r}}let ib=({name:e,code:t,encode:i})=>new iv(e,t,i);class iv{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?iw(this.code,t):t.then(e=>iw(this.code,e))}throw Error("Unknown type, must be binary type")}}let iC=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var iE=Object.freeze({__proto__:null,sha256:ib({name:"sha2-256",code:18,encode:iC("SHA-256")}),sha512:ib({name:"sha2-512",code:19,encode:iC("SHA-512")})}),ix=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:t0,digest:e=>iw(0,t0(e))}});new TextEncoder,new TextDecoder;let iA={...t7,...ie,...it,...ii,...ir,...is,...ia,...io,...il,...iu};function i_(e,t,i,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:i},decoder:{decode:r}}}({...iE,...ix});let iI=i_("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),iS=i_("ascii","a",e=>{let t="a";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},e=>{let t=tJ((e=e.substring(1)).length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}),iN={utf8:iI,"utf-8":iI,hex:iA.base16,latin1:iS,ascii:iS,binary:iS,...iA};function ik(e,t="utf8"){let i=iN[t];if(!i)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):i.encoder.encode(e).substring(1)}function iT(e,t="utf8"){let i=iN[t];if(!i)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?tY(globalThis.Buffer.from(e,"utf-8")):i.decoder.decode(`${i.prefix}${e}`)}function iO(e){return Y(ik(iT(e,tV),tZ))}function iR(e){return ik(iT(J(e),tZ),tV)}function iP(e){return["did:key","z"+ik(tX([iT("K36",tG),e]),tG)].join(":")}function i$(e){let t=e.split(".");return{header:iO(t[0]),payload:iO(t[1]),signature:iT(t[2],tV),data:iT(t.slice(0,2).join("."),tK)}}function iU(e=eR(32)){let t=tz.getPublicKey(e);return{secretKey:tX([e,t]),publicKey:t}}async function iM(e,t,i,r,n=(0,T.fromMiliseconds)(Date.now())){let s={alg:"EdDSA",typ:"JWT"},a={iss:iP(r.publicKey),sub:e,aud:t,iat:n,exp:n+i},o=iT([iR((l={header:s,payload:a}).header),iR(l.payload)].join("."),tK);var l,c={header:s,payload:a,signature:tz.sign(o,r.secretKey.slice(0,32))};return[iR(c.header),iR(c.payload),ik(c.signature,tV)].join(".")}var iD=i(41463),iL=function(e,t,i){if(i||2==arguments.length)for(var r,n=0,s=t.length;n<s;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))},iW=function(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"},iB=function(e){this.version=e,this.type="node",this.name="node",this.os=iD.platform},ij=function(e,t,i,r){this.name=e,this.version=t,this.os=i,this.bot=r,this.type="bot-device"},iF=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},iH=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},iq=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,iz=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;
4611\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],iV=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]],iZ=i(57247),iK=i(3536),iG=i(95972),iY=i(50822),iJ=i(71757),iX=i(78375),iQ=i(12542);function i0(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}class i1{type;data;constructor(e,t){this.type=e,this.data=t}}class i2 extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Object.create(i2.prototype)),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:i2.name})}}function i3(e,t,i){let r=Math.floor(i/0x100000000);e.setUint32(t,r),e.setUint32(t+4,i)}function i5(e,t){return 0x100000000*e.getInt32(t)+e.getUint32(t+4)}let i4={type:-1,encode:function(e){if(!(e instanceof Date))return null;{let t,i,r,n;return function({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=0x3ffffffff)if(0===t&&e<=0xffffffff){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}else{let i=e/0x100000000,r=new Uint8Array(8),n=new DataView(r.buffer);return n.setUint32(0,t<<2|3&i),n.setUint32(4,0|e),r}{let i=new Uint8Array(12),r=new DataView(i.buffer);return r.setUint32(0,t),i3(r,4,e),i}}((i=Math.floor((t=e.getTime())/1e3),n=Math.floor((r=(t-1e3*i)*1e6)/1e9),{sec:i+n,nsec:r-1e9*n}))}},decode:function(e){let t=function(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{let e=t.getUint32(0);return{sec:(3&e)*0x100000000+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:i5(t,4),nsec:t.getUint32(0)};default:throw new i2(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}(e);return new Date(1e3*t.sec+t.nsec/1e6)}};class i6{static defaultCodec=new i6;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(i4)}register({type:e,encode:t,decode:i}){if(e>=0)this.encoders[e]=t,this.decoders[e]=i;else{let r=-1-e;this.builtInEncoders[r]=t,this.builtInDecoders[r]=i}}tryToEncode(e,t){for(let i=0;i<this.builtInEncoders.length;i++){let r=this.builtInEncoders[i];if(null!=r){let n=r(e,t);if(null!=n)return new i1(-1-i,n)}}for(let i=0;i<this.encoders.length;i++){let r=this.encoders[i];if(null!=r){let n=r(e,t);if(null!=n)return new i1(i,n)}}return e instanceof i1?e:null}decode(e,t,i){let r=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return r?r(e,t,i):new i1(t,e)}}let i8=new TextEncoder;function i9(e,t,i){let r=t,n=r+i,s=[],a="";for(;r<n;){let t=e[r++];if((128&t)==0)s.push(t);else if((224&t)==192){let i=63&e[r++];s.push((31&t)<<6|i)}else if((240&t)==224){let i=63&e[r++],n=63&e[r++];s.push((31&t)<<12|i<<6|n)}else if((248&t)==240){let i=(7&t)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++];i>65535&&(i-=65536,s.push(i>>>10&1023|55296),i=56320|1023&i),s.push(i)}else s.push(t);s.length>=4096&&(a+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(a+=String.fromCharCode(...s)),a}let i7=new TextDecoder;function re(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer?new Uint8Array(e):Uint8Array.from(e)}class rt{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(e=16,t=16){this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let e=0;e<this.maxKeyLength;e++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,i){let r=this.caches[i-1];e:for(let n of r){let r=n.bytes;for(let n=0;n<i;
4611n++)if(r[n]!==e[t+n])continue e;return n.str}return null}store(e,t){let i=this.caches[e.length-1],r={bytes:e,str:t};i.length>=this.maxLengthPerKey?i[Math.random()*i.length|0]=r:i.push(r)}decode(e,t,i){let r=this.find(e,t,i);if(null!=r)return this.hit++,r;this.miss++;let n=i9(e,t,i),s=Uint8Array.prototype.slice.call(e,t,t+i);return this.store(s,n),n}}let ri="array",rr="map_key",rn="map_value",rs=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new i2("The type of key must be string or number but "+typeof e)};class ra{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let t=this.getUninitializedStateFromPool();t.type=ri,t.position=0,t.size=e,t.array=Array(e)}pushMapState(e){let t=this.getUninitializedStateFromPool();t.type=rr,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw Error("Invalid stack state. Released state is not on top of the stack.");e.type===ri&&(e.size=0,e.array=void 0,e.position=0,e.type=void 0),(e.type===rr||e.type===rn)&&(e.size=0,e.map=void 0,e.readCount=0,e.type=void 0),this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}let ro=new DataView(new ArrayBuffer(0)),rl=new Uint8Array(ro.buffer);try{ro.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}let rc=RangeError("Insufficient data"),rd=new rt;class rh{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=ro;bytes=rl;headByte=-1;stack=new ra;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??i6.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??0xffffffff,this.maxBinLength=e?.maxBinLength??0xffffffff,this.maxArrayLength=e?.maxArrayLength??0xffffffff,this.maxMapLength=e?.maxMapLength??0xffffffff,this.maxExtLength=e?.maxExtLength??0xffffffff,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:rd,this.mapKeyConverter=e?.mapKeyConverter??rs}clone(){return new rh({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(e){let t=re(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(-1!==this.headByte||this.hasRemaining(1)){let t=this.bytes.subarray(this.pos),i=re(e),r=new Uint8Array(t.length+i.length);r.set(t),r.set(i,t.length),this.setBuffer(r)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:t,pos:i}=this;return RangeError(`Extra ${t.byteLength-i} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){let t=this.clone();yield*t.decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{let t;this.entered=!0;let i=!1;for await(let r of e){if(i)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(r);try{t=this.doDecodeSync(),i=!0}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}if(i){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}let{headByte:r,pos:n,totalPos:s}=this;throw RangeError(`Insufficient data in parsing ${i0(r)} at ${s} (${n} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async *decodeMultiAsync(e,t){if(this.entered){let i=this.clone();yield*i.decodeMultiAsync(e,t);return}try{this.entered=!0;let i=t,r=-1;for await(let n of e){if(t&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(n),i&&(r=this.readArraySize(),i=!1,this.complete());try{for(;yield this.doDecodeSync(),0!=--r;);}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){t:for(;;){let e,t=this.readHeadByte();if(t>=224)e=t-256;else if(t<192)if(t<128)e=t;else if(t<144){let i=t-128;if(0!==i){this.pushMapState(i),this.complete();continue}e={}}else if(t<160){let i=t-144;if(0!==i){this.pushArrayState(i),this.complete();continue}e=[]}else{let i=t-160;e=this.decodeString(i,0)}else if(192===t)e=null;else if(194===t)e=!1;else if(195===t)e=!0;else if(202===t)e=this.readF32();else if(203===t)e=this.readF64();else if(204===t)e=this.readU8();else if(205===t)e=this.readU16();else if(206===t)e=this.readU32();else if(207===t)e=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===t)e=this.readI8();else if(209===t)e=this.readI16();else if(210===t)e=this.readI32();else if(211===t)e=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===t){let t=this.lookU8();e=this.decodeString(t,1)}else if(218===t){let t=this.lookU16();e=this.decodeString(t,2)}else if(219===t){let t=this.lookU32();e=this.decodeString(t,4)}else if(220===t){let t=this.readU16();if(0!==t){this.pushArrayState(t),this.complete();continue}e=[]}else if(221===t){let t=this.readU32();if(0!==t){this.pushArrayState(t),this.complete();continue}e=[]}else if(222===t){let t=this.readU16();if(0!==t){this.pushMapState(t),this.complete();continue}e={}}else if(223===t){let t=this.readU32();if(0!==t){this.pushMapState(t),this.complete();continue}e={}}else if(196===t){let t=this.lookU8();e=this.decodeBinary(t,1)}else if(197===t){let t=this.lookU16();e=this.decodeBinary(t,2)}else if(198===t){let t=this.lookU32();e=this.decodeBinary(t,4)}else if(212===t)e=this.decodeExtension(1,0);else if(213===t)e=this.decodeExtension(2,0);else if(214===t)e=this.decodeExtension(4,0);else if(215===t)e=this.decodeExtension(8,0);else if(216===t)e=this.decodeExtension(16,0);else if(199===t){let t=this.lookU8();e=this.decodeExtension(t,1)}else if(200===t){let t=this.lookU16();e=this.decodeExtension(t,2)}else if(201===t){let t=this.lookU32();e=this.decodeExtension(t,4)}else throw new i2(`Unrecognized type byte: ${i0(t)}`);this.complete();let i=this.stack;for(;i.length>0;){let t=i.top();if(t.type===ri)if(t.array[t.position]=e,t.position++,t.position===t.size)e=t.array,i.release(t);else continue t;else if(t.type===rr){if("__proto__"===e)throw new i2("The key __proto__ is not allowed");t.key=this.mapKeyConverter(e),t.type=rn;continue t}else if(t.map[t.key]=e,t.readCount++,t.readCount===t.size)e=t.map,i.release(t);else{t.key=null,t.type=rr;continue t}}return e}}readHeadByte(){return -1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new i2(`Unrecognized array type byte: ${i0(e)}`)}}pushMapState(e){if(e>this.maxMapLength)throw new i2(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new i2(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){let i;if(e>this.maxStrLength)throw new i2(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw rc;let r=this.pos+t;return i=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,r,e):function(e,t,i){let r;if(!(i>200))return i9(e,t,i);return r=e.subarray(t,t+i),i7.decode(r)}(this.bytes,r,e),this.pos+=t+e,i}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===rr}decodeBinary(e,t){if(e>this.maxBinLength)throw new i2(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw rc;let i=this.pos+t,r=this.bytes.subarray(i,i+e);return this.pos+=t+e,r}decodeExtension(e,t){if(e>this.maxExtLength)throw new i2(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let i=this.view.getInt8(this.pos+t),r=this.decodeBinary(e,t+1);return this.extensionCodec.decode(r,i,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){var e,t;let i=(e=this.view,t=this.pos,0x100000000*e.getUint32(t)+e.getUint32(t+4));return this.pos+=8,i}readI64(){let e=i5(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}}class ru{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(e){this.extensionCodec=e?.extensionCodec??i6.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??100,this.initialBufferSize=e?.initialBufferSize??2048,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new ru({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw Error(`Too deep objects in depth ${t}`);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):"str
4611ing"==typeof e?this.encodeString(e):this.useBigInt64&&"bigint"==typeof e?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){let t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)}resizeBuffer(e){let t=new ArrayBuffer(e),i=new Uint8Array(t),r=new DataView(t);i.set(this.bytes),this.view=r,this.bytes=i}encodeNil(){this.writeU8(192)}encodeBoolean(e){!1===e?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<0x100000000?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-0x80000000?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<0x100000000)this.writeU8(219),this.writeU32(e);else throw Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let t=function(e){let t=e.length,i=0,r=0;for(;r<t;){let n=e.charCodeAt(r++);if((0xffffff80&n)==0){i++;continue}if((0xfffff800&n)==0)i+=2;else{if(n>=55296&&n<=56319&&r<t){let t=e.charCodeAt(r);(64512&t)==56320&&(++r,n=((1023&n)<<10)+(1023&t)+65536)}(0xffff0000&n)==0?i+=3:i+=4}}return i}(e);this.ensureBufferSizeToWrite(5+t),this.writeStringHeader(t),function(e,t,i){if(e.length>50)i8.encodeInto(e,t.subarray(i));else!function(e,t,i){let r=e.length,n=i,s=0;for(;s<r;){let i=e.charCodeAt(s++);if((0xffffff80&i)==0){t[n++]=i;continue}if((0xfffff800&i)==0)t[n++]=i>>6&31|192;else{if(i>=55296&&i<=56319&&s<r){let t=e.charCodeAt(s);(64512&t)==56320&&(++s,i=((1023&i)<<10)+(1023&t)+65536)}(0xffff0000&i)==0?t[n++]=i>>12&15|224:(t[n++]=i>>18&7|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128}t[n++]=63&i|128}}(e,t,i)}(e,this.bytes,this.pos),this.pos+=t}encodeObject(e,t){let i=this.extensionCodec.tryToEncode(e,this.context);if(null!=i)this.encodeExtension(i);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if("object"==typeof e)this.encodeMap(e,t);else throw Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<0x100000000)this.writeU8(198),this.writeU32(t);else throw Error(`Too large binary: ${t}`);let i=re(e);this.writeU8a(i)}encodeArray(e,t){let i=e.length;if(i<16)this.writeU8(144+i);else if(i<65536)this.writeU8(220),this.writeU16(i);else if(i<0x100000000)this.writeU8(221),this.writeU32(i);else throw Error(`Too large array: ${i}`);for(let i of e)this.doEncode(i,t+1)}countWithoutUndefined(e,t){let i=0;for(let r of t)void 0!==e[r]&&i++;return i}encodeMap(e,t){let i=Object.keys(e);this.sortKeys&&i.sort();let r=this.ignoreUndefined?this.countWithoutUndefined(e,i):i.length;if(r<16)this.writeU8(128+r);else if(r<65536)this.writeU8(222),this.writeU16(r);else if(r<0x100000000)this.writeU8(223),this.writeU32(r);else throw Error(`Too large map object: ${r}`);for(let r of i){let i=e[r];this.ignoreUndefined&&void 0===i||(this.encodeString(r),this.doEncode(i,t+1))}}encodeExtension(e){if("function"==typeof e.data){let t=e.data(this.pos+6),i=t.length;if(i>=0x100000000)throw Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(t);return}let t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<0x100000000)this.writeU8(201),this.writeU32(t);else throw Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){var t,i;this.ensureBufferSizeToWrite(8),t=this.view,i=this.pos,t.setUint32(i,e/0x100000000),t.setUint32(i+4,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),i3(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function rp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function rf(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function rg(e){if("function"!=typeof e)throw Error("function expected");return!0}function rm(e,t){if("string"!=typeof t)throw Error(`${e}: string expected`);return!0}function rw(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function ry(e){if(!Array.isArray(e))throw Error("array expected")}function rb(e,t){if(!rf(!0,t))throw Error(`${e}
4611: array of strings expected`)}function rv(e,t){if(!rf(!1,t))throw Error(`${e}: array of numbers expected`)}function rC(...e){let t=e=>e,i=(e,t)=>i=>e(t(i));return{encode:e.map(e=>e.encode).reduceRight(i,t),decode:e.map(e=>e.decode).reduce(i,t)}}function rE(e){let t="string"==typeof e?e.split(""):e,i=t.length;rb("alphabet",t);let r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(ry(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=i)throw Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${e}`);return t[r]})),decode:t=>(ry(t),t.map(t=>{rm("alphabet.decode",t);let i=r.get(t);if(void 0===i)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return i}))}}function rx(e=""){return rm("join",e),{encode:t=>(rb("join.decode",t),t.join(e)),decode:t=>(rm("join.decode",t),t.split(e))}}function rA(e,t,i){if(t<2)throw Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(i<2)throw Error(`convertRadix: invalid to=${i}, base cannot be less than 2`);if(ry(e),!e.length)return[];let r=0,n=[],s=Array.from(e,e=>{if(rw(e),e<0||e>=t)throw Error(`invalid integer: ${e}`);return e}),a=s.length;for(;;){let e=0,o=!0;for(let n=r;n<a;n++){let a=s[n],l=t*e,c=l+a;if(!Number.isSafeInteger(c)||l/t!==e||c-a!==l)throw Error("convertRadix: carry overflow");let d=c/i;e=c%i;let h=Math.floor(d);if(s[n]=h,!Number.isSafeInteger(h)||h*i+e!==c)throw Error("convertRadix: carry overflow");o&&(h?o=!1:r=n)}if(n.push(e),o)break}for(let t=0;t<e.length-1&&0===e[t];t++)n.push(0);return n.reverse()}let r_=(e,t)=>0===t?e:r_(t,e%t),rI=(e,t)=>e+(t-r_(e,t)),rS=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function rN(e,t,i,r){if(ry(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(i<=0||i>32)throw Error(`convertRadix2: wrong to=${i}`);if(rI(t,i)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${i} carryBits=${rI(t,i)}`);let n=0,s=0,a=rS[t],o=rS[i]-1,l=[];for(let r of e){if(rw(r),r>=a)throw Error(`convertRadix2: invalid data word=${r} from=${t}`);if(n=n<<t|r,s+t>32)throw Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=i;s-=i)l.push((n>>s-i&o)>>>0);let e=rS[s];if(void 0===e)throw Error("invalid carry");n&=e-1}if(n=n<<i-s&o,!r&&s>=t)throw Error("Excess padding");if(!r&&n>0)throw Error(`Non-zero padding: ${n}`);return r&&s>0&&l.push(n>>>0),l}let rk=rC(function(e=!1){rw(5),!1;if(rI(8,5)>32||rI(5,8)>32)throw Error("radix2: carry overflow");return{encode:t=>{if(!rp(t))throw Error("radix2.encode input should be Uint8Array");return rN(Array.from(t),8,5,!e)},decode:t=>(rv("radix2.decode",t),Uint8Array.from(rN(t,5,8,e)))}}(),rE("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),function(e="="){return rw(5),rm("padding",e),{encode(t){for(rb("padding.encode",t);5*t.length%8;)t.push(e);return t},decode(t){rb("padding.decode",t);let i=t.length;if(5*i%8)throw Error("padding: invalid, string should have whole number of bytes");for(;i>0&&t[i-1]===e;i--)if((i-1)*5%8==0)throw Error("padding: invalid, string has too much padding");return t.slice(0,i)}}}(),rx("")),rT="function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64,rO=rC((rw(58),{encode:e=>{if(!rp(e))throw Error("radix.encode input should be Uint8Array");return rA(Array.from(e),256,58)},decode:e=>(rv("radix.decode",e),Uint8Array.from(rA(e,58,256)))}),rE("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),rx("")),rR=rC(rE("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),rx(""));function rP(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function r$(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?rP(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function rU(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let i=r$(t),r=0;for(let t of e)i.set(t,r),r+=t.length;return rP(i)}"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex||rg(e=>{if("string"!=typeof e||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()});let rM=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var i=new Uint8Array(256),r=0;r<i.length;r++)i[r]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),a=s.charCodeAt(0);if(255!==i[a])throw TypeError(s+" is ambiguous");i[a]=n}
4611var o=e.length,l=e.charAt(0),c=Math.log(o)/Math.log(256),d=Math.log(256)/Math.log(o);function h(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var r=0,n=0;e[t]===l;)r++,t++;for(var s=(e.length-t)*c+1>>>0,a=new Uint8Array(s);e[t];){var d=i[e.charCodeAt(t)];if(255===d)return;for(var h=0,u=s-1;(0!==d||h<n)&&-1!==u;u--,h++)d+=o*a[u]>>>0,a[u]=d%256>>>0,d=d/256>>>0;if(0!==d)throw Error("Non-zero carry");n=h,t++}if(" "!==e[t]){for(var p=s-n;p!==s&&0===a[p];)p++;for(var f=new Uint8Array(r+(s-p)),g=r;p!==s;)f[g++]=a[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var i=0,r=0,n=0,s=t.length;n!==s&&0===t[n];)n++,i++;for(var a=(s-n)*d+1>>>0,c=new Uint8Array(a);n!==s;){for(var h=t[n],u=0,p=a-1;(0!==h||u<r)&&-1!==p;p--,u++)h+=256*c[p]>>>0,c[p]=h%o>>>0,h=h/o>>>0;if(0!==h)throw Error("Non-zero carry");r=u,n++}for(var f=a-r;f!==a&&0===c[f];)f++;for(var g=l.repeat(i);f<a;++f)g+=e.charAt(c[f]);return g},decodeUnsafe:h,decode:function(e){var i=h(e);if(i)return i;throw Error(`Non-${t} character`)}}};new Uint8Array(0);let rD=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")};class rL{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class rW{constructor(e,t,i){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return rj(this,e)}}class rB{constructor(e){this.decoders=e}or(e){return rj(this,e)}decode(e){let t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let rj=(e,t)=>new rB({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class rF{constructor(e,t,i,r){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=r,this.encoder=new rL(e,t,i),this.decoder=new rW(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let rH=({name:e,prefix:t,encode:i,decode:r})=>new rF(e,t,i,r),rq=({prefix:e,name:t,alphabet:i})=>{let{encode:r,decode:n}=rM(i,t);return rH({prefix:e,name:t,encode:r,decode:e=>rD(n(e))})},rz=({name:e,prefix:t,bitsPerChar:i,alphabet:r})=>rH({prefix:t,name:e,encode:e=>((e,t,i)=>{let r="="===t[t.length-1],n=(1<<i)-1,s="",a=0,o=0;for(let r=0;r<e.length;++r)for(o=o<<8|e[r],a+=8;a>i;)a-=i,s+=t[n&o>>a];if(a&&(s+=t[n&o<<i-a]),r)for(;s.length*i&7;)s+="=";return s})(e,r,i),decode:t=>((e,t,i,r)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let a=new Uint8Array(s*i/8|0),o=0,l=0,c=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${r} character`);l=l<<i|s,(o+=i)>=8&&(o-=8,a[c++]=255&l>>o)}if(o>=i||255&l<<8-o)throw SyntaxError("Unexpected end of data");return a})(t,r,i,e)}),rV=rH({prefix:"\0",name:"identity",encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)}),rZ=rz({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),rK=rz({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),rG=rq({prefix:"9",name:"base10",alphabet:"0123456789"}),rY=rz({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),rJ=rz({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),rX=rz({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),rQ=rz({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),r0=rz({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),r1=rz({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),r2=rz({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),r3=rz({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),r5=rz({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),r4=rz({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),r6=rz({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),r8=rq({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),r9=rq({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),r7=rq({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ne=rq({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),nt=rz({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
4611+/",bitsPerChar:6}),ni=rz({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),nr=rz({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),nn=rz({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ns=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),na=ns.reduce((e,t,i)=>(e[i]=t,e),[]),no=ns.reduce((e,t,i)=>(e[t.codePointAt(0)]=i,e),[]),nl=rH({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=na[t],"")},decode:function(e){let t=[];for(let i of e){let e=no[i.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${i}`);t.push(e)}return new Uint8Array(t)}});function nc(e,t,i){t=t||[];for(var r=i=i||0;e>=0x80000000;)t[i++]=255&e|128,e/=128;for(;-128&e;)t[i++]=255&e|128,e>>>=7;return t[i]=0|e,nc.bytes=i-r+1,t}let nd=function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10},nh=(e,t,i=0)=>(nc(e,t,i),t),nu=(e,t)=>{let i=t.byteLength,r=nd(e),n=r+nd(i),s=new Uint8Array(n+i);return nh(e,s,0),nh(i,s,r),s.set(t,n),new np(e,i,t,s)};
4611class np{constructor(e,t,i,r){this.code=e,this.size=t,this.digest=i,this.bytes=r}}let nf=({name:e,code:t,encode:i})=>new ng(e,t,i);class ng{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?nu(this.code,t):t.then(e=>nu(this.code,e))}throw Error("Unknown type, must be binary type")}}let nm=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),nw=nf({name:"sha2-256",code:18,encode:nm("SHA-256")}),ny=nf({name:"sha2-512",code:19,encode:nm("SHA-512")}),nb={code:0,name:"identity",encode:rD,digest:e=>nu(0,rD(e))},nv="raw",nC=85,nE=e=>rD(e),nx=e=>rD(e),nA=new TextEncoder,n_=new TextDecoder,nI="json",nS=512,nN=e=>nA.encode(JSON.stringify(e)),nk=e=>JSON.parse(n_.decode(e));Symbol.for("nodejs.util.inspect.custom"),Symbol.for("@ipld/js-cid/CID");let nT={...f,...g,...m,...w,...y,...b,...v,...C,...E,...x};function nO(e,t,i,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:i},decoder:{decode:r}}}({...A,..._});let nR=nO("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),nP=nO("ascii","a",e=>{let t="a";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},e=>{let t=r$((e=e.substring(1)).length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}),n$={utf8:nR,"utf-8":nR,hex:nT.base16,latin1:nP,ascii:nP,binary:nP,...nT};function nU(e,t="utf8"){let i=n$[t];if(!i)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?rP(globalThis.Buffer.from(e,"utf-8")):i.decoder.decode(`${i.prefix}${e}`)}function nM(e,t="utf8"){let i=n$[t];if(!i)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):i.encoder.encode(e).substring(1)}let nD={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var nL=i(71594),nW=i(41463),nB=i(49304).hp;function nj(e){let[t,i]=e.split(":");return{namespace:t,reference:i}}function nF(e,t){return e.includes(":")?[e]:t.chains||[]}let nH={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},nq={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function nz(e,t){let{message:i,code:r}=nq[e];return{message:t?`${i} ${t}`:i,code:r}}function nV(e,t){let{message:i,code:r}=nH[e];return{message:t?`${i} ${t}`:i,code:r}}var nZ=Object.defineProperty,nK=Object.defineProperties,nG=Object.getOwnPropertyDescriptors,nY=Object.getOwnPropertySymbols,nJ=Object.prototype.hasOwnProperty,nX=Object.prototype.propertyIsEnumerable,nQ=(e,t,i)=>t in e?nZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,n0=(e,t)=>{for(var i in t||(t={}))nJ.call(t,i)&&nQ(e,i,t[i]);if(nY)for(var i of nY(t))nX.call(t,i)&&nQ(e,i,t[i]);return e},n1=(e,t,i)=>nQ(e,"symbol"!=typeof t?t+"":t,i);let n2="react-native",n3="node",n5="browser";function n4(){return"u">typeof nW&&"u">typeof nW.versions&&"u">typeof nW.versions.node}
4611function n6(){return!(0,iZ.getDocument)()&&!!(0,iZ.getNavigator)()&&"ReactNative"===navigator.product}function n8(){return!n4()&&!!(0,iZ.getNavigator)()&&!!(0,iZ.getDocument)()}function n9(){return n6()?n2:n4()?n3:n8()?n5:"unknown"}function n7(){var e;try{return n6()&&"u">typeof global&&"u">typeof(null==global?void 0:global.Application)?null==(e=global.Application)?void 0:e.applicationId:void 0}catch{return}}function se(){return(0,iK.g)()||{name:"",description:"",url:"",icons:[""]}}function st(e,t,i){var r;let n,s=function(){if(n9()===n2&&"u">typeof global&&"u">typeof(null==global?void 0:global.Platform)){let{OS:e,Version:t}=global.Platform;return[e,t].join("-")}let e="u"<typeof document&&"u">typeof navigator&&"ReactNative"===navigator.product?new iH:"u">typeof navigator?function(e){var t=""!==e&&iz.reduce(function(t,i){var r=i[0],n=i[1];if(t)return t;var s=n.exec(e);return!!s&&[r,s]},!1);if(!t)return null;var i=t[0],r=t[1];if("searchbot"===i)return new iF;var n=r[1]&&r[1].split(".").join("_").split("_").slice(0,3);n?n.length<3&&(n=iL(iL([],n,!0),function(e){for(var t=[],i=0;i<e;i++)t.push("0");return t}(3-n.length),!0)):n=[];var s=n.join("."),a=function(e){for(var t=0,i=iV.length;t<i;t++){var r=iV[t],n=r[0];if(r[1].exec(e))return n}return null}(e),o=iq.exec(e);return o&&o[1]?new ij(i,s,a,o[1]):new iW(i,s,a)}(navigator.userAgent):void 0!==iD&&iD.version?new iB(iD.version.slice(1)):null;if(null===e)return"unknown";let t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}(),a=(n=n9())===n5?[n,(null==(r=(0,iZ.getLocation)())?void 0:r.host)||"unknown"].join(":"):n;return[[e,t].join("-"),["js",i].join("-"),s,a].join("/")}function si(e,t){return e.filter(e=>t.includes(e)).length===e.length}function sr(e){return Object.fromEntries(e.entries())}function sn(e){return new Map(Object.entries(e))}function ss(e=T.FIVE_MINUTES,t){let i,r,n,s,a=(0,T.toMiliseconds)(e||T.FIVE_MINUTES);return{resolve:e=>{n&&i&&(clearTimeout(n),i(e),s=Promise.resolve(e))},reject:e=>{n&&r&&(clearTimeout(n),r(e))},done:()=>new Promise((e,o)=>{if(s)return e(s);n=setTimeout(()=>{let e=nz("EXPIRED"),i=Error(t||e.message);i.code=e.code,o(i)},a),i=e,r=o})}}function sa(e,t,i){return new Promise(async(r,n)=>{let s=setTimeout(()=>n(Error(i)),t);try{let t=await e;r(t)}catch(e){n(e)}clearTimeout(s)})}function so(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw Error(`Unknown expirer target type: ${e}`)}function sl(e){let[t,i]=e.split(":"),r={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof i)r.topic=i;else if("id"===t&&Number.isInteger(Number(i)))r.id=Number(i);else throw Error(`Invalid target, expected id:number or topic:string, got ${t}:${i}`);return r}function sc(e,t){return(0,T.fromMiliseconds)((t||Date.now())+(0,T.toMiliseconds)(e))}function sd(e){return Date.now()>=(0,T.toMiliseconds)(e)}function sh(e,t){return`${e}${t?`:${t}`:""}`}function su(e=[],t=[]){return[...new Set([...e,...t])]}async function sp({id:e,topic:t,wcDeepLink:i}){var r,n;try{if(!i)return;let s="string"==typeof i?JSON.parse(i):i,a=s?.href;if("string"!=typeof a)return;let o=function(e,t,i){let r=`requestId=${t}&sessionTopic=${i}`;e.endsWith("/")&&(e=e.slice(0,-1));let n=`${e}`;if(e.startsWith("https://t.me")){let t=e.includes("?")?"&startapp=":"?startapp=";n=`${n}${t}${function(e,t=!1){let i=nB.from(e).toString("base64");return t?i.replace(/[=]/g,""):i}(r,!0)}`}else n=`${n}/wc?${r}`;return n}(a,e,t),l=n9();if(l===n5){let e;if(!(null!=(r=(0,iZ.getDocument)())&&r.hasFocus()))return void console.warn("Document does not have focus, skipping deeplink.");n=o,e="_self",!function(){try{return window.self!==window.top}catch{return!1}}()?("u">typeof window&&(window.TelegramWebviewProxy||window.Telegram||window.TelegramWebviewProxyProto)||n.startsWith("https://")||n.startsWith("http://"))&&(e="_blank"):e="_top",window.open(n,e,"noreferrer noopener")}else l===n2&&"u">typeof(null==global?void 0:global.Linking)&&await global.Linking.openURL(o)}catch(e){console.error(e)}}async function sf(e,t){let i="";try{if(n8()&&(i=localStorage.getItem(t)))return i;i=await e.getItem(t)}catch(e){console.error(e)}return i}function sg(e,t){if(!e.includes(t))return null;let i=e.split(/([&,?,=])/),r=i.indexOf(t);return i[r+2]}function sm(){return"u">typeof crypto&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function sw(){return"u">typeof nW&&"true"===nW.env.IS_VITEST}function sy(e){return nB.from(e,"base64").toString("utf-8")}class sb{constructor({limit:e}){n1(this,"limit"),n1(this,"set"),this.limit=e,this.set=new Set}
4611add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){let e=this.set.values().next().value;e&&this.set.delete(e)}this.set.add(e)}}has(e){return this.set.has(e)}}let sv=BigInt(0x100000000-1),sC=BigInt(32);function sE(e,t=!1){return t?{h:Number(e&sv),l:Number(e>>sC&sv)}:{h:0|Number(e>>sC&sv),l:0|Number(e&sv)}}function sx(e,t=!1){let i=e.length,r=new Uint32Array(i),n=new Uint32Array(i);for(let s=0;s<i;s++){let{h:i,l:a}=sE(e[s],t);[r[s],n[s]]=[i,a]}return[r,n]}let sA=(e,t,i)=>e>>>i,s_=(e,t,i)=>e<<32-i|t>>>i,sI=(e,t,i)=>e>>>i|t<<32-i,sS=(e,t,i)=>e<<32-i|t>>>i,sN=(e,t,i)=>e<<64-i|t>>>i-32,sk=(e,t,i)=>e>>>i-32|t<<64-i;function sT(e,t,i,r){let n=(t>>>0)+(r>>>0);return{h:e+i+(n/0x100000000|0)|0,l:0|n}}let sO=(e,t,i)=>(e>>>0)+(t>>>0)+(i>>>0),sR=(e,t,i,r)=>t+i+r+(e/0x100000000|0)|0,sP=(e,t,i,r)=>(e>>>0)+(t>>>0)+(i>>>0)+(r>>>0),s$=(e,t,i,r,n)=>t+i+r+n+(e/0x100000000|0)|0,sU=(e,t,i,r,n)=>(e>>>0)+(t>>>0)+(i>>>0)+(r>>>0)+(n>>>0),sM=(e,t,i,r,n,s)=>t+i+r+n+s+(e/0x100000000|0)|0,sD="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function sL(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function sW(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function sB(e,...t){if(!sL(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function sj(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");sW(e.outputLen),sW(e.blockLen)}function sF(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function sH(e,t){sB(e);let i=t.outputLen;if(e.length<i)throw Error("digestInto() expects output buffer of length at least "+i)}function sq(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function sz(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function sV(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function sZ(e,t){return e<<32-t|e>>>t}let sK=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function sG(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}let sY=sK?e=>e:e=>sG(e),sJ=sK?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=sG(e[t]);return e},sX="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,sQ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function s0(e){if(sB(e),sX)return e.toHex();let t="";for(let i=0;i<e.length;i++)t+=sQ[e[i]];return t}function s1(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function s2(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(sX)return Uint8Array.fromHex(e);let t=e.length,i=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(i);for(let t=0,n=0;t<i;t++,n+=2){let i=s1(e.charCodeAt(n)),s=s1(e.charCodeAt(n+1));if(void 0===i||void 0===s)throw Error('hex string expected, got non-hex character "'+(e[n]+e[n+1])+'" at index '+n);r[t]=16*i+s}return r}function s3(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function s5(e){return"string"==typeof e&&(e=s3(e)),sB(e),e}function s4(...e){let t=0;for(let i=0;i<e.length;i++){let r=e[i];sB(r),t+=r.length}let i=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let n=e[t];i.set(n,r),r+=n.length}return i}class s6{}function s8(e){let t=t=>e().update(s5(t)).digest(),i=e();return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=()=>e(),t}function s9(e=32){if(sD&&"function"==typeof sD.getRandomValues)return sD.getRandomValues(new Uint8Array(e));if(sD&&"function"==typeof sD.randomBytes)return Uint8Array.from(sD.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}let s7=BigInt(0),ae=BigInt(1),at=BigInt(2),ai=BigInt(7),ar=BigInt(256),an=BigInt(113),as=[],aa=[],ao=[];for(let e=0,t=ae,i=1,r=0;e<24;e++){[i,r]=[r,(2*i+3*r)%5],as.push(2*(5*r+i)),aa.push((e+1)*(e+2)/2%64);let n=s7;for(let e=0;e<7;e++)(t=(t<<ae^(t>>ai)*an)%ar)&at&&(n^=ae<<(ae<<BigInt(e))-ae);ao.push(n)}let al=sx(ao,!0),ac=al[0],ad=al[1],ah=(e,t,i)=>i>32?t<<i-32|e>>>64-i:e<<i|t>>>32-i,au=(e,t,i)=>i>32?e<<i-32|t>>>64-i:t<<i|e>>>32-i;class ap extends s6{constructor(e,t,i,r=!1,n=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=i,this.enableXOF=r,this.rounds=n,sW(i),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=sq(this.state)}clone(){return this._cloneInto()}keccak(){sJ(this.state32),function(e,t=24){let i=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)i[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,n=(t+2)%10,s=i[n],a=i[n+1],o=ah(s,a,1)^i[r],l=au(s,a,1)^i[r+1];for(let i=0;i<50;i+=10)e[t+i]^=o,e[t+i+1]^=l}let t=e[2],n=e[3];for(let i=0;i<24;i++){let r=aa[i],s=ah(t,n,r),a=au(t,n,r),o=as[i];t=e[o],n=e[o+1],e[o]=s,e[o+1]=a}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)i[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~i[(r+2)%10]&i[(r+4)%10]}e[0]^=ac[r],e[1]^=ad[r]}sz(i)}(this.state32,this.rounds),sJ(this.state32),this.posOut=0,this.pos=0}update(e){sF(this),sB(e=s5(e));let{blockLen:t,state:i}=this,r=e.length;for(let n=0;n<r;){let s=Math.min(t-this.pos,r-n);for(let t=0;t<s;t++)i[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:i,blockLen:r}=this;e[i]^=t,(128&t)!=0&&i===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){sF(this,!1),sB(e),this.finish();let t=this.state,{blockLen:i}=this;for(let r=0,n=e.length;r<n;){this.posOut>=i&&this.keccak();let s=Math.min(i-this.posOut,n-r);e.set(t.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return sW(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(sH(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,sz(this.state)}_cloneInto(e){let{blockLen:t,suffix:i,outputLen:r,rounds:n,enableXOF:s}=this;return e||(e=new ap(t,i,r,s,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=i,e.outputLen=r,e.enableXOF=s,e.destroyed=this.destroyed,e}}let af=s8(()=>new ap(136,1,32));class ag extends s6{constructor(e,t,i,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=i,this.isLE=r,this.buffer=new Uint8Array(e),this.view=sV(this.buffer)}update(e){sF(this),sB(e=s5(e));let{view:t,buffer:i,blockLen:r}=this,n=e.length;for(let s=0;s<n;){let a=Math.min(r-this.pos,n-s);if(a===r){let t=sV(e);for(;r<=n-s;s+=r)this.process(t,s);continue}i.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){sF(this),sH(e,this),this.finished=!0;let{buffer:t,view:i,blockLen:r,isLE:n}=this,{pos:s}=this;t[s++]=128,sz(this.buffer.subarray(s)),this.padOffset>r-s&&(this.process(i,0),s=0);for(let e=s;e<r;e++)t[e]=0;(function(e,t,i,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,i,r);let n=BigInt(32),s=BigInt(0xffffffff),a=Number(i>>n&s),o=Number(i&s),l=4*!!r,c=4*!r;e.setUint32(t+l,a,r),e.setUint32(t+c,o,r)})(i,r-8,BigInt(8*this.length),n),this.process(i,0);let a=sV(e),o=this.outputLen;if(o%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=o/4,c=this.get();if(l>c.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)a.setUint32(4*e,c[e],n)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let i=e.slice(0,t);return this.destroy(),i}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:i,length:r,finished:n,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=n,e.length=r,e.pos=a,r%t&&e.buffer.set(i),e}clone(){return this._cloneInto()}}
4611let am=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),aw=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),ay=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),ab=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),av=new Uint32Array(64);class aC extends ag{constructor(e=32){super(64,e,8,!1),this.A=0|am[0],this.B=0|am[1],this.C=0|am[2],this.D=0|am[3],this.E=0|am[4],this.F=0|am[5],this.G=0|am[6],this.H=0|am[7]}get(){let{A:e,B:t,C:i,D:r,E:n,F:s,G:a,H:o}=this;return[e,t,i,r,n,s,a,o]}set(e,t,i,r,n,s,a,o){this.A=0|e,this.B=0|t,this.C=0|i,this.D=0|r,this.E=0|n,this.F=0|s,this.G=0|a,this.H=0|o}process(e,t){for(let i=0;i<16;i++,t+=4)av[i]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=av[e-15],i=av[e-2],r=sZ(t,7)^sZ(t,18)^t>>>3,n=sZ(i,17)^sZ(i,19)^i>>>10;av[e]=n+av[e-7]+r+av[e-16]|0}let{A:i,B:r,C:n,D:s,E:a,F:o,G:l,H:c}=this;for(let e=0;e<64;e++){var d,h,u,p;let t=c+(sZ(a,6)^sZ(a,11)^sZ(a,25))+((d=a)&o^~d&l)+ab[e]+av[e]|0,f=(sZ(i,2)^sZ(i,13)^sZ(i,22))+((h=i)&(u=r)^h&(p=n)^u&p)|0;c=l,l=o,o=a,a=s+t|0,s=n,n=r,r=i,i=t+f|0}i=i+this.A|0,r=r+this.B|0,n=n+this.C|0,s=s+this.D|0,a=a+this.E|0,o=o+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(i,r,n,s,a,o,l,c)}roundClean(){sz(av)}destroy(){this.set(0,0,0,0,0,0,0,0),sz(this.buffer)}}let aE=sx(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
46115771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ax=aE[0],aA=aE[1],a_=new Uint32Array(80),aI=new Uint32Array(80);class aS extends ag{constructor(e=64){super(128,e,16,!1),this.Ah=0|ay[0],this.Al=0|ay[1],this.Bh=0|ay[2],this.Bl=0|ay[3],this.Ch=0|ay[4],this.Cl=0|ay[5],this.Dh=0|ay[6],this.Dl=0|ay[7],this.Eh=0|ay[8],this.El=0|ay[9],this.Fh=0|ay[10],this.Fl=0|ay[11],this.Gh=0|ay[12],this.Gl=0|ay[13],this.Hh=0|ay[14],this.Hl=0|ay[15]}get(){let{Ah:e,Al:t,Bh:i,Bl:r,Ch:n,Cl:s,Dh:a,Dl:o,Eh:l,El:c,Fh:d,Fl:h,Gh:u,Gl:p,Hh:f,Hl:g}=this;return[e,t,i,r,n,s,a,o,l,c,d,h,u,p,f,g]}set(e,t,i,r,n,s,a,o,l,c,d,h,u,p,f,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|i,this.Bl=0|r,this.Ch=0|n,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|l,this.El=0|c,this.Fh=0|d,this.Fl=0|h,this.Gh=0|u,this.Gl=0|p,this.Hh=0|f,this.Hl=0|g}process(e,t){for(let i=0;i<16;i++,t+=4)a_[i]=e.getUint32(t),aI[i]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|a_[e-15],i=0|aI[e-15],r=sI(t,i,1)^sI(t,i,8)^sA(t,i,7),n=sS(t,i,1)^sS(t,i,8)^s_(t,i,7),s=0|a_[e-2],a=0|aI[e-2],o=sI(s,a,19)^sN(s,a,61)^sA(s,a,6),l=sP(n,sS(s,a,19)^sk(s,a,61)^s_(s,a,6),aI[e-7],aI[e-16]),c=s$(l,r,o,a_[e-7],a_[e-16]);a_[e]=0|c,aI[e]=0|l}let{Ah:i,Al:r,Bh:n,Bl:s,Ch:a,Cl:o,Dh:l,Dl:c,Eh:d,El:h,Fh:u,Fl:p,Gh:f,Gl:g,Hh:m,Hl:w}=this;for(let e=0;e<80;e++){let t=sI(d,h,14)^sI(d,h,18)^sN(d,h,41),y=sS(d,h,14)^sS(d,h,18)^sk(d,h,41),b=d&u^~d&f,v=sU(w,y,h&p^~h&g,aA[e],aI[e]),C=sM(v,m,t,b,ax[e],a_[e]),E=0|v,x=sI(i,r,28)^sN(i,r,34)^sN(i,r,39),A=sS(i,r,28)^sk(i,r,34)^sk(i,r,39),_=i&n^i&a^n&a,I=r&s^r&o^s&o;m=0|f,w=0|g,f=0|u,g=0|p,u=0|d,p=0|h,({h:d,l:h}=sT(0|l,0|c,0|C,0|E)),l=0|a,c=0|o,a=0|n,o=0|s,n=0|i,s=0|r;let S=sO(E,A,I);i=sR(S,C,x,_),r=0|S}({h:i,l:r}=sT(0|this.Ah,0|this.Al,0|i,0|r)),({h:n,l:s}=sT(0|this.Bh,0|this.Bl,0|n,0|s)),({h:a,l:o}=sT(0|this.Ch,0|this.Cl,0|a,0|o)),({h:l,l:c}=sT(0|this.Dh,0|this.Dl,0|l,0|c)),({h:d,l:h}=sT(0|this.Eh,0|this.El,0|d,0|h)),({h:u,l:p}=sT(0|this.Fh,0|this.Fl,0|u,0|p)),({h:f,l:g}=sT(0|this.Gh,0|this.Gl,0|f,0|g)),({h:m,l:w}=sT(0|this.Hh,0|this.Hl,0|m,0|w)),this.set(i,r,n,s,a,o,l,c,d,h,u,p,f,g,m,w)}roundClean(){sz(a_,aI)}destroy(){sz(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class aN extends aS{constructor(){super(48),this.Ah=0|aw[0],this.Al=0|aw[1],this.Bh=0|aw[2],this.Bl=0|aw[3],this.Ch=0|aw[4],this.Cl=0|aw[5],this.Dh=0|aw[6],this.Dl=0|aw[7],this.Eh=0|aw[8],this.El=0|aw[9],this.Fh=0|aw[10],this.Fl=0|aw[11],this.Gh=0|aw[12],this.Gl=0|aw[13],this.Hh=0|aw[14],this.Hl=0|aw[15]}}let ak=Uint32Array.from([0x22312194,0xfc2bf72c,0x9f555fa3,0xc84c64c2,0x2393b86b,0x6f53b151,0x96387719,0x5940eabd,0x96283ee2,0xa88effe3,0xbe5e1e25,0x53863992,0x2b0199fc,0x2c85b8aa,0xeb72ddc,0x81c52ca2]);class aT extends aS{constructor(){super(32),this.Ah=0|ak[0],this.Al=0|ak[1],this.Bh=0|ak[2],this.Bl=0|ak[3],this.Ch=0|ak[4],this.Cl=0|ak[5],this.Dh=0|ak[6],this.Dl=0|ak[7],this.Eh=0|ak[8],this.El=0|ak[9],this.Fh=0|ak[10],this.Fl=0|ak[11],this.Gh=0|ak[12],this.Gl=0|ak[13],this.Hh=0|ak[14],this.Hl=0|ak[15]}}let aO=s8(()=>new aC),aR=s8(()=>new aS),aP=s8(()=>new aN),a$=s8(()=>new aT),aU=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),aM=Uint32Array.from([0xf3bcc908,0x6a09e66
46117,0x84caa73b,0xbb67ae85,0xfe94f82b,0x3c6ef372,0x5f1d36f1,0xa54ff53a,0xade682d1,0x510e527f,0x2b3e6c1f,0x9b05688c,0xfb41bd6b,0x1f83d9ab,0x137e2179,0x5be0cd19]),aD=new Uint32Array(32);function aL(e,t,i,r,n,s){let a=n[s],o=n[s+1],l=aD[2*e],c=aD[2*e+1],d=aD[2*t],h=aD[2*t+1],u=aD[2*i],p=aD[2*i+1],f=aD[2*r],g=aD[2*r+1],m=sO(l,d,a);c=sR(m,c,h,o),l=0|m,({Dh:g,Dl:f}={Dh:g^c,Dl:f^l}),({Dh:g,Dl:f}={Dh:f,Dl:g}),({h:p,l:u}=sT(p,u,g,f)),({Bh:h,Bl:d}={Bh:h^p,Bl:d^u}),({Bh:h,Bl:d}={Bh:sI(h,d,24),Bl:sS(h,d,24)}),aD[2*e]=l,aD[2*e+1]=c,aD[2*t]=d,aD[2*t+1]=h,aD[2*i]=u,aD[2*i+1]=p,aD[2*r]=f,aD[2*r+1]=g}function aW(e,t,i,r,n,s){let a=n[s],o=n[s+1],l=aD[2*e],c=aD[2*e+1],d=aD[2*t],h=aD[2*t+1],u=aD[2*i],p=aD[2*i+1],f=aD[2*r],g=aD[2*r+1],m=sO(l,d,a);c=sR(m,c,h,o),l=0|m,({Dh:g,Dl:f}={Dh:g^c,Dl:f^l}),({Dh:g,Dl:f}={Dh:sI(g,f,16),Dl:sS(g,f,16)}),({h:p,l:u}=sT(p,u,g,f)),({Bh:h,Bl:d}={Bh:h^p,Bl:d^u}),({Bh:h,Bl:d}={Bh:sN(h,d,63),Bl:sk(h,d,63)}),aD[2*e]=l,aD[2*e+1]=c,aD[2*t]=d,aD[2*t+1]=h,aD[2*i]=u,aD[2*i+1]=p,aD[2*r]=f,aD[2*r+1]=g}class aB extends s6{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,sW(e),sW(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=sq(this.buffer)}update(e){sF(this),sB(e=s5(e));let{blockLen:t,buffer:i,buffer32:r}=this,n=e.length,s=e.byteOffset,a=e.buffer;for(let o=0;o<n;){this.pos===t&&(sJ(r),this.compress(r,0,!1),sJ(r),this.pos=0);let l=Math.min(t-this.pos,n-o),c=s+o;if(l===t&&!(c%4)&&o+l<n){let e=new Uint32Array(a,c,Math.floor((n-o)/4));sJ(e);for(let i=0;o+t<n;i+=r.length,o+=t)this.length+=t,this.compress(e,i,!1);sJ(e);continue}i.set(e.subarray(o,o+l),this.pos),this.pos+=l,this.length+=l,o+=l}return this}digestInto(e){sF(this),sH(e,this);let{pos:t,buffer32:i}=this;this.finished=!0,sz(this.buffer.subarray(t)),sJ(i),this.compress(i,0,!0),sJ(i);let r=sq(e);this.get().forEach((e,t)=>r[t]=sY(e))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let i=e.slice(0,t);return this.destroy(),i}_cloneInto(e){let{buffer:t,length:i,finished:r,destroyed:n,outputLen:s,pos:a}=this;return e||(e=new this.constructor({dkLen:s})),e.set(...this.get()),e.buffer.set(t),e.destroyed=n,e.finished=r,e.length=i,e.pos=a,e.outputLen=s,e}clone(){return this._cloneInto()}}class aj extends aB{constructor(e={}){const t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|aM[0],this.v0h=0|aM[1],this.v1l=0|aM[2],this.v1h=0|aM[3],this.v2l=0|aM[4],this.v2h=0|aM[5],this.v3l=0|aM[6],this.v3h=0|aM[7],this.v4l=0|aM[8],this.v4h=0|aM[9],this.v5l=0|aM[10],this.v5h=0|aM[11],this.v6l=0|aM[12],this.v6h=0|aM[13],this.v7l=0|aM[14],this.v7h=0|aM[15],function(e,t={}){if(sW(64),e<0||e>64)throw Error("outputLen bigger than keyLen");let{key:i,salt:r,personalization:n}=t;if(void 0!==i&&(i.length<1||i.length>64))throw Error("key length must be undefined or 1..64");if(void 0!==r&&16!==r.length)throw Error("salt must be undefined or 16");if(void 0!==n&&16!==n.length)throw Error("personalization must be undefined or 16")}(t,e);let{key:i,personalization:r,salt:n}=e,s=0;if(void 0!==i&&(s=(i=s5(i)).length),this.v0l^=this.outputLen|s<<8|0x1010000,void 0!==n){const e=sq(n=s5(n));this.v4l^=sY(e[0]),this.v4h^=sY(e[1]),this.v5l^=sY(e[2]),this.v5h^=sY(e[3])}if(void 0!==r){const e=sq(r=s5(r));this.v6l^=sY(e[0]),this.v6h^=sY(e[1]),this.v7l^=sY(e[2]),this.v7h^=sY(e[3])}if(void 0!==i){const e=new Uint8Array(this.blockLen);e.set(i),this.update(e)}}get(){let{v0l:e,v0h:t,v1l:i,v1h:r,v2l:n,v2h:s,v3l:a,v3h:o,v4l:l,v4h:c,v5l:d,v5h:h,v6l:u,v6h:p,v7l:f,v7h:g}=this;return[e,t,i,r,n,s,a,o,l,c,d,h,u,p,f,g]}set(e,t,i,r,n,s,a,o,l,c,d,h,u,p,f,g){this.v0l=0|e,this.v0h=0|t,this.v1l=0|i,this.v1h=0|r,this.v2l=0|n,this.v2h=0|s,this.v3l=0|a,this.v3h=0|o,this.v4l=0|l,this.v4h=0|c,this.v5l=0|d,this.v5h=0|h,this.v6l=0|u,this.v6h=0|p,this.v7l=0|f,this.v7h=0|g}compress(e,t,i){this.get().forEach((e,t)=>aD[t]=e),aD.set(aM,16);let{h:r,l:n}=sE(BigInt(this.length));aD[24]=aM[8]^n,aD[25]=aM[9]^r,i&&(aD[28]=~aD[28],aD[29]=~aD[29]);let s=0;for(let i=0;i<12;i++)aL(0,4,8,12,e,t+2*aU[s++]),aW(0,4,8,12,e,t+2*aU[s++]),aL(1,5,9,13,e,t+2*aU[s++]),aW(1,5,9,13,e,t+2*aU[s++]),aL(2,6,10,14,e,t+2*aU[s++]),aW(2,6,10,14,e,t+2*aU[s++]),aL(3,7,11,15,e,t+2*aU[s++]),aW(3,7,11,15,e,t+2*aU[s++]),aL(0,5,10,15,e,t+2*aU[s++]),aW(0,5,10,15,e,t+2*aU[s++]),aL(1,6,11,12,e,t+2*aU[s++]),aW(1,6,11,12,e,t+2*aU[s++]),aL(2,7,8,13,e,t+2*aU[s++]),aW(2,7,8,13,e,t+2*aU[s++]),aL(3,4,9,14,e,t+2*aU[s++]),aW(3,4,9,14,e,t+2*aU[s++]);this.v0l^=aD[0]^aD[16],this.v0h^=aD[1]^aD[17],this.v1l^=aD[2]^aD[18],this.v1h^=aD[3]^aD[19],this.v2l^=aD[4]^aD[20],this.v2h^=aD[5]^aD[21],this.v3l^=aD[6]^aD[22],this.v3h^=aD[7]^aD[23],this.v4l^=aD[8]^aD[24],this.v4h^=aD[9]^aD[25],this.v5l^=aD[10]^aD[26],this.v5h^=aD[11]^aD[27],this.v6l^=aD[
461112]^aD[28],this.v6h^=aD[13]^aD[29],this.v7l^=aD[14]^aD[30],this.v7h^=aD[15]^aD[31],sz(aD)}destroy(){this.destroyed=!0,sz(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let aF=(u=e=>new aj(e),(a=(e,t)=>u(t).update(s5(e)).digest()).outputLen=(o=u({})).outputLen,a.blockLen=o.blockLen,a.create=e=>u(e),a);function aH(e){let t=`�Ethereum Signed Message:
4612${e.length}`,i=new TextEncoder().encode(t+e);return"0x"+nB.from(af(i)).toString("hex")}async function aq(e,t,i,r,n,s){switch(i.t){case"eip191":var a,o,l,c;let d;return await (a=e,o=t,l=i.s,d=iG.aD(l),(c={payload:aH(o),signature:d},iJ.bI(function(e){let{payload:t,signature:i}=e,{r,s:n,yParity:s}=i,a=new iY.bI.Signature(BigInt(r),BigInt(n)).addRecoveryBit(s).recoverPublicKey(iX.HT(t).substring(2));return iQ.HT(a)}(c))).toLowerCase()===a.toLowerCase());case"eip1271":return await az(e,t,i.s,r,n,s);default:throw Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${i.t}`)}}async function az(e,t,i,r,n,s){let a=nj(r);if(!a.namespace||!a.reference)throw Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${r}`);try{let a="0x1626ba7e",o=i.substring(2),l=(o.length/2).toString(16).padStart(64,"0"),c=(t.startsWith("0x")?t:aH(t)).substring(2),d=a+c+"0000000000000000000000000000000000000000000000000000000000000040"+l+o,h=await fetch(`${s||"https://rpc.walletconnect.org/v1"}/?chainId=${r}&projectId=${n}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:d},"latest"]})}),{result:u}=await h.json();return!!u&&u.slice(0,a.length).toLowerCase()===a.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}function aV(e){let t=new Uint8Array(aO(function(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if("object"==typeof e&&null!=e&&e.data)return new Uint8Array(Object.values(e.data));if("object"==typeof e&&e)return new Uint8Array(Object.values(e));throw Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}(e)));return rO.encode(t)}function aZ(e){var t;let i=(t=nB.from(e,"base64"),new rh(void 0).decode(t)).txn;if(!i)throw Error("Invalid signed transaction: missing 'txn' field");let r=new ru(void 0).encodeSharedRef(i),n=nB.from("TX"),s=a$(nB.concat([n,nB.from(r)]));return rk.encode(s).replace(/=+$/,"")}function aK(e){let t=[],i=BigInt(e);for(;i>=BigInt(128);)t.push(Number(i&BigInt(127)|BigInt(128))),i>>=BigInt(7);return t.push(Number(i)),nB.from(t)}var aG=Object.defineProperty,aY=Object.defineProperties,aJ=Object.getOwnPropertyDescriptors,aX=Object.getOwnPropertySymbols,aQ=Object.prototype.hasOwnProperty,a0=Object.prototype.propertyIsEnumerable,a1=(e,t,i)=>t in e?aG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;let a2="did:pkh:",a3={eip155:"Ethereum",solana:"Solana",bip122:"Bitcoin"},a5=e=>e?.split(":"),a4=e=>{let t=e&&a5(e);if(t)return t[2]+":"+t[3]},a6=e=>{let t=e&&a5(e);if(t)return t.pop()};async function a8(e){let{cacao:t,projectId:i}=e,{s:r,p:n}=t,s=a9(n,n.iss),a=a6(n.iss);return await aq(a,s,r,a4(n.iss),i)}let a9=(e,t)=>{let i=(e=>{let t=e&&a5(e);if(t)return e.includes(a2)?t[2]:t[0]})(t);if(!i)throw Error("Invalid issuer: "+t);let r=`${e.domain} wants you to sign in with your ${i?a3[i]||i:""} account:`,n=a6(t);if(!e.aud&&!e.uri)throw Error("Either `aud` or `uri` is required to construct the message");let s=e.statement||void 0,a=`URI: ${e.aud||e.uri}`,o=`Version: ${e.version}`,l=`Chain ID: ${(e=>{let t=e&&a5(e);if(t)return e.includes(a2)?t[3]:t[1]})(t)}`,c=`Nonce: ${e.nonce}`,d=`Issued At: ${e.iat}`,h=e.exp?`Expiration Time: ${e.exp}`:void 0,u=e.nbf?`Not Before: ${e.nbf}`:void 0,p=e.requestId?`Request ID: ${e.requestId}`:void 0,f=e.resources?`Resources:${e.resources.map(e=>`
4613- ${e}`).join("")}`:void 0,g=on(e.resources);return g&&(s=function(e="",t){a7(t);let i="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(i))return e;let r=[],n=0;
4613Object.keys(t.att).forEach(e=>{let i=Object.keys(t.att[e]).map(e=>({ability:e.split("/")[0],action:e.split("/")[1]}));i.sort((e,t)=>e.action.localeCompare(t.action));let s={};i.forEach(e=>{s[e.ability]||(s[e.ability]=[]),s[e.ability].push(e.action)});let a=Object.keys(s).map(t=>(n++,`(${n}) '${t}': '${s[t].join("', '")}' for '${e}'.`));r.push(a.join(", ").replace(".,","."))});let s=r.join(" "),a=`${i}${s}`;return`${e?e+" ":""}${a}`}(s,ot(g))),[r,n,"",s,"",a,o,l,c,d,h,u,p,f].filter(e=>null!=e).join(`
4614`)};function a7(e){if(!e)throw Error("No recap provided, value is undefined");if(!e.att)throw Error("No `att` property found");let t=Object.keys(e.att);if(!(null!=t&&t.length))throw Error("No resources found in `att` property");t.forEach(t=>{let i=e.att[t];if(Array.isArray(i)||"object"!=typeof i)throw Error(`Resource must be an object: ${t}`);if(!Object.keys(i).length)throw Error(`Resource object is empty: ${t}`);Object.keys(i).forEach(e=>{let t=i[e];if(!Array.isArray(t))throw Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach(t=>{if("object"!=typeof t)throw Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)})})})}function oe(e){return a7(e),`urn:recap:${nB.from(JSON.stringify(e)).toString("base64").replace(/=/g,"")}`}function ot(e){var t;let i=(t=e.replace("urn:recap:",""),JSON.parse(nB.from(t,"base64").toString("utf-8")));return a7(i),i}function oi(e){var t;let i=ot(e);a7(i);let r=null==(t=i.att)?void 0:t.eip155;return r?Object.keys(r).map(e=>e.split("/")[1]):[]}function or(e){let t=ot(e);a7(t);let i=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;null!=(t=e?.[0])&&t.chains&&i.push(e[0].chains)})}),[...new Set(i.flat())]}function on(e){if(!e)return;let t=e?.[e.length-1];return t&&t.includes("urn:recap:")?t:void 0}function os(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function oa(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function oo(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function ol(e,...t){if(!os(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function oc(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function od(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function oh(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}let ou=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function op(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e);else if(os(e))e=om(e);else throw Error("Uint8Array expected, got "+typeof e);return e}function of(e,t,i=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw Error("invalid output length, expected "+e+", got: "+t.length);if(i&&t.byteOffset%4!=0)throw Error("invalid output, must be aligned");return t}function og(e,t,i,r){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,i,r);let n=BigInt(32),s=BigInt(0xffffffff),a=Number(i>>n&s),o=Number(i&s),l=4*!!r,c=4*!r;e.setUint32(t+l,a,r),e.setUint32(t+c,o,r)}function om(e){return Uint8Array.from(e)}let ow=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),oy=ow("expand 16-byte k"),ob=ow("expand 32-byte k"),ov=od(oy),oC=od(ob);function oE(e,t){return e<<t|e>>>32-t}function ox(e){return e.byteOffset%4==0}let oA=0x100000000-1,o_=new Uint32Array,oI=(e,t)=>255&e[t++]|(255&e[t++])<<8;class oS{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,ol(e=op(e),32);const t=oI(e,0),i=oI(e,2),r=oI(e,4),n=oI(e,6),s=oI(e,8),a=oI(e,10),o=oI(e,12),l=oI(e,14);this.r[0]=8191&t,this.r[1]=(t>>>13|i<<3)&8191,this.r[2]=(i>>>10|r<<6)&7939,this.r[3]=(r>>>7|n<<9)&8191,this.r[4]=(n>>>4|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|a<<2)&8191,this.r[7]=(a>>>11|o<<5)&8065,this.r[8]=(o>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let t=0;t<8;t++)this.pad[t]=oI(e,16+2*t)}process(e,t,i=!1){let{h:r,r:n}
4614=this,s=n[0],a=n[1],o=n[2],l=n[3],c=n[4],d=n[5],h=n[6],u=n[7],p=n[8],f=n[9],g=oI(e,t+0),m=oI(e,t+2),w=oI(e,t+4),y=oI(e,t+6),b=oI(e,t+8),v=oI(e,t+10),C=oI(e,t+12),E=oI(e,t+14),x=r[0]+(8191&g),A=r[1]+((g>>>13|m<<3)&8191),_=r[2]+((m>>>10|w<<6)&8191),I=r[3]+((w>>>7|y<<9)&8191),S=r[4]+((y>>>4|b<<12)&8191),N=r[5]+(b>>>1&8191),k=r[6]+((b>>>14|v<<2)&8191),T=r[7]+((v>>>11|C<<5)&8191),O=r[8]+((C>>>8|E<<8)&8191),R=r[9]+(E>>>5|2048*!i),P=0,$=0+x*s+5*f*A+5*p*_+5*u*I+5*h*S;P=$>>>13,$&=8191,$+=5*d*N+5*c*k+5*l*T+5*o*O+5*a*R,P+=$>>>13,$&=8191;let U=P+x*a+A*s+5*f*_+5*p*I+5*u*S;P=U>>>13,U&=8191,U+=5*h*N+5*d*k+5*c*T+5*l*O+5*o*R,P+=U>>>13,U&=8191;let M=P+x*o+A*a+_*s+5*f*I+5*p*S;P=M>>>13,M&=8191,M+=5*u*N+5*h*k+5*d*T+5*c*O+5*l*R,P+=M>>>13,M&=8191;let D=P+x*l+A*o+_*a+I*s+5*f*S;P=D>>>13,D&=8191,D+=5*p*N+5*u*k+5*h*T+5*d*O+5*c*R,P+=D>>>13,D&=8191;let L=P+x*c+A*l+_*o+I*a+S*s;P=L>>>13,L&=8191,L+=5*f*N+5*p*k+5*u*T+5*h*O+5*d*R,P+=L>>>13,L&=8191;let W=P+x*d+A*c+_*l+I*o+S*a;P=W>>>13,W&=8191,W+=N*s+5*f*k+5*p*T+5*u*O+5*h*R,P+=W>>>13,W&=8191;let B=P+x*h+A*d+_*c+I*l+S*o;P=B>>>13,B&=8191,B+=N*a+k*s+5*f*T+5*p*O+5*u*R,P+=B>>>13,B&=8191;let j=P+x*u+A*h+_*d+I*c+S*l;P=j>>>13,j&=8191,j+=N*o+k*a+T*s+5*f*O+5*p*R,P+=j>>>13,j&=8191;let F=P+x*p+A*u+_*h+I*d+S*c;P=F>>>13,F&=8191,F+=N*l+k*o+T*a+O*s+5*f*R,P+=F>>>13,F&=8191;let H=P+x*f+A*p+_*u+I*h+S*d;P=H>>>13,H&=8191,H+=N*c+k*l+T*o+O*a+R*s,P+=H>>>13,H&=8191,$=8191&(P=(P=(P<<2)+P|0)+$|0),P>>>=13,U+=P,r[0]=$,r[1]=U,r[2]=M,r[3]=D,r[4]=L,r[5]=W,r[6]=B,r[7]=j,r[8]=F,r[9]=H}finalize(){let{h:e,pad:t}=this,i=new Uint16Array(10),r=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=r,r=e[t]>>>13,e[t]&=8191;e[0]+=5*r,r=e[0]>>>13,e[0]&=8191,e[1]+=r,r=e[1]>>>13,e[1]&=8191,e[2]+=r,i[0]=e[0]+5,r=i[0]>>>13,i[0]&=8191;for(let t=1;t<10;t++)i[t]=e[t]+r,r=i[t]>>>13,i[t]&=8191;i[9]-=8192;let n=(1^r)-1;for(let e=0;e<10;e++)i[e]&=n;n=~n;for(let t=0;t<10;t++)e[t]=e[t]&n|i[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let s=e[0]+t[0];e[0]=65535&s;for(let i=1;i<8;i++)s=(e[i]+t[i]|0)+(s>>>16)|0,e[i]=65535&s;oh(i)}update(e){oc(this),ol(e=op(e));let{buffer:t,blockLen:i}=this,r=e.length;for(let n=0;n<r;){let s=Math.min(i-this.pos,r-n);if(s===i){for(;i<=r-n;n+=i)this.process(e,n);continue}t.set(e.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===i&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){oh(this.h,this.r,this.buffer,this.pad)}digestInto(e){oc(this),function(e,t){ol(e);let i=t.outputLen;if(e.length<i)throw Error("digestInto() expects output buffer of length at least "+i)}(e,this),this.finished=!0;let{buffer:t,h:i}=this,{pos:r}=this;if(r){for(t[r++]=1;r<16;r++)t[r]=0;this.process(t,0,!0)}this.finalize();let n=0;for(let t=0;t<8;t++)e[n++]=i[t]>>>0,e[n++]=i[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let i=e.slice(0,t);return this.destroy(),i}}let oN=(p=e=>new oS(e),(l=(e,t)=>p(t).update(op(e)).digest()).outputLen=(c=p(new Uint8Array(32))).outputLen,l.blockLen=c.blockLen,l.create=e=>p(e),l),ok=function(e,t){let{allowShortKeys:i,extendNonceFn:r,counterLength:n,counterRight:s,rounds:a}=function(e,t){if(null==t||"object"!=typeof t)throw Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw Error("core must be a function");return oo(n),oo(a),oa(s),oa(i),(t,o,l,c,d=0)=>{ol(t),ol(o),ol(l);let h=l.length;if(void 0===c&&(c=new Uint8Array(h)),ol(c),oo(d),d<0||d>=oA)throw Error("arx: counter overflow");if(c.length<h)throw Error(`arx: output (${c.length}) is shorter than data (${h})`);let u=[],p=t.length,f,g;if(32===p)u.push(f=om(t)),g=oC;else if(16===p&&i)(f=new Uint8Array(32)).set(t),f.set(t,16),g=ov,u.push(f);else throw Error(`arx: invalid 32-byte key, got length=${p}`);ox(o)||u.push(o=om(o));let m=od(f);if(r){if(24!==o.length)throw Error("arx: extended nonce must be 24 bytes");r(g,m,od(o.subarray(0,16)),m),o=o.subarray(16)}let w=16-n;if(w!==o.length)throw Error(`arx: nonce must be ${w} or 16 bytes`);if(12!==w){let e=new Uint8Array(12);e.set(o,s?0:12-o.length),o=e,u.push(o)}return function(e,t,i,r,n,s,a,o){let l=n.length,c=new Uint8Array(64),d=od(c),h=ox(n)&&ox(s),u=h?od(n):o_,p=h?od(s):o_;for(let f=0;f<l;a++){if(e(t,i,r,d,a,o),a>=oA)throw Error("arx: counter overflow");let g=Math.min(64,l-f);if(h&&64===g){let e=f/4;
4614if(f%4!=0)throw Error("arx: invalid block position");for(let t=0,i;t<16;t++)p[i=e+t]=u[i]^d[t];f+=64;continue}for(let e=0,t;e<g;e++)s[t=f+e]=n[t]^c[e];f+=g}}(e,g,m,od(o),l,c,d,a),oh(...u),c}}(function(e,t,i,r,n,s=20){let a=e[0],o=e[1],l=e[2],c=e[3],d=t[0],h=t[1],u=t[2],p=t[3],f=t[4],g=t[5],m=t[6],w=t[7],y=i[0],b=i[1],v=i[2],C=a,E=o,x=l,A=c,_=d,I=h,S=u,N=p,k=f,T=g,O=m,R=w,P=n,$=y,U=b,M=v;for(let e=0;e<s;e+=2)k=k+(P=oE(P^(C=C+_|0),16))|0,C=C+(_=oE(_^k,12))|0,k=k+(P=oE(P^C,8))|0,_=oE(_^k,7),T=T+($=oE($^(E=E+I|0),16))|0,E=E+(I=oE(I^T,12))|0,T=T+($=oE($^E,8))|0,I=oE(I^T,7),O=O+(U=oE(U^(x=x+S|0),16))|0,x=x+(S=oE(S^O,12))|0,O=O+(U=oE(U^x,8))|0,S=oE(S^O,7),R=R+(M=oE(M^(A=A+N|0),16))|0,A=A+(N=oE(N^R,12))|0,R=R+(M=oE(M^A,8))|0,N=oE(N^R,7),O=O+(M=oE(M^(C=C+I|0),16))|0,C=C+(I=oE(I^O,12))|0,O=O+(M=oE(M^C,8))|0,I=oE(I^O,7),R=R+(P=oE(P^(E=E+S|0),16))|0,E=E+(S=oE(S^R,12))|0,R=R+(P=oE(P^E,8))|0,S=oE(S^R,7),k=k+($=oE($^(x=x+N|0),16))|0,x=x+(N=oE(N^k,12))|0,k=k+($=oE($^x,8))|0,N=oE(N^k,7),T=T+(U=oE(U^(A=A+_|0),16))|0,A=A+(_=oE(_^T,12))|0,T=T+(U=oE(U^A,8))|0,_=oE(_^T,7);let D=0;r[D++]=a+C|0,r[D++]=o+E|0,r[D++]=l+x|0,r[D++]=c+A|0,r[D++]=d+_|0,r[D++]=h+I|0,r[D++]=u+S|0,r[D++]=p+N|0,r[D++]=f+k|0,r[D++]=g+T|0,r[D++]=m+O|0,r[D++]=w+R|0,r[D++]=n+P|0,r[D++]=y+$|0,r[D++]=b+U|0,r[D++]=v+M|0},{counterRight:!1,counterLength:4,allowShortKeys:!1}),oT=new Uint8Array(16),oO=(e,t)=>{e.update(t);let i=t.length%16;i&&e.update(oT.subarray(i))},oR=new Uint8Array(32);function oP(e,t,i,r,n){var s,a;let o,l,c=e(t,i,oR),d=oN.create(c);n&&oO(d,n),oO(d,r);let h=(s=r.length,a=n?n.length:0,oa(!0),og(l=new DataView((o=new Uint8Array(16)).buffer,o.byteOffset,o.byteLength),0,BigInt(a),!0),og(l,8,BigInt(s),!0),o);d.update(h);let u=d.digest();return oh(c,h),u}let o$=((e,t)=>{function i(r,...n){if(ol(r),!ou)throw Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){let t=n[0];if(!t)throw Error("nonce / iv required");e.varSizeNonce?ol(t):ol(t,e.nonceLength)}let s=e.tagLength;s&&void 0!==n[1]&&ol(n[1]);let a=t(r,...n),o=(e,t)=>{if(void 0!==t){if(2!==e)throw Error("cipher output not supported");ol(t)}},l=!1;return{encrypt(e,t){if(l)throw Error("cannot encrypt() twice with same key + nonce");return l=!0,ol(e),o(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(ol(e),s&&e.length<s)throw Error("invalid ciphertext length: smaller than tagLength="+s);return o(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(i,e),i})({blockSize:64,nonceLength:12,tagLength:16},(e,t,i)=>({encrypt(r,n){let s=r.length;(n=of(s+16,n,!1)).set(r);let a=n.subarray(0,-16);ok(e,t,a,a,1);let o=oP(ok,e,t,a,i);return n.set(o,s),oh(o),n},decrypt(r,n){n=of(r.length-16,n,!1);let s=r.subarray(0,-16),a=r.subarray(-16),o=oP(ok,e,t,s,i);if(!function(e,t){if(e.length!==t.length)return!1;let i=0;for(let r=0;r<e.length;r++)i|=e[r]^t[r];return 0===i}(a,o))throw Error("invalid tag");return n.set(r.subarray(0,-16)),ok(e,t,n,n,1),oh(o),n}}));class oU extends s6{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,sj(e);const i=s5(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,n=new Uint8Array(r);n.set(i.length>r?e.create().update(i).digest():i);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),sz(n)}update(e){return sF(this),this.iHash.update(e),this}digestInto(e){sF(this),sB(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:i,finished:r,destroyed:n,blockLen:s,outputLen:a}=this;return e.finished=r,e.destroyed=n,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=i._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let oM=(e,t,i)=>new oU(e,t).update(i).digest();oM.create=(e,t)=>
vendor: 7,984 bytes, line 4614
4614new oU(e,t);let oD=Uint8Array.from([0]),oL=Uint8Array.of(),oW=BigInt(0),oB=BigInt(1);function oj(e,t=""){if("boolean"!=typeof e)throw Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e}function oF(e,t,i=""){let r=sL(e),n=e?.length,s=void 0!==t;if(!r||s&&n!==t)throw Error((i&&`"${i}" `)+"expected Uint8Array"+(s?` of length ${t}`:"")+", got "+(r?`length=${n}`:`type=${typeof e}`));return e}function oH(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function oq(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?oW:BigInt("0x"+e)}function oz(e){return sB(e),oq(s0(Uint8Array.from(e).reverse()))}function oV(e,t){return s2(e.toString(16).padStart(2*t,"0"))}function oZ(e,t){return oV(e,t).reverse()}function oK(e,t,i){let r;if("string"==typeof t)try{r=s2(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(sL(t))r=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let n=r.length;if("number"==typeof i&&n!==i)throw Error(e+" of length "+i+" expected, got "+n);return r}let oG=e=>"bigint"==typeof e&&oW<=e;function oY(e,t,i,r){if(!(oG(t)&&oG(i)&&oG(r))||!(i<=t)||!(t<r))throw Error("expected valid "+e+": "+i+" <= n < "+r+", got "+t)}function oJ(e){let t;for(t=0;e>oW;e>>=oB,t+=1);return t}let oX=e=>(oB<<BigInt(e))-oB;function oQ(e,t,i={}){if(!e||"object"!=typeof e)throw Error("expected valid options object");function r(t,i,r){let n=e[t];if(r&&void 0===n)return;let s=typeof n;if(s!==i||null===n)throw Error(`param "${t}" is invalid: expected ${i}, got ${s}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(i).forEach(([e,t])=>r(e,t,!0))}function o0(e){let t=new WeakMap;return(i,...r)=>{let n=t.get(i);if(void 0!==n)return n;let s=e(i,...r);return t.set(i,s),s}}let o1=BigInt(0),o2=BigInt(1),o3=BigInt(2),o5=BigInt(3),o4=BigInt(4),o6=BigInt(5),o8=BigInt(7),o9=BigInt(8),o7=BigInt(9),le=BigInt(16);function lt(e,t){let i=e%t;return i>=o1?i:t+i}function li(e,t,i){let r=e;for(;t-- >o1;)r*=r,r%=i;return r}function lr(e,t){if(e===o1)throw Error("invert: expected non-zero number");if(t<=o1)throw Error("invert: expected positive modulus, got "+t);let i=lt(e,t),r=t,n=o1,s=o2;for(;i!==o1;){let e=r/i,t=r%i,a=n-s*e;r=i,i=t,n=s,s=a}if(r!==o2)throw Error("invert: does not exist");return lt(n,t)}function ln(e,t,i){if(!e.eql(e.sqr(t),i))throw Error("Cannot find square root")}function ls(e,t){let i=(e.ORDER+o2)/o4,r=e.pow(t,i);return ln(e,r,t),r}function la(e,t){let i=(e.ORDER-o6)/o9,r=e.mul(t,o3),n=e.pow(r,i),s=e.mul(t,n),a=e.mul(e.mul(s,o3),n),o=e.mul(s,e.sub(a,e.ONE));return ln(e,o,t),o}function lo(e){if(e<o5)throw Error("sqrt is not defined for small field");let t=e-o2,i=0;for(;t%o3===o1;)t/=o3,i++;let r=o3,n=lu(e);for(;1===ld(n,r);)if(r++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===i)return ls;let s=n.pow(r,t),a=(t+o2)/o3;return function(e,r){if(e.is0(r))return r;if(1!==ld(e,r))throw Error("Cannot find square root");let n=i,o=e.mul(e.ONE,s),l=e.pow(r,t),c=e.pow(r,a);for(;!e.eql(l,e.ONE);){if(e.is0(l))return e.ZERO;let t=1,i=e.sqr(l);for(;!e.eql(i,e.ONE);)if(t++,i=e.sqr(i),t===n)throw Error("Cannot find square root");let r=o2<<BigInt(n-t-1),s=e.pow(o,r);n=t,o=e.sqr(s),l=e.mul(l,o),c=e.mul(c,s)}return c}}let ll=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function lc(e,t,i=!1){let r=Array(t.length).fill(i?e.ZERO:void 0),n=t.reduce((t,i,n)=>e.is0(i)?t:(r[n]=t,e.mul(t,i)),e.ONE),s=e.inv(n);return t.reduceRight((t,i,n)=>e.is0(i)?t:(r[n]=e.mul(t,r[n]),e.mul(t,i)),s),r}function ld(e,t){let i=(e.ORDER-o2)/o3,r=e.pow(t,i),n=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),a=e.eql(r,e.neg(e.ONE));if(!n&&!s&&!a)throw Error("invalid Legendre symbol result");return n?1:s?0:-1}function lh(e,t){void 0!==t&&sW(t);let i=void 0!==t?t:e.toString(2).length,r=Math.ceil(i/8);return{nBitLength:i,nByteLength:r}}function lu(e,t,i=!1,r={}){let n;if(e<=o1)throw Error("invalid field: expected ORDER > 0, got "+e);let s,a,o=!1,l;if("object"==typeof t&&null!=t){if(r.sqrt||i)throw Error("cannot specify opts in two arguments");t.BITS&&(s=t.BITS),t.sqrt&&(a=t.sqrt),"boolean"==typeof t.isLE&&(i=t.isLE),"boolean"==typeof t.modFromBytes&&(o=t.modFromBytes),l=t.allowedLengths}else"number"==typeof t&&(s=t),r.sqrt&&(a=r.sqrt);let{nBitLength:c,nByteLength:d}=lh(e,s);if(d>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let h=Object.freeze({ORDER:e,isLE:i,BITS:c,BYTES:d,MASK:oX(c),ZERO:o1,ONE:o2,allowedLengths:l,create:t=>lt(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return o1<=t&&t<e},is0:e=>e===o1,isValidNot0:e=>!h.is0(e)&&h.isValid(e),isOdd:e=>(e&o2)===o2,neg:t=>lt(-t,e),eql:(e,t)=>e===t,sqr:t=>lt(t*t,e),add:(t,i)=>lt(t+i,e),sub:(t,i)=>lt(t-i,e),mul:(t,i)=>lt(t*i,e),pow:(e,t)=>(function(e,t,i){if(i<o1)throw Error("invalid exponent, negatives unsupported");if(i===o1)return e.ONE;if(i===o2)return t;let r=e.ONE,n=t;for(;i>o1;)i&o2&&(r=e.mul(r,n)),n=e.sqr(n),i>>=o2;return r})(h,e,t),div:(t,i)=>lt(t*lr(i,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>lr(t,e),sqrt:a||(t=>{let i,r,s,a,o,l;return n||(n=e%o4===o5?ls:e%o9===o6?la:e%le===o7?(i=lu(e),s=(r=lo(e))(i,i.neg(i.ONE)),a=r(i,s),o=r(i,i.neg(s)),l=(e+o8)/le,(e,t)=>{let i=e.pow(t,l),r=e.mul(i,s),n=e.mul(i,a),c=e.mul(i,o),d=e.eql(e.sqr(r),t),h=e.eql(e.sqr(n),t);i=e.cmov(i,r,d),r=e.cmov(c,n,h);let u=e.eql(e.sqr(r),t),p=e.cmov(i,r,u);return ln(e,p,t),p}):lo(e)),n(h,t)}),toBytes:e=>i?oZ(e,d):oV(e,d),fromBytes:(t,r=!0)=>{if(l){if(!l.includes(t.length)||t.length>d)throw Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);let e=new Uint8Array(d);e.set(t,i?0:e.length-t.length),t=e}if(t.length!==d)throw Error("Field.fromBytes: expected "+d+" bytes, got "+t.length);let n=i?oz(t):oq(s0(t));if(o&&(n=lt(n,e)),!r&&!h.isValid(n))throw Error("invalid field element: outside of range 0..ORDER");return n},invertBatch:e=>lc(h,e),cmov:(e,t,i)=>i?t:e});return Object.freeze(h)}function lp(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function lf(e){let t=lp(e);return t+Math.ceil(t/2)}let lg=BigInt(0),lm=BigInt(1);function lw(e,t){let i=t.negate();return e?i:t}function ly(e,t){let i=lc(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(i[r])))}function lb(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function lv(e,t){lb(e,t);let i=Math.ceil(t/e)+1,r=2**(e-1),n=2**e;return{windows:i,windowSize:r,mask:oX(e),maxNumber:n,shiftBy:BigInt(e)}}function lC(e,t,i){let{windowSize:r,mask:n,maxNumber:s,shiftBy:a}=i,o=Number(e&n),l=e>>a;o>r&&(o-=s,l+=lm);let c=t*r;return{nextN:l,offset:c+Math.abs(o)-1,isZero:0===o,isNeg:o<0,isNegF:t%2!=0,offsetF:c}}let lE=new WeakMap,lx=new WeakMap;function lA(e){return lx.get(e)||1}function l_(e){if(e!==lg)throw Error("invalid wNAF")}class lI{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,i=this.ZERO){let r=e;for(;t>lg;)t&lm&&(i=i.add(r)),r=r.double(),t>>=lm;return i}precomputeWindow(e,t){let{windows:i,windowSize:r}=lv(t,this.bits),n=[],s=e,a=s;for(let e=0;e<i;e++){a=s,n.push(a);for(let e=1;e<r;e++)a=a.add(s),n.push(a);s=a.double()}return n}wNAF(e,t,i){if(!this.Fn.isValid(i))throw Error("invalid scalar");let r=this.ZERO,n=this.BASE,s=lv(e,this.bits);for(let e=0;e<s.windows;e++){let{nextN:a,offset:o,isZero:l,isNeg:c,isNegF:d,offsetF:h}=lC(i,e,s);i=a,l?n=n.add(lw(d,t[h])):r=r.add(lw(c,t[o]))}return l_(i),{p:r,f:n}}wNAFUnsafe(e,t,i,r=this.ZERO){let n=lv(e,this.bits);for(let e=0;e<n.windows&&i!==lg;e++){let{nextN:s,offset:a,isZero:o,isNeg:l}=lC(i,e,n);if(i=s,!o){let e=t[a];r=r.add(l?e.negate():e)}}return l_(i),r}getPrecomputes(e,t,i){let r=lE.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&("function"==typeof i&&(r=i(r)),lE.set(t,r))),r}cached(e,t,i){let r=lA(e);
4614return this.wNAF(r,this.getPrecomputes(r,e,i),t)}unsafe(e,t,i,r){let n=lA(e);return 1===n?this._unsafeLadder(e,t,r):this.wNAFUnsafe(n,this.getPrecomputes(n,e,i),t,r)}createCache(e,t){lb(t,this.bits),lx.set(e,t),lE.delete(e)}hasCache(e){return 1!==lA(e)}}function lS(e,t,i){if(!t)return lu(e,{isLE:i});if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return oQ(t,ll.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),t}BigInt(0),BigInt(1),BigInt(2),BigInt(8),s3("HashToScalar-");let lN=BigInt(0),lk=BigInt(1),lT=BigInt(2),lO=BigInt(1),lR=BigInt(2),lP=BigInt(3),l$=BigInt(5),lU=BigInt(8),lM=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),lD={p:lM,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:lU,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},lL=function(e){let{P:t,type:i,adjustScalarBytes:r,powPminus2:n,randomBytes:s}=(oQ(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})),a="x25519"===i;if(!a&&"x448"!==i)throw Error("invalid type");let o=s||s9,l=a?255:448,c=a?32:56,d=BigInt(a?9:5),h=BigInt(a?121665:39081),u=a?lT**BigInt(254):lT**BigInt(447),p=u+(a?BigInt(8)*lT**BigInt(251)-lk:BigInt(4)*lT**BigInt(445)-lk)+lk,f=e=>lt(e,t),g=oZ(f(d),c);function m(e,i){let s,o=function(e,i){oY("u",e,lN,t),oY("scalar",i,u,p);let r=lk,s=lN,a=e,o=lk,c=lN;for(let t=BigInt(l-1);t>=lN;t--){let n=i>>t&lk;c^=n,({x_2:r,x_3:a}=y(c,r,a)),({x_2:s,x_3:o}=y(c,s,o)),c=n;let l=r+s,d=f(l*l),u=r-s,p=f(u*u),g=d-p,m=a+o,w=f((a-o)*l),b=f(m*u),v=w+b,C=w-b;a=f(v*v),o=f(e*f(C*C)),r=f(d*p),s=f(g*(d+f(h*g)))}return{x_2:r,x_3:a}=y(c,r,a),{x_2:s,x_3:o}=y(c,s,o),f(r*n(s))}((s=oK("u coordinate",i,c),a&&(s[31]&=127),f(oz(s))),oz(r(oK("scalar",e,c))));if(o===lN)throw Error("invalid private or public key received");return oZ(f(o),c)}function w(e){return m(e,g)}function y(e,t,i){let r=f(e*(t-i));return{x_2:t=f(t-r),x_3:i=f(i+r)}}let b={secretKey:c,publicKey:c,seed:c},v=(e=o(c))=>(sB(e,b.seed),e);return{keygen:function(e){let t=v(e);return{secretKey:t,publicKey:w(t)}},getSharedSecret:(e,t)=>m(e,t),getPublicKey:e=>w(e),scalarMult:m,scalarMultBase:w,utils:{randomSecretKey:v,randomPrivateKey:v},GuBytes:g.slice(),lengths:b}}({P:d=lu(lD.p,{isLE:!0}).ORDER,type:"x25519",powPminus2:e=>{let t,i,r,n,s,a,o,l,c,h,u,p,f,g,{pow_p_5_8:m,b2:w}=(t=BigInt(10),i=BigInt(20),r=BigInt(40),n=BigInt(80),a=li(s=e*e%lM*e%lM,lR,lM)*s%lM,o=li(a,lO,lM)*e%lM,l=li(o,l$,lM)*o%lM,c=li(l,t,lM)*l%lM,h=li(c,i,lM)*c%lM,u=li(h,r,lM)*h%lM,p=li(u,n,lM)*u%lM,f=li(p,n,lM)*u%lM,g=li(f,t,lM)*l%lM,{pow_p_5_8:li(g,lR,lM)*e%lM,b2:s});return lt(li(m,lP,d)*w,d)},adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}}),lW=(e,t)=>(e+(e>=0?t:-t)/lV)/t;function lB(e){if(!["compact","recovered","der"].includes(e))throw Error('Signature format must be "compact", "recovered", or "der"');return e}function lj(e,t){let i={};for(let r of Object.keys(t))i[r]=void 0===e[r]?t[r]:e[r];return oj(i.lowS,"lowS"),oj(i.prehash,"prehash"),void 0!==i.format&&lB(i.format),i}class lF extends Error{constructor(e=""){super(e)}}let lH={Err:lF,_tlv:{encode:(e,t)=>{let{Err:i}=lH;if(e<0||e>256)throw new i("tlv.encode: wrong tag");if(1&t.length)throw new i("tlv.encode: unpadded data");let r=t.length/2,n=oH(r);if(n.length/2&128)throw new i("tlv.encode: long form length too big");let s=r>127?oH(n.length/2|128):"";return oH(e)+s+n+t},decode(e,t){let{Err:i}=lH,r=0;if(e<0||e>256)throw new i("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new i("tlv.decode: wrong tlv");let n=t[r++],s=0;if(128&n){let e=127&n;if(!e)throw new i("tlv.decode(long): indefinite length not supported");if(e>4)throw new i("tlv.decode(long): byte length is too big");let a=t.subarray(r,r+e);
4614if(a.length!==e)throw new i("tlv.decode: length bytes not complete");if(0===a[0])throw new i("tlv.decode(long): zero leftmost byte");for(let e of a)s=s<<8|e;if(r+=e,s<128)throw new i("tlv.decode(long): not minimal encoding")}else s=n;let a=t.subarray(r,r+s);if(a.length!==s)throw new i("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+s)}}},_int:{encode(e){let{Err:t}=lH;if(e<lq)throw new t("integer: negative integers are not allowed");let i=oH(e);if(8&Number.parseInt(i[0],16)&&(i="00"+i),1&i.length)throw new t("unexpected DER parsing assertion: unpadded hex");return i},decode(e){let{Err:t}=lH;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return oq(s0(e))}},toSig(e){let{Err:t,_int:i,_tlv:r}=lH,n=oK("signature",e),{v:s,l:a}=r.decode(48,n);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:o,l:l}=r.decode(2,s),{v:c,l:d}=r.decode(2,l);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:i.decode(o),s:i.decode(c)}},hexFromSig(e){let{_tlv:t,_int:i}=lH,r=t.encode(2,i.encode(e.r)),n=t.encode(2,i.encode(e.s));return t.encode(48,r+n)}},lq=BigInt(0),lz=BigInt(1),lV=BigInt(2),lZ=BigInt(3),lK=BigInt(4);function lG(e,t){let i,{BYTES:r}=e;if("bigint"==typeof t)i=t;else{let n=oK("private key",t);try{i=e.fromBytes(n)}catch{throw Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(i))throw Error("invalid private key: out of range [1..N-1]");return i}function lY(e){return Uint8Array.of(e?2:3)}function lJ(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function lX(e,t){let i=t=>(function(e){let t,{CURVE:i,curveOpts:r,hash:n,ecdsaOpts:s}=function(e){let t,i,r,n,{CURVE:s,curveOpts:a}=(t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},i=e.Fp,r=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0,n={Fp:i,Fn:lu(t.n,{BITS:e.nBitLength,allowedLengths:r,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes},{CURVE:t,curveOpts:n}),o={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:s,curveOpts:a,hash:e.hash,ecdsaOpts:o}}(e),a=function(e,t,i={}){sj(t),oQ(i,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let r=i.randomBytes||s9,n=i.hmac||((e,...i)=>oM(t,e,s4(...i))),{Fp:s,Fn:a}=e,{ORDER:o,BITS:l}=a,{keygen:c,getPublicKey:d,getSharedSecret:h,utils:u,lengths:p}=function(e,t={}){let{Fn:i}=e,r=t.randomBytes||s9,n=Object.assign(lJ(e.Fp,i),{seed:lf(i.ORDER)});function s(e){try{return!!lG(i,e)}catch{return!1}}function a(e=r(n.seed)){return function(e,t,i=!1){let r=e.length,n=lp(t),s=lf(t);if(r<16||r<s||r>1024)throw Error("expected "+s+"-1024 bytes of input, got "+r);let a=lt(i?oz(e):oq(s0(e)),t-o2)+o2;return i?oZ(a,n):oV(a,n)}(oF(e,n.seed,"seed"),i.ORDER)}function o(t,r=!0){return e.BASE.multiply(lG(i,t)).toBytes(r)}function l(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;let{secretKey:r,publicKey:s,publicKeyUncompressed:a}=n;if(i.allowedLengths||r===s)return;let o=oK("key",t).length;return o===s||o===a}return Object.freeze({getPublicKey:o,getSharedSecret:function(t,r,n=!0){if(!0===l(t))throw Error("first arg must be private key");if(!1===l(r))throw Error("second arg must be public key");let s=lG(i,t);return e.fromHex(r).multiply(s).toBytes(n)},keygen:function(e){let t=a(e);return{secretKey:t,publicKey:o(t)}},Point:e,utils:{isValidSecretKey:s,isValidPublicKey:function(t,i){let{publicKey:r,publicKeyUncompressed:s}=n;try{let n=t.length;return(!0!==i||n===r)&&(!1!==i||n===s)&&!!e.fromBytes(t)}catch{return!1}},randomSecretKey:a,isValidPrivateKey:s,randomPrivateKey:a,normPrivateKeyToScalar:e=>lG(i,e),precompute:(t=8,i=e.BASE)=>i.precompute(t,!1)},lengths:n})}(e,i),f={prehash:!1,lowS:"boolean"==typeof i.lowS&&i.lowS,format:void 0,extraEntropy:!1},g="compact";function m(e,t){if(!a.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class w{constructor(e,t,i){this.r=m("r",e),this.s=m("s",t),null!=i&&(this.recovery=i),Object.freeze(this)}static fromBytes(e,t=g){var i,r;let n,s;if(i=e,lB(r=t),s=p.signature,oF(i,"compact"===r?s:"recovered"===r?s+1:void 0,`${r}
4614 signature`),"der"===t){let{r:t,s:i}=lH.toSig(oF(e));return new w(t,i)}"recovered"===t&&(n=e[0],t="compact",e=e.subarray(1));let o=a.BYTES,l=e.subarray(0,o),c=e.subarray(o,2*o);return new w(a.fromBytes(l),a.fromBytes(c),n)}static fromHex(e,t){return this.fromBytes(s2(e),t)}addRecoveryBit(e){return new w(this.r,this.s,e)}recoverPublicKey(t){let i=s.ORDER,{r:r,s:n,recovery:l}=this;if(null==l||![0,1,2,3].includes(l))throw Error("recovery id invalid");if(o*lV<i&&l>1)throw Error("recovery id is ambiguous for h>1 curve");let c=2===l||3===l?r+o:r;if(!s.isValid(c))throw Error("recovery id 2 or 3 invalid");let d=s.toBytes(c),h=e.fromBytes(s4(lY((1&l)==0),d)),u=a.inv(c),p=b(oK("msgHash",t)),f=a.create(-p*u),g=a.create(n*u),m=e.BASE.multiplyUnsafe(f).add(h.multiplyUnsafe(g));if(m.is0())throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>o>>lz}toBytes(e=g){if(lB(e),"der"===e)return s2(lH.hexFromSig(this));let t=a.toBytes(this.r),i=a.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw Error("recovery bit must be present");return s4(Uint8Array.of(this.recovery),t,i)}return s4(t,i)}toHex(e){return s0(this.toBytes(e))}assertValidity(){}static fromCompact(e){return w.fromBytes(oK("sig",e),"compact")}static fromDER(e){return w.fromBytes(oK("sig",e),"der")}normalizeS(){return this.hasHighS()?new w(this.r,a.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return s0(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return s0(this.toBytes("compact"))}}let y=i.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=oq(s0(e)),i=8*e.length-l;return i>0?t>>BigInt(i):t},b=i.bits2int_modN||function(e){return a.create(y(e))},v=oX(l);function C(e){return oY("num < 2^"+l,e,lq,v),a.toBytes(e)}function E(e,i){return oF(e,void 0,"message"),i?oF(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:c,getPublicKey:d,getSharedSecret:h,utils:u,lengths:p,Point:e,sign:function(i,s,l={}){let{seed:c,k2sig:d}=function(t,i,n){if(["recovered","canonical"].some(e=>e in n))throw Error("sign() legacy options not supported");let{lowS:s,prehash:l,extraEntropy:c}=lj(n,f),d=b(t=E(t,l)),h=lG(a,i),u=[C(h),C(d)];if(null!=c&&!1!==c){let e=!0===c?r(p.secretKey):c;u.push(oK("extraEntropy",e))}return{seed:s4(...u),k2sig:function(t){let i=y(t);if(!a.isValidNot0(i))return;let r=a.inv(i),n=e.BASE.multiply(i).toAffine(),l=a.create(n.x);if(l===lq)return;let c=a.create(r*a.create(d+l*h));if(c===lq)return;let u=2*(n.x!==l)|Number(n.y&lz),p=c;return s&&c>o>>lz&&(p=a.neg(c),u^=1),new w(l,p,u)}}}(i=oK("message",i),s,l);return(function(e,t,i){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof i)throw Error("hmacFn must be a function");let r=e=>new Uint8Array(e),n=r(e),s=r(e),a=0,o=()=>{n.fill(1),s.fill(0),a=0},l=(...e)=>i(s,n,...e),c=(e=r(0))=>{s=l(Uint8Array.of(0),e),n=l(),0!==e.length&&(s=l(Uint8Array.of(1),e),n=l())},d=()=>{if(a++>=1e3)throw Error("drbg: tried 1000 values");let e=0,i=[];for(;e<t;){let t=(n=l()).slice();i.push(t),e+=n.length}return s4(...i)};return(e,t)=>{let i;for(o(),c(e);!(i=t(d()));)c();return o(),i}})(t.outputLen,a.BYTES,n)(c,d)},verify:function(t,i,r,n={}){let{lowS:s,prehash:o,format:l}=lj(n,f);if(r=oK("publicKey",r),i=E(oK("message",i),o),"strict"in n)throw Error("options.strict was renamed to lowS");let c=void 0===l?function(e){let t,i="string"==typeof e||sL(e),r=!i&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!i&&!r)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(r)t=new w(e.r,e.s);else if(i){try{t=w.fromBytes(oK("sig",e),"der")}catch(e){if(!(e instanceof lH.Err))throw e}if(!t)try{t=w.fromBytes(oK("sig",e),"compact")}catch{return!1}}return t||!1}(t):w.fromBytes(oK("sig",t),l);if(!1===c)return!1;try{let t=e.fromBytes(r);if(s&&c.hasHighS())return!1;let{r:n,s:o}=c,l=b(i),d=a.inv(o),h=a.create(l*d),u=a.create(n*d),p=e.BASE.multiplyUnsafe(h).add(t.multiplyUnsafe(u));return!p.is0()&&a.create(p.x)===n}catch{return!1}},recoverPublicKey:function(e,t,i={}){let{prehash:r}=lj(i,f);return t=E(t,r),w.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:w,hash:t})}(function(e,t={}){let i=function(e,t,i={},r){if(void 0===r&&(r="edwards"===e),!t||"object"!=typeof t)throw Error(`expected valid ${e} CURVE object`);for(let e of["p","n","h"]){let i=t[e];if(!("bigint"==typeof i&&i>lg))throw Error(`CURVE.${e} must be positive bigint`)}let n=lS(t.p,i.Fp,r),s=lS(t.n,i.Fn,r);for(let i of["Gx","Gy","a","weierstrass"===e?"b":"d"])if(!n.isValid(t[i]))throw Error(`CURVE.${i} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:n,Fn:s}}("weierstrass",e,t),{Fp:r,Fn:n}=i,s=i.CURVE,{h:a,n:o}=s;oQ(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:l}=t;if(l&&(!r.is0(s.a)||"bigint"!=typeof l.beta||!Array.isArray(l.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let c=lJ(r,n);function d(){if(!r.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let h=t.toBytes||function(e,t,i){let{x:n,y:s}=t.toAffine(),a=r.toBytes(n);return(oj(i,"isCompressed"),i)?(d(),s4(lY(!r.isOdd(s)),a)):s4(Uint8Array.of(4),a,r.toBytes(s))},u=t.fromBytes||function(e){oF(e,void 0,"Point");let{publicKey:t,publicKeyUncompressed:i}=c,n=e.length,s=e[0],a=e.subarray(1);if(n===t&&(2===s||3===s)){let e,t=r.fromBytes(a);if(!r.isValid(t))throw Error("bad point: is not on curve, wrong x");let i=p(t);try{e=r.sqrt(i)}catch(e){throw Error("bad point: is not on curve, sqrt error"+(e instanceof Error?": "+e.message:""))}return d(),(1&s)==1!==r.isOdd(e)&&(e=r.neg(e)),{x:t,y:e}}if(n===i&&4===s){let e=r.BYTES,t=r.fromBytes(a.subarray(0,e)),i=r.fromBytes(a.subarray(e,2*e));if(!f(t,i))throw Error("bad point: is not on curve");return{x:t,y:i}}throw Error(`bad point: got length ${n}, expected compressed=${t} or uncompressed=${i}`)};function p(e){let t=r.sqr(e),i=r.mul(t,e);return r.add(r.add(i,r.mul(e,s.a)),s.b)}function f(e,t){let i=r.sqr(t),n=p(e);return r.eql(i,n)}if(!f(s.Gx,s.Gy))throw Error("bad curve params: generator point");let g=r.mul(r.pow(s.a,lZ),lK),m=r.mul(r.sqr(s.b),BigInt(27));if(r.is0(r.add(g,m)))throw Error("bad curve params: a or b");function w(e,t,i=!1){if(!r.isValid(t)||i&&r.is0(t))throw Error(`bad point coordinate ${e}`);return t}function y(e){if(!(e instanceof x))throw Error("ProjectivePoint expected")}function b(e){if(!l||!l.basises)throw Error("no endo");return function(e,t,i){let[[r,n],[s,a]]=t,o=lW(a*e,i),l=lW(-n*e,i),c=e-o*r-l*s,d=-o*n-l*a,h=c<lq,u=d<lq;h&&(c=-c),u&&(d=-d);let p=oX(Math.ceil(oJ(i)/2))+lz;if(c<lq||c>=p||d<lq||d>
vendor: 4,380 bytes, line 4614
4614=p)throw Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:h,k1:c,k2neg:u,k2:d}}(e,l.basises,n.ORDER)}let v=o0((e,t)=>{let{X:i,Y:n,Z:s}=e;if(r.eql(s,r.ONE))return{x:i,y:n};let a=e.is0();null==t&&(t=a?r.ONE:r.inv(s));let o=r.mul(i,t),l=r.mul(n,t),c=r.mul(s,t);if(a)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw Error("invZ was invalid");return{x:o,y:l}}),C=o0(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.Y))return;throw Error("bad point: ZERO")}let{x:i,y:n}=e.toAffine();if(!r.isValid(i)||!r.isValid(n))throw Error("bad point: x or y not field elements");if(!f(i,n))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function E(e,t,i,n,s){return i=new x(r.mul(i.X,e),i.Y,i.Z),t=lw(n,t),i=lw(s,i),t.add(i)}class x{constructor(e,t,i){this.X=w("x",e),this.Y=w("y",t,!0),this.Z=w("z",i),Object.freeze(this)}static CURVE(){return s}static fromAffine(e){let{x:t,y:i}=e||{};if(!e||!r.isValid(t)||!r.isValid(i))throw Error("invalid affine point");if(e instanceof x)throw Error("projective point not allowed");return r.is0(t)&&r.is0(i)?x.ZERO:new x(t,i,r.ONE)}static fromBytes(e){let t=x.fromAffine(u(oF(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return x.fromBytes(oK("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return _.createCache(this,e),t||this.multiply(lZ),this}assertValidity(){C(this)}hasEvenY(){let{y:e}=this.toAffine();if(!r.isOdd)throw Error("Field doesn't support isOdd");return!r.isOdd(e)}equals(e){y(e);let{X:t,Y:i,Z:n}=this,{X:s,Y:a,Z:o}=e,l=r.eql(r.mul(t,o),r.mul(s,n)),c=r.eql(r.mul(i,o),r.mul(a,n));return l&&c}negate(){return new x(this.X,r.neg(this.Y),this.Z)}double(){let{a:e,b:t}=s,i=r.mul(t,lZ),{X:n,Y:a,Z:o}=this,l=r.ZERO,c=r.ZERO,d=r.ZERO,h=r.mul(n,n),u=r.mul(a,a),p=r.mul(o,o),f=r.mul(n,a);return f=r.add(f,f),d=r.mul(n,o),d=r.add(d,d),l=r.mul(e,d),c=r.mul(i,p),c=r.add(l,c),l=r.sub(u,c),c=r.add(u,c),c=r.mul(l,c),l=r.mul(f,l),d=r.mul(i,d),p=r.mul(e,p),f=r.sub(h,p),f=r.mul(e,f),f=r.add(f,d),d=r.add(h,h),h=r.add(d,h),h=r.add(h,p),h=r.mul(h,f),c=r.add(c,h),p=r.mul(a,o),p=r.add(p,p),h=r.mul(p,f),l=r.sub(l,h),d=r.mul(p,u),d=r.add(d,d),new x(l,c,d=r.add(d,d))}add(e){y(e);let{X:t,Y:i,Z:n}=this,{X:a,Y:o,Z:l}=e,c=r.ZERO,d=r.ZERO,h=r.ZERO,u=s.a,p=r.mul(s.b,lZ),f=r.mul(t,a),g=r.mul(i,o),m=r.mul(n,l),w=r.add(t,i),b=r.add(a,o);w=r.mul(w,b),b=r.add(f,g),w=r.sub(w,b),b=r.add(t,n);let v=r.add(a,l);return b=r.mul(b,v),v=r.add(f,m),b=r.sub(b,v),v=r.add(i,n),c=r.add(o,l),v=r.mul(v,c),c=r.add(g,m),v=r.sub(v,c),h=r.mul(u,b),c=r.mul(p,m),h=r.add(c,h),c=r.sub(g,h),h=r.add(g,h),d=r.mul(c,h),g=r.add(f,f),g=r.add(g,f),m=r.mul(u,m),b=r.mul(p,b),g=r.add(g,m),m=r.sub(f,m),m=r.mul(u,m),b=r.add(b,m),f=r.mul(g,b),d=r.add(d,f),f=r.mul(v,b),c=r.mul(w,c),c=r.sub(c,f),f=r.mul(w,g),h=r.mul(v,h),new x(c,d,h=r.add(h,f))}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}multiply(e){let i,r,{endo:s}=t;if(!n.isValidNot0(e))throw Error("invalid scalar: out of range");let a=e=>_.cached(this,e,e=>ly(x,e));if(s){let{k1neg:t,k1:n,k2neg:o,k2:l}=b(e),{p:c,f:d}=a(n),{p:h,f:u}=a(l);r=d.add(u),i=E(s.beta,c,h,t,o)}else{let{p:t,f:n}=a(e);i=t,r=n}return ly(x,[i,r])[0]}multiplyUnsafe(e){let{endo:i}=t;if(!n.isValid(e))throw Error("invalid scalar: out of range");if(e===lq||this.is0())return x.ZERO;if(e===lz)return this;if(_.hasCache(this))return this.multiply(e);if(!i)return _.unsafe(this,e);{let{k1neg:t,k1:r,k2neg:n,k2:s}=b(e),{p1:a,p2:o}=function(e,t,i,r){let n=t,s=e.ZERO,a=e.ZERO;for(;i>lg||r>lg;)i&lm&&(s=s.add(n)),r&lm&&(a=a.add(n)),n=n.double(),i>>=lm,r>>=lm;return{p1:s,p2:a}}(x,this,r,s);return E(i.beta,a,o,t,n)}}multiplyAndAddUnsafe(e,t,i){let r=this.multiplyUnsafe(t).add(e.multiplyUnsafe(i));return r.is0()?void 0:r}toAffine(e){return v(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return a===lz||(e?e(x,this):_.unsafe(this,o).is0())}clearCofactor(){let{clearCofactor:e}=t;return a===lz?this:e?e(x,this):this.multiplyUnsafe(a)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}toBytes(e=!0){return oj(e,"isCompressed"),this.assertValidity(),h(x,this,e)}toHex(e=!0){return s0(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}
4614_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return ly(x,e)}static msm(e,t){return function(e,t,i,r){(function(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,i)=>{if(!(e instanceof t))throw Error("invalid point at index "+i)})})(i,e),function(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,i)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+i)})}(r,t);let n=i.length,s=r.length;if(n!==s)throw Error("arrays of points and scalars must have equal length");let a=e.ZERO,o=oJ(BigInt(n)),l=1;o>12?l=o-3:o>4?l=o-2:o>0&&(l=2);let c=oX(l),d=Array(Number(c)+1).fill(a),h=Math.floor((t.BITS-1)/l)*l,u=a;for(let e=h;e>=0;e-=l){d.fill(a);for(let t=0;t<s;t++){let n=Number(r[t]>>BigInt(e)&c);d[n]=d[n].add(i[t])}let t=a;for(let e=d.length-1,i=a;e>0;e--)i=i.add(d[e]),t=t.add(i);if(u=u.add(t),0!==e)for(let e=0;e<l;e++)u=u.double()}return u}(x,n,e,t)}static fromPrivateKey(e){return x.BASE.multiply(lG(n,e))}}x.BASE=new x(s.Gx,s.Gy,r.ONE),x.ZERO=new x(r.ZERO,r.ONE,r.ZERO),x.Fp=r,x.Fn=n;let A=n.BITS,_=new lI(x,t.endo?Math.ceil(A/2):A);return x.BASE.precompute(8),x}(i,r),n,s);return t=a.Point,Object.assign({},a,{ProjectivePoint:t,CURVE:Object.assign({},e,lh(t.Fn.ORDER,t.Fn.BITS))})})({...e,hash:t});return{...i(t),create:i}}let lQ={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},l0={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},l1={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},l2=lu(lQ.p),l3=lu(l0.p),l5=lu(l1.p),l4=lX({...lQ,Fp:l2,lowS:!1},aO);lX({...l0,Fp:l3,lowS:!1},aP),lX({...l1,Fp:l5,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},aR);let l6="base10",l8="base16",l9="base64pad",l7="base64url",ce="utf8";function ct(){return nM(s9(32),l8)}function ci(e){return nM(aO(nU(e,l8)),l8)}function cr(e){return nM(aO(nU(e,ce)),l8)}function cn(e){return Number(nM(e,l6))}function cs(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ca(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),i=(4-t.length%4)%4;return t+"=".repeat(i)}function co(e){if(2===cn(e.type))return nM(rU([e.type,e.sealed]),l9);if(1===cn(e.type)){if(typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");
4614return nM(rU([e.type,e.senderPublicKey,e.iv,e.sealed]),l9)}return nM(rU([e.type,e.iv,e.sealed]),l9)}function cl(e){let t=nU((e.encoding||l9)===l7?ca(e.encoded):e.encoded,l9),i=t.slice(0,1);if(1===cn(i)){let e=t.slice(1,33),r=t.slice(33,45);return{type:i,sealed:t.slice(45),iv:r,senderPublicKey:e}}if(2===cn(i))return{type:i,sealed:t.slice(1),iv:s9(12)};let r=t.slice(1,13);return{type:i,sealed:t.slice(13),iv:r}}function cc(e){let t=e?.type||0;if(1===t){if(typeof e?.senderPublicKey>"u")throw Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function cd(e){return 1===e.type&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function ch(e){return e?.relay||{protocol:"irn"}}function cu(e){let t=nD[e];if(typeof t>"u")throw Error(`Relay Protocol not supported: ${e}`);return t}var cp=Object.defineProperty,cf=Object.defineProperties,cg=Object.getOwnPropertyDescriptors,cm=Object.getOwnPropertySymbols,cw=Object.prototype.hasOwnProperty,cy=Object.prototype.propertyIsEnumerable,cb=(e,t,i)=>t in e?cp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,cv=(e,t)=>{for(var i in t||(t={}))cw.call(t,i)&&cb(e,i,t[i]);if(cm)for(var i of cm(t))cy.call(t,i)&&cb(e,i,t[i]);return e};function cC(e){var t;if(!e.includes("wc:")){let t=sy(e);null!=t&&t.includes("wc:")&&(e=t)}let i=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,i),s=e.substring(i+1,r).split("@"),a=Object.fromEntries(new URLSearchParams("u">typeof r?e.substring(r):"").entries()),o="string"==typeof a.methods?a.methods.split(","):void 0;return{protocol:n,topic:(t=s[0]).startsWith("//")?t.substring(2):t,version:parseInt(s[1],10),symKey:a.symKey,relay:function(e,t="-"){let i={},r="relay"+t;return Object.keys(e).forEach(t=>{if(t.startsWith(r)){let n=t.replace(r,""),s=e[t];i[n]=s}}),i}(a),methods:o,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function cE(e){let t=new URLSearchParams;return Object.entries(cv(cv(cf(cv({},function(e,t="-"){let i={};return Object.keys(e).forEach(r=>{e[r]&&(i["relay"+t+r]=e[r])}),i}(e.relay)),cg({symKey:e.symKey})),e.expiryTimestamp&&{expiryTimestamp:e.expiryTimestamp.toString()}),e.methods&&{methods:e.methods.join(",")})).sort(([e],[t])=>e.localeCompare(t)).forEach(([e,i])=>{void 0!==i&&t.append(e,String(i))}),`${e.protocol}:${e.topic}@${e.version}?${t}`}function cx(e,t,i){return`${e}?wc_ev=${i}&topic=${t}`}var cA=Object.defineProperty,c_=Object.defineProperties,cI=Object.getOwnPropertyDescriptors,cS=Object.getOwnPropertySymbols,cN=Object.prototype.hasOwnProperty,ck=Object.prototype.propertyIsEnumerable,cT=(e,t,i)=>t in e?cA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,cO=(e,t)=>{for(var i in t||(t={}))cN.call(t,i)&&cT(e,i,t[i]);if(cS)for(var i of cS(t))ck.call(t,i)&&cT(e,i,t[i]);return e},cR=(e,t)=>c_(e,cI(t));function cP(e){let t=[];return e.forEach(e=>{let[i,r]=e.split(":");t.push(`${i}:${r}`)}),t}function c$(e){let t=[];return Object.values(e).forEach(e=>{t.push(...cP(e.accounts))}),[...new Set(t)]}function cU(e){return e.includes(":")}function cM(e){return cU(e)?e.split(":")[0]:e}function cD(e){var t,i,r;let n={};if(!cB(e))return n;for(let[s,a]of Object.entries(e)){let e=cU(s)?[s]:a.chains,o=a.methods||[],l=a.events||[],c=cM(s);n[c]=cR(cO({},n[c]),{chains:su(e,null==(t=n[c])?void 0:t.chains),methods:su(o,null==(i=n[c])?void 0:i.methods),events:su(l,null==(r=n[c])?void 0:r.events)})}return n}function cL(e,t){var i;let r,n=(i=t=t.map(e=>e.replace("did:pkh:","")),r={},i?.forEach(e=>{var t;let[i,n]=e.split(":");r[i]||(r[i]={accounts:[],chains:[],events:[],methods:[]}),r[i].accounts.push(e),null==(t=r[i].chains)||t.push(`${i}:${n}`)}),r);for(let[t,i]of Object.entries(n))i.methods?i.methods=su(i.methods,e):i.methods=e,i.events=["chainChanged","accountsChanged"];return n}function cW(e,t){return!!Array.isArray(e)&&(!("u">typeof t)||!e.length||e.every(t))}function cB(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function cj(e){return typeof e>"u"}function cF(e,t){return!!(t&&cj(e))||"string"==typeof e&&!!e.trim().length}function cH(e,t){return!!(t&&cj(e))||"number"==typeof e&&!isNaN(e)}function cq(e){return!!(cF(e,!1)&&e.includes(":"))&&2===e.split(":").length}function cz(e){let t=!0;return cW(e)?e.length&&(t=e.every(e=>cF(e,!1))):t=!1,t}function cV(e,t){let i=null;
4614return Object.values(e).forEach(e=>{var r;let n;if(i)return;let s=(r=`${t}, namespace`,n=null,cz(e?.methods)?cz(e?.events)||(n=nV("UNSUPPORTED_EVENTS",`${r}, events should be an array of strings or empty array for no events`)):n=nV("UNSUPPORTED_METHODS",`${r}, methods should be an array of strings or empty array for no methods`),n);s&&(i=s)}),i}function cZ(e,t){let i=null;if(e&&cB(e)){let r,n=cV(e,t);n&&(i=n);let s=(r=null,Object.values(e).forEach(e=>{var i,n;let s;if(r)return;let a=(i=e?.accounts,n=`${t} namespace`,s=null,cW(i)?i.forEach(e=>{s||function(e){if(cF(e,!1)&&e.includes(":")){let t=e.split(":");if(3===t.length){let e=t[0]+":"+t[1];return!!t[2]&&cq(e)}}return!1}(e)||(s=nV("UNSUPPORTED_ACCOUNTS",`${n}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):s=nV("UNSUPPORTED_ACCOUNTS",`${n}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),s);a&&(r=a)}),r);s&&(i=s)}else i=nz("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return i}function cK(e){return cF(e.protocol,!0)}function cG(e){return"u">typeof e}function cY(e,t){return!(!cq(t)||!c$(e).includes(t))}function cJ(e,t,i){var r,n;let s,a,o=null,l=(s={},Object.keys(r=e).forEach(e=>{var t;e.includes(":")?s[e]=r[e]:null==(t=r[e].chains)||t.forEach(t=>{s[t]={methods:r[e].methods,events:r[e].events}})}),s),c=(a={},Object.keys(n=t).forEach(e=>{if(e.includes(":"))a[e]=n[e];else{let t=cP(n[e].accounts);t?.forEach(t=>{a[t]={accounts:n[e].accounts.filter(e=>e.includes(`${t}:`)),methods:n[e].methods,events:n[e].events}})}}),a),d=Object.keys(l),h=Object.keys(c),u=cX(Object.keys(e)),p=cX(Object.keys(t)),f=u.filter(e=>!p.includes(e));return f.length&&(o=nz("NON_CONFORMING_NAMESPACES",`${i} namespaces keys don't satisfy requiredNamespaces.
4615      Required: ${f.toString()}
4616      Received: ${Object.keys(t).toString()}`)),si(d,h)||(o=nz("NON_CONFORMING_NAMESPACES",`${i} namespaces chains don't satisfy required namespaces.
4617      Required: ${d.toString()}
4618      Approved: ${h.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(":")||o)return;let r=cP(t[e].accounts);r.includes(e)||(o=nz("NON_CONFORMING_NAMESPACES",`${i} namespaces accounts don't satisfy namespace accounts for ${e}
4619        Required: ${e}
4620        Approved: ${r.toString()}`))}),d.forEach(e=>{o||(si(l[e].methods,c[e].methods)?si(l[e].events,c[e].events)||(o=nz("NON_CONFORMING_NAMESPACES",`${i} namespaces events don't satisfy namespace events for ${e}`)):o=nz("NON_CONFORMING_NAMESPACES",`${i} namespaces methods don't satisfy namespace methods for ${e}`))}),o}function cX(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function cQ(){let e=n9();return new Promise(t=>{switch(e){case n5:t(n8()&&navigator?.onLine);break;case n2:t(c0());break;default:t(!0)}})}async function c0(){if(n6()&&"u">typeof global&&null!=global&&global.NetInfo){let e=await (null==global?void 0:global.NetInfo.fetch());return e?.isConnected}return!0}let c1={};class c2{static get(e){return c1[e]}static set(e,t){c1[e]=t}static delete(e){delete c1[e]}}function c3(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function c5({logger:e,name:t}){let i="string"==typeof e?(0,eo.D5)({opts:{level:e,name:t}}).logger:e;return i.level="string"==typeof e?e:e.level,i}let c4="INTERNAL_ERROR",c6="SERVER_ERROR",c8=[-32700,-32600,-32601,-32602,-32603],c9={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[c4]:{code:-32603,message:"Internal error"},[c6]:{code:-32e3,message:"Server error"}};function c7(e){return Object.keys(c9).includes(e)?c9[e]:c9[c6]}function de(e,t,i){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${i} RPC url at ${t}`):e}var dt=i(99405);
4620function di(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function dr(e=6){return BigInt(di(e))}function dn(e,t,i){return{id:i||di(),jsonrpc:"2.0",method:e,params:t}}function ds(e,t){return{id:e,jsonrpc:"2.0",result:t}}function da(e,t,i){var r,n,s,a;let o;return{id:e,jsonrpc:"2.0",error:(r=t,n=i,void 0===r?c7(c4):("string"==typeof r&&(r=Object.assign(Object.assign({},c7(c6)),{message:r})),void 0!==n&&(r.data=n),s=r.code,c8.includes(s)&&(a=r.code,r=(o=Object.values(c9).find(e=>e.code===a))||c9[c6]),r))}}class dl{}class dc extends dl{constructor(){super()}}class dd extends dc{constructor(e){super()}}function dh(e,t){let i=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==i&&new RegExp(t).test(i)}function du(e){return dh(e,"^https?:")}function dp(e){return dh(e,"^wss?:")}function df(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function dg(e){return df(e)&&"method"in e}function dm(e){return df(e)&&(dw(e)||dy(e))}function dw(e){return"result"in e}function dy(e){return"error"in e}class db extends dd{constructor(e){super(e),this.events=new N.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(dn(e.method,e.params||[],e.id||dr().toString()),t)}async requestStrict(e,t){return new Promise(async(i,r)=>{if(!this.connection.connected)try{await this.open()}catch(e){r(e)}this.events.on(`${e.id}`,e=>{dy(e)?r(e.error):i(e.result)});try{await this.connection.send(e,t)}catch(e){r(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),dm(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}let dv=e=>e.split("?")[0],dC="u">typeof WebSocket?WebSocket:"u">typeof i.g&&"u">typeof i.g.WebSocket?i.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:i(73636);class dE{constructor(e){if(this.url=e,this.events=new N.EventEmitter,this.registering=!1,!dp(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{typeof this.socket>"u"?t(Error("Connection already closed")):(this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close())})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(J(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!dp(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>
4620{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{let n=(0,dt.isReactNative)()?void 0:{rejectUnauthorized:!RegExp("wss?://localhost(:d{2,5})?").test(e)},s=new dC(e,[],n);"u">typeof WebSocket||"u">typeof i.g&&"u">typeof i.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket?s.onerror=e=>{r(this.emitError(e.error))}:s.on("error",e=>{r(this.emitError(e))}),s.onopen=()=>{this.onOpen(s),t(s)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?Y(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let i=this.parseError(t),r=da(e,i.message||i.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return de(e,dv(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${dv(this.url)}`));return this.events.emit("register_error",t),t}}var dx=i(49304).hp,dA=i(41463);let d_="core",dI=`wc@2:${d_}:`,dS={database:":memory:"},dN="client_ed25519_seed",dk=T.ONE_DAY,dT=T.SIX_HOURS,dO="wss://relay.walletconnect.org",dR="relayer_message",dP="relayer_message_ack",d$="relayer_connection_stalled",dU="relayer_publish",dM="payload",dD="connect",dL="disconnect",dW="error",dB="2.23.7",dj="link_mode",dF="relay",dH="inbound",dq="WALLETCONNECT_LINK_MODE_APPS",dz="subscription_created",dV="subscription_deleted",dZ=(T.FIVE_SECONDS,{wc_pairingDelete:{req:{ttl:T.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:T.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:T.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:T.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:T.ONE_DAY,prompt:!1,tag:0},res:{ttl:T.ONE_DAY,prompt:!1,tag:0}}}),dK="pairing_create",dG="pairing_delete",dY="history_created",dJ="history_updated",dX="history_deleted",dQ="expirer_created",d0="expirer_deleted",d1="expirer_expired",d2="https://verify.walletconnect.org",d3=`${d2}/v3`,d5=["https://verify.walletconnect.com",d2],d4="malformed_pairing_uri",d6="session_approve_started";var d8=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var i=new Uint8Array(256),r=0;r<i.length;r++)i[r]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),a=s.charCodeAt(0);if(255!==i[a])throw TypeError(s+" is ambiguous");i[a]=n}var o=e.length,l=e.charAt(0),c=Math.log(o)/Math.log(256),d=Math.log(256)/Math.log(o);function h(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var r=0,n=0;e[t]===l;)r++,t++;for(var s=(e.length-t)*c+1>>>0,a=new Uint8Array(s);e[t];){var d=i[e.charCodeAt(t)];if(255===d)return;for(var h=0,u=s-1;(0!==d||h<n)&&-1!==u;u--,h++)d+=o*a[u]>>>0,a[u]=d%256>>>0,d=d/256>>>0;if(0!==d)throw Error("Non-zero carry");n=h,t++}if(" "!==e[t]){for(var p=s-n;p!==s&&0===a[p];)p++;for(var f=new Uint8Array(r+(s-p)),g=r;p!==s;)f[g++]=a[p++];return f}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var i=0,r=0,n=0,s=t.length;n!==s&&0===t[n];)n++,i++;for(var a=(s-n)*d+1>>>0,c=new Uint8Array(a);n!==s;){for(var h=t[n],u=0,p=a-1;(0!==h||u<r)&&-1!==p;p--,u++)h+=256*c[p]>>>0,c[p]=h%o>>>0,h=h/o>>>0;if(0!==h)throw Error("Non-zero carry");r=u,n++}for(var f=a-r;f!==a&&0===c[f];)f++;for(var g=l.repeat(i);f<a;++f)g+=e.charAt(c[f]);return g},decodeUnsafe:h,decode:function(e){var i=h(e);if(i)return i;throw Error(`Non-${t} character`)}}};let d9=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")};class d7{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class he{constructor(e,t,i){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
4620 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return hi(this,e)}}class ht{constructor(e){this.decoders=e}or(e){return hi(this,e)}decode(e){let t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let hi=(e,t)=>new ht({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class hr{constructor(e,t,i,r){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=r,this.encoder=new d7(e,t,i),this.decoder=new he(e,t,r)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let hn=({name:e,prefix:t,encode:i,decode:r})=>new hr(e,t,i,r),hs=({prefix:e,name:t,alphabet:i})=>{let{encode:r,decode:n}=d8(i,t);return hn({prefix:e,name:t,encode:r,decode:e=>d9(n(e))})},ha=({name:e,prefix:t,bitsPerChar:i,alphabet:r})=>hn({prefix:t,name:e,encode:e=>((e,t,i)=>{let r="="===t[t.length-1],n=(1<<i)-1,s="",a=0,o=0;for(let r=0;r<e.length;++r)for(o=o<<8|e[r],a+=8;a>i;)a-=i,s+=t[n&o>>a];if(a&&(s+=t[n&o<<i-a]),r)for(;s.length*i&7;)s+="=";return s})(e,r,i),decode:t=>((e,t,i,r)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let s=e.length;for(;"="===e[s-1];)--s;let a=new Uint8Array(s*i/8|0),o=0,l=0,c=0;for(let t=0;t<s;++t){let s=n[e[t]];if(void 0===s)throw SyntaxError(`Non-${r} character`);l=l<<i|s,(o+=i)>=8&&(o-=8,a[c++]=255&l>>o)}if(o>=i||255&l<<8-o)throw SyntaxError("Unexpected end of data");return a})(t,r,i,e)});var ho=Object.freeze({__proto__:null,identity:hn({prefix:"\0",name:"identity",encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)})}),hl=Object.freeze({__proto__:null,base2:ha({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),hc=Object.freeze({__proto__:null,base8:ha({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),hd=Object.freeze({__proto__:null,base10:hs({prefix:"9",name:"base10",alphabet:"0123456789"})}),hh=Object.freeze({__proto__:null,base16:ha({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:ha({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}),hu=Object.freeze({__proto__:null,base32:ha({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper:ha({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad:ha({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper:ha({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex:ha({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper:ha({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad:ha({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:ha({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:ha({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),hp=Object.freeze({__proto__:null,base36:hs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:hs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),hf=Object.freeze({__proto__:null,base58btc:hs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:hs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}),hg=Object.freeze({__proto__:null,base64:ha({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad:ha({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:ha({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:ha({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let hm=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),hw=hm.reduce((e,t,i)=>(e[i]=t,e),[]),hy=hm.reduce((e,t,i)=>(e[t.codePointAt(0)]=i,e),[]);var hb=Object.freeze({__proto__:null,base256emoji:hn({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
4620e+=hw[t],"")},decode:function(e){let t=[];for(let i of e){let e=hy[i.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${i}`);t.push(e)}return new Uint8Array(t)}})});function hv(e,t,i){t=t||[],i=i||0;for(var r=i;e>=0x80000000;)t[i++]=255&e|128,e/=128;for(;-128&e;)t[i++]=255&e|128,e>>>=7;return t[i]=0|e,hv.bytes=i-r+1,t}var hC=function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10};let hE=(e,t,i=0)=>(hv(e,t,i),t),hx=(e,t)=>{let i=t.byteLength,r=hC(e),n=r+hC(i),s=new Uint8Array(n+i);return hE(e,s,0),hE(i,s,r),s.set(t,n),new hA(e,i,t,s)};class hA{constructor(e,t,i,r){this.code=e,this.size=t,this.digest=i,this.bytes=r}}let h_=({name:e,code:t,encode:i})=>new hI(e,t,i);class hI{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?hx(this.code,t):t.then(e=>hx(this.code,e))}throw Error("Unknown type, must be binary type")}}let hS=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var hN=Object.freeze({__proto__:null,sha256:h_({name:"sha2-256",code:18,encode:hS("SHA-256")}),sha512:h_({name:"sha2-512",code:19,encode:hS("SHA-512")})}),hk=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:d9,digest:e=>hx(0,d9(e))}});new TextEncoder,new TextDecoder;let hT={...ho,...hl,...hc,...hd,...hh,...hu,...hp,...hf,...hg,...hb};function hO(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function hR(e,t,i,r){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:i},decoder:{decode:r}}}({...hN,...hk});let hP=hR("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),h$=hR("ascii","a",e=>{let t="a";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return t},e=>{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?hO(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}((e=e.substring(1)).length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}),hU={utf8:hP,"utf-8":hP,hex:hT.base16,latin1:h$,ascii:h$,binary:h$,...hT};var hM=Object.defineProperty,hD=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?hM(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class hL{constructor(e,t){this.core=e,this.logger=t,hD(this,"keychain",new Map),hD(this,"name","keychain"),hD(this,"version","0.3"),hD(this,"initialized",!1),hD(this,"storagePrefix",dI),hD(this,"init",async()=>{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}}),hD(this,"has",e=>(this.isInitialized(),this.keychain.has(e))),hD(this,"set",async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()}),hD(this,"get",e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=nz("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}),hD(this,"del",async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()}),this.core=e,this.logger=(0,eo.U5)(t,this.name)}get context(){return(0,eo.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,sr(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?sn(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}}var hW=Object.defineProperty,hB=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?hW(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class hj{constructor(e,t,i){this.core=e,this.logger=t,hB(this,"name","crypto"),hB(this,"keychain"),hB(this,"randomSessionIdentifier",ct()),hB(this,"initialized",!1),hB(this,"clientId"),hB(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),hB(this,"hasKeys",e=>(this.isInitialized(),this.keychain.has(e))),hB(this,"getClientId",async()=>
4620{if(this.isInitialized(),this.clientId)return this.clientId;let e=iP(iU(await this.getClientSeed()).publicKey);return this.clientId=e,e}),hB(this,"generateKeyPair",()=>{let e,t;this.isInitialized();let i=(e=lL.utils.randomPrivateKey(),t=lL.getPublicKey(e),{privateKey:nM(e,l8),publicKey:nM(t,l8)});return this.setPrivateKey(i.publicKey,i.privateKey)}),hB(this,"signJWT",async e=>{this.isInitialized();let t=iU(await this.getClientSeed()),i=this.randomSessionIdentifier;return await iM(i,e,dk,t)}),hB(this,"generateSharedKey",(e,t,i)=>{var r,n,s;let a;this.isInitialized();let o=(r=this.getPrivateKey(e),nM((a=lL.getSharedSecret(nU(r,l8),nU(t,l8)),n=void 0,function(e,t,i,r=32){sj(e),sW(r);let n=e.outputLen;if(r>255*n)throw Error("Length should be <= 255*HashLen");let s=Math.ceil(r/n);void 0===i&&(i=oL);let a=new Uint8Array(s*n),o=oM.create(e,t),l=o._cloneInto(),c=new Uint8Array(o.outputLen);for(let e=0;e<s;e++)oD[0]=e+1,l.update(0===e?oL:c).update(i).update(oD).digestInto(c),a.set(c,n*e),o._cloneInto(l);return o.destroy(),l.destroy(),sz(c,oD),a.slice(0,r)}(aO,(s=void 0,sj(aO),void 0===s&&(s=new Uint8Array(aO.outputLen)),oM(aO,s5(s),s5(a))),n,32)),l8));return this.setSymKey(o,i)}),hB(this,"setSymKey",async(e,t)=>{this.isInitialized();let i=t||ci(e);return await this.keychain.set(i,e),i}),hB(this,"deleteKeyPair",async e=>{this.isInitialized(),await this.keychain.del(e)}),hB(this,"deleteSymKey",async e=>{this.isInitialized(),await this.keychain.del(e)}),hB(this,"encode",async(e,t,i)=>{this.isInitialized();let r=cc(i),n=J(t);if(2===r.type){var s;let e,t,r;return s=i?.encoding,e=nU("2",l6),t=s9(12),r=co({type:e,sealed:nU(n,ce),iv:t}),s===l7?cs(r):r}if(cd(r)){let t=r.senderPublicKey,i=r.receiverPublicKey;e=await this.generateSharedKey(t,i)}let a=this.getSymKey(e),{type:o,senderPublicKey:l}=r;return function(e){var t;let i=(t="u">typeof e.type?e.type:0,nU(`${t}`,l6));if(1===cn(i)&&typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");let r="u">typeof e.senderPublicKey?nU(e.senderPublicKey,l8):void 0,n="u">typeof e.iv?nU(e.iv,l8):s9(12),s=co({type:i,sealed:o$(nU(e.symKey,l8),n).encrypt(nU(e.message,ce)),iv:n,senderPublicKey:r});return e.encoding===l7?cs(s):s}({type:o,symKey:a,message:n,senderPublicKey:l,encoding:i?.encoding})}),hB(this,"decode",async(e,t,i)=>{let r;this.isInitialized();let n=cc({type:cn((r=cl({encoded:t,encoding:i?.encoding})).type),senderPublicKey:"u">typeof r.senderPublicKey?nM(r.senderPublicKey,l8):void 0,receiverPublicKey:i?.receiverPublicKey});if(2===n.type)return Y(function(e,t){let{sealed:i}=cl({encoded:e,encoding:t});return nM(i,ce)}(t,i?.encoding));if(cd(n)){let t=n.receiverPublicKey,i=n.senderPublicKey;e=await this.generateSharedKey(t,i)}try{let r=this.getSymKey(e),n=function(e){let t=nU(e.symKey,l8),{sealed:i,iv:r}=cl({encoded:e.encoded,encoding:e.encoding}),n=o$(t,r).decrypt(i);if(null===n)throw Error("Failed to decrypt");return nM(n,ce)}({symKey:r,encoded:t,encoding:i?.encoding});return Y(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}}),hB(this,"getPayloadType",(e,t=l9)=>cn(cl({encoded:e,encoding:t}).type)),hB(this,"getPayloadSenderPublicKey",(e,t=l9)=>{let i=cl({encoded:e,encoding:t});return i.senderPublicKey?nM(i.senderPublicKey,l8):void 0}),this.core=e,this.logger=(0,eo.U5)(t,this.name),this.keychain=i||new hL(this.core,this.logger)}get context(){return(0,eo.oI)(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(dN)}catch{e=ct(),await this.keychain.set(dN,e)}return function(e,t="utf8"){let i=hU[t];if(!i)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?hO(globalThis.Buffer.from(e,"utf-8")):i.decoder.decode(`${i.prefix}${e}`)}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}}var hF=Object.defineProperty,hH=Object.defineProperties,hq=Object.getOwnPropertyDescriptors,hz=Object.getOwnPropertySymbols,hV=Object.prototype.hasOwnProperty,hZ=Object.prototype.propertyIsEnumerable,hK=(e,t,i)=>t in e?hF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,hG=(e,t,i)=>hK(e,"symbol"!=typeof t?t+"":t,i);class hY extends ep{constructor(e,t){super(e,t),this.logger=e,this.core=t,hG(this,"messages",new Map),hG(this,"messagesWithoutClientAck",new Map),hG(this,"name","messages"),hG(this,"version","0.3"),hG(this,"initialized",!1),hG(this,"storagePrefix",dI),hG(this,"init",async()=>
4620{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e);let t=await this.getRelayerMessagesWithoutClientAck();"u">typeof t&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}}),hG(this,"set",async(e,t,i)=>{this.isInitialized();let r=cr(t),n=this.messages.get(e);if(typeof n>"u"&&(n={}),"u">typeof n[r])return r;if(n[r]=t,this.messages.set(e,n),i===dH){let i=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,hH(((e,t)=>{for(var i in t||(t={}))hV.call(t,i)&&hK(e,i,t[i]);if(hz)for(var i of hz(t))hZ.call(t,i)&&hK(e,i,t[i]);return e})({},i),hq({[r]:t})))}return await this.persist(),r}),hG(this,"get",e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t}),hG(this,"getWithoutAck",e=>{this.isInitialized();let t={};for(let i of e){let e=this.messagesWithoutClientAck.get(i)||{};t[i]=Object.values(e)}return t}),hG(this,"has",(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[cr(t)])),hG(this,"ack",async(e,t)=>{this.isInitialized();let i=this.messagesWithoutClientAck.get(e);if(typeof i>"u")return;let r=cr(t);delete i[r],0===Object.keys(i).length?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,i),await this.persist()}),hG(this,"del",async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()}),this.logger=(0,eo.U5)(e,this.name),this.core=t}get context(){return(0,eo.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,sr(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,sr(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?sn(e):void 0}async getRelayerMessagesWithoutClientAck(){let e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return"u">typeof e?sn(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}}var hJ=Object.defineProperty,hX=Object.defineProperties,hQ=Object.getOwnPropertyDescriptors,h0=Object.getOwnPropertySymbols,h1=Object.prototype.hasOwnProperty,h2=Object.prototype.propertyIsEnumerable,h3=(e,t,i)=>t in e?hJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,h5=(e,t)=>{for(var i in t||(t={}))h1.call(t,i)&&h3(e,i,t[i]);if(h0)for(var i of h0(t))h2.call(t,i)&&h3(e,i,t[i]);return e},h4=(e,t,i)=>h3(e,"symbol"!=typeof t?t+"":t,i);class h6 extends ef{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,h4(this,"events",new N.EventEmitter),h4(this,"name","publisher"),h4(this,"queue",new Map),h4(this,"publishTimeout",(0,T.toMiliseconds)(T.ONE_MINUTE)),h4(this,"initialPublishTimeout",(0,T.toMiliseconds)(15*T.ONE_SECOND)),h4(this,"needsTransportRestart",!1),h4(this,"publish",async(e,t,i)=>{var r,n,s,a,o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:i}});let l=i?.ttl||dT,c=i?.prompt||!1,d=i?.tag||0,h=i?.id||dr().toString(),u=cu(ch().protocol),p={id:h,method:i?.publishMethod||u.publish,params:h5({topic:e,message:t,ttl:l,prompt:c,tag:d,attestation:i?.attestation},i?.tvf)},f=`Failed to publish payload, please try again. id:${h} tag:${d}`;try{cj(null==(r=p.params)?void 0:r.prompt)&&(null==(n=p.params)||delete n.prompt),cj(null==(s=p.params)?void 0:s.tag)&&(null==(a=p.params)||delete a.tag);let o=new Promise(async e=>{let t=({id:i})=>{var r;(null==(r=p.id)?void 0:r.toString())===i.toString()&&(this.removeRequestFromQueue(i),this.relayer.events.removeListener(dU,t),e())};this.relayer.events.on(dU,t);let r=sa(new Promise((e,t)=>
4620{this.rpcPublish(p,i).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${h} tag:${d}`);try{await r,this.events.removeListener(dU,t)}catch(e){this.queue.set(h,{request:p,opts:i,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:h,topic:e,message:t,opts:i}}),await sa(o,this.publishTimeout,f)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(o=i?.internal)&&o.throwOnFailedPublish)throw e}finally{this.queue.delete(h)}}),h4(this,"publishCustom",async e=>{var t,i,r,n,s;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:e});let{payload:a,opts:o={}}=e,{attestation:l,tvf:c,publishMethod:d,prompt:h,tag:u,ttl:p=T.FIVE_MINUTES}=o,f=o.id||dr().toString(),g=cu(ch().protocol),m=d||g.publish,w={id:f,method:m,params:h5(hX(h5({},a),hQ({ttl:p,prompt:h,tag:u,attestation:l})),c)},y=`Failed to publish custom payload, please try again. id:${f} tag:${u}`;try{cj(null==(t=w.params)?void 0:t.prompt)&&(null==(i=w.params)||delete i.prompt),cj(null==(r=w.params)?void 0:r.tag)&&(null==(n=w.params)||delete n.tag);let e=new Promise(async e=>{let t=({id:i})=>{var r;(null==(r=w.id)?void 0:r.toString())===i.toString()&&(this.removeRequestFromQueue(i),this.relayer.events.removeListener(dU,t),e())};this.relayer.events.on(dU,t);let i=sa(new Promise((e,t)=>{this.rpcPublish(w,o).then(e).catch(e=>{this.logger.warn(e,e?.message),t(e)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${m} id:${f} tag:${u}`);try{await i,this.events.removeListener(dU,t)}catch(e){this.queue.set(f,{request:w,opts:o,attempt:1}),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,payload:a,opts:o}}),await sa(e,this.publishTimeout,y)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(s=o?.internal)&&s.throwOnFailedPublish)throw e}finally{this.queue.delete(f)}}),h4(this,"on",(e,t)=>{this.events.on(e,t)}),h4(this,"once",(e,t)=>{this.events.once(e,t)}),h4(this,"off",(e,t)=>{this.events.off(e,t)}),h4(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.relayer=e,this.logger=(0,eo.U5)(t,this.name),this.registerEventListeners()}get context(){return(0,eo.oI)(this.logger)}async rpcPublish(e,t){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});let i=await this.relayer.request(e);return this.relayer.events.emit(dU,h5(h5({},e),t)),this.logger.debug("Successfully Published Payload"),i}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{var i;let r=e.attempt+1;this.queue.set(t,hX(h5({},e),hQ({attempt:r}))),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${null==(i=e.request.params)?void 0:i.tag}, attempt: ${r}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on($,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(d$);return}this.checkQueue()}),this.relayer.on(dP,e=>{this.removeRequestFromQueue(e.id.toString())})}}var h8=Object.defineProperty,h9=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?h8(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class h7{constructor(){h9(this,"map",new Map),h9(this,"set",(e,t)=>{let i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])}),h9(this,"get",e=>this.map.get(e)||[]),h9(this,"exists",(e,t)=>this.get(e).includes(t)),h9(this,"delete",(e,t)=>{if(typeof t>"u")return void this.map.delete(e);if(!this.map.has(e))return;let i=this.get(e);if(!this.exists(e,t))return;let r=i.filter(e=>e!==t);r.length?this.map.set(e,r):this.map.delete(e)}),h9(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var ue=Object.defineProperty,ut=Object.defineProperties,ui=Object.getOwnPropertyDescriptors,ur=Object.getOwnPropertySymbols,un=Object.prototype.hasOwnProperty,us=Object.prototype.propertyIsEnumerable,ua=(e,t,i)=>t in e?ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,uo=(e,t)=>{for(var i in t||(t={}))un.call(t,i)&&ua(e,i,t[i]);if(ur)for(var i of ur(t))us.call(t,i)&&ua(e,i,t[i]);return e},ul=(e,t,i)=>ua(e,"symbol"!=typeof t?t+"":t,i);class uc extends ew{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,ul(this,"subscriptions",new Map),ul(this,"topicMap",new h7),ul(this,"events",new N.EventEmitter),ul(this,"name","subscription"),ul(this,"version","0.3"),ul(this,"pending",new Map),ul(this,"cac
4620hed",[]),ul(this,"initialized",!1),ul(this,"storagePrefix",dI),ul(this,"subscribeTimeout",(0,T.toMiliseconds)(T.ONE_MINUTE)),ul(this,"initialSubscribeTimeout",(0,T.toMiliseconds)(15*T.ONE_SECOND)),ul(this,"clientId"),ul(this,"batchSubscribeTopicsLimit",500),ul(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),ul(this,"subscribe",async(e,t)=>{var i;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let r=ch(t),n={topic:e,relay:r,transportType:t?.transportType};null!=(i=t?.internal)&&i.skipSubscribe||this.pending.set(e,n);let s=await this.rpcSubscribe(e,r,t);return"string"==typeof s&&(this.onSubscribe(s,n),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),s}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}}),ul(this,"unsubscribe",async(e,t)=>{this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)}),ul(this,"isSubscribed",e=>new Promise(t=>{t(this.topicMap.topics.includes(e))})),ul(this,"isKnownTopic",e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))})),ul(this,"on",(e,t)=>{this.events.on(e,t)}),ul(this,"once",(e,t)=>{this.events.once(e,t)}),ul(this,"off",(e,t)=>{this.events.off(e,t)}),ul(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),ul(this,"start",async()=>{await this.onConnect()}),ul(this,"stop",async()=>{await this.onDisconnect()}),ul(this,"restart",async()=>{await this.restore(),await this.onRestart()}),ul(this,"checkPending",async()=>{if(0===this.pending.size&&(!this.initialized||!this.relayer.connected))return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}),ul(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on($,async()=>{await this.checkPending()}),this.events.on(dz,async e=>{this.logger.info(`Emitting ${dz}`),this.logger.debug({type:"event",event:dz,data:e}),await this.persist()}),this.events.on(dV,async e=>{this.logger.info(`Emitting ${dV}`),this.logger.debug({type:"event",event:dV,data:e}),await this.persist()})}),this.relayer=e,this.logger=(0,eo.U5)(t,this.name),this.clientId=""}get context(){return(0,eo.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let i=this.topicMap.get(e);await Promise.all(i.map(async i=>await this.unsubscribeById(e,i,t)))}async unsubscribeById(e,t,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}});try{let r=ch(i);await this.restartToComplete({topic:e,id:t,relay:r}),await this.rpcUnsubscribe(e,t,r);let n=nV("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,n),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,i){var r,n;
4620let s=await this.getSubscriptionId(e);if(null!=(r=i?.internal)&&r.skipSubscribe)return s;i&&i?.transportType!==dF||await this.restartToComplete({topic:e,id:e,relay:t});let a={method:cu(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a});let o=null==(n=i?.internal)?void 0:n.throwOnFailedPublish;try{if(i?.transportType===dj)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(a).catch(e=>this.logger.warn(e))},(0,T.toMiliseconds)(T.ONE_SECOND)),s;let t=new Promise(async t=>{let i=r=>{r.topic===e&&(this.events.removeListener(dz,i),t(r.id))};this.events.on(dz,i);try{let r=await sa(new Promise((e,t)=>{this.relayer.request(a).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(dz,i),t(r)}catch{}}),r=await sa(t,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!r&&o)throw Error(`Subscribing to ${e} failed, please try again`);return r?s:null}catch(e){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(d$),o)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return!0;let t={method:cu(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{return await sa(new Promise((e,i)=>{this.relayer.request(t).then(e).catch(e=>{this.logger.warn(e),i(e)})}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again"),!0}catch{return this.relayer.events.emit(d$),!1}}async rpcBatchFetchMessages(e){let t;if(!e.length)return;let i={method:cu(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{t=await await sa(new Promise((e,t)=>{this.relayer.request(i).catch(e=>{this.logger.warn(e),t(e)}).then(e)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(d$)}return t}rpcUnsubscribe(e,t,i){let r={method:cu(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r}),this.relayer.request(r)}onSubscribe(e,t){this.setSubscription(e,ut(uo({},t),ui({id:e}))),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,uo({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,uo({},t)),this.topicMap.set(t.topic,e),this.events.emit(dz,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=nz("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(dV,ut(uo({},i),ui({reason:t})))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit("subscription_sync")}async onRestart(){if(this.cached.length){let e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let i=0;i<t;i++){let t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit("subscription_resubscribed")}
4620async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(e=>{var t;return e.topic===(null==(t=this.subscriptions.get(e.id))?void 0:t.topic)})){let{message:e}=nz("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(e.length){if(!await this.rpcBatchSubscribe(e)){this.logger.warn(`Batch subscribe failed for ${e.length} topics, adding to pending for retry`),e.forEach(e=>{this.pending.set(e.topic,e)});return}this.onBatchSubscribe(await Promise.all(e.map(async e=>ut(uo({},e),ui({id:await this.getSubscriptionId(e.topic)})))))}}async batchFetchMessages(e){var t;if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let i=await this.rpcBatchFetchMessages(e);i&&i.messages&&(await (t=(0,T.toMiliseconds)(T.ONE_SECOND),new Promise(e=>setTimeout(e,t))),await this.relayer.handleBatchMessageEvents(i.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(e){this.relayer.connected||this.relayer.connecting||(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return cr(e+await this.getClientId())}}var ud=Object.defineProperty,uh=Object.getOwnPropertySymbols,uu=Object.prototype.hasOwnProperty,up=Object.prototype.propertyIsEnumerable,uf=(e,t,i)=>t in e?ud(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,ug=(e,t)=>{for(var i in t||(t={}))uu.call(t,i)&&uf(e,i,t[i]);if(uh)for(var i of uh(t))up.call(t,i)&&uf(e,i,t[i]);return e},um=(e,t,i)=>uf(e,"symbol"!=typeof t?t+"":t,i);class uw extends eg{constructor(e){var t;super(e),um(this,"protocol","wc"),um(this,"version",2),um(this,"core"),um(this,"logger"),um(this,"events",new N.EventEmitter),um(this,"provider"),um(this,"messages"),um(this,"subscriber"),um(this,"publisher"),um(this,"name","relayer"),um(this,"transportExplicitlyClosed",!1),um(this,"initialized",!1),um(this,"connectionAttemptInProgress",!1),um(this,"relayUrl"),um(this,"projectId"),um(this,"packageName"),um(this,"bundleId"),um(this,"hasExperiencedNetworkDisruption",!1),um(this,"pingTimeout"),um(this,"heartBeatTimeout",(0,T.toMiliseconds)(T.THIRTY_SECONDS+T.FIVE_SECONDS)),um(this,"reconnectTimeout"),um(this,"connectPromise"),um(this,"reconnectInProgress",!1),um(this,"requestsInFlight",[]),um(this,"connectTimeout",(0,T.toMiliseconds)(15*T.ONE_SECOND)),um(this,"stalledRestartInProgress",!1),um(this,"stalledRestartTimeout"),um(this,"stalledRestartBackoff",0),um(this,"stalledRestartBaseInterval",(0,T.toMiliseconds)(2*T.ONE_SECOND)),um(this,"stalledRestartMaxInterval",(0,T.toMiliseconds)(T.THIRTY_SECONDS)),um(this,"request",async e=>{var t,i;this.logger.debug("Publishing Request Payload");let r=e.id||dr().toString();await this.toEstablishConnection();try{this.logger.trace({id:r,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - publishing...");let n=`${r}:${(null==(i=e.params)?void 0:i.tag)||""}`;this.requestsInFlight.push(n);let s=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==n),s}catch(e){throw this.logger.debug(`Failed to Publish Request: ${r}`),e}}),um(this,"resetPingTimeout",()=>{n4()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,i,r;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),null==(r=null==(i=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:i.terminate)||r.call(i)}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))}),um(this,"onPayloadHandler",e=>{this.onProviderPayload(e),this.resetPingTimeout()}),um(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected \uD83D\uDEDC"),this.startPingTimeout(),this.events.emit("relayer_connect")}),um(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected \uD83D\uDED1"),this.requestsInFlight=[],this.onProviderDisconnect()}),um(this,"onProviderErrorHandler",e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit("relayer_error",e),this.logger.fatal("Fatal socket error received, closing transport"),this.transportExplicitlyClosed=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1,this.transportClose().catch(e=>this.logger.warn(e))}),um(this,"registerProviderListeners",()=>{this.provider.on(dM,this.onPayloadHandler),this.provider.on(dD,this.onConnectHandler),this.provider.on(dL,this.onDisconnectHandler),this.provider.on(dW,this.onProviderErrorHandler)}),this.core=e.core,this.logger=c5({logger:null!=(t=e.logger)?t:"error",name:this.name}),this.messages=new hY(this.logger,e.core),this.subscriber=new uc(this,this.logger),this.publisher=new h6(this,this.logger),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||dO,n6()&&"u">typeof global&&"u">typeof(null==global?void 0:global.Platform)&&(null==global?void 0:global.Platform.OS)==="android"?this.packageName=n7():n6()&&"u">typeof global&&"u">typeof(null==global?void 0:global.Platform)&&(null==global?void 0:global.Platform.OS)==="ios"&&(this.bundleId=n7()),this.provider={}}
4620async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e?.message))}get context(){return(0,eo.oI)(this.logger)}get connected(){var e,t,i;return(null==(i=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:i.readyState)===1}get connecting(){var e,t,i;return(null==(i=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:i.readyState)===0||void 0!==this.connectPromise}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:dF},"outbound")}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,t){var i,r,n;this.isInitialized(),null!=t&&t.transportType&&t?.transportType!=="relay"||await this.toEstablishConnection();let s=typeof(null==(i=t?.internal)?void 0:i.throwOnFailedPublish)>"u"||(null==(r=t?.internal)?void 0:r.throwOnFailedPublish),a=(null==(n=this.subscriber.topicMap.get(e))?void 0:n[0])||"",o,l=t=>{t.topic===e&&(this.subscriber.off(dz,l),o())};return await Promise.all([new Promise(e=>{o=e,this.subscriber.on(dz,l)}),new Promise(async(i,r)=>{a=await this.subscriber.subscribe(e,ug({internal:{throwOnFailedPublish:s}},t)).catch(e=>{s&&r(e)})||a,i()})]),a}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await sa(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,clearTimeout(this.stalledRestartTimeout),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,await this.resetTransport()}async transportOpen(e){if(!this.subscriber.hasAnyTopics)return void this.logger.info("Starting WS connection skipped because the client has no topics to work with.");if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(t,i)=>{await this.connect(e).then(t).catch(i).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.resetTransport(),await this.transportOpen())}async resetTransport(){this.reconnectInProgress=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,await this.transportDisconnect(),await this.subscriber.stop(),this.reconnectInProgress=!1}async confirmOnlineStateOrThrow(){if(!await cQ())throw Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0)return void this.logger.trace("Batch message events is empty. Ignoring...");let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);for(let e of(this.logger.debug(`Batch of ${t.length} message events sorted`),t))try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,"Error while processing batch message event: "+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:i}=e;if(!t.sessionExists){let e=sc(T.FIVE_MINUTES);await this.core.pairing.pairings.set(i,{topic:i,expiry:e,relay:{protocol:"irn"},active:!1})}this.events.emit(dR,e),await this.recordMessageEvent(e,dH)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise(async(e,t)=>{let i=()=>
4620{t(Error("Connection interrupted while trying to connect"))};this.provider.once(dL,i),await sa(new Promise((e,t)=>{this.provider.connect().then(e).catch(t)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{this.provider.off(dL,i),clearTimeout(this.reconnectTimeout)}),await new Promise(async(e,i)=>{let r=()=>{t(Error("Connection interrupted while trying to subscribe"))};this.provider.once(dL,r),await this.subscriber.start().then(e).catch(i).finally(()=>{this.provider.off(dL,r)})}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){await this.subscriber.stop(),this.logger.warn({},e.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,(0,T.toMiliseconds)(+t))),t++}}startPingTimeout(){var e,t,i,r,n;if(n4())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(n=null==(r=null==(i=this.provider)?void 0:i.connection)?void 0:r.socket)||n.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new db(new dE(function({protocol:e,version:t,relayUrl:i,sdkVersion:r,auth:n,projectId:s,useOnCloseEvent:a,bundleId:o,packageName:l}){var c,d;let h,u=i.split("?"),p=st(e,t,r),f=(c=u[1]||"",d={auth:n,ua:p,projectId:s,useOnCloseEvent:a||void 0,packageName:l||void 0,bundleId:o||void 0},h=new URLSearchParams(c),Object.entries(d).sort(([e],[t])=>e.localeCompare(t)).forEach(([e,t])=>{null!=t&&h.set(e,String(t))}),h.toString());return u[0]+"?"+f}({sdkVersion:dB,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){let{topic:i,message:r}=e;await this.messages.set(i,r,t)}async shouldIgnoreMessageEvent(e){let{topic:t,message:i}=e;if(!i||0===i.length)return this.logger.warn(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;let r=this.messages.has(t,i);return r&&this.logger.warn(`Ignoring duplicate message: ${i}`),r}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),dg(e)){if(!e.method.endsWith("_subscription"))return;let t=e.params,{topic:i,message:r,publishedAt:n,attestation:s}=t.data,a={topic:i,message:r,publishedAt:n,transportType:dF,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(ug({type:"event",event:t.id},a)),this.events.emit(t.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else dm(e)&&this.events.emit(dP,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,dH),this.events.emit(dR,e))}async acknowledgePayload(e){let t=ds(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(dM,this.onPayloadHandler),this.provider.off(dD,this.onConnectHandler),this.provider.off(dL,this.onDisconnectHandler),this.provider.off(dW,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await cQ();(function(e){var t,i;switch(n9()){case n5:t=e,!n6()&&n8()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)));break;case n2:i=e,n6()&&"u">typeof global&&null!=global&&global.NetInfo&&global?.NetInfo.addEventListener(e=>i(e?.isConnected))}})(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on($,async()=>{var e;if(!this.transportExplicitlyClosed&&!this.connected&&(!(n8()&&(0,iZ.getDocument)())||
4620(null==(e=(0,iZ.getDocument)())?void 0:e.visibilityState)==="visible"))try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}}),this.events.on(d$,()=>{if(this.transportExplicitlyClosed||this.stalledRestartInProgress)return;this.stalledRestartInProgress=!0;let e=0===this.stalledRestartBackoff?0:Math.min(Math.pow(2,this.stalledRestartBackoff-1)*this.stalledRestartBaseInterval,this.stalledRestartMaxInterval);this.stalledRestartBackoff++,this.logger.warn(`Connection stalled, restarting transport${e?` in ${e}ms`:""}...`),this.stalledRestartTimeout=setTimeout(async()=>{try{if(this.transportExplicitlyClosed)return;await this.restartTransport()}catch(e){this.logger.error(e,e?.message)}finally{this.stalledRestartInProgress=!1}},e)})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit("relayer_disconnect"),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,T.toMiliseconds)(.1)))))}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise)return void await this.connectPromise;await this.connect()}}}function uy(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function ub(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let uv="[object Arguments]",uC="[object Object]";function uE(e){if(!e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function ux(){}var uA=Object.defineProperty,u_=Object.getOwnPropertySymbols,uI=Object.prototype.hasOwnProperty,uS=Object.prototype.propertyIsEnumerable,uN=(e,t,i)=>t in e?uA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,uk=(e,t)=>{for(var i in t||(t={}))uI.call(t,i)&&uN(e,i,t[i]);if(u_)for(var i of u_(t))uS.call(t,i)&&uN(e,i,t[i]);return e},uT=(e,t,i)=>uN(e,"symbol"!=typeof t?t+"":t,i);class uO extends em{constructor(e,t,i,r=dI,n){super(e,t,i,r),this.core=e,this.logger=t,this.name=i,uT(this,"map",new Map),uT(this,"version","0.3"),uT(this,"cached",[]),uT(this,"initialized",!1),uT(this,"getKey"),uT(this,"storagePrefix",dI),uT(this,"recentlyDeleted",[]),uT(this,"recentlyDeletedLimit",200),uT(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{var t;this.getKey&&null!==e&&!cj(e)?this.map.set(this.getKey(e),e):(null==(t=e?.proposer)?void 0:t.publicKey)?this.map.set(e.id,e):e?.topic&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)}),uT(this,"set",async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())}),uT(this,"get",e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e))),uT(this,"getAll",e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(i=>{var r;return r=t[i],function e(t,i,r,n,s,a,o){let l=o(t,i,r,n,s,a);if(void 0!==l)return l;if(typeof t==typeof i)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return t===i;case"number":return t===i||Object.is(t,i)}return function t(i,r,n,s){if(Object.is(i,r))return!0;let a=ub(i),o=ub(r);if(a===uv&&(a=uC),o===uv&&(o=uC),a!==o)return!1;switch(a){case"[object String]":return i.toString()===r.toString();case"[object Number]":{let e=i.valueOf(),t=r.valueOf();return e===t||Number.isNaN(e)&&Number.isNaN(t)}case"[object Boolean]":case"[object Date]":case"[object Symbol]":return Object.is(i.valueOf(),r.valueOf());case"[object RegExp]":return i.source===r.source&&i.flags===r.flags;case"[object Function]":return i===r}let l=(n=n??new Map).get(i),c=n.get(r);if(null!=l&&null!=c)return l===r;n.set(i,r),n.set(r,i);try{switch(a){case"[object Map]":if(i.size!==r.size)return!1;for(let[t,a]of i.entries())if(!r.has(t)||!e(a,r.get(t),t,i,r,n,s))return!1;return!0;case"[object Set]":{if(i.size!==r.size)return!1;let t=Array.from(i.values()),a=Array.from(r.values());for(let o=0;o<t.length;o++){let l=t[o],c=a.findIndex(t=>e(l,t,void 0,i,r,n,s));if(-1===c)return!1;a.splice(c,1)}return!0}case"[object Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":case"[object BigUint64Array
4620]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object BigInt64Array]":case"[object Float32Array]":case"[object Float64Array]":if("u">typeof dx&&dx.isBuffer(i)!==dx.isBuffer(r)||i.length!==r.length)return!1;for(let t=0;t<i.length;t++)if(!e(i[t],r[t],t,i,r,n,s))return!1;return!0;case"[object ArrayBuffer]":return i.byteLength===r.byteLength&&t(new Uint8Array(i),new Uint8Array(r),n,s);case"[object DataView]":return i.byteLength===r.byteLength&&i.byteOffset===r.byteOffset&&t(new Uint8Array(i),new Uint8Array(r),n,s);case"[object Error]":return i.name===r.name&&i.message===r.message;case uC:{if(!(t(i.constructor,r.constructor,n,s)||uE(i)&&uE(r)))return!1;let a=[...Object.keys(i),...uy(i)],o=[...Object.keys(r),...uy(r)];if(a.length!==o.length)return!1;for(let t=0;t<a.length;t++){let o=a[t],l=i[o];if(!Object.hasOwn(r,o))return!1;let c=r[o];if(!e(l,c,o,i,r,n,s))return!1}return!0}default:return!1}}finally{n.delete(i),n.delete(r)}}(t,i,a,o)}(r,e[i],void 0,void 0,void 0,void 0,ux)})):this.values)),uT(this,"update",async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let i=uk(uk({},this.getData(e)),t);this.map.set(e,i),await this.persist()}),uT(this,"delete",async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())}),this.logger=(0,eo.U5)(t,this.name),this.storagePrefix=r,this.getKey=n}get context(){return(0,eo.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=nz("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=nz("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=nz("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}}var uR=Object.defineProperty,uP=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?uR(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class u${constructor(e,t){this.core=e,this.logger=t,uP(this,"name","pairing"),uP(this,"version","0.3"),uP(this,"events",new N),uP(this,"pairings"),uP(this,"initialized",!1),uP(this,"storagePrefix",dI),uP(this,"ignoredPayloadTypes",[1]),uP(this,"registeredMethods",[]),uP(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),uP(this,"register",({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]}),uP(this,"create",async e=>{this.isInitialized();let t=ct(),i=await this.core.crypto.setSymKey(t),r=sc(T.FIVE_MINUTES),n={protocol:"irn"},s={topic:i,expiry:r,relay:n,active:!1,methods:e?.methods},a=cE({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:t,relay:n,expiryTimestamp:r,methods:e?.methods});return this.events.emit(dK,s),this.core.expirer.set(i,r),await this.pairings.set(i,s),await this.core.relayer.subscribe(i,{transportType:e?.transportType,internal:e?.internal}),{topic:i,uri:a}}),uP(this,"pair",async e=>{let t;this.isInitialized();let i=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:["pairing_started"]}});this.isValidPair(e,i);let{topic:r,symKey:n,relay:s,expiryTimestamp:a,methods:o}=cC(e.uri);if(i.props.properties.topic=r,i.addTrace("pairing_uri_validation_success"),i.addTrace("pairing_uri_not_expired"),this.pairings.keys.includes(r)){if(t=this.pairings.get(r),i.addTrace("existing_pairing"),t.active)throw i.setError("active_pairing_already_exists"),Error(`Pairing already exists: ${r}. Please try again with a new connection URI.`);
4620i.addTrace("pairing_not_expired")}let l=a||sc(T.FIVE_MINUTES),c={topic:r,relay:s,expiry:l,active:!1,methods:o};this.core.expirer.set(r,l),await this.pairings.set(r,c),i.addTrace("store_new_pairing"),e.activatePairing&&await this.activate({topic:r}),this.events.emit(dK,c),i.addTrace("emit_inactive_pairing"),this.core.crypto.keychain.has(r)||await this.core.crypto.setSymKey(n,r),i.addTrace("subscribing_pairing_topic");try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError("no_internet_connection")}try{await this.core.relayer.subscribe(r,{relay:s})}catch(e){throw i.setError("subscribe_pairing_topic_failure"),e}return i.addTrace("subscribe_pairing_topic_success"),c}),uP(this,"activate",async({topic:e})=>{this.isInitialized();let t=sc(T.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})}),uP(this,"ping",async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn("ping() is deprecated and will be removed in the next major release.");let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:i,resolve:r,reject:n}=ss();this.events.once(sh("pairing_ping",e),({error:e})=>{e?n(e):r()}),await i()}}),uP(this,"updateExpiry",async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})}),uP(this,"updateMetadata",async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})}),uP(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),uP(this,"disconnect",async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",nV("USER_DISCONNECTED")),await this.deletePairing(t))}),uP(this,"formatUriFromPairing",e=>{this.isInitialized();let{topic:t,relay:i,expiry:r,methods:n}=e,s=this.core.crypto.keychain.get(t);return cE({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:s,relay:i,expiryTimestamp:r,methods:n})}),uP(this,"sendRequest",async(e,t,i)=>{let r=dn(t,i),n=await this.core.crypto.encode(e,r),s=dZ[t].req;return this.core.history.set(e,r),this.core.relayer.publish(e,n,s),r.id}),uP(this,"sendResult",async(e,t,i)=>{let r=ds(e,i),n=await this.core.crypto.encode(t,r),s=dZ[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,n,s),await this.core.history.resolve(r)}),uP(this,"sendError",async(e,t,i)=>{let r=da(e,i),n=await this.core.crypto.encode(t,r),s=(await this.core.history.get(t,e)).request.method,a=dZ[s]?dZ[s].res:dZ.unregistered_method.res;await this.core.relayer.publish(t,n,a),await this.core.history.resolve(r)}),uP(this,"deletePairing",async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,nV("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])}),uP(this,"cleanup",async()=>{let e=this.pairings.getAll().filter(e=>sd(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))}),uP(this,"onRelayEventRequest",async e=>{let{topic:t,payload:i}=e;switch(i.method){case"wc_pairingPing":return await this.onPairingPingRequest(t,i);case"wc_pairingDelete":return await this.onPairingDeleteRequest(t,i);default:return await this.onUnknownRpcMethodRequest(t,i)}}),uP(this,"onRelayEventResponse",async e=>{let{topic:t,payload:i}=e,r=(await this.core.history.get(t,i.id)).request.method;return"wc_pairingPing"===r?this.onPairingPingResponse(t,i):this.onUnknownRpcMethodResponse(r)}),uP(this,"onPairingPingRequest",async(e,t)=>{let{id:i}=t;try{this.isValidPing({topic:e}),await this.sendResult(i,e,!0),this.events.emit("pairing_ping",{id:i,topic:e})}catch(t){await this.sendError(i,e,t),this.logger.error(t)}}),uP(this,"onPairingPingResponse",(e,t)=>{let{id:i}=t;setTimeout(()=>{dw(t)?this.events.emit(sh("pairing_ping",i),{}):dy(t)&&this.events.emit(sh("pairing_ping",i),{error:t.error})},500)}),uP(this,"onPairingDeleteRequest",async(e,t)=>{let{id:i}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(dG,{id:i,topic:e})}catch(t){await this.sendError(i,e,t),this.logger.error(t)}}),uP(this,"onUnknownRpcMethodRequest",async(e,t)=>{let{id:i,method:r}=t;try{if(this.registeredMethods.includes(r))return;let t=nV("WC_METHOD_UNSUPPORTED",r);await this.sendError(i,e,t),this.logger.error(t)}catch(t){await this.sendError(i,e,t),this.logger.error(t)}}),uP(this,"onUnknownRpcMethodResponse",e=>{this.registeredMethods.includes(e)||this.logger.error(nV("WC_METHOD_UNSUPPORTED",e))}),uP(this,"isValidPair",(e,t)=>{var i;if(!cG(e)){let{message:i}=nz("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(d4),Error(i)}if(!function(e){function t(e){try{return"u">typeof new URL(e)}catch{return!1}}try{if(cF(e,!1)){if(t(e))return!0;let i=sy(e);return t(i)}}catch{}return!1}(e.uri)){let{message:i}=nz("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(d4),Error(i)}let r=cC(e?.uri);if(!(null!=(i=r?.relay)&&i.protocol)){let{message:e}=nz("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(d4),Error(e)}if(!(null!=r&&r.symKey)){let{message:e}=nz("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(d4),Error(e)}if(null!=r&&r.expiryTimestamp&&(0,T.toMiliseconds)(r?.expiryTimestamp)<Date.now()){t.setError("pairing_expired");let{message:e}=nz("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw Error(e)}}),uP(this,"isValidPing",async e=>{if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)}),uP(this,"isValidDisconnect",async e=>{if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)}),uP(this,"isValidPairingTopic",async e=>{if(!cF(e,!1)){let{message:t}=nz("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=nz("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(sd(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=nz("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}),this.core=e,this.logger=(0,eo.U5)(t,this.name),this.pairings=new uO(this.core,this.logger,this.name,this.storagePrefix)}get context(){return(0,eo.oI)(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(dR,async e=>{let{topic:t,message:i,transportType:r}=e;if(this.pairings.keys.includes(t)&&r!==dj&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))try{let e=await this.core.crypto.decode(t,i);dg(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):dm(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,i)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(d1,async e=>{let{topic:t}=sl(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit("pairing_expire",{topic:t}))})}}var uU=Object.defineProperty,uM=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?uU(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class uD extends eu{constructor(e,t){super(e,t),this.core=e,this.logger=t,uM(this,"records",new Map),uM(this,"events",new N.EventEmitter),uM(this,"name","history"),uM(this,"version","0.3"),uM(this,"cac
4620hed",[]),uM(this,"initialized",!1),uM(this,"storagePrefix",dI),uM(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),uM(this,"set",(e,t,i)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:i}),this.records.has(t.id))return;let r={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:i,expiry:sc(T.THIRTY_DAYS)};this.records.set(r.id,r),this.persist(),this.events.emit(dY,r)}),uM(this,"resolve",async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=dy(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(dJ,t))}),uM(this,"get",async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t))),uM(this,"delete",(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(i=>{i.topic===e&&("u">typeof t&&i.id!==t||(this.records.delete(i.id),this.events.emit(dX,i)))}),this.persist()}),uM(this,"exists",async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e)),uM(this,"on",(e,t)=>{this.events.on(e,t)}),uM(this,"once",(e,t)=>{this.events.once(e,t)}),uM(this,"off",(e,t)=>{this.events.off(e,t)}),uM(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=(0,eo.U5)(t,this.name)}get context(){return(0,eo.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if("u">typeof t.response)return;let i={topic:t.topic,request:dn(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=nz("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit("history_sync")}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=nz("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(dY,e=>{this.logger.info(`Emitting ${dY}`),this.logger.debug({type:"event",event:dY,record:e})}),this.events.on(dJ,e=>{this.logger.info(`Emitting ${dJ}`),this.logger.debug({type:"event",event:dJ,record:e})}),this.events.on(dX,e=>{this.logger.info(`Emitting ${dX}`),this.logger.debug({type:"event",event:dX,record:e})}),this.core.heartbeat.on($,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,T.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(dX,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}}var uL=Object.defineProperty,uW=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?uL(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class uB extends ey{constructor(e,t){super(e,t),this.core=e,this.logger=t,uW(this,"expirations",new Map),uW(this,"events",new N.EventEmitter),uW(this,"name","expirer"),uW(this,"version","0.3"),uW(this,"cac
4620hed",[]),uW(this,"initialized",!1),uW(this,"storagePrefix",dI),uW(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),uW(this,"has",e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}}),uW(this,"set",(e,t)=>{this.isInitialized();let i=this.formatTarget(e),r={target:i,expiry:t};this.expirations.set(i,r),this.checkExpiry(i,r),this.events.emit(dQ,{target:i,expiration:r})}),uW(this,"get",e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)}),uW(this,"del",e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),i=this.getExpiration(t);this.expirations.delete(t),this.events.emit(d0,{target:t,expiration:i})}}),uW(this,"on",(e,t)=>{this.events.on(e,t)}),uW(this,"once",(e,t)=>{this.events.once(e,t)}),uW(this,"off",(e,t)=>{this.events.off(e,t)}),uW(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=(0,eo.U5)(t,this.name)}get context(){return(0,eo.oI)(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return so("topic",e);if("number"==typeof e)return so("id",e);let{message:t}=nz("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit("expirer_sync")}async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=nz("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=nz("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:i}=t;(0,T.toMiliseconds)(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(d1,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on($,()=>this.checkExpirations()),this.events.on(dQ,e=>{this.logger.info(`Emitting ${dQ}`),this.logger.debug({type:"event",event:dQ,data:e}),this.persist()}),this.events.on(d1,e=>{this.logger.info(`Emitting ${d1}`),this.logger.debug({type:"event",event:d1,data:e}),this.persist()}),this.events.on(d0,e=>{this.logger.info(`Emitting ${d0}`),this.logger.debug({type:"event",event:d0,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}}var uj=Object.defineProperty,uF=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?uj(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class uH extends eb{constructor(e,t,i){super(e,t,i),this.core=e,this.logger=t,this.store=i,uF(this,"name","verify-api"),uF(this,"abortController"),uF(this,"isDevEnv"),uF(this,"verifyUrlV3",d3),uF(this,"storagePrefix",dI),uF(this,"version",2),uF(this,"publicKey"),uF(this,"fetchPromise"),uF(this,"init",async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,T.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),uF(this,"register",async e=>{if(!n8()||this.isDevEnv)return;let t=window.location.origin,{id:i,decryptedId:r}=e,n=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${i}&decryptedId=${r}`;try{let e=(0,iZ.getDocument)(),t=this.startAbortTimer(5*T.ONE_SECOND),r=await new Promise((r,s)=>{let a=()=>{window.removeEventListener("message",l),e.body.removeChild(o),s("attestation aborted")};this.abortController.signal.addEventListener("abort",a);let o=e.createElement("iframe");o.src=n,o.style.display="none",o.addEventListener("error",a,{signal:this.abortController.signal});let l=n=>{if(n.data&&"string"==typeof n.data)try{let s=JSON.parse(n.data);if("verify_attestation"===s.type){if(i$(s.attestation).payload.id!==i)return;clearInterval(t),e.body.removeChild(o),this.abortController.signal.removeEventListener("abort",a),window.removeEventListener("message",l),r(null===s.attestation?"":s.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(o),window.addEventListener("message",l,{signal:this.abortController.signal})});
4620return this.logger.debug(r,"jwt attestation"),r}catch(e){this.logger.warn(e)}return""}),uF(this,"resolve",async e=>{if(this.isDevEnv)return"";let{attestationId:t,hash:i,encryptedId:r}=e;if(""===t)return void this.logger.debug("resolve: attestationId is empty, skipping");if(t){if(i$(t).payload.id!==r)return;let e=await this.isValidJwtAttestation(t);if(e)return e.isVerified?e:void this.logger.warn("resolve: jwt attestation: origin url not verified")}if(!i)return;let n=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(i,n)}),uF(this,"fetchAttestation",async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let i=this.startAbortTimer(5*T.ONE_SECOND),r=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(i),200===r.status?await r.json():void 0}),uF(this,"getVerifyUrl",e=>{let t=e||d2;return d5.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${d2}`),t=d2),t}),uF(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(T.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}}),uF(this,"persistPublicKey",async e=>{this.logger.debug(e,"persisting public key to local storage"),await this.store.setItem(this.storeKey,e),this.publicKey=e}),uF(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),uF(this,"isValidJwtAttestation",async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}let i=await this.fetchAndPersistPublicKey();try{if(i)return this.validateAttestation(e,i)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}}),uF(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),uF(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e}),uF(this,"validateAttestation",(e,t)=>{let i=function(e,t){let i,r,[n,s,a]=e.split("."),o=nB.from(ca(a),"base64");if(64!==o.length)throw Error("Invalid signature length");let l=o.slice(0,32),c=o.slice(32,64),d=aO(`${n}.${s}`),h=(i=nB.from(t.x,"base64"),r=nB.from(t.y,"base64"),rU([new Uint8Array([4]),i,r]));if(!l4.verify(rU([l,c]),d,h))throw Error("Invalid signature");return i$(e).payload}(e,t.publicKey),r={hasExpired:(0,T.toMiliseconds)(i.exp)<Date.now(),payload:i};if(r.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),Error("JWT attestation expired");return{origin:r.payload.origin,isScam:r.payload.isScam,isVerified:r.payload.isVerified}}),this.logger=(0,eo.U5)(t,this.name),this.abortController=new AbortController,this.isDevEnv=sw(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return(0,eo.oI)(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,T.toMiliseconds)(e))}}var uq=Object.defineProperty,uz=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?uq(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class uV extends ev{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,uz(this,"context","echo"),uz(this,"registerDeviceToken",async e=>{let{clientId:t,token:i,notificationType:r,enableEncrypted:n=!1}=e,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:r,token:i,always_raw:n})})}),this.logger=(0,eo.U5)(t,this.context)}}var uZ=Object.defineProperty,uK=Object.getOwnPropertySymbols,uG=Object.prototype.hasOwnProperty,uY=Object.prototype.propertyIsEnumerable,uJ=(e,t,i)=>t in e?uZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,uX=(e,t)=>{for(var i in t||(t={}))uG.call(t,i)&&uJ(e,i,t[i]);if(uK)for(var i of uK(t))uY.call(t,i)&&uJ(e,i,t[i]);return e},uQ=(e,t,i)=>uJ(e,"symbol"!=typeof t?t+"":t,i);class u0 extends eC{constructor(e,t,i=!0){super(e,t,i),this.core=e,this.logger=t,uQ(this,"context","event-client"),uQ(this,"storagePrefix",dI),uQ(this,"storageVersion",.1),uQ(this,"events",new Map),uQ(this,"shouldPersist",!1),uQ(this,"init",async()=>
4620{if(!sw())try{let e={eventId:sm(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:st(this.core.relayer.protocol,this.core.relayer.version,dB)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}}),uQ(this,"createEvent",e=>{let{event:t="ERROR",type:i="",properties:{topic:r,trace:n}}=e,s=sm(),a=this.core.projectId||"",o=uX({eventId:s,timestamp:Date.now(),props:{event:t,type:i,properties:{topic:r,trace:n}},bundleId:a,domain:this.getAppDomain()},this.setMethods(s));return this.telemetryEnabled&&(this.events.set(s,o),this.shouldPersist=!0),o}),uQ(this,"getEvent",e=>{let{eventId:t,topic:i}=e;if(t)return this.events.get(t);let r=Array.from(this.events.values()).find(e=>e.props.properties.topic===i);if(r)return uX(uX({},r),this.setMethods(r.eventId))}),uQ(this,"deleteEvent",e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0}),uQ(this,"setEventListeners",()=>{this.core.heartbeat.on($,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,T.fromMiliseconds)(Date.now())-(0,T.fromMiliseconds)(e.timestamp)>86400&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})}),uQ(this,"setMethods",e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)})),uQ(this,"addTrace",(e,t)=>{let i=this.events.get(e);i&&(i.props.properties.trace.push(t),this.events.set(e,i),this.shouldPersist=!0)}),uQ(this,"setError",(e,t)=>{let i=this.events.get(e);i&&(i.props.type=t,i.timestamp=Date.now(),this.events.set(e,i),this.shouldPersist=!0)}),uQ(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),uQ(this,"restore",async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,uX(uX({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}}),uQ(this,"submit",async()=>{if(!this.telemetryEnabled||0===this.events.size)return;let e=[];for(let[t,i]of this.events)i.props.type&&e.push(i);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}}),uQ(this,"sendEvent",async e=>{let t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`https://pulse.walletconnect.org/batch?projectId=${this.core.projectId}&st=events_sdk&sv=js-${dB}${t}`,{method:"POST",body:JSON.stringify(e)})}),uQ(this,"getAppDomain",()=>se().url),this.logger=(0,eo.U5)(t,this.context),this.telemetryEnabled=i,i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var u1=Object.defineProperty,u2=Object.getOwnPropertySymbols,u3=Object.prototype.hasOwnProperty,u5=Object.prototype.propertyIsEnumerable,u4=(e,t,i)=>t in e?u1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,u6=(e,t)=>{for(var i in t||(t={}))u3.call(t,i)&&u4(e,i,t[i]);if(u2)for(var i of u2(t))u5.call(t,i)&&u4(e,i,t[i]);return e},u8=(e,t,i)=>u4(e,"symbol"!=typeof t?t+"":t,i);class u9 extends ed{constructor(e){var t;super(e),u8(this,"protocol","wc"),u8(this,"version",2),u8(this,"name",d_),u8(this,"relayUrl"),u8(this,"projectId"),u8(this,"customStoragePrefix"),u8(this,"events",new N.EventEmitter),u8(this,"logger"),u8(this,"heartbeat"),u8(this,"relayer"),u8(this,"crypto"),u8(this,"storage"),u8(this,"history"),u8(this,"expirer"),u8(this,"pairing"),u8(this,"verify"),u8(this,"echoClient"),u8(this,"linkModeSupportedApps"),u8(this,"eventClient"),u8(this,"initialized",!1),u8(this,"logChunkController"),u8(this,"on",(e,t)=>this.events.on(e,t)),u8(this,"once",(e,t)=>this.events.once(e,t)),u8(this,"off",(e,t)=>this.events.off(e,t)),u8(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),u8(this,"dispatchEnvelope",({topic:e,message:t,sessionExists:i})=>{if(!e||!t)return;let r={topic:e,message:t,publishedAt:Date.now(),transportType:dj};this.relayer.onLinkMessageEvent(r,{sessionExists:i})});const i=this.getGlobalCore(e?.customStoragePrefix);if(i)try{return this.customStoragePrefix=i.customStoragePrefix,this.logger=i.logger,this.heartbeat=i.heartbeat,this.crypto=i.crypto,this.history=i.history,this.expirer=i.expirer,this.storage=i.storage,this.relayer=i.relayer,this.pairing=i.pairing,this.verify=i.verify,this.echoClient=i.echoClient,this.linkModeSupportedApps=i.linkModeSupportedApps,this.eventClient=i.eventClient,this.initialized=i.initialized,this.logChunkController=i.logChunkController,i}catch(e){console.warn("Failed to copy global core",e)}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||dO,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const r=(0,eo.iP)({level:"string"==typeof e?.logger&&e.logger?e.logger:"error",name:d_}),{logger:n,chunkLoggerController:s}=(0,eo.D5)({opts:r,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=s,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=(0,eo.U5)(n,this.name),this.heartbeat=new U,this.crypto=new hj(this,this.logger,e?.keychain),this.history=new uD(this,this.logger),this.expirer=new uB(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new ea(u6(u6({},dS),e?.storageOptions)),this.relayer=new uw({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new u$(this,this.logger),this.verify=new uH(this,this.logger,this.storage),this.echoClient=new uV(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new u0(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(e){let t=new u9(e);await t.initialize();let i=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",i),t}get context(){return(0,eo.oI)(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(dq,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
4620),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(dq)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e}`,i=`${t}_count`;return globalThis[i]=(globalThis[i]||0)+1,globalThis[i]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[i]} times.`),globalThis[t]}catch(e){console.warn("Failed to get global WalletConnect core",e);return}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;let i=`_walletConnectCore_${(null==(t=e.opts)?void 0:t.customStoragePrefix)||""}`;globalThis[i]=e}catch(e){console.warn("Failed to set global WalletConnect core",e)}}isGlobalCoreDisabled(){try{return"u">typeof dA&&"true"===dA.env.DISABLE_GLOBAL_CORE}catch{return!0}}}let u7="client",pe=`wc@2:${u7}:`,pt="WALLETCONNECT_DEEPLINK_CHOICE",pi="Proposal expired",pr=T.SEVEN_DAYS,pn={wc_sessionPropose:{req:{ttl:T.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:T.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:T.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:T.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:T.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:T.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:T.ONE_DAY,prompt:!1,tag:1104},res:{ttl:T.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:T.ONE_DAY,prompt:!1,tag:1106},res:{ttl:T.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:3*T.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:3*T.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:T.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:T.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:T.ONE_DAY,prompt:!1,tag:1112},res:{ttl:T.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:T.ONE_DAY,prompt:!1,tag:1114},res:{ttl:T.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:T.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:T.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:T.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:T.FIVE_MINUTES,prompt:!1,tag:1119}}},ps={min:T.FIVE_MINUTES,max:T.SEVEN_DAYS},pa="IDLE",po="ACTIVE",pl={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},pc=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],pd="[email protected]:auth:",ph=`${pd}:PUB_KEY`;var pu=Object.defineProperty,pp=Object.defineProperties,pf=Object.getOwnPropertyDescriptors,pg=Object.getOwnPropertySymbols,pm=Object.prototype.hasOwnProperty,pw=Object.prototype.propertyIsEnumerable,py=(e,t,i)=>t in e?pu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,pb=(e,t)=>{for(var i in t||(t={}))pm.call(t,i)&&py(e,i,t[i]);if(pg)for(var i of pg(t))pw.call(t,i)&&py(e,i,t[i]);return e},pv=(e,t,i)=>py(e,"symbol"!=typeof t?t+"":t,i);class pC extends e_{constructor(e){super(e),pv(this,"name","engine"),pv(this,"events",new N),pv(this,"initialized",!1),pv(this,"requestQueue",{state:pa,queue:[]}),pv(this,"sessionRequestQueue",{state:pa,queue:[]}),pv(this,"emittedSessionRequests",new sb({limit:500})),pv(this,"requestQueueDelay",T.ONE_SECOND),pv(this,"expectedPairingMethodMap",new Map),pv(this,"recentlyDeletedMap",new Map),pv(this,"recentlyDeletedLimit",200),pv(this,"relayMessageCache",[]),pv(this,"pendingSessions",new Map),pv(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(pn)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,T.toMiliseconds)(this.requestQueueDelay)))}),pv(this,"connect",async e=>{var t;this.isInitialized(),await this.confirmOnlineStateOrThrow();let i=pp(pb({},e),pf({requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}}));await this.isValidConnect(i),i.optionalNamespaces=function(e,t){var i,r,n,s,a,o;let l=cD(e),c=cD(t),d={};for(let e of Object.keys(l).concat(Object.keys(c)))d[e]={chains:su(null==(i=l[e])?void 0:i.chains,null==(r=c[e])?void 0:r.chains),methods:su(null==(n=l[e])?void 0:n.methods,null==(s=c[e])?void 0:s.methods),events:su(null==(a=l[e])?void 0:a.events,null==(o=c[e])?void 0:o.events)};return d}(i.requiredNamespaces,i.optionalNamespaces),i.requiredNamespaces={};let{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:s,sessionProperties:a,scopedProperties:o,relays:l,authentication:c,walletPay:d}=i,h=(null==(t=c?.[0])?void 0:t.ttl)||pn.wc_sessionPropose.req.ttl||T.FIVE_MINUTES;this.validateRequestExpiry(h);let u=r,p,f=!1;try{if(u){let e=this.client.core.pairing.pairings.get(u);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),f=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${u}) failed`),e}if(!u||!f){let{topic:e,uri:t}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});u=e,p=t}if(!u){let{message:e}=nz("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw Error(e)}let g=await this.client.core.crypto.generateKeyPair(),m=sc(h),w=pb(pp(pb(pb({requiredNamespaces:n,optionalNamespaces:s,relays:l??[{protocol:"irn"}],proposer:{publicKey:g,metadata:this.client.metadata},expiryTimestamp:m,pairingTopic:u},a&&{sessionProperties:a}),o&&{scopedProperties:o}),pf({id:di()})),(c||d)&&{requests:{authentication:c?.map(e=>{let{domain:t,chains:i,nonce:r,uri:n,exp:s,nbf:a,type:o,statement:l,requestId:c,resources:d,signatureTypes:h}=e;return{domain:t,chains:i,nonce:r,type:o??"caip122",aud:n,version:"1",iat:new Date().toISOString(),exp:s,nbf:a,statement:l,requestId:c,resources:d,signatureTypes:h}}),walletPay:d}}),y=sh("session_connect",w.id),{reject:b,resolve:v,done:C}=ss(h,pi),E=({id:e})=>{e===w.id&&(this.client.events.off("proposal_expire",E),this.pendingSessions.delete(w.id),this.events.emit(y,{error:{message:pi,code:0}}))};return this.client.events.on("proposal_expire",E),this.events.once(y,({error:e,session:t})=>{this.client.events.off("proposal_expire",E),e?b(e):t&&v(t)}
4620),await this.setProposal(w.id,w),await this.sendProposeSession({proposal:w,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:w.id}}}).catch(e=>{throw this.deleteProposal(w.id),e}),{uri:p,approval:C}}),pv(this,"pair",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}}),pv(this,"approve",async e=>{var t,i,r;let n=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[d6]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw n.setError("no_internet_connection"),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),n.setError("proposal_not_found"),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError("session_approve_namespace_validation_failure"),e}let{id:s,relayProtocol:a,namespaces:o,sessionProperties:l,scopedProperties:c,sessionConfig:d,proposalRequestsResponses:h}=e,u=this.client.proposal.get(s);this.client.core.eventClient.deleteEvent({eventId:n.eventId});let{pairingTopic:p,proposer:f,requiredNamespaces:g,optionalNamespaces:m}=u,w=null==(i=this.client.core.eventClient)?void 0:i.getEvent({topic:p});w||(w=null==(r=this.client.core.eventClient)?void 0:r.createEvent({type:d6,properties:{topic:p,trace:[d6,"session_namespaces_validation_success"]}}));let y=await this.client.core.crypto.generateKeyPair(),b=f.publicKey,v=await this.client.core.crypto.generateSharedKey(y,b),C=pp(pb(pb(pb({relay:{protocol:a??"irn"},namespaces:o,controller:{publicKey:y,metadata:this.client.metadata},expiry:sc(pr)},l&&{sessionProperties:l}),c&&{scopedProperties:c}),d&&{sessionConfig:d}),pf({proposalRequestsResponses:h}));w.addTrace("subscribing_session_topic");try{await this.client.core.relayer.subscribe(v,{transportType:dF,internal:{skipSubscribe:!0}})}catch(e){throw w.setError("subscribe_session_topic_failure"),e}w.addTrace("subscribe_session_topic_success");let E=pp(pb({},C),pf({topic:v,requiredNamespaces:g,optionalNamespaces:m,pairingTopic:p,acknowledged:!1,self:C.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:y,transportType:dF,authentication:h?.authentication,walletPayResult:h?.walletPay}));await this.client.session.set(v,E),w.addTrace("store_session");try{await this.sendApproveSession({sessionTopic:v,proposal:u,pairingProposalResponse:{relay:{protocol:a??"irn"},responderPublicKey:y},sessionSettleRequest:C,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:pb({correlationId:s},this.getTVFApproveParams(E))}}),w.addTrace("session_approve_publish_success")}catch(e){throw this.client.logger.error(e),this.client.session.delete(v,nV("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(v),e}return this.client.core.eventClient.deleteEvent({eventId:w.eventId}),await this.client.core.pairing.updateMetadata({topic:p,metadata:f.metadata}),await this.deleteProposal(s),await this.client.core.pairing.activate({topic:p}),await this.setExpiry(v,sc(pr)),{topic:v,acknowledged:()=>Promise.resolve(this.client.session.get(v))}}),pv(this,"reject",async e=>{let t;this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}let{id:i,reason:r}=e;try{t=this.client.proposal.get(i).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),e}t&&await this.sendError({id:i,topic:t,error:r,rpcOpts:pn.wc_sessionPropose.reject}),await this.deleteProposal(i)}),pv(this,"update",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}let{topic:t,namespaces:i}=e,{done:r,resolve:n,reject:s}=ss(T.FIVE_MINUTES,"Session update request expired without receiving any acknowledgement"),a=di(),o=dr().toString(),l=this.client.session.get(t).namespaces;return this.events.once(sh("session_update",a),({error:e})=>{e?s(e):n()}),await this.client.session.update(t,{namespaces:i}
4620),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:a,relayRpcId:o}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:l}),s(e)}),{acknowledged:r}}),pv(this,"extend",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}let{topic:t}=e,i=di(),{done:r,resolve:n,reject:s}=ss(T.FIVE_MINUTES,"Session extend request expired without receiving any acknowledgement");return this.events.once(sh("session_extend",i),({error:e})=>{e?s(e):n()}),await this.setExpiry(t,sc(pr)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(e=>{s(e)}),{acknowledged:r}}),pv(this,"request",async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}let{chainId:t,request:i,topic:r,expiry:n=pn.wc_sessionRequest.req.ttl}=e,s=this.client.session.get(r);s?.transportType===dF&&await this.confirmOnlineStateOrThrow();let a=di(),o=dr().toString(),{done:l,resolve:c,reject:d}=ss(n,"Request expired. Please try again.");this.events.once(sh("session_request",a),({error:e,result:t})=>{e?d(e):c(t)});let h="wc_sessionRequest",u=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);if(u)return await this.sendRequest({clientRpcId:a,relayRpcId:o,topic:r,method:h,params:{request:pp(pb({},i),pf({expiryTimestamp:sc(n)})),chainId:t},expiry:n,throwOnFailedPublish:!0,appLink:u}).catch(e=>d(e)),this.client.events.emit("session_request_sent",{topic:r,request:i,chainId:t,id:a}),await l();let p={request:pp(pb({},i),pf({expiryTimestamp:sc(n)})),chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:a,relayRpcId:o,topic:r,method:h,params:p,expiry:n,throwOnFailedPublish:!0,tvf:this.getTVFParams(a,p)}).catch(e=>d(e)),this.client.events.emit("session_request_sent",{topic:r,request:i,chainId:t,id:a}),e()}),new Promise(async e=>{var t;if(!(null!=(t=s.sessionConfig)&&t.disableDeepLink)){let e=await sf(this.client.core.storage,pt);await sp({id:a,topic:r,wcDeepLink:e})}e()}),l()]).then(e=>e[2])}),pv(this,"respond",async e=>{var t,i;this.isInitialized();let r=this.client.core.eventClient.createEvent({properties:{topic:e?.topic||(null==(i=null==(t=e?.response)?void 0:t.id)?void 0:i.toString()),trace:["session_request_response_started"]}});try{await this.isValidRespond(e)}catch(e){throw r.addTrace(e?.message),r.setError("session_request_response_validation_failure"),e}r.addTrace("session_request_response_validation_success");let{topic:n,response:s}=e,{id:a}=s,o=this.client.session.get(n);o.transportType===dF&&await this.confirmOnlineStateOrThrow();let l=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);try{r.addTrace("session_request_response_publish_started"),dw(s)?await this.sendResult({id:a,topic:n,result:s.result,throwOnFailedPublish:!0,appLink:l}):dy(s)&&await this.sendError({id:a,topic:n,error:s.error,appLink:l}),this.cleanupAfterResponse(e)}catch(e){throw r.addTrace(e?.message),r.setError("session_request_response_publish_failure"),e}}),pv(this,"ping",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=di(),i=dr().toString(),{done:r,resolve:n,reject:s}=ss(T.FIVE_MINUTES,"Ping request expired without receiving any acknowledgement");this.events.once(sh("session_ping",e),({error:e})=>{e?s(e):n()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:i}),r()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:t}))}),pv(this,"emit",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);
4620let{topic:t,event:i,chainId:r}=e,n=dr().toString(),s=di();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:i,chainId:r},throwOnFailedPublish:!0,relayRpcId:n,clientRpcId:s})}),pv(this,"disconnect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:nV("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=nz("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}}),pv(this,"find",e=>(this.isInitialized(),this.client.session.getAll().filter(t=>(function(e,t){let{requiredNamespaces:i}=t,r=Object.keys(e.namespaces),n=Object.keys(i),s=!0;return!!si(n,r)&&(r.forEach(t=>{let{accounts:r,methods:n,events:a}=e.namespaces[t],o=cP(r),l=i[t];si(nF(t,l),o)&&si(l.methods,n)&&si(l.events,a)||(s=!1)}),s)})(t,e)))),pv(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),pv(this,"authenticate",async(e,t)=>{var i,r,n,s,a;let o;this.isInitialized(),this.isValidAuthenticate(e);let l=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(i=this.client.metadata.redirect)?void 0:i.linkMode),c=l?dj:dF;c===dF&&await this.confirmOnlineStateOrThrow();let{chains:d,statement:h="",uri:u,domain:p,nonce:f,type:g,exp:m,nbf:w,methods:y=[],expiry:b}=e,v=[...e.resources||[]],{topic:C,uri:E}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:c});this.client.logger.info({message:"Generated new pairing",pairing:{topic:C,uri:E}});let x=await this.client.core.crypto.generateKeyPair(),A=ci(x);if(await Promise.all([this.client.auth.authKeys.set(ph,{responseTopic:A,publicKey:x}),this.client.auth.pairingTopics.set(A,{topic:A,pairingTopic:C})]),await this.client.core.relayer.subscribe(A,{transportType:c}),this.client.logger.info(`sending request to new pairing topic: ${C}`),y.length>0){let e,t,{namespace:i}=nj(d[0]),o=oe(function(e,t,i,r={}){return i?.sort((e,t)=>e.localeCompare(t)),{att:{[e]:function(e,t,i={}){return Object.assign({},...(t=t?.sort((e,t)=>e.localeCompare(t))).map(t=>({[`${e}/${t}`]:[i]})))}(t,i,r)}}}(i,"request",y));on(v)&&(r=o,n=v.pop(),o=oe((s=ot(r),a=ot(n),a7(s),a7(a),e=Object.keys(s.att).concat(Object.keys(a.att)).sort((e,t)=>e.localeCompare(t)),t={att:{}},e.forEach(e=>{var i,r;Object.keys((null==(i=s.att)?void 0:i[e])||{}).concat(Object.keys((null==(r=a.att)?void 0:r[e])||{})).sort((e,t)=>e.localeCompare(t)).forEach(i=>{var r,n;t.att[e]=aY(((e,t)=>{for(var i in t||(t={}))aQ.call(t,i)&&a1(e,i,t[i]);if(aX)for(var i of aX(t))a0.call(t,i)&&a1(e,i,t[i]);return e})({},t.att[e]),aJ({[i]:(null==(r=s.att[e])?void 0:r[i])||(null==(n=a.att[e])?void 0:n[i])}))})}),t))),v.push(o)}let _=b&&b>pn.wc_sessionAuthenticate.req.ttl?b:pn.wc_sessionAuthenticate.req.ttl,I={authPayload:{type:g??"caip122",chains:d,statement:h,aud:u,domain:p,version:"1",nonce:f,iat:new Date().toISOString(),exp:m,nbf:w,resources:v},requester:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:sc(_)},S={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:d,methods:[...new Set(["personal_sign",...y])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:C,proposer:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:sc(pn.wc_sessionPropose.req.ttl),id:di()},{done:N,resolve:k,reject:T}=ss(_,"Request expired"),O=di(),R=sh("session_connect",S.id),P=sh("session_request",O),$=async({error:e,session:t})=>{this.events.off(P,U),e?T(e):t&&k({session:t})},U=async e=>{var i,r,n;let s;if(await this.deletePendingAuthRequest(O,{message:"fulfilled",code:0}),e.error){let t=nV("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(R,$),T(e.error.message))}await this.deleteProposal(S.id),this.events.off(R,$);let{cacaos:a,responder:o}=e.result,l=[],d=[];for(let e of a){await a8({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),T(nV("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:t}=e,i=on(t.resources),r=[a4(t.iss)],n=a6(t.iss);if(i){let e=oi(i),t=or(i);l.push(...e),r.push(...t)}for(let e of r)d.push(`${e}:${n}`)}let h=await this.client.core.crypto.generateSharedKey(x,o.publicKey);l.length>0&&(s={topic:h,acknowledged:!0,self:{publicKey:x,metadata:this.client.metadata},peer:o,controller:o.publicKey,expiry:sc(pr),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:C,namespaces:cL([...new Set(l)],[...new Set(d)]),transportType:c},await this.client.core.relayer.subscribe(h,{transportType:c}),await this.client.session.set(h,s),C&&await this.client.core.pairing.updateMetadata({topic:C,metadata:o.metadata}),s=this.client.session.get(h)),null!=(i=this.client.metadata.redirect)&&i.linkMode&&null!=(r=o.metadata.redirect)&&r.linkMode&&null!=(n=o.metadata.redirect)&&n.universal&&t&&(this.client.core.addLinkModeSupportedApp(o.metadata.redirect.universal),this.client.session.update(h,{transportType:dj})),k({auths:a,session:s})};
4620this.events.once(R,$),this.events.once(P,U);try{if(l){let e=dn("wc_sessionAuthenticate",I,O);this.client.core.history.set(C,e);let i=await this.client.core.crypto.encode("",e,{type:2,encoding:l7});o=cx(t,C,i)}else await Promise.all([this.sendRequest({topic:C,method:"wc_sessionAuthenticate",params:I,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:O}),this.sendRequest({topic:C,method:"wc_sessionPropose",params:S,expiry:pn.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:S.id})])}catch(e){throw this.events.off(R,$),this.events.off(P,U),e}return await this.setProposal(S.id,S),await this.setAuthRequest(O,{request:pp(pb({},I),pf({verifyContext:{}})),pairingTopic:C,transportType:c}),{uri:o??E,response:N}}),pv(this,"approveSessionAuthenticate",async e=>{let t,{id:i,auths:r}=e,n=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:["authenticated_session_approve_started"]}});try{this.isInitialized()}catch(e){throw n.setError("no_internet_connection"),e}let s=this.getPendingAuthRequest(i);if(!s)throw n.setError("authenticated_session_pending_request_not_found"),Error(`Could not find pending auth request with id ${i}`);let a=s.transportType||dF;a===dF&&await this.confirmOnlineStateOrThrow();let o=s.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),c=ci(o),d={type:1,receiverPublicKey:o,senderPublicKey:l},h=[],u=[];for(let e of r){if(!await a8({cacao:e,projectId:this.client.core.projectId})){n.setError("invalid_cacao");let e=nV("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:c,error:e,encodeOpts:d}),Error(e.message)}n.addTrace("cacaos_verified");let{p:t}=e,r=on(t.resources),s=[a4(t.iss)],a=a6(t.iss);if(r){let e=oi(r),t=or(r);h.push(...e),s.push(...t)}for(let e of s)u.push(`${e}:${a}`)}let p=await this.client.core.crypto.generateSharedKey(l,o);if(n.addTrace("create_authenticated_session_topic"),h?.length>0){t={topic:p,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:o,metadata:s.requester.metadata},controller:o,expiry:sc(pr),authentication:r,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:cL([...new Set(h)],[...new Set(u)]),transportType:a},n.addTrace("subscribing_authenticated_session_topic");try{await this.client.core.relayer.subscribe(p,{transportType:a})}catch(e){throw n.setError("subscribe_authenticated_session_topic_failure"),e}n.addTrace("subscribe_authenticated_session_topic_success"),await this.client.session.set(p,t),n.addTrace("store_authenticated_session"),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})}n.addTrace("publishing_authenticated_session_approve");try{await this.sendResult({topic:c,id:i,result:{cacaos:r,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:d,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(s.requester.metadata,a)})}catch(e){throw n.setError("authenticated_session_approve_publish_failure"),e}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:n.eventId}),{session:t}}),pv(this,"rejectSessionAuthenticate",async e=>{this.isInitialized();let{id:t,reason:i}=e,r=this.getPendingAuthRequest(t);if(!r)throw Error(`Could not find pending auth request with id ${t}`);r.transportType===dF&&await this.confirmOnlineStateOrThrow();let n=r.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),a=ci(n);await this.sendError({id:t,topic:a,error:i,encodeOpts:{type:1,receiverPublicKey:n,senderPublicKey:s},rpcOpts:pn.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(r.requester.metadata,r.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.deleteProposal(t)}),pv(this,"formatAuthMessage",e=>{this.isInitialized();let{request:t,iss:i}=e;return a9(t,i)}),pv(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)}
4620),pv(this,"cleanupDuplicatePairings",async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(i=>{var r,n;return(null==(r=i.peerMetadata)?void 0:r.url)&&(null==(n=i.peerMetadata)?void 0:n.url)===e.peer.metadata.url&&i.topic&&i.topic!==t.topic});if(0===i.length)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}}),pv(this,"deleteSession",async e=>{var t;let{topic:i,expirerHasDeleted:r=!1,emitEvent:n=!0,id:s=0}=e,{self:a}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,nV("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),r||this.client.core.expirer.del(i),this.client.core.storage.removeItem(pt).catch(e=>this.client.logger.warn(e)),i===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=pa),await Promise.all(this.getPendingSessionRequests().filter(e=>e.topic===i).map(e=>this.deletePendingSessionRequest(e.id,nV("USER_DISCONNECTED")))),n&&this.client.events.emit("session_delete",{id:s,topic:i})}),pv(this,"deleteProposal",async(e,t)=>{if(t)try{let t=this.client.proposal.get(e),i=this.client.core.eventClient.getEvent({topic:t.pairingTopic});i?.setError("proposal_expired")}catch{}await Promise.all([this.client.proposal.delete(e,nV("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")}),pv(this,"deletePendingSessionRequest",async(e,t,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),i?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),i&&(this.sessionRequestQueue.state=pa,this.client.events.emit("session_request_expire",{id:e}))}),pv(this,"deletePendingAuthRequest",async(e,t,i=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),i?Promise.resolve():this.client.core.expirer.del(e)])}),pv(this,"setExpiry",async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))}),pv(this,"setProposal",async(e,t)=>{this.client.core.expirer.set(e,sc(pn.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)}),pv(this,"setAuthRequest",async(e,t)=>{let{request:i,pairingTopic:r,transportType:n=dF}=t;this.client.core.expirer.set(e,i.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:e,pairingTopic:r,verifyContext:i.verifyContext,transportType:n})}),pv(this,"setPendingSessionRequest",async e=>{let{id:t,topic:i,params:r,verifyContext:n}=e,s=r.request.expiryTimestamp||sc(pn.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,s),await this.client.pendingRequest.set(t,{id:t,topic:i,params:r,verifyContext:n})}),pv(this,"sendRequest",async e=>{let t,i,{topic:r,method:n,params:s,expiry:a,relayRpcId:o,clientRpcId:l,throwOnFailedPublish:c,appLink:d,tvf:h,publishOpts:u={}}=e,p=dn(n,s,l),f=!!d;try{let e=f?l7:l9;t=await this.client.core.crypto.encode(r,p,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${r} failed`),e}if(pc.includes(n)){let e=cr(JSON.stringify(p)),r=cr(t);i=await this.client.core.verify.register({id:r,decryptedId:e})}let g=pb(pb({},pn[n].req),u);if(g.attestation=i,a&&(g.ttl=a),o&&(g.id=o),this.client.core.history.set(r,p),f){let e=cx(d,r,t);await global.Linking.openURL(e,this.client.name)}else{let e;g.tvf=pp(pb({},h),pf({correlationId:p.id})),c?(e=pb({},g.internal),g.internal=pp(e,pf({throwOnFailedPublish:!0})),await this.client.core.relayer.publish(r,t,g)):this.client.core.relayer.publish(r,t,g).catch(e=>this.client.logger.error(e))}return p.id}),pv(this,"sendProposeSession",async e=>{let{proposal:t,publishOpts:i}=e,r=dn("wc_sessionPropose",t,t.id);this.client.core.history.set(t.pairingTopic,r);let n=await this.client.core.crypto.encode(t.pairingTopic,r,{encoding:l9}),s=cr(JSON.stringify(r)),a=cr(n),o=await this.client.core.verify.register({id:a,decryptedId:s});await this.client.core.relayer.publishCustom({payload:{pairingTopic:t.pairingTopic,sessionProposal:n},opts:pp(pb({},i),pf({publishMethod:"wc_proposeSession",attestation:o}))})}),pv(this,"sendApproveSession",async e=>{let{sessionTopic:t,pairingProposalResponse:i,proposal:r,sessionSettleRequest:n,publishOpts:s}=e,a=ds(r.id,i),o=await this.client.core.crypto.encode(r.pairingTopic,a,{encoding:l9}),l=dn("wc_sessionSettle",n,s?.id),c=await this.client.core.crypto.encode(t,l,{encoding:l9});this.client.core.history.set(t,l),await this.client.core.relayer.publishCustom({payload:{sessionTopic:t,pairingTopic:r.pairingTopic,sessionProposalResponse:o,sessionSettlementRequest:c},opts:pp(pb({},s),pf({publishMethod:"wc_approveSession"}))})}),pv(this,"sendResult",async e=>{let t,i,r,{id:n,topic:s,result:a,throwOnFailedPublish:o,encodeOpts:l,appLink:c}=e,d=ds(n,a),h=c&&"u">typeof(null==global?void 0:global.Linking);try{let e,i,r=h?l7:l9;t=await this.client.core.crypto.encode(s,d,(e=pb({},l||{}),i={encoding:r},pp(e,pf(i))))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),e}try{let e=(i=await this.client.core.history.get(s,n)).request;try{r=this.getTVFParams(n,e.params,a)}catch(e){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${e?.message}`)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${n}) failed`),e}if(h){let e=cx(c,s,t);await global.Linking.openURL(e,this.client.name)}else{let e,a=pn[i.request.method].res;a.tvf=pp(pb({},r),pf({correlationId:n})),o?(e=pb({},a.internal),a.internal=pp(e,pf({throwOnFailedPublish:!0})),await this.client.core.relayer.publish(s,t,a)):this.client.core.relayer.publish(s,t,a).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(d)}),pv(this,"sendError",async e=>{let t,i,{id:r,topic:n,error:s,encodeOpts:a,rpcOpts:o,appLink:l}=e,c=da(r,s),d=l&&"u">typeof(null==global?void 0:global.Linking);try{let e,i,r=d?l7:l9;t=await this.client.core.crypto.encode(n,c,(e=pb({},a||{}),i={encoding:r},pp(e,pf(i))))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),e}try{i=await this.client.core.history.get(n,r)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${n}, ${r}) failed`),e}if(d){let e=cx(l,n,t);await global.Linking.openURL(e,this.client.name)}else{let e=i.request.method,r=o||pn[e].res;this.client.core.relayer.publish(n,t,r)}await this.client.core.history.resolve(c)}),pv(this,"cleanup",async()=>{let e=[],t=[];
4620this.client.session.getAll().forEach(t=>{let i=!1;sd(t.expiry)&&(i=!0),this.client.core.crypto.keychain.has(t.topic)||(i=!0),i&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{sd(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])}),pv(this,"onProviderMessageEvent",async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)}),pv(this,"onRelayEventRequest",async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()}),pv(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===po)return void this.client.logger.info("Request queue already active, skipping...");for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=po;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=pa}),pv(this,"processRequest",async e=>{let{topic:t,payload:i,attestation:r,transportType:n,encryptedId:s}=e,a=i.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:a}))switch(a){case"wc_sessionPropose":return await this.onSessionProposeRequest
4620({topic:t,payload:i,attestation:r,encryptedId:s});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,i);case"wc_sessionPing":return await this.onSessionPingRequest(t,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:i,attestation:r,encryptedId:s,transportType:n});case"wc_sessionEvent":return await this.onSessionEventRequest(t,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:i,attestation:r,encryptedId:s,transportType:n});default:return this.client.logger.info(`Unsupported request method ${a}`)}}),pv(this,"onRelayEventResponse",async e=>{let{topic:t,payload:i,transportType:r}=e,n=(await this.client.core.history.get(t,i.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,i,r);case"wc_sessionSettle":return this.onSessionSettleResponse(t,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,i);case"wc_sessionExtend":return this.onSessionExtendResponse(t,i);case"wc_sessionPing":return this.onSessionPingResponse(t,i);case"wc_sessionRequest":return this.onSessionRequestResponse(t,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,i);default:return this.client.logger.info(`Unsupported response method ${n}`)}}),pv(this,"onRelayEventUnknownPayload",e=>{let{topic:t}=e,{message:i}=nz("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(i)}),pv(this,"shouldIgnorePairingRequest",e=>{let{topic:t,requestMethod:i}=e,r=this.expectedPairingMethodMap.get(t);return!(!r||r.includes(i))&&!!(r.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),pv(this,"onSessionProposeRequest",async e=>{let{topic:t,payload:i,attestation:r,encryptedId:n}=e,{params:s,id:a}=i;try{let e=this.client.core.eventClient.getEvent({topic:t});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError("proposal_listener_not_found")),this.isValidConnect(pb({},i.params));let o=s.expiryTimestamp||sc(pn.wc_sessionPropose.req.ttl),l=pb({id:a,pairingTopic:t,expiryTimestamp:o,attestation:r,encryptedId:n},s);await this.setProposal(a,l);let c=await this.getVerifyContext({attestationId:r,hash:cr(JSON.stringify(i)),encryptedId:n,metadata:l.proposer.metadata});e?.addTrace("emit_session_proposal"),this.client.events.emit("session_proposal",{id:a,params:l,verifyContext:c})}catch(e){await this.sendError({id:a,topic:t,error:e,rpcOpts:pn.wc_sessionPropose.autoReject}),this.client.logger.error(e)}}),pv(this,"onSessionProposeResponse",async(e,t,i)=>{let{id:r}=t;if(dw(t)){let{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});let s=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:s});let a=s.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});let o=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:o});let l=await this.client.core.crypto.generateSharedKey(a,o);this.pendingSessions.set(r,{sessionTopic:l,pairingTopic:e,proposalId:r,publicKey:a});let c=await this.client.core.relayer.subscribe(l,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:c}),await this.client.core.pairing.activate({topic:e})}else if(dy(t)){await this.deleteProposal(r);let e=sh("session_connect",r);if(0===this.events.listenerCount(e))throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}}),pv(this,"onSessionSettleRequest",async(e,t)=>{let{id:i,params:r}=t;try{let i,n;this.isValidSessionSettleRequest(r);let{relay:s,controller:a,expiry:o,namespaces:l,sessionProperties:c,scopedProperties:d,sessionConfig:h,proposalRequestsResponses:u}=t.params,p=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!p)return this.client.logger.error(`Pending session not found for topic ${e}`);let f=this.client.proposal.get(p.proposalId),g=(i=pb(pb(pb({topic:e,relay:s,expiry:o,namespaces:l,acknowledged:!0,pairingTopic:p.pairingTopic,requiredNamespaces:f.requiredNamespaces,optionalNamespaces:f.optionalNamespaces,controller:a.publicKey,self:{publicKey:p.publicKey,metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},c&&{sessionProperties:c}),d&&{scopedProperties:d}),h&&{sessionConfig:h}),n={transportType:dF,authentication:u?.authentication,walletPayResult:u?.walletPay},pp(i,pf(n)));await this.client.session.set(g.topic,g),await this.setExpiry(g.topic,g.expiry),await this.client.core.pairing.updateMetadata({topic:p.pairingTopic,metadata:g.peer.metadata}),this.pendingSessions.delete(p.proposalId),this.deleteProposal(p.proposalId,!1),this.cleanupDupl
4620icatePairings(g),await this.sendResult({id:t.id,topic:e,throwOnFailedPublish:!0,result:!0}),this.client.events.emit("session_connect",{session:g}),this.events.emit(sh("session_connect",p.proposalId),{session:g})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}}),pv(this,"onSessionSettleResponse",async(e,t)=>{let{id:i}=t;dw(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(sh("session_approve",i),{})):dy(t)&&(await this.client.session.delete(e,nV("USER_DISCONNECTED")),this.events.emit(sh("session_approve",i),{error:t.error}))}),pv(this,"onSessionUpdateRequest",async(e,t)=>{let{params:i,id:r}=t;try{let t=`${e}_session_update`,n=c2.get(t);if(n&&this.isRequestOutOfSync(n,r)){this.client.logger.warn(`Discarding out of sync request - ${r}`),this.sendError({id:r,topic:e,error:nV("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(pb({topic:e},i));try{c2.set(t,r),await this.client.session.update(e,{namespaces:i.namespaces}),await this.sendResult({id:r,topic:e,result:!0})}catch(e){throw c2.delete(t),e}this.client.events.emit("session_update",{id:r,topic:e,params:i})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),pv(this,"isRequestOutOfSync",(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3)),pv(this,"onSessionUpdateResponse",(e,t)=>{let{id:i}=t,r=sh("session_update",i);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);dw(t)?this.events.emit(sh("session_update",i),{}):dy(t)&&this.events.emit(sh("session_update",i),{error:t.error})}),pv(this,"onSessionExtendRequest",async(e,t)=>{let{id:i}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,sc(pr)),await this.sendResult({id:i,topic:e,result:!0}),this.client.events.emit("session_extend",{id:i,topic:e})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}}),pv(this,"onSessionExtendResponse",(e,t)=>{let{id:i}=t,r=sh("session_extend",i);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);dw(t)?this.events.emit(sh("session_extend",i),{}):dy(t)&&this.events.emit(sh("session_extend",i),{error:t.error})}),pv(this,"onSessionPingRequest",async(e,t)=>{let{id:i}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:i,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:e})}catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}}),pv(this,"onSessionPingResponse",(e,t)=>{let{id:i}=t,r=sh("session_ping",i);setTimeout(()=>{if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners 2176`);dw(t)?this.events.emit(sh("session_ping",i),{}):dy(t)&&this.events.emit(sh("session_ping",i),{error:t.error})},500)}),pv(this,"onSessionDeleteRequest",async(e,t)=>{let{id:i}=t;try{await this.isValidDisconnect({topic:e,reason:t.params}),this.cleanupPendingSentRequestsForTopic({topic:e,error:nV("USER_DISCONNECTED")}),await this.deleteSession({topic:e,id:i})}catch(e){this.client.logger.error(e)}}),pv(this,"onSessionRequest",async e=>{var t,i,r;let{topic:n,payload:s,attestation:a,encryptedId:o,transportType:l}=e,{id:c,params:d}=s;try{await this.isValidRequest(pb({topic:n},d));let e=this.client.session.get(n),s=await this.getVerifyContext({attestationId:a,hash:cr(JSON.stringify(dn("wc_sessionRequest",d,c))),encryptedId:o,metadata:e.peer.metadata,transportType:l}),h={id:c,topic:n,params:d,verifyContext:s};await this.setPendingSessionRequest(h),l===dj&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(i=e.peer.metadata.redirect)?void 0:i.universal),null!=(r=this.client.signConfig)&&r.disableRequestQueue?this.emitSessionRequest(h):(this.addSessionRequestToSessionRequestQueue(h),this.processSessionRequestQueue())}catch(e){await this.sendError({id:c,topic:n,error:e}),this.client.logger.error(e)}}),pv(this,"onSessionRequestResponse",(e,t)=>{let{id:i}=t,r=sh("session_request",i);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);dw(t)?this.events.emit(sh("session_request",i),{result:t.result}):dy(t)&&this.events.emit(sh("session_request",i),{error:t.error})}),pv(this,"onSessionEventRequest",async(e,t)=>{let{id:i,params:r}=t;try{let t=`${e}_session_event_${r.event.name}`,n=c2.get(t);if(n&&this.isRequestOutOfSync(n,i))return void this.client.logger.info(`Discarding out of sync request - ${i}`);this.isValidEmit(pb({topic:e},r)),this.client.events.emit("session_event",{id:i,topic:e,params:r}),c2.set(t,i)}
4620catch(t){await this.sendError({id:i,topic:e,error:t}),this.client.logger.error(t)}}),pv(this,"onSessionAuthenticateResponse",(e,t)=>{let{id:i}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),dw(t)?this.events.emit(sh("session_request",i),{result:t.result}):dy(t)&&this.events.emit(sh("session_request",i),{error:t.error})}),pv(this,"onSessionAuthenticateRequest",async e=>{var t;let{topic:i,payload:r,attestation:n,encryptedId:s,transportType:a}=e;try{let{requester:e,authPayload:o,expiryTimestamp:l}=r.params,c=await this.getVerifyContext({attestationId:n,hash:cr(JSON.stringify(r)),encryptedId:s,metadata:e.metadata,transportType:a}),d={requester:e,pairingTopic:i,id:r.id,authPayload:o,verifyContext:c,expiryTimestamp:l};await this.setAuthRequest(r.id,{request:d,pairingTopic:i,transportType:a}),a===dj&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:r.params,id:r.id,verifyContext:c})}catch(s){this.client.logger.error(s);let e=r.params.requester.publicKey,t=await this.client.core.crypto.generateKeyPair(),n=this.getAppLinkIfEnabled(r.params.requester.metadata,a);await this.sendError({id:r.id,topic:i,error:s,encodeOpts:{type:1,receiverPublicKey:e,senderPublicKey:t},rpcOpts:pn.wc_sessionAuthenticate.autoReject,appLink:n})}}),pv(this,"addSessionRequestToSessionRequestQueue",e=>{this.sessionRequestQueue.queue.push(e)}),pv(this,"cleanupAfterResponse",e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=pa,this.processSessionRequestQueue()},(0,T.toMiliseconds)(this.requestQueueDelay))}),pv(this,"cleanupPendingSentRequestsForTopic",({topic:e,error:t})=>{let i=this.client.core.history.pending;i.length>0&&i.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{this.events.emit(sh("session_request",e.request.id),{error:t})})}),pv(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===po)return void this.client.logger.info("session request queue is already active.");let e=this.sessionRequestQueue.queue[0];if(!e)return void this.client.logger.info("session request queue is empty.");try{this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}}),pv(this,"emitSessionRequest",e=>{this.emittedSessionRequests.has(e.id)?this.client.logger.warn({id:e.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${e.id}`):(this.sessionRequestQueue.state=po,this.emittedSessionRequests.add(e.id),this.client.events.emit("session_request",e))}),pv(this,"onPairingCreated",e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);
4620t&&this.onSessionProposeRequest({topic:e.topic,payload:dn("wc_sessionPropose",pp(pb({},t),pf({requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties})),t.id),attestation:t.attestation,encryptedId:t.encryptedId})}),pv(this,"isValidConnect",async e=>{let t;if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:i,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:s,scopedProperties:a,relays:o}=e;if(cj(i)||await this.isValidPairingTopic(i),t=!1,o?o&&cW(o)&&o.length&&o.forEach(e=>{t=cK(e)}):t=!0,!t){let{message:e}=nz("MISSING_OR_INVALID",`connect() relays: ${o}`);throw Error(e)}if(r&&!cj(r)&&0!==cB(r)){let e="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(e):this.client.logger.warn(e),this.validateNamespaces(r,"requiredNamespaces")}if(n&&!cj(n)&&0!==cB(n)&&this.validateNamespaces(n,"optionalNamespaces"),s&&!cj(s)&&this.validateSessionProps(s,"sessionProperties"),a&&!cj(a)){this.validateSessionProps(a,"scopedProperties");let e=Object.keys(r||{}).concat(Object.keys(n||{}));if(!Object.keys(a).every(t=>e.includes(t.split(":")[0])))throw Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(e)}`)}}),pv(this,"validateNamespaces",(e,t)=>{let i=function(e,t,i){let r=null;if(e&&cB(e)){let n,s=cV(e,t);s&&(r=s);let a=(n=null,Object.entries(e).forEach(([e,r])=>{var s,a;let o;if(n)return;let l=(s=nF(e,r),a=`${t} ${i}`,o=null,cW(s)&&s.length?s.forEach(e=>{o||cq(e)||(o=nV("UNSUPPORTED_CHAINS",`${a}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):cq(e)||(o=nV("UNSUPPORTED_CHAINS",`${a}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),o);l&&(n=l)}),n);a&&(r=a)}else r=nz("MISSING_OR_INVALID",`${t}, ${i} should be an object with data`);return r}(e,"connect()",t);if(i)throw Error(i.message)}),pv(this,"isValidApprove",async e=>{if(!cG(e))throw Error(nz("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:i,relayProtocol:r,sessionProperties:n,scopedProperties:s}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let a=this.client.proposal.get(t),o=cZ(i,"approve()");if(o)throw Error(o.message);let l=cJ(a.requiredNamespaces,i,"approve()");if(l)throw Error(l.message);if(!cF(r,!0)){let{message:e}=nz("MISSING_OR_INVALID",`approve() relayProtocol: ${r}`);throw Error(e)}if(n&&!cj(n)&&this.validateSessionProps(n,"sessionProperties"),s&&!cj(s)){this.validateSessionProps(s,"scopedProperties");let e=new Set(Object.keys(i));if(!Object.keys(s).every(t=>e.has(t.split(":")[0])))throw Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(s)}, approved namespaces: ${Array.from(e).join(", ")}`)}}),pv(this,"isValidReject",async e=>{if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:i}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!i||"object"!=typeof i||!i.code||!cH(i.code,!1)||!i.message||!cF(i.message,!1)){let{message:e}=nz("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw Error(e)}}),pv(this,"isValidSessionSettleRequest",e=>{let t;if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}
4620let{relay:i,controller:r,namespaces:n,expiry:s}=e;if(!cK(i)){let{message:e}=nz("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let a=(t=null,cF(r?.publicKey,!1)||(t=nz("MISSING_OR_INVALID","onSessionSettleRequest() controller public key should be a string")),t);if(a)throw Error(a.message);let o=cZ(n,"onSessionSettleRequest()");if(o)throw Error(o.message);if(sd(s)){let{message:e}=nz("EXPIRED","onSessionSettleRequest()");throw Error(e)}}),pv(this,"isValidUpdate",async e=>{if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let r=this.client.session.get(t),n=cZ(i,"update()");if(n)throw Error(n.message);let s=cJ(r.requiredNamespaces,i,"update()");if(s)throw Error(s.message)}),pv(this,"isValidExtend",async e=>{if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)}),pv(this,"isValidRequest",async e=>{var t;let i;if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:r,request:n,chainId:s,expiry:a}=e;this.checkRecentlyDeleted(r),await this.isValidSessionTopic(r);let{namespaces:o}=this.client.session.get(r);if(!cY(o,s)){let{message:e}=nz("MISSING_OR_INVALID",`request() chainId: ${s}`);throw Error(e)}if(cj(n)||!cF(n.method,!1)){let{message:e}=nz("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw Error(e)}if(!(cF(t=n.method,!1)&&(i=[],Object.values(o).forEach(e=>{cP(e.accounts).includes(s)&&i.push(...e.methods)}),i).includes(t))){let{message:e}=nz("MISSING_OR_INVALID",`request() method: ${n.method}`);throw Error(e)}this.validateRequestExpiry(a)}),pv(this,"isValidRespond",async e=>{var t;if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:i,response:r}=e;try{await this.isValidSessionTopic(i)}catch(i){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),i}if(cj(r)||cj(r.result)&&cj(r.error)||!cH(r.id,!1)||!cF(r.jsonrpc,!1)){let{message:e}=nz("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(r)}`);throw Error(e)}let n=this.client.pendingRequest.get(r.id);if(n.topic!==i){let{message:e}=nz("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${r.id}, expected topic: ${n.topic}, received topic: ${i}`);throw Error(e)}}),pv(this,"isValidPing",async e=>{if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),pv(this,"isValidEmit",async e=>{var t;let i;if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:r,event:n,chainId:s}=e;await this.isValidSessionTopic(r);let{namespaces:a}=this.client.session.get(r);if(!cY(a,s)){let{message:e}=nz("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw Error(e)}if(cj(n)||!cF(n.name,!1)||!(cF(t=n.name,!1)&&(i=[],Object.values(a).forEach(e=>{cP(e.accounts).includes(s)&&i.push(...e.events)}),i).includes(t))){let{message:e}=nz("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw Error(e)}}),pv(this,"isValidDisconnect",async e=>{if(!cG(e)){let{message:t}=nz("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),pv(this,"isValidAuthenticate",e=>{let{chains:t,uri:i,domain:r,nonce:n}=e;if(!Array.isArray(t)||0===t.length)throw Error("chains is required and must be a non-empty array");if(!cF(i,!1))throw Error("uri is required parameter");if(!cF(r,!1))throw Error("domain is required parameter");if(!cF(n,!1))throw Error("nonce is required parameter");if([...new Set(t.map(e=>nj(e).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:s}=nj(t[0]);if("eip155"!==s)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),pv(this,"getVerifyContext",async e=>{let{attestationId:t,hash:i,encryptedId:r,metadata:n,transportType:s}=e,a={verified:{verifyUrl:n.verifyUrl||d2,validation:"UNKNOWN",origin:n.url||""}};try{if(s===dj){let e=this.getAppLinkIfEnabled(n,s);return a.verified.validation=e&&new URL(e).origin===new URL(n.url).origin?"VALID":"INVALID",a}let e=await this.client.core.verify.resolve({attestationId:t,hash:i,encryptedId:r,verifyUrl:n.verifyUrl});e&&(a.verified.origin=e.origin,a.verified.isScam=e.isScam,a.verified.validation=e.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(a)}`),a}),pv(this,"validateSessionProps",(e,t)=>{Object.values(e).forEach((i,r)=>{if(null==i){let{message:n}=nz("MISSING_OR_INVALID",`${t} must contain an existing value for each key. Received: ${i} for key ${Object.keys(e)[r]}`);throw Error(n)}})}),pv(this,"getPendingAuthRequest",e=>{let t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0}),pv(this,"addToRecentlyDeleted",(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;
4620for(let i of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(i)}}}),pv(this,"checkRecentlyDeleted",e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:i}=nz("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw Error(i)}}),pv(this,"isLinkModeEnabled",(e,t)=>{var i,r,n,s,a,o,l,c,d;return!!e&&t===dj&&(null==(r=null==(i=this.client.metadata)?void 0:i.redirect)?void 0:r.linkMode)===!0&&(null==(s=null==(n=this.client.metadata)?void 0:n.redirect)?void 0:s.universal)!==void 0&&(null==(o=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:o.universal)!==""&&(null==(l=e?.redirect)?void 0:l.universal)!==void 0&&(null==(c=e?.redirect)?void 0:c.universal)!==""&&(null==(d=e?.redirect)?void 0:d.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&"u">typeof(null==global?void 0:global.Linking)}),pv(this,"getAppLinkIfEnabled",(e,t)=>{var i;return this.isLinkModeEnabled(e,t)?null==(i=e?.redirect)?void 0:i.universal:void 0}),pv(this,"handleLinkModeMessage",({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;let t=sg(e,"topic")||"",i=decodeURIComponent(sg(e,"wc_ev")||""),r=this.client.session.keys.includes(t);r&&this.client.session.update(t,{transportType:dj}),this.client.core.dispatchEnvelope({topic:t,message:i,sessionExists:r})}),pv(this,"registerLinkModeListeners",async()=>{var e;if(sw()||n6()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){let e=null==global?void 0:global.Linking;if("u">typeof e){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}),pv(this,"getTVFApproveParams",e=>{try{var t,i;let r,n,s=c$(e.namespaces),a=(t=e.namespaces,r=[],Object.values(t).forEach(e=>{r.push(...e.methods)}),[...new Set(r)]),o=(i=e.namespaces,n=[],Object.values(i).forEach(e=>{n.push(...e.events)}),[...new Set(n)]),l=e.sessionProperties,c=e.scopedProperties;return{approvedChains:s,approvedMethods:a,approvedEvents:o,sessionProperties:l,scopedProperties:c}}catch(e){return this.client.logger.warn(e,"Error getting TVF approve params"),{}}}),pv(this,"getTVFParams",(e,t,i)=>{var r,n,s;if(!(null!=(r=t.request)&&r.method))return{};let a={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{a.txHashes=this.extractTxHashesFromResult(t.request,i),a.contractAddresses=this.isValidContractData(t.request.params)?[null==(s=null==(n=t.request.params)?void 0:n[0])?void 0:s.to]:[]}catch(e){this.client.logger.warn(e,"Error getting TVF params")}return a}),pv(this,"isValidContractData",e=>{var t;if(!e)return!1;try{let i=e?.data||(null==(t=e?.[0])?void 0:t.data);if(!i.startsWith("0x"))return!1;let r=i.slice(2);return!!/^[0-9a-fA-F]*$/.test(r)&&r.length%2==0}catch{}return!1}),pv(this,"extractTxHashesFromResult",(e,t)=>{var i,r,n,s,a;try{if(!t)return[];let o=e.method,l=pl[o];if("sui_signTransaction"===o){let e,i,r,s;return[(n=t.transactionBytes,e=new Uint8Array(nB.from(n,"base64")),i=Array.from("TransactionData::").map(e=>e.charCodeAt(0)),(r=new Uint8Array(i.length+e.length)).set(i),r.set(e,i.length),s=aF(r,{dkLen:32}),rO.encode(s))]}if("near_signTransaction"===o)return[aV(t)];if("near_signTransactions"===o)return t.map(e=>aV(e));if("xrpl_signTransactionFor"===o||"xrpl_signTransaction"===o)return[null==(i=t.tx_json)?void 0:i.hash];if("polkadot_signTransaction"===o){let i,n,s,a;return[(r={transaction:e.params.transactionPayload,signature:t.signature},s=Uint8Array.from(nB.from(r.signature,"hex")),a=function({publicKey:e,signature:t,payload:i}){var r,n,s;let a,o=c3(i.method),l=128|parseInt((null==(r=i.version)?void 0:r.toString())||"4"),c=(n=i.address,a=rO.decode(n)[0],42===a?0:60===a?2:1),d="00"===i.era?new Uint8Array([0]):c3(i.era);if(1!==d.length&&2!==d.length)throw Error("Invalid era length");let h=parseInt(i.nonce,16),u=new Uint8Array([255&h,h>>8&255]),p=new Uint8Array([0,...e,c,...t,...d,...u,...function(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){let t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}if(e<BigInt(1)<<BigInt(30)){let t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}throw Error("BigInt compact encoding not supported > 2^30")}(BigInt(`0x${(s=i.tip).startsWith("0x")?s.slice(2):s}`)),...o]);return new Uint8Array([...function(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){let t=e<<2|1;return new Uint8Array([255&t,t>>8&255])}if(e<0x40000000){let t=e<<2|2;return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}throw Error("Compact encoding > 2^30 not supported")}(p.length+1),l,...p])}({publicKey:function(e){let t=rO.decode(e);if(t.length<33)throw Error("Too short to contain a public key");return t.slice(1,33)}(r.transaction.address),signature:s,payload:r.transaction}),i=c3(nB.from(a).toString("hex")),n=(0,nL.blake2b)(i,void 0,32),"0x"+nB.from(n).toString("hex"))]}if("algo_signTxn"===o)return cW(t)?t.map(e=>aZ(e)):[aZ(t)];
4620if("cosmos_signDirect"===o){let e,i,r,n,s;return[(e=nB.from(t.signed.bodyBytes,"base64"),i=nB.from(t.signed.authInfoBytes,"base64"),r=nB.from(t.signature.signature,"base64"),(n=[]).push(nB.from([10])),n.push(aK(e.length)),n.push(e),n.push(nB.from([18])),n.push(aK(i.length)),n.push(i),n.push(nB.from([26])),n.push(aK(r.length)),n.push(r),s=aO(nB.concat(n)),nB.from(s).toString("hex").toUpperCase())]}if("wallet_sendCalls"===o){let e=[];try{if("string"==typeof t)return e.push(t),e;if("object"!=typeof t)return e;null!=t&&t.id&&e.push(t.id);let i=null==(a=null==(s=t?.capabilities)?void 0:s.caip345)?void 0:a.transactionHashes;i&&e.push(...i)}catch(e){console.warn("getWalletSendCallsHashes failed: ",e)}return e}if("string"==typeof t)return[t];let c=t[l.key];if(cW(c))return"solana_signAllTransactions"===o?c.map(e=>(function(e){let t=atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);let r=i[0];if(0===r)throw Error("No signatures found");if(i.length<1+64*r)throw Error("Transaction data too short for claimed signature count");if(i.length<100)throw Error("Transaction too short");let n=nB.from(e,"base64").slice(1,65);return rO.encode(n)})(e)):c;if("string"==typeof c)return[c]}catch(e){this.client.logger.warn(e,"Error extracting tx hashes from result")}return[]})}async processPendingMessageEvents(){try{let e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(let[e,i]of Object.entries(t))for(let t of i)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn(e,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){let{message:e}=nz("NOT_INITIALIZED",this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(dR,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){let{topic:t,message:i,attestation:r,transportType:n}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(ph)?this.client.auth.authKeys.get(ph):{responseTopic:void 0,publicKey:void 0};try{let e=await this.client.core.crypto.decode(t,i,{receiverPublicKey:s,encoding:n===dj?l7:l9});dg(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:r,transportType:n,encryptedId:cr(i)})):dm(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:n}),this.client.core.history.delete(t,e.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(e)}`),await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:n})),await this.client.core.relayer.messages.ack(t,i)}catch(e){this.client.logger.error(`onRelayMessage() -> failed to process an inbound message: ${i}`),this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(d1,async e=>{let{topic:t,id:i}=sl(e.target);return i&&this.client.pendingRequest.keys.includes(i)?await this.deletePendingSessionRequest(i,nz("EXPIRED"),!0):i&&this.client.auth.requests.keys.includes(i)?await this.deletePendingAuthRequest(i,nz("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i})))})}registerPairingEvents(){this.client.core.pairing.events.on(dK,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(dG,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!cF(e,!1)){let{message:t}=nz("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=nz("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(sd(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=nz("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!cF(e,!1)){let{message:t}=nz("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=nz("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if(sd(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=nz("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=nz("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(cF(e,!1)){let{message:t}=nz("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=nz("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if("number"!=typeof e){let{message:t}=nz("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=nz("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if(sd(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=nz("EXPIRED",`proposal id: ${e}`);throw Error(t)}}validateRequestExpiry(e){if(e&&(!cH(e,!1)||!(e<=ps.max)||!(e>=ps.min))){let{message:t}=nz("MISSING_OR_INVALID",`request() expiry: ${e}. Expiry must be a number (in seconds) between ${ps.min} and ${ps.max}`);throw Error(t)}}}class pE extends uO{constructor(e,t){super(e,t,"proposal",pe),this.core=e,this.logger=t}}class px extends uO{constructor(e,t){super(e,t,"session",pe),this.core=e,this.logger=t}}class pA extends uO{constructor(e,t){super(e,t,"request",pe,e=>e.id),this.core=e,this.logger=t}}class p_ extends uO{constructor(e,t){super(e,t,"authKeys",pd,()=>ph),this.core=e,this.logger=t}}class pI extends uO{constructor(e,t){super(e,t,"pairingTopics",pd),this.core=e,this.logger=t}}class pS extends uO{constructor(e,t){super(e,t,"requests",pd,e=>e.id),this.core=e,this.logger=t}}var pN=Object.defineProperty,pk=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?pN(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class pT{constructor(e,t){this.core=e,this.logger=t,pk(this,"authKeys"),pk(this,"pairingTopics"),pk(this,"requests"),this.authKeys=new p_(this.core,this.logger),this.pairingTopics=new pI(this.core,this.logger),this.requests=new pS(this.core,this.logger)}
4620async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var pO=Object.defineProperty,pR=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?pO(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class pP extends eA{constructor(e){super(e),pR(this,"protocol","wc"),pR(this,"version",2),pR(this,"name",u7),pR(this,"metadata"),pR(this,"core"),pR(this,"logger"),pR(this,"events",new N.EventEmitter),pR(this,"engine"),pR(this,"session"),pR(this,"proposal"),pR(this,"pendingRequest"),pR(this,"auth"),pR(this,"signConfig"),pR(this,"on",(e,t)=>this.events.on(e,t)),pR(this,"once",(e,t)=>this.events.once(e,t)),pR(this,"off",(e,t)=>this.events.off(e,t)),pR(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),pR(this,"removeAllListeners",e=>this.events.removeAllListeners(e)),pR(this,"connect",async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"pair",async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"approve",async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"reject",async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"update",async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"extend",async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"request",async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"respond",async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"ping",async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"emit",async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"disconnect",async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"find",e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}}),pR(this,"authenticate",async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"formatAuthMessage",e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"approveSessionAuthenticate",async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),pR(this,"rejectSessionAuthenticate",async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),this.name=e?.name||u7,this.metadata=function(e){var t,i;let r=se();try{let n,s;return null!=e&&e.url&&r.url&&new URL(e.url).host!==new URL(r.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${r.url}. This is probably unintended and can lead to issues.`),e.url=r.url),null!=(t=e?.icons)&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>""!==e)),n=n0(n0({},r),e),s={url:e?.url||r.url,name:e?.name||r.name,description:e?.description||r.description,icons:null!=(i=e?.icons)&&i.length&&e.icons.length>0?e.icons:r.icons},nK(n,nG(s))}catch(t){return console.warn("Error populating app metadata",t),e||r}}(e?.metadata),this.signConfig=e?.signConfig;const t=c5({logger:e?.logger||"error",name:this.name});this.logger=t,this.core=e?.core||new u9(e),this.session=new px(this.core,this.logger),this.proposal=new pE(this.core,this.logger),this.pendingRequest=new pA(this.core,this.logger),this.engine=new pC(this),this.auth=new pT(this.core,this.logger)}static async init(e){let t=new pP(e);return await t.initialize(),t}get context(){return(0,eo.oI)(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var p$=i(37837),pU=i.n(p$),pM=Object.defineProperty,pD=Object.defineProperties,pL=Object.getOwnPropertyDescriptors,pW=Object.getOwnPropertySymbols,pB=Object.prototype.hasOwnProperty,pj=Object.prototype.propertyIsEnumerable,pF=(e,t,i)=>t in e?pM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,pH=(e,t)=>{for(var i in t||(t={}
4620))pB.call(t,i)&&pF(e,i,t[i]);if(pW)for(var i of pW(t))pj.call(t,i)&&pF(e,i,t[i]);return e};let pq={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class pz{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new N.EventEmitter,this.isAvailable=!1,this.registering=!1,!du(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{let t,i,r=J(e),n=await (await pU()(this.url,(t=pH({},pq),i={body:r},pD(t,pL(i))))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!du(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(Error("HTTP connection is missing or invalid"));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t,i,r=J({id:1,jsonrpc:"2.0",method:"test",params:[]});await pU()(e,(t=pH({},pq),i={body:r},pD(t,pL(i))))}this.onOpen()}catch(t){let e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?Y(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let i=this.parseError(t),r=da(e,i.message||i.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return de(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}var pV=i(49304).hp;function pZ(e){return null==e||"object"!=typeof e&&"function"!=typeof e}function pK(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function pG(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let pY="[object String]",pJ="[object Number]",pX="[object Boolean]",pQ="[object Arguments]",p0="[object Object]";function p1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function p2(e,t,i,r=new Map,n){let s=n?.(e,t,i,r);if(void 0!==s)return s;if(pZ(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let s=0;s<e.length;
4620s++)t[s]=p2(e[s],s,i,r,n);return Object.hasOwn(e,"index")&&(t.index=e.index),Object.hasOwn(e,"input")&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;for(let[s,a]of(r.set(e,t),e))t.set(s,p2(a,s,i,r,n));return t}if(e instanceof Set){let t=new Set;for(let s of(r.set(e,t),e))t.add(p2(s,void 0,i,r,n));return t}if("u">typeof pV&&pV.isBuffer(e))return e.subarray();if(p1(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let s=0;s<e.length;s++)t[s]=p2(e[s],s,i,r,n);return t}if(e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),p3(t,e,i,r,n),t}if("u">typeof File&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),p3(t,e,i,r,n),t}if("u">typeof Blob&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),p3(t,e,i,r,n),t}if(e instanceof Error){let t=new e.constructor;return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,p3(t,e,i,r,n),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),p3(t,e,i,r,n),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),p3(t,e,i,r,n),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),p3(t,e,i,r,n),t}if("object"==typeof e&&function(e){switch(pG(e)){case pQ:case"[object Array]":case"[object ArrayBuffer]":case"[object DataView]":case pX:case"[object Date]":case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Map]":case pJ:case p0:case"[object RegExp]":case"[object Set]":case pY:case"[object Symbol]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return!0;default:return!1}}(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),p3(t,e,i,r,n),t}return e}function p3(e,t,i=e,r,n){let s=[...Object.keys(t),...pK(t)];for(let a=0;a<s.length;a++){let o=s[a],l=Object.getOwnPropertyDescriptor(e,o);
4620(null==l||l.writable)&&(e[o]=p2(t[o],o,i,r,n))}}function p5(e){var t;return t=(t,i,r,n)=>{let s;if(void 0!==s)return s;if("object"==typeof e){if(pG(e)===p0&&"function"!=typeof e.constructor){let t={};return n.set(e,t),p3(t,e,r,n),t}switch(Object.prototype.toString.call(e)){case pJ:case pY:case pX:{let t=new e.constructor(e?.valueOf());return p3(t,e),t}case pQ:{let t={};return p3(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}},p2(e,void 0,e,new Map,t)}function p4(e){return null!==e&&"object"==typeof e&&"[object Arguments]"===pG(e)}function p6(e){return"object"==typeof e&&null!==e}function p8(){}function p9(e){if("object"!=typeof e||null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){let t=e[Symbol.toStringTag];return null!=t&&!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}let p7="error",fe="universal_provider",ft=`wc@2:${fe}:`,fi="https://rpc.walletconnect.org/v1/",fr="generic",fn=`${fi}bundler`,fs="call_status",fa="default_chain_changed";var fo=Object.defineProperty,fl=Object.defineProperties,fc=Object.getOwnPropertyDescriptors,fd=Object.getOwnPropertySymbols,fh=Object.prototype.hasOwnProperty,fu=Object.prototype.propertyIsEnumerable,fp=(e,t,i)=>t in e?fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,ff=(e,t)=>{for(var i in t||(t={}))fh.call(t,i)&&fp(e,i,t[i]);if(fd)for(var i of fd(t))fu.call(t,i)&&fp(e,i,t[i]);return e},fg=(e,t)=>fl(e,fc(t));function fm(e,t,i){var r;let n=nj(e);return(null==(r=t.rpcMap)?void 0:r[n.reference])||`${fi}?chainId=${n.namespace}:${n.reference}&projectId=${i}`}function fw(e){return e.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function fy(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>{var i,r;return(null==(i=t?.chains)?void 0:i.length)&&(null==(r=t?.chains)?void 0:r.length)>0}))}function fb(e={},t={}){return function(e,...t){return function(e,...t){let i=t.slice(0,-1),r=t[t.length-1],n=e;for(let e=0;e<i.length;e++)n=function e(t,i,r,n){if(pZ(t)&&(t=Object(t)),null==i||"object"!=typeof i)return t;if(n.has(i))return function(e){if(pZ(e))return e;if(Array.isArray(e)||p1(e)||e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(null==t)return Object.assign(Object.create(t),e);let i=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new i(e);if(e instanceof RegExp){let t=new i(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new i(e.buffer.slice(0));if(e instanceof Error){let t;return(t=e instanceof AggregateError?new i(e.errors,e.message,{cause:e.cause}):new i(e.message,{cause:e.cause})).stack=e.stack,Object.assign(t,e),t}return"u">typeof File&&e instanceof File?new i([e],e.name,{type:e.type,lastModified:e.lastModified}):"object"==typeof e?Object.assign(Object.create(t),e):e}(n.get(i));if(n.set(i,t),Array.isArray(i)){i=i.slice();for(let e=0;e<i.length;e++)i[e]=i[e]??void 0}let s=[...Object.keys(i),...pK(i)];for(let a=0;a<s.length;a++){let o=s[a];if("__proto__"===o)continue;let l=i[o],c=t[o];if(p4(l)&&(l={...l}),p4(c)&&(c={...c}),"u">typeof pV&&pV.isBuffer(l)&&(l=p5(l)),Array.isArray(l))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let i=0;i<t.length;i++){let r=t[i];e[r]=c[r]}c=e}else if(function(e){var t;return p6(e)&&null!=e&&"function"!=typeof e&&Number.isSafeInteger(t=e.length)&&t>=0}(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let d=r(c,l,o,t,i,n);void 0!==d?t[o]=d:Array.isArray(l)||p6(c)&&p6(l)&&(p9(c)||p9(l)||p1(c)||p1(l))?t[o]=e(c,l,r,n):null==c&&p9(l)?t[o]=e({},l,r,n):null==c&&p1(l)?t[o]=p5(l):(void 0===c||void 0!==l)&&(t[o]=l)}return t}(n,i[e],r,new Map);return n}(e,...t,p8)}(fy(fv(e)),fy(fv(t)))}function fv(e){var t,i,r,n,s;let a={};if(!cB(e))return a;for(let[o,l]of Object.entries(e)){let e=cU(o)?[o]:l.chains,c=l.methods||[],d=l.events||[],h=l.rpcMap||{},u=cM(o);a[u]=fg(ff(ff({},a[u]),l),{chains:su(e,null==(t=a[u])?void 0:t.chains),methods:su(c,null==(i=a[u])?void 0:i.methods),events:su(d,null==(r=a[u])?void 0:r.events)}),(cB(h)||cB((null==(n=a[u])?void 0:n.rpcMap)||{}))&&(a[u].rpcMap=ff(ff({},h),null==(s=a[u])?void 0:s.rpcMap))}return a}function fC(e){return e.includes(":")?e.split(":")[2]:e}function fE(e){let t={};for(let[i,r]of Object.entries(e)){let e=r.methods||[],n=r.events||[],s=r.accounts||[],a=cU(i)?[i]:r.chains?r.chains:fw(r.accounts);t[i]={chains:a,methods:e,events:n,accounts:s}}return t}function fx(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):isNaN(Number(e=e.includes(":")?e.split(":")[1]:e))?e:Number(e)}let fA={},f_=e=>fA[e],fI=(e,t)=>{fA[e]=t};var fS=Object.defineProperty,fN=Object.getOwnPropertySymbols,fk=Object.prototype.hasOwnProperty,fT=Object.prototype.propertyIsEnumerable,fO=(e,t,i)=>t in e?fS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,fR=(e,t)=>{for(var i in t||(t={}))fk.call(t,i)&&fO(e,i,t[i]);if(fN)for(var i of fN(t))fT.call(t,i)&&fO(e,i,t[i]);return e};
4620let fP="eip155",f$=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],fU=e=>e&&e.startsWith("0x")?BigInt(e).toString(10):e,fM=e=>e&&e.startsWith("0x")?e:`0x${BigInt(e).toString(16)}`,fD=e=>Object.keys(e).filter(e=>f$.includes(e)).reduce((t,i)=>(t[i]=fL(e[i]),t),{}),fL=e=>"string"==typeof e&&function(e){try{let t=JSON.parse(e);return"object"==typeof t&&null!==t&&!Array.isArray(t)}catch{return!1}}(e)?JSON.parse(e):e;var fW=Object.defineProperty;class fB{constructor(e){((e,t)=>{let i,r;return r=void 0,(i="symbol"!=typeof t?t+"":t)in e?fW(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r})(this,"storage"),this.storage=e}async getItem(e){return await this.storage.getItem(e)}async setItem(e,t){return await this.storage.setItem(e,t)}async removeItem(e){return await this.storage.removeItem(e)}static getStorage(e){return r||(r=new fB(e)),r}}var fj=Object.defineProperty,fF=Object.defineProperties,fH=Object.getOwnPropertyDescriptors,fq=Object.getOwnPropertySymbols,fz=Object.prototype.hasOwnProperty,fV=Object.prototype.propertyIsEnumerable,fZ=(e,t,i)=>t in e?fj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;async function fK(e,t){let i,r=nj(e.result.capabilities.caip345.caip2),n=e.result.capabilities.caip345.transactionHashes,s=await Promise.allSettled(n.map(e=>fG(r.reference,e,t))),a=s.filter(e=>"fulfilled"===e.status).map(e=>e.value).filter(e=>e);s.filter(e=>"rejected"===e.status).forEach(e=>console.warn("Failed to fetch transaction receipt:",e.reason));let o=!a.length||a.some(e=>!e),l=a.every(e=>e?.status==="0x1"),c=a.every(e=>e?.status==="0x0"),d=a.some(e=>e?.status==="0x0");return o?i=100:l?i=200:c?i=500:d&&(i=600),{id:e.result.id,version:e.request.version,atomic:e.request.atomicRequired,chainId:e.request.chainId,capabilities:e.result.capabilities,receipts:a,status:i}}async function fG(e,t,i){return await i(parseInt(e)).request(dn("eth_getTransactionReceipt",[t]))}async function fY({sendCalls:e,storage:t}){let i=await t.getItem(fs);await t.setItem(fs,fF(((e,t)=>{for(var i in t||(t={}))fz.call(t,i)&&fZ(e,i,t[i]);if(fq)for(var i of fq(t))fV.call(t,i)&&fZ(e,i,t[i]);return e})({},i),fH({[e.result.id]:{request:e.request,result:e.result,expiry:sc(86400)}})))}async function fJ({resultId:e,storage:t}){let i=await t.getItem(fs);if(i){for(let r in delete i[e],await t.setItem(fs,i),i)sd(i[r].expiry)&&delete i[r];await t.setItem(fs,i)}}async function fX({resultId:e,storage:t}){let i=await t.getItem(fs),r=i?.[e];if(r&&!sd(r.expiry))return r;await fJ({resultId:e,storage:t})}var fQ=Object.defineProperty,f0=Object.defineProperties,f1=Object.getOwnPropertyDescriptors,f2=Object.getOwnPropertySymbols,f3=Object.prototype.hasOwnProperty,f5=Object.prototype.propertyIsEnumerable,f4=(e,t,i)=>t in e?fQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,f6=(e,t)=>{for(var i in t||(t={}))f3.call(t,i)&&f4(e,i,t[i]);if(f2)for(var i of f2(t))f5.call(t,i)&&f4(e,i,t[i]);return e},f8=(e,t,i)=>f4(e,"symbol"!=typeof t?t+"":t,i);class f9{constructor(e){f8(this,"name","eip155"),f8(this,"client"),f8(this,"chainId"),f8(this,"namespace"),f8(this,"httpProviders"),f8(this,"events"),f8(this,"storage"),this.namespace=e.namespace,this.events=f_("events"),this.client=f_("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=fB.getStorage(this.client.core.storage)}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e);case"wallet_sendCalls":return await this.sendCalls(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t);let i=this.chainId;this.chainId=parseInt(e),this.events.emit(fa,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${i}`})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){let i=t||fm(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new db(new pz(i,f_("disableProviderPing")))}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var i;let r=parseInt(t.includes(":")?t.split(":")[1]:t);e[r]=this.createHttpProvider(r,null==(i=this.namespace.rpcMap)?void 0:i[t])}),e}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(e){let t=e||this.chainId;return this.httpProviders[t]||(this.httpProviders=f0(f6({},this.httpProviders),f1({[t]:this.createHttpProvider(t)})),this.httpProviders[t])}async handleSwitchChain(e){var t,i;let r=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0",n=parseInt(r=r.startsWith("0x")?r:`0x${r}`,16);if(this.isChainApproved(n))this.setDefaultChain(`${n}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:r}]},chainId:null==(i=this.namespace.chains)?void 0:i[0]}),this.setDefaultChain(`${n}`);else throw Error(`Failed to switch to chain 'eip155:${n}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,i,r,n,s;let a,o=null==(i=null==(t=e.request)?void 0:t.params)?void 0:i[0],l=(null==(n=null==(r=e.request)?void 0:r.params)?void 0:n[1])||[];if(!o)throw Error("Missing address parameter in `wallet_getCapabilities` request");let c=this.client.session.get(e.topic),d=(null==(s=c?.sessionProperties)?void 0:s.capabilities)||{},h=l.length>0?l.join(","):`0x${this.chainId.toString(16)}`,u=`${o}${h}`,p=d?.[u];if(p)return p;try{a=((e,t,i)=>{let{sessionProperties:r={},scopedProperties:n={}}=e,s={};if(!cB(n)&&!cB(r))return;let a=fD(r);for(let e of i){let i=fU(e);if(!i)continue;s[fM(i)]=a;let r=n?.[`${fP}:${i}`];if(r){let e=r?.[`${fP}:${i}:${t}`];s[fM(i)]=fR(fR({},s[fM(i)]),fD(e||r))}}for(let[e,t]of Object.entries(s))0===Object.keys(t).length&&delete s[e];return Object.keys(s).length>0?s:void 0})(c,o,l)}catch(e){console.warn("Failed to extract capabilities from session",e)}if(a)return a;let f=await this.client.request(e);try{let t,i,r,n;await this.client.session.update(e.topic,{sessionProperties:(r=f6({},c.sessionProperties||{}),n={capabilities:(t=f6({},d||{}),i={[u]:f},f0(t,f1(i)))},f0(r,f1(n)))})}catch(e){console.warn("Failed to update session with capabilities",e)}return f}async getCallStatus(e){var t,i,r;let n=this.client.session.get(e.topic),s=null==(t=n.sessionProperties)?void 0:t.bundler_name;if(s){let t=this.getBundlerUrl(e.chainId,s);try{return await this.getUserOperationReceipt(t,e)}catch(e){console.warn("Failed to fetch call status from bundler",e,t)}}let a=null==(i=n.sessionProperties)?void 0:i.bundler_url;if(a)try{return await this.getUserOperationReceipt(a,e)}catch(e){console.warn("Failed to fetch call status from custom bundler",e,a)}let o=await fX({resultId:null==(r=e.request.params)?void 0:r[0],storage:this.storage});if(o)try{return await fK(o,this.getHttpProvider.bind(this))}catch(e){console.warn("Failed to fetch call status from stored send calls",e,o)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var i;let r=new URL(e),n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(dn("eth_getUserOperationReceipt",[null==(i=t.request.params)?void 0:i[0]]))});if(!n.ok)throw Error(`Failed to fetch user operation receipt - ${n.status}`);return await n.json()}
4620getBundlerUrl(e,t){return`${fn}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}async sendCalls(e){var t,i,r;let n=await this.client.request(e),s=null==(t=e.request.params)?void 0:t[0],a=n?.id,o=n?.capabilities||{},l=null==(i=o?.caip345)?void 0:i.caip2,c=null==(r=o?.caip345)?void 0:r.transactionHashes;return a&&l&&null!=c&&c.length&&await fY({sendCalls:{request:s,result:n},storage:this.storage}),n}}var f7=Object.defineProperty,ge=(e,t,i)=>{let r;return(r="symbol"!=typeof t?t+"":t)in e?f7(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i};class gt{constructor(e){ge(this,"name",fr),ge(this,"client"),ge(this,"httpProviders"),ge(this,"events"),ge(this,"namespace"),ge(this,"chainId"),this.namespace=e.namespace,this.events=f_("events"),this.client=f_("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t);let i=this.chainId;this.chainId=e,this.events.emit(fa,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${i}`})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getNamespaceName(){let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return nj(e).namespace}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){var e,t;let i={};return null==(t=null==(e=this.namespace)?void 0:e.accounts)||t.forEach(e=>{var t,r;let n=nj(e),s=null==(r=null==(t=this.namespace)?void 0:t.rpcMap)?void 0:r[`${n.namespace}:${n.reference}`];i[n.reference]=this.createHttpProvider(e,s)}),i}getHttpProvider(e){let t=nj(e).reference,i=this.httpProviders[t];if(typeof i>"u")throw Error(`JSON-RPC provider for ${e} not found`);return i}setHttpProvider(e,t){let i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){let i=t||fm(e,this.namespace,this.client.core.projectId);if(!i)throw Error(`No RPC url provided for chainId: ${e}`);return new db(new pz(i,f_("disableProviderPing")))}}var gi=Object.defineProperty,gr=Object.defineProperties,gn=Object.getOwnPropertyDescriptors,gs=Object.getOwnPropertySymbols,ga=Object.prototype.hasOwnProperty,go=Object.prototype.propertyIsEnumerable,gl=(e,t,i)=>t in e?gi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,gc=(e,t)=>{for(var i in t||(t={}))ga.call(t,i)&&gl(e,i,t[i]);if(gs)for(var i of gs(t))go.call(t,i)&&gl(e,i,t[i]);return e},gd=(e,t,i)=>gl(e,"symbol"!=typeof t?t+"":t,i);class gh{constructor(e){var t,i;gd(this,"client"),gd(this,"namespaces"),gd(this,"optionalNamespaces"),gd(this,"sessionProperties"),gd(this,"scopedProperties"),gd(this,"events",new N),gd(this,"rpcProviders",{}),gd(this,"session"),gd(this,"providerOpts"),gd(this,"logger"),gd(this,"uri"),gd(this,"disableProviderPing",!1),gd(this,"connectParams"),this.providerOpts=e,this.logger=c5({logger:null!=(t=e.logger)?t:p7,name:null!=(i=this.providerOpts.name)?i:fe}),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){let t=new gh(e);return await t.initialize(),t}async request(e,t,i){let[r,n]=this.validateChain(t);if(!this.session)throw Error("Please call connect() before request()");return await this.getProvider(r).request({request:gc({}
4620,e),chainId:`${r}:${n}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,r){let n=new Date().getTime();this.request(e,i,r).then(e=>t(null,ds(n,e))).catch(e=>t(e,void 0))}async enable(){if(!this.client)throw Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:nV("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw Error("Sign Client not initialized");if(this.connectParams=e,this.setNamespaces(e),this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();let{uri:i,response:r}=await this.client.authenticate(e,t);i&&(this.uri=i,this.events.emit("display_uri",i));let n=await r();if(this.session=n.session,this.session){let e=fE(this.session.namespaces);this.namespaces=fb(this.namespaces,e),await this.persist("namespaces",this.namespaces),this.onConnect()}return n}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){var t,i;let{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties,authentication:null==(t=this.connectParams)?void 0:t.authentication,walletPay:null==(i=this.connectParams)?void 0:i.walletPay});r&&(this.uri=r,this.events.emit("display_uri",r));let s=await n();this.session=s;let a=fE(s.namespaces);return this.namespaces=fb(this.namespaces,a),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;let[i,r]=this.validateChain(e),n=this.getProvider(i);n?n.setDefaultChain(r,t):this.session&&this.logger.warn(`Provider for namespace '${i}' not found in setDefaultChain`)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){try{this.logger.info("Cleaning up inactive pairings...");let t=this.client.pairing.getAll();if(!cW(t))return;for(let i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}catch(e){this.logger.warn(e,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,t;if(this.client=this.providerOpts.client||await pP.init({core:this.providerOpts.core,logger:this.providerOpts.logger||p7,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.org",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(i){throw this.logger.error(i,"Failed to get session"),Error(`The provided session: ${null==(t=null==(e=this.providerOpts)?void 0:e.session)?void 0:t.topic} doesn't exist in the Sign client`)}else{let e=this.client.session.getAll();this.session=e[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw Error("Sign Client not initialized");if(!this.session)throw Error("Session not initialized. Please call connect() before enable()");let e=[...new Set(Object.keys(this.session.namespaces).map(e=>cM(e)))];fI("client",this.client),fI("events",this.events),fI("disableProviderPing",this.disableProviderPing),e.forEach(e
4620=>{if(!this.session)return;let t=function(e,t){let i=Object.keys(t.namespaces).filter(t=>t.includes(e));if(!i.length)return[];let r=[];return i.forEach(e=>{let i=t.namespaces[e].accounts;r.push(...i)}),r}(e,this.session);if(t?.length===0)return;let i=fw(t),r=gr(gc({},fb(this.namespaces,this.optionalNamespaces)[e]),gn({accounts:t,chains:i}));"eip155"===e?this.rpcProviders[e]=new f9({namespace:r}):this.rpcProviders[e]=new gt({namespace:r})})}registerEventListeners(){if(typeof this.client>"u")throw Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var t;let{topic:i}=e;i===(null==(t=this.session)?void 0:t.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var t;let{params:i,topic:r}=e;if(r!==(null==(t=this.session)?void 0:t.topic))return;let{event:n}=i;if("accountsChanged"===n.name){let e=n.data;e&&cW(e)&&this.events.emit("accountsChanged",e.map(fC))}else if("chainChanged"===n.name){let e=i.chainId,t=i.event.data,r=cM(e),n=fx(e)!==fx(t)?`${r}:${fx(t)}`:e;this.onChainChanged({currentCaipChainId:n})}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i,r;if(e!==(null==(i=this.session)?void 0:i.topic))return;let{namespaces:n}=t,s=null==(r=this.client)?void 0:r.session.get(e);this.session=gr(gc({},s),gn({namespaces:n})),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{var t;e.topic===(null==(t=this.session)?void 0:t.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",gr(gc({},nV("USER_DISCONNECTED")),gn({data:e.topic}))))}),this.on(fa,e=>{this.onChainChanged(gr(gc({},e),gn({internal:!0})))})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[fr]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])})}setNamespaces(e){let{namespaces:t={},optionalNamespaces:i={},sessionProperties:r,scopedProperties:n}=e;this.optionalNamespaces=fb(t,i),this.sessionProperties=r,this.scopedProperties=n}validateChain(e){let[t,i]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(e=>cM(e)).includes(t))throw Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];let r=cM(Object.keys(this.namespaces)[0]),n=this.rpcProviders[r].getDefaultChain();return[r,n]}async requestAccounts(){let[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged({currentCaipChainId:e,previousCaipChainId:t,internal:i=!1}){if(!this.namespaces)return;let[r,n]=this.validateChain(e);if(n){if(this.updateNamespaceChain(r,n),i)this.events.emit("chainChanged",n),this.emitAccountsChangedOnChainChange({namespace:r,currentCaipChainId:e,previousCaipChainId:t});else{let e=this.getProvider(r);e?e.setDefaultChain(n):this.session&&this.logger.warn(`Provider for namespace '${r}' not found during chain change`)}await this.persist("namespaces",this.namespaces)}}emitAccountsChangedOnChainChange({namespace:e,currentCaipChainId:t,previousCaipChainId:i}){var r,n;try{if(i===t)return;let s=null==(n=null==(r=this.session)?void 0:r.namespaces[e])?void 0:n.accounts;if(!s)return;let a=s.filter(e=>e.includes(`${t}:`)).map(fC);if(!cW(a))return;this.events.emit("accountsChanged",a)}catch(e){this.logger.warn(e,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(e,t){if(!this.namespaces)return;let i=this.namespaces[e]?e:`${e}:${t}`;this.namespaces[i]?this.namespaces[i]&&(this.namespaces[i].defaultChain=t):this.namespaces[i]={chains:[],methods:[],events:[],defaultChain:t}}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.connectParams=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,t){var i;let r=(null==(i=this.session)?void 0:i.topic)||"";await this.client.core.storage.setItem(`${ft}/${e}${r}`,t)}async getFromStore(e){var t;let i=(null==(t=this.session)?void 0:t.topic)||"";return await this.client.core.storage.getItem(`${ft}/${e}${i}`)}async deleteFromStore(e){var t;let i=(null==(t=this.session)?void 0:t.topic)||"";await this.client.core.storage.removeItem(`${ft}/${e}${i}`)}async cleanupStorage(){var e;try{if((null==(e=this.client)?void 0:e.session.length)>0)return;for(let e of(await this.client.core.storage.getKeys()))e.startsWith(ft)&&await this.client.core.storage.removeItem(e)}catch(e){this.logger.warn(e,"Failed to cleanup storage")}}}},45082:(e,t,i)=>{"use strict";function r(){return(null===i.g||void 0===i.g?void 0:i.g.crypto)||(null===i.g||void 0===i.g?void 0:i.g.msCrypto)||{}}function n(){let e=r();return e.subtle||e.webkitSubtle}
4620Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=r,t.getSubtleCrypto=n,t.isBrowserCryptoAvailable=function(){return!!r()&&!!n()}},45199:(e,t,i)=>{let r=i(94762);function n(e,t,i){let r=e[t]+e[i],n=e[t+1]+e[i+1];r>=0x100000000&&n++,e[t]=r,e[t+1]=n}function s(e,t,i,r){let n=e[t]+i;i<0&&(n+=0x100000000);let s=e[t+1]+r;n>=0x100000000&&s++,e[t]=n,e[t+1]=s}function a(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,i,r,a,o){let l=h[a],c=h[a+1],u=h[o],p=h[o+1];n(d,e,t),s(d,e,l,c);let f=d[r]^d[e],g=d[r+1]^d[e+1];d[r]=g,d[r+1]=f,n(d,i,r),f=d[t]^d[i],g=d[t+1]^d[i+1],d[t]=f>>>24^g<<8,d[t+1]=g>>>24^f<<8,n(d,e,t),s(d,e,u,p),f=d[r]^d[e],g=d[r+1]^d[e+1],d[r]=f>>>16^g<<16,d[r+1]=g>>>16^f<<16,n(d,i,r),f=d[t]^d[i],g=d[t+1]^d[i+1],d[t]=g>>>31^f<<1,d[t+1]=f>>>31^g<<1}let l=new Uint32Array([0xf3bcc908,0x6a09e667,0x84caa73b,0xbb67ae85,0xfe94f82b,0x3c6ef372,0x5f1d36f1,0xa54ff53a,0xade682d1,0x510e527f,0x2b3e6c1f,0x9b05688c,0xfb41bd6b,0x1f83d9ab,0x137e2179,0x5be0cd19]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map(function(e){return 2*e})),d=new Uint32Array(32),h=new Uint32Array(32);function u(e,t){let i=0;for(i=0;i<16;i++)d[i]=e.h[i],d[i+16]=l[i];for(d[24]=d[24]^e.t,d[25]=d[25]^e.t/0x100000000,t&&(d[28]=~d[28],d[29]=~d[29]),i=0;i<32;i++)h[i]=a(e.b,4*i);for(i=0;i<12;i++)o(0,8,16,24,c[16*i+0],c[16*i+1]),o(2,10,18,26,c[16*i+2],c[16*i+3]),o(4,12,20,28,c[16*i+4],c[16*i+5]),o(6,14,22,30,c[16*i+6],c[16*i+7]),o(0,10,20,30,c[16*i+8],c[16*i+9]),o(2,12,22,24,c[16*i+10],c[16*i+11]),o(4,14,16,26,c[16*i+12],c[16*i+13]),o(6,8,18,28,c[16*i+14],c[16*i+15]);for(i=0;i<16;i++)e.h[i]=e.h[i]^d[i]^d[i+16]}let p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function f(e,t,i,r){if(0===e||e>64)throw Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(i&&16!==i.length)throw Error("Illegal salt, expected Uint8Array with length is 16");if(r&&16!==r.length)throw Error("Illegal personal, expected Uint8Array with length is 16");let n={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};p.fill(0),p[0]=e,t&&(p[1]=t.length),p[2]=1,p[3]=1,i&&p.set(i,32),r&&p.set(r,48);for(let e=0;e<16;e++)n.h[e]=l[e]^a(p,4*e);return t&&(g(n,t),n.c=128),n}function g(e,t){for(let i=0;i<t.length;i++)128===e.c&&(e.t+=e.c,u(e,!1),e.c=0),e.b[e.c++]=t[i]}function m(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;u(e,!0);let t=new Uint8Array(e.outlen);for(let i=0;i<e.outlen;i++)t[i]=e.h[i>>2]>>8*(3&i);return t}function w(e,t,i,n,s){i=i||64,e=r.normalizeInput(e),n&&(n=r.normalizeInput(n)),s&&(s=r.normalizeInput(s));let a=f(i,t,n,s);return g(a,e),m(a)}e.exports={blake2b:w,blake2bHex:function(e,t,i,n,s){let a=w(e,t,i,n,s);return r.toHex(a)},blake2bInit:f,blake2bUpdate:g,blake2bFinal:m}},45667:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(82016),i(12936);var s=i(94895),a=i(69428),o=i(34175);let l=(0,o.AH)`
4621  button {
4622    border: none;
4623    background: transparent;
4624    height: 20px;
4625    padding: ${({spacing:e})=>e[2]};
4626    column-gap: ${({spacing:e})=>e[1]};
4627    border-radius: ${({borderRadius:e})=>e[1]};
4628    padding: 0 ${({spacing:e})=>e[1]};
4629    border-radius: ${({spacing:e})=>e[1]};
4630  }
4631
4632  /* -- Variants --------------------------------------------------------- */
4633  button[data-variant='accent'] {
4634    color: ${({tokens:e})=>e.core.textAccentPrimary};
4635  }
4636
4637  button[data-variant='secondary'] {
4638    color: ${({tokens:e})=>e.theme.textSecondary};
4639  }
4640
4641  /* -- Focus states --------------------------------------------------- */
4642  button:focus-visible:enabled {
4643    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
4644  }
4645
4646  button[data-variant='accent']:focus-visible:enabled {
4647    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
4648  }
4649
4650  button[data-variant='secondary']:focus-visible:enabled {
4651    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4652  }
4653
4654  /* -- Hover & Active states ----------------------------------------------------------- */
4655  button[data-variant='accent']:hover:enabled {
4656    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
4657  }
4658
4659  button[data-variant='secondary']:hover:enabled {
4660    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4661  }
4662
4663  button[data-variant='accent']:focus-visible {
4664    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
4665  }
4666
4667  button[data-variant='secondary']:focus-visible {
4668    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4669    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
4670  }
4671
4672  button[disabled] {
4673    opacity: 0.5;
4674    cursor: not-allowed;
4675  }
4676`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d={sm:"sm-medium",md:"md-medium"},h={accent:"accent-primary",secondary:"secondary"},u=class extends r.WF{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.variant="accent",this.icon=void 0}render(){return(0,r.qy)`
4677      <button ?disabled=${this.disabled} data-variant=${this.variant}>
4678        <slot name="iconLeft"></slot>
4679        <wui-text
4680          color=${h[this.variant]}
4681          variant=${d[this.size]}
4682        >
4683          <slot></slot>
4684        </wui-text>
4685        ${this.iconTemplate()}
4686      </button>
4687    `}iconTemplate(){return this.icon?(0,r.qy)`<wui-icon name=${this.icon} size="sm"></wui-icon>`:null}};u.styles=[s.W5,s.fD,l],c([(0,n.MZ)()],u.prototype,"size",void 0),c([(0,n.MZ)({type:Boolean})],u.prototype,"disabled",void 0),c([(0,n.MZ)()],u.prototype,"variant",void 0),c([(0,n.MZ)()],u.prototype,"icon",void 0),u=c([(0,a.E)("wui-link")],u)},46166:(e,t,i)=>{let r=i(8452);t.mul=function(e,t){let i=new Uint8Array(e.length+t.length-1);for(let n=0;n<e.length;n++)for(let s=0;s<t.length;s++)i[n+s]^=r.mul(e[n],t[s]);return i},t.mod=function(e,t){let i=new Uint8Array(e);for(;i.length-t.length>=0;){let e=i[0];for(let n=0;n<t.length;n++)i[n]^=r.mul(t[n],e);let n=0;for(;n<i.length&&0===i[n];)n++;i=i.slice(n)}return i},t.generateECPolynomial=function(e){let i=new Uint8Array([1]);for(let n=0;n<e;n++)i=t.mul(i,new Uint8Array([1,r.exp(n)]));return i}},47002:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(94895),a=i(21736),o=i(69428);let l=(0,r.AH)`
4688  :host {
4689    display: flex;
4690    width: inherit;
4691    height: inherit;
4692    box-sizing: border-box;
4693  }
4694`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{render(){return this.style.cssText=`
4695      flex-direction: ${this.flexDirection};
4696      flex-wrap: ${this.flexWrap};
4697      flex-basis: ${this.flexBasis};
4698      flex-grow: ${this.flexGrow};
4699      flex-shrink: ${this.flexShrink};
4700      align-items: ${this.alignItems};
4701      justify-content: ${this.justifyContent};
4702      column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
4703      row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
4704      gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
4705      padding-top: ${this.padding&&a.Z.getSpacingStyles(this.padding,0)};
4706      padding-right: ${this.padding&&a.Z.getSpacingStyles(this.padding,1)};
4707      padding-bottom: ${this.padding&&a.Z.getSpacingStyles(this.padding,2)};
4708      padding-left: ${this.padding&&a.Z.getSpacingStyles(this.padding,3)};
4709      margin-top: ${this.margin&&a.Z.getSpacingStyles(this.margin,0)};
4710      margin-right: ${this.margin&&a.Z.getSpacingStyles(this.margin,1)};
4711      margin-bottom: ${this.margin&&a.Z.getSpacingStyles(this.margin,2)};
4712      margin-left: ${this.margin&&a.Z.getSpacingStyles(this.margin,3)};
4713      width: ${this.width};
4714    `,(0,r.qy)`<slot></slot>`}};d.styles=[s.W5,l],c([(0,n.MZ)()],d.prototype,"flexDirection",void 0),c([(0,n.MZ)()],d.prototype,"flexWrap",void 0),c([(0,n.MZ)()],d.prototype,"flexBasis",void 0),c([(0,n.MZ)()],d.prototype,"flexGrow",void 0),c([(0,n.MZ)()],d.prototype,"flexShrink",void 0),c([(0,n.MZ)()],d.prototype,"alignItems",void 0),c([(0,n.MZ)()],d.prototype,"justifyContent",void 0),c([(0,n.MZ)()],d.prototype,"columnGap",void 0),c([(0,n.MZ)()],d.prototype,"rowGap",void 0),c([(0,n.MZ)()],d.prototype,"gap",void 0),c([(0,n.MZ)()],d.prototype,"padding",void 0),c([(0,n.MZ)()],d.prototype,"margin",void 0),c([(0,n.MZ)()],d.prototype,"width",void 0),d=c([(0,o.E)("wui-flex")],d)},47232:(e,t,i)=>{"use strict";var r,n,s=i(88088),a=i(53227),o=i(4693),l=i(1024),c=i(53494),d=i(37056),h=i(44458),u=i(11403),p=i(43242),f=i(33452),g=i(59306);i(74970),i(37132),i(45667),i(3658);var m=i(40859);
4714i(12936);var w=i(94895);(r=n||(n={})).approve="approved",r.bought="bought",r.borrow="borrowed",r.burn="burnt",r.cancel="canceled",r.claim="claimed",r.deploy="deployed",r.deposit="deposited",r.execute="executed",r.mint="minted",r.receive="received",r.repay="repaid",r.send="sent",r.sell="sold",r.stake="staked",r.trade="swapped",r.unstake="unstaked",r.withdraw="withdrawn";var y=i(69428);i(82016),i(88364),i(15642);var b=i(34175);let v=(0,b.AH)`
4715  :host > wui-flex {
4716    display: flex;
4717    justify-content: center;
4718    align-items: center;
4719    position: relative;
4720    width: 40px;
4721    height: 40px;
4722    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.core.glass010};
4723    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4724  }
4725
4726  :host([data-no-images='true']) > wui-flex {
4727    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4728    border-radius: ${({borderRadius:e})=>e[3]} !important;
4729  }
4730
4731  :host > wui-flex wui-image {
4732    display: block;
4733  }
4734
4735  :host > wui-flex,
4736  :host > wui-flex wui-image,
4737  .swap-images-container,
4738  .swap-images-container.nft,
4739  wui-image.nft {
4740    border-top-left-radius: var(--local-left-border-radius);
4741    border-top-right-radius: var(--local-right-border-radius);
4742    border-bottom-left-radius: var(--local-left-border-radius);
4743    border-bottom-right-radius: var(--local-right-border-radius);
4744  }
4745
4746  .swap-images-container {
4747    position: relative;
4748    width: 40px;
4749    height: 40px;
4750    overflow: hidden;
4751  }
4752
4753  .swap-images-container wui-image:first-child {
4754    position: absolute;
4755    width: 40px;
4756    height: 40px;
4757    top: 0;
4758    left: 0%;
4759    clip-path: inset(0px calc(50% + 2px) 0px 0%);
4760  }
4761
4762  .swap-images-container wui-image:last-child {
4763    clip-path: inset(0px 0px 0px calc(50% + 2px));
4764  }
4765
4766  .swap-fallback-container {
4767    position: absolute;
4768    inset: 0;
4769    width: 40px;
4770    height: 40px;
4771    display: flex;
4772    align-items: center;
4773    justify-content: center;
4774  }
4775
4776  .swap-fallback-container.first {
4777    clip-path: inset(0px calc(50% + 2px) 0px 0%);
4778  }
4779
4780  .swap-fallback-container.last {
4781    clip-path: inset(0px 0px 0px calc(50% + 2px));
4782  }
4783
4784  wui-flex.status-box {
4785    position: absolute;
4786    right: 0;
4787    bottom: 0;
4788    transform: translate(20%, 20%);
4789    border-radius: ${({borderRadius:e})=>e[4]};
4790    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
4791    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.backgroundPrimary};
4792    overflow: hidden;
4793    width: 16px;
4794    height: 16px;
4795  }
4796`;var C=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let E=class extends s.WF{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""},this.failedImageUrls=new Set}handleImageError(e){return t=>{t.stopPropagation(),this.failedImageUrls.add(e),this.requestUpdate()}}render(){let[e,t]=this.images;this.images.length||(this.dataset.noImages="true");let i=e?.type==="NFT",r=t?.url?"NFT"===t.type:i;return this.style.cssText=`
4797    --local-left-border-radius: ${i?"var(--apkt-borderRadius-3)":"var(--apkt-borderRadius-5)"};
4798    --local-right-border-radius: ${r?"var(--apkt-borderRadius-3)":"var(--apkt-borderRadius-5)"};
4799    `,(0,s.qy)`<wui-flex> ${this.templateVisual()} ${this.templateIcon()} </wui-flex>`}templateVisual(){let[e,t]=this.images;return 2===this.images.length&&(e?.url||t?.url)?this.renderSwapImages(e,t):e?.url&&!this.failedImageUrls.has(e.url)?this.renderSingleImage(e):e?.type==="NFT"?this.renderPlaceholderIcon("nftPlaceholder"):this.renderPlaceholderIcon("coinPlaceholder")}renderSwapImages(e,t){return(0,s.qy)`<div class="swap-images-container">
4800      ${e?.url?this.renderImageOrFallback(e,"first",!0):null}
4801      ${t?.url?this.renderImageOrFallback(t,"last",!0):null}
4802    </div>`}renderSingleImage(e){return this.renderImageOrFallback(e,void 0,!1)}renderImageOrFallback(e,t,i=!1){return e.url?this.failedImageUrls.has(e.url)?i&&t?this.renderFallbackIconInContainer(t):this.renderFallbackIcon():(0,s.qy)`<wui-image
4803      src=${e.url}
4804      alt="Transaction image"
4805      @onLoadError=${this.handleImageError(e.url)}
4806    ></wui-image>`:null}renderFallbackIconInContainer(e){return(0,s.qy)`<div class="swap-fallback-container ${e}">${this.renderFallbackIcon()}</div>`}renderFallbackIcon(){return(0,s.qy)`<wui-icon
4807      size="xl"
4808      weight="regular"
4809      color="default"
4810      name="networkPlaceholder"
4811    ></wui-icon>`}renderPlaceholderIcon(e){return(0,s.qy)`<wui-icon size="xl" weight="regular" color="default" name=${e}></wui-icon>`}templateIcon(){let e,t="accent-primary";return(e=this.getIcon(),this.status&&(t=this.getStatusColor()),e)?(0,s.qy)`
4812      <wui-flex alignItems="center" justifyContent="center" class="status-box">
4813        <wui-icon-box size="sm" color=${t} icon=${e}></wui-icon-box>
4814      </wui-flex>
4815    `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():"trade"===this.type?"swapHorizontal":"approve"===this.type?"checkmark":"cancel"===this.type?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success";case"failed":return"error";
4815case"pending":return"inverse";default:return"accent-primary"}}};E.styles=[v],C([(0,a.MZ)()],E.prototype,"type",void 0),C([(0,a.MZ)()],E.prototype,"status",void 0),C([(0,a.MZ)()],E.prototype,"direction",void 0),C([(0,a.MZ)({type:Boolean})],E.prototype,"onlyDirectionIcon",void 0),C([(0,a.MZ)({type:Array})],E.prototype,"images",void 0),C([(0,a.MZ)({type:Object})],E.prototype,"secondImage",void 0),C([(0,a.wk)()],E.prototype,"failedImageUrls",void 0),E=C([(0,y.E)("wui-transaction-visual")],E);let x=(0,b.AH)`
4816  :host {
4817    width: 100%;
4818  }
4819
4820  :host > wui-flex:first-child {
4821    align-items: center;
4822    column-gap: ${({spacing:e})=>e[2]};
4823    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
4824    width: 100%;
4825  }
4826
4827  :host > wui-flex:first-child wui-text:nth-child(1) {
4828    text-transform: capitalize;
4829  }
4830
4831  wui-transaction-visual {
4832    width: 40px;
4833    height: 40px;
4834  }
4835
4836  wui-flex {
4837    flex: 1;
4838  }
4839
4840  :host wui-flex wui-flex {
4841    overflow: hidden;
4842  }
4843
4844  :host .description-container wui-text span {
4845    word-break: break-all;
4846  }
4847
4848  :host .description-container wui-text {
4849    overflow: hidden;
4850  }
4851
4852  :host .description-separator-icon {
4853    margin: 0px 6px;
4854  }
4855
4856  :host wui-text > span {
4857    overflow: hidden;
4858    display: -webkit-box;
4859    -webkit-box-orient: vertical;
4860    -webkit-line-clamp: 1;
4861  }
4862`;var A=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let _=class extends s.WF{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[]}render(){return(0,s.qy)`
4863      <wui-flex>
4864        <wui-transaction-visual
4865          .status=${this.status}
4866          direction=${(0,m.J)(this.direction)}
4867          type=${this.type}
4868          .onlyDirectionIcon=${this.onlyDirectionIcon}
4869          .images=${this.images}
4870        ></wui-transaction-visual>
4871        <wui-flex flexDirection="column" gap="1">
4872          <wui-text variant="lg-medium" color="primary">
4873            ${n[this.type]||this.type}
4874          </wui-text>
4875          <wui-flex class="description-container">
4876            ${this.templateDescription()} ${this.templateSecondDescription()}
4877          </wui-flex>
4878        </wui-flex>
4879        <wui-text variant="sm-medium" color="secondary"><span>${this.date}</span></wui-text>
4880      </wui-flex>
4881    `}templateDescription(){let e=this.descriptions?.[0];return e?(0,s.qy)`
4882          <wui-text variant="md-regular" color="secondary">
4883            <span>${e}</span>
4884          </wui-text>
4885        `:null}templateSecondDescription(){let e=this.descriptions?.[1];return e?(0,s.qy)`
4886          <wui-icon class="description-separator-icon" size="sm" name="arrowRight"></wui-icon>
4887          <wui-text variant="md-regular" color="secondary">
4888            <span>${e}</span>
4889          </wui-text>
4890        `:null}};_.styles=[w.W5,x],A([(0,a.MZ)()],_.prototype,"type",void 0),A([(0,a.MZ)({type:Array})],_.prototype,"descriptions",void 0),A([(0,a.MZ)()],_.prototype,"date",void 0),A([(0,a.MZ)({type:Boolean})],_.prototype,"onlyDirectionIcon",void 0),A([(0,a.MZ)()],_.prototype,"status",void 0),A([(0,a.MZ)()],_.prototype,"direction",void 0),A([(0,a.MZ)({type:Array})],_.prototype,"images",void 0),_=A([(0,y.E)("wui-transaction-list-item")],_),i(63270),i(47002);let I=(0,b.AH)`
4891  wui-flex {
4892    position: relative;
4893    display: inline-flex;
4894    justify-content: center;
4895    align-items: center;
4896  }
4897
4898  wui-image {
4899    border-radius: ${({borderRadius:e})=>e[128]};
4900  }
4901
4902  .fallback-icon {
4903    color: ${({tokens:e})=>e.theme.iconInverse};
4904    border-radius: ${({borderRadius:e})=>e[3]};
4905    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4906  }
4907
4908  .direction-icon,
4909  .status-image {
4910    position: absolute;
4911    right: 0;
4912    bottom: 0;
4913    border-radius: ${({borderRadius:e})=>e[128]};
4914    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
4915  }
4916
4917  .direction-icon {
4918    padding: ${({spacing:e})=>e["01"]};
4919    color: ${({tokens:e})=>e.core.iconSuccess};
4920
4921    background-color: color-mix(
4922      in srgb,
4923      ${({tokens:e})=>e.core.textSuccess} 30%,
4924      ${({tokens:e})=>e.theme.backgroundPrimary} 70%
4925    );
4926  }
4927
4928  /* -- Sizes --------------------------------------------------- */
4929  :host([data-size='sm']) > wui-image:not(.status-image),
4930  :host([data-size='sm']) > wui-flex {
4931    width: 24px;
4932    height: 24px;
4933  }
4934
4935  :host([data-size='lg']) > wui-image:not(.status-image),
4936  :host([data-size='lg']) > wui-flex {
4937    width: 40px;
4938    height: 40px;
4939  }
4940
4941  :host([data-size='sm']) .fallback-icon {
4942    height: 16px;
4943    width: 16px;
4944    padding: ${({spacing:e})=>e[1]};
4945  }
4946
4947  :host([data-size='lg']) .fallback-icon {
4948    height: 32px;
4949    width: 32px;
4950    padding: ${({spacing:e})=>e[1]};
4951  }
4952
4953  :host([data-size='sm']) .direction-icon,
4954  :host([data-size='sm']) .status-image {
4955    transform: translate(40%, 30%);
4956  }
4957
4958  :host([data-size='lg']) .direction-icon,
4959  :host([data-size='lg']) .status-image {
4960    transform: translate(40%, 10%);
4961  }
4962
4963  :host([data-size='sm']) .status-image {
4964    height: 14px;
4965    width: 14px;
4966  }
4967
4968  :host([data-size='lg']) .status-image {
4969    height: 20px;
4970    width: 20px;
4971  }
4972
4973  /* -- Crop effects --------------------------------------------------- */
4974  .swap-crop-left-image,
4975  .swap-crop-right-image {
4976    position: absolute;
4977    top: 0;
4978    bottom: 0;
4979  }
4980
4981  .swap-crop-left-image {
4982    left: 0;
4983    clip-path: inset(0px calc(50% + 1.5px) 0px 0%);
4984  }
4985
4986  .swap-crop-right-image {
4987    right: 0;
4988    clip-path: inset(0px 0px 0px calc(50% + 1.5px));
4989  }
4990`;var S=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let N={sm:"xxs",lg:"md"},k=class extends s.WF{constructor(){super(...arguments),this.type="approve",this.size="lg",this.statusImageUrl="",this.images=[]}render(){return(0,s.qy)`<wui-flex>${this.templateVisual()} ${this.templateIcon()}</wui-flex>`}templateVisual(){switch(this.dataset.size=this.size,this.type){case"trade":return this.swapTemplate();case"fiat":return this.fiatTemplate();case"unknown":return this.unknownTemplate();default:return this.tokenTemplate()}}swapTemplate(){let[e,t]=this.images;return 2===this.images.length&&(e||t)?(0,s.qy)`
4991        <wui-image class="swap-crop-left-image" src=${e} alt="Swap image"></wui-image>
4992        <wui-image class="swap-crop-right-image" src=${t} alt="Swap image"></wui-image>
4993      `:e?(0,s.qy)`<wui-image src=${e} alt="Swap image"></wui-image>`:null}fiatTemplate(){return(0,s.qy)`<wui-icon
4994      class="fallback-icon"
4995      size=${N[this.size]}
4996      name="dollar"
4997    ></wui-icon>`}unknownTemplate(){return(0,s.qy)`<wui-icon
4998      class="fallback-icon"
4999      size=${N[this.size]}
5000      name="questionMark"
5001    ></wui-icon>`}tokenTemplate(){let[e]=this.images;return e?(0,s.qy)`<wui-image src=${e} alt="Token image"></wui-image> `:(0,s.qy)`<wui-icon
5002      class="fallback-icon"
5003      name=${"nft"===this.type?"image":"coinPlaceholder"}
5004    ></wui-icon>`}templateIcon(){return this.statusImageUrl?(0,s.qy)`<wui-image
5005        class="status-image"
5006        src=${this.statusImageUrl}
5007        alt="Status image"
5008      ></wui-image>`:(0,s.qy)`<wui-icon
5009      class="direction-icon"
5010      size=${N[this.size]}
5011      name=${this.getTemplateIcon()}
5012    ></wui-icon>`}getTemplateIcon(){return"trade"===this.type?"arrowClockWise":"arrowBottom"}};k.styles=[I],S([(0,a.MZ)()],k.prototype,"type",void 0),S([(0,a.MZ)()],k.prototype,"size",void 0),S([(0,a.MZ)()],k.prototype,"statusImageUrl",void 0),S([(0,a.MZ)({type:Array})],k.prototype,"images",void 0),k=S([(0,y.E)("wui-transaction-thumbnail")],k);let T=(0,b.AH)`
5013  :host > wui-flex:first-child {
5014    gap: ${({spacing:e})=>e[2]};
5015    padding: ${({spacing:e})=>e[3]};
5016    width: 100%;
5017  }
5018
5019  wui-flex {
5020    display: flex;
5021    flex: 1;
5022  }
5023`,O=class extends s.WF{render(){return(0,s.qy)`
5024      <wui-flex alignItems="center" .padding=${["1","2","1","2"]}>
5025        <wui-shimmer width="40px" height="40px" rounded></wui-shimmer>
5026        <wui-flex flexDirection="column" gap="1">
5027          <wui-shimmer width="124px" height="16px" rounded></wui-shimmer>
5028          <wui-shimmer width="60px" height="14px" rounded></wui-shimmer>
5029        </wui-flex>
5030        <wui-shimmer width="24px" height="12px" rounded></wui-shimmer>
5031      </wui-flex>
5032    `}};O.styles=[w.W5,T],O=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,y.E)("wui-transaction-list-item-loader")],O);var R=i(67066);let P=(0,g.AH)`
5033  :host {
5034    min-height: 100%;
5035  }
5036
5037  .group-container[last-group='true'] {
5038    padding-bottom: ${({spacing:e})=>e["3"]};
5039  }
5040
5041  .contentContainer {
5042    height: 280px;
5043  }
5044
5045  .contentContainer > wui-icon-box {
5046    width: 40px;
5047    height: 40px;
5048    border-radius: ${({borderRadius:e})=>e["3"]};
5049  }
5050
5051  .contentContainer > .textContent {
5052    width: 65%;
5053  }
5054
5055  .emptyContainer {
5056    height: 100%;
5057  }
5058`;var $=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let U="last-transaction",M=class extends s.WF{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.caipAddress=l.W.state.activeCaipAddress,this.transactionsByYear=c.W.state.transactionsByYear,this.loading=c.W.state.loading,this.empty=c.W.state.empty,this.next=c.W.state.next,c.W.clearCursor(
5058),this.unsubscribe.push(l.W.subscribeKey("activeCaipAddress",e=>{e&&this.caipAddress!==e&&(c.W.resetTransactions(),c.W.fetchTransactions(e)),this.caipAddress=e}),l.W.subscribeKey("activeCaipNetwork",()=>{this.updateTransactionView()}),c.W.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){this.updateTransactionView(),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,s.qy)` ${this.empty?null:this.templateTransactionsByYear()}
5059    ${this.loading?this.templateLoading():null}
5060    ${!this.loading&&this.empty?this.templateEmpty():null}`}updateTransactionView(){c.W.resetTransactions(),this.caipAddress&&c.W.fetchTransactions(d.w.getPlainAddress(this.caipAddress))}templateTransactionsByYear(){return Object.keys(this.transactionsByYear).sort().reverse().map(e=>{let t=parseInt(e,10),i=Array(12).fill(null).map((e,i)=>({groupTitle:g.tt.getTransactionGroupTitle(t,i),transactions:this.transactionsByYear[t]?.[i]})).filter(({transactions:e})=>e).reverse();return i.map(({groupTitle:e,transactions:t},r)=>{let n=r===i.length-1;return t?(0,s.qy)`
5061          <wui-flex
5062            flexDirection="column"
5063            class="group-container"
5064            last-group="${n?"true":"false"}"
5065            data-testid="month-indexes"
5066          >
5067            <wui-flex
5068              alignItems="center"
5069              flexDirection="row"
5070              .padding=${["2","3","3","3"]}
5071            >
5072              <wui-text variant="md-medium" color="secondary" data-testid="group-title">
5073                ${e}
5074              </wui-text>
5075            </wui-flex>
5076            <wui-flex flexDirection="column" gap="2">
5077              ${this.templateTransactions(t,n)}
5078            </wui-flex>
5079          </wui-flex>
5080        `:null})})}templateRenderTransaction(e,t){let{date:i,descriptions:r,direction:n,images:a,status:o,type:l,transfers:c,isAllNFT:d}=this.getTransactionListItemProps(e);return(0,s.qy)`
5081      <wui-transaction-list-item
5082        date=${i}
5083        .direction=${n}
5084        id=${t&&this.next?U:""}
5085        status=${o}
5086        type=${l}
5087        .images=${a}
5088        .onlyDirectionIcon=${d||1===c.length}
5089        .descriptions=${r}
5090      ></wui-transaction-list-item>
5091    `}templateTransactions(e,t){return e.map((i,r)=>{let n=t&&r===e.length-1;return(0,s.qy)`${this.templateRenderTransaction(i,n)}`})}emptyStateActivity(){return(0,s.qy)`<wui-flex
5092      class="emptyContainer"
5093      flexGrow="1"
5094      flexDirection="column"
5095      justifyContent="center"
5096      alignItems="center"
5097      .padding=${["10","5","10","5"]}
5098      gap="5"
5099      data-testid="empty-activity-state"
5100    >
5101      <wui-icon-box color="default" icon="wallet" size="xl"></wui-icon-box>
5102      <wui-flex flexDirection="column" alignItems="center" gap="2">
5103        <wui-text align="center" variant="lg-medium" color="primary">No Transactions yet</wui-text>
5104        <wui-text align="center" variant="lg-regular" color="secondary"
5105          >Start trading on dApps <br />
5106          to grow your wallet!</wui-text
5107        >
5108      </wui-flex>
5109    </wui-flex>`}emptyStateAccount(){return(0,s.qy)`<wui-flex
5110      class="contentContainer"
5111      alignItems="center"
5112      justifyContent="center"
5113      flexDirection="column"
5114      gap="4"
5115      data-testid="empty-account-state"
5116    >
5117      <wui-icon-box icon="swapHorizontal" size="lg" color="default"></wui-icon-box>
5118      <wui-flex
5119        class="textContent"
5120        gap="2"
5121        flexDirection="column"
5122        justifyContent="center"
5123        flexDirection="column"
5124      >
5125        <wui-text variant="md-regular" align="center" color="primary">No activity yet</wui-text>
5126        <wui-text variant="sm-regular" align="center" color="secondary"
5127          >Your next transactions will appear here</wui-text
5128        >
5129      </wui-flex>
5130      <wui-link @click=${this.onReceiveClick.bind(this)}>Trade</wui-link>
5131    </wui-flex>`}templateEmpty(){return"account"===this.page?(0,s.qy)`${this.emptyStateAccount()}`:(0,s.qy)`${this.emptyStateActivity()}`}templateLoading(){return"activity"===this.page?(0,s.qy)` <wui-flex flexDirection="column" width="100%">
5132        <wui-flex .padding=${["2","3","3","3"]}>
5133          <wui-shimmer width="70px" height="16px" rounded></wui-shimmer>
5134        </wui-flex>
5135        <wui-flex flexDirection="column" gap="2" width="100%">
5136          ${Array(7).fill((0,s.qy)` <wui-transaction-list-item-loader></wui-transaction-list-item-loader> `).map(e=>e)}
5137        </wui-flex>
5138      </wui-flex>`:null}onReceiveClick(){h.I.push("WalletReceive")}createPaginationObserver(){let{projectId:e}=u.H.state;this.paginationObserver=new IntersectionObserver(([t])=>{t?.isIntersecting&&!this.loading&&(c.W.fetchTransactions(d.w.getPlainAddress(this.caipAddress)),p.E.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:d.w.getPlainAddress(this.caipAddress),projectId:e,cursor:this.next,isSmartAccount:(0,f.lj)(l.W.state.activeChain)===R.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}))},{}),this.setPaginationObserver()}setPaginationObserver(){this.paginationObserver?.disconnect();let e=this.shadowRoot?.querySelector(`#${U}`);e&&this.paginationObserver?.observe(e)}getTransactionListItemProps(e){let t=o.r.formatDate(e?.metadata?.minedAt),i=g.tt.mergeTransfers(e?.transfers||[]),r=g.tt.getTransactionDescriptions(e,i),n=i?.[0],s=!!n&&i?.every(e=>!!e.nft_info),a=g.tt.getTransactionImages(i);return{date:t,direction:n?.direction,descriptions:r,isAllNFT:s,images:a,status:e.metadata?.status,transfers:i,type:e.metadata?.operationType}}};M.styles=P,$([(0,a.MZ)()],M.prototype,"page",void 0),$([(0,a.wk)()],M.prototype,"caipAddress",void 0),$([(0,a.wk)()],M.prototype,"transactionsByYear",void 0),$([(0,a.wk)()],M.prototype,"loading",void 0),$([(0,a.wk)()],M.prototype,"empty",void 0),$([(0,a.wk)()],M.prototype,"next",void 0),M=$([(0,g.EM)("w3m-activity-list")],M)},47653:(e,t,i)=>{"use strict";i.d(t,{q:()=>n});let r={adapters:{}},n={state:r,initialize(e){r.adapters={...e}},get:e=>r.adapters[e]}},48075:(e,t,i)=>{"use strict";i.d(t,{L:()=>o});var r=i(34386),n=i(1024),s=i(11446),a=i(44458);let o={onSwitchNetwork({network:e,ignoreSwitchConfirmation:t=!1}){let i=n.W.state.activeCaipNetwork,o=n.W.state.activeChain,l=a.I.state.data;if(e.id===i?.id)return;let c=!!n.W.getAccountData(o)?.address,d=!!n.W.getAccountData(e.chainNamespace)?.address,h=e.chainNamespace!==o,u=s.a.getConnectorId(o)===r.o.CONNECTOR_ID.AUTH,p=r.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(t=>t===e.chainNamespace);t||u&&p?a.I.push("SwitchNetwork",{...l,network:e}):c&&h&&!d?a.I.push("SwitchActiveChain",{switchToChain:e.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:e}):a.I.push("SwitchNetwork",{...l,network:e})}}},48657:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(40859);i(82016),i(12936);var a=i(94895),o=i(69428);i(19493);let l=(0,r.AH)`
5139  :host {
5140    position: relative;
5141    display: inline-block;
5142    width: 100%;
5143  }
5144`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{constructor(){super(...arguments),this.disabled=!1}render(){return(0,r.qy)`
5145      <wui-input-text
5146        type="email"
5147        placeholder="Email"
5148        icon="mail"
5149        size="lg"
5150        .disabled=${this.disabled}
5151        .value=${this.value}
5152        data-testid="wui-email-input"
5153        tabIdx=${(0,s.J)(this.tabIdx)}
5154      ></wui-input-text>
5155      ${this.templateError()}
5156    `}templateError(){return this.errorMessage?(0,r.qy)`<wui-text variant="sm-regular" color="error">${this.errorMessage}</wui-text>`:null}};d.styles=[a.W5,l],c([(0,n.MZ)()],d.prototype,"errorMessage",void 0),c([(0,n.MZ)({type:Boolean})],d.prototype,"disabled",void 0),c([(0,n.MZ)()],d.prototype,"value",void 0),c([(0,n.MZ)()],d.prototype,"tabIdx",void 0),d=c([(0,o.E)("wui-email-input")],d)},48789:(e,t,i)=>{"use strict";i.d(t,{$:()=>d});var r=i(92679),n=i(34386),s=i(92929),a=i(76581),o=i(11403);let l={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:"",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00",cosmos:"",sui:"",stacks:"",ton:"20f673c0-095e-49b2-07cf-eb5049dcf600",tron:"3502bb86-cc4e-420f-a387-59ea63a28b00"},c=(0,r.BX)({networkImagePromises:{},tokenImagePromises:{}}),d={async fetchWalletImage(e){if(e)return await s.N._fetchWalletImage(e),this.getWalletImageById(e)},async fetchNetworkImage(e){if(!e)return;let t=this.getNetworkImageById(e);return t||(c.networkImagePromises[e]||(c.networkImagePromises[e]=s.N._fetchNetworkImage(e)),await c.networkImagePromises[e],this.getNetworkImageById(e))},async fetchTokenImage(e){if(e)return c.tokenImagePromises[e]||(c.tokenImagePromises[e]=s.N._fetchTokenImage(e)),await c.tokenImagePromises[e],this.getTokenImage(e)},getWalletImageById(e){if(e)return a.j.state.walletImages[e]},getWalletImage:e=>e?.image_url?e?.image_url:e?.image_id?a.j.state.walletImages[e.image_id]:void 0,getNetworkImage:e=>e?.assets?.imageUrl?e?.assets?.imageUrl:e?.assets?.imageId?a.j.state.networkImages[e.assets.imageId]:void 0,getNetworkImageById(e){if(e)return a.j.state.networkImages[e]},getConnectorImage:e=>e?.imageUrl?e.imageUrl:e?.info?.icon?e.info.icon:e?.imageId?a.j.state.connectorImages[e.imageId]:void 0,getChainImage:e=>a.j.state.networkImages[l[e]],getTokenImage(e){if(e)return a.j.state.tokenImages[e]},getWalletImageUrl(e){if(!e)return"";let{projectId:t,sdkType:i,sdkVersion:r}=o.H.state,s=new URL(`${n.o.W3M_API_URL}/getWalletImage/${e}`);return s.searchParams.set("projectId",t),s.searchParams.set("st",i),s.searchParams.set("sv",r),s.toString()},getAssetImageUrl(e){if(!e)return"";let{projectId:t,sdkType:i,sdkVersion:r}=o.H.state,s=new URL(`${n.o.W3M_API_URL}/public/getAssetImage/${e}`);return s.searchParams.set("projectId",t),s.searchParams.set("st",i),s.searchParams.set("sv",r),s.toString()},getChainNamespaceImageUrl(e){return this.getAssetImageUrl(l[e])},async getImageByToken(e,t){if("native"===e){let e=n.o.NATIVE_IMAGE_IDS_BY_NAMESPACE[t]??null;if(!e)return;return d.fetchNetworkImage(e)}let[,i]=Object.entries(n.o.TOKEN_SYMBOLS_BY_ADDRESS).find(([t])=>t.toLowerCase()===e.toLowerCase())??[];if(i)return d.fetchTokenImage(i)}}},51369:(e,t,i)=>{"use strict";i.d(t,{A:()=>u,X:()=>f});var r=i(92679),n=i(3125),s=i(37056),a=i(75821),o=i(11403);let l=Object.freeze({enabled:!0,events:[]}),c=new a.Z({baseUrl:s.w.getAnalyticsUrl(),clientId:null}),d=(0,r.BX)({...l}),h={state:d,subscribeKey:(e,t)=>(0,n.u$)(d,e,t),async sendError(e,t){if(!d.enabled)return;let i=Date.now();if(d.events.filter(e=>i-new Date(e.properties.timestamp||"").getTime()<6e4).length>=5)return;let r={type:"error",event:t,properties:{errorType:e.name,errorMessage:e.message,stackTrace:e.stack,timestamp:new Date().toISOString()}};d.events.push(r);try{if("u"<typeof window)return;let{projectId:i,sdkType:r,sdkVersion:n}=o.H.state;await c.post({path:"/e",params:{projectId:i,st:r,sv:n||"html-wagmi-4.2.2"},body:{eventId:s.w.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:new Date().toISOString(),props:{type:"error",event:t,errorType:e.name,errorMessage:e.message,stackTrace:e.stack}}})}catch{}},enable(){d.enabled=!0},disable(){d.enabled=!1},clearEvents(){d.events=[]}};
5156class u extends Error{constructor(e,t,i){super(e),this.originalName="AppKitError",this.name="AppKitError",this.category=t,this.originalError=i,i&&i instanceof Error&&(this.originalName=i.name),Object.setPrototypeOf(this,u.prototype);let r=!1;if(i instanceof Error&&"string"==typeof i.stack&&i.stack){const e=i.stack,t=e.indexOf("\n");if(t>-1){const i=e.substring(t+1);this.stack=`${this.name}: ${this.message}
5157${i}`,r=!0}}!r&&(Error.captureStackTrace?Error.captureStackTrace(this,u):this.stack||(this.stack=`${this.name}: ${this.message}`))}}function p(e,t){let i="";try{i=e instanceof Error?e.message:"string"==typeof e?e:"object"==typeof e&&null!==e?0===Object.keys(e).length?"Unknown error":e?.message||JSON.stringify(e):String(e)}catch(e){i="Unknown error",console.error("Error parsing error message",e)}let r=e instanceof u?e:new u(i,t,e);throw h.sendError(r,r.category),r}function f(e,t="INTERNAL_SDK_ERROR"){let i={};return Object.keys(e).forEach(r=>{let n=e[r];if("function"==typeof n){let e=n;e="AsyncFunction"===n.constructor.name?async(...e)=>{try{return await n(...e)}catch(e){return p(e,t)}}:(...e)=>{try{return n(...e)}catch(e){return p(e,t)}},i[r]=e}else i[r]=n}),i}},52589:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(12936);var s=i(94895),a=i(69428),o=i(34175);let l=(0,o.AH)`
5158  :host {
5159    position: relative;
5160    display: flex;
5161    width: 100%;
5162    height: 1px;
5163    background-color: ${({tokens:e})=>e.theme.borderPrimary};
5164    justify-content: center;
5165    align-items: center;
5166  }
5167
5168  :host > wui-text {
5169    position: absolute;
5170    padding: 0px 8px;
5171    transition: background-color ${({durations:e})=>e.lg}
5172      ${({easings:e})=>e["ease-out-power-2"]};
5173    will-change: background-color;
5174  }
5175
5176  :host([data-bg-color='primary']) > wui-text {
5177    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
5178  }
5179
5180  :host([data-bg-color='secondary']) > wui-text {
5181    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5182  }
5183`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{constructor(){super(...arguments),this.text="",this.bgColor="primary"}render(){return this.dataset.bgColor=this.bgColor,(0,r.qy)`${this.template()}`}template(){return this.text?(0,r.qy)`<wui-text variant="md-regular" color="secondary">${this.text}</wui-text>`:null}};d.styles=[s.W5,l],c([(0,n.MZ)()],d.prototype,"text",void 0),c([(0,n.MZ)()],d.prototype,"bgColor",void 0),d=c([(0,a.E)("wui-separator")],d)},53227:(e,t,i)=>{"use strict";i.d(t,{MZ:()=>r.M,wk:()=>n.w});var r=i(42608),n=i(97734)},53415:(e,t)=>{t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){let t=e.size,i=0,r=0,n=0,s=null,a=null;for(let o=0;o<t;o++){r=n=0,s=a=null;for(let l=0;l<t;l++){let t=e.get(o,l);t===s?r++:(r>=5&&(i+=3+(r-5)),s=t,r=1),(t=e.get(l,o))===a?n++:(n>=5&&(i+=3+(n-5)),a=t,n=1)}r>=5&&(i+=3+(r-5)),n>=5&&(i+=3+(n-5))}return i},t.getPenaltyN2=function(e){let t=e.size,i=0;for(let r=0;r<t-1;r++)for(let n=0;n<t-1;n++){let t=e.get(r,n)+e.get(r,n+1)+e.get(r+1,n)+e.get(r+1,n+1);(4===t||0===t)&&i++}return 3*i},t.getPenaltyN3=function(e){let t=e.size,i=0,r=0,n=0;for(let s=0;s<t;s++){r=n=0;for(let a=0;a<t;a++)r=r<<1&2047|e.get(s,a),a>=10&&(1488===r||93===r)&&i++,n=n<<1&2047|e.get(a,s),a>=10&&(1488===n||93===n)&&i++}return 40*i},t.getPenaltyN4=function(e){let t=0,i=e.data.length;for(let r=0;r<i;r++)t+=e.data[r];return 10*Math.abs(Math.ceil(100*t/i/5)-10)},t.applyMask=function(e,i){let r=i.size;for(let n=0;n<r;n++)for(let s=0;s<r;s++)i.isReserved(s,n)||i.xor(s,n,function(e,i,r){switch(e){case t.Patterns.PATTERN000:return(i+r)%2==0;case t.Patterns.PATTERN001:return i%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(i+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return i*r%2+i*r%3==0;case t.Patterns.PATTERN110:return(i*r%2+i*r%3)%2==0;case t.Patterns.PATTERN111:return(i*r%3+(i+r)%2)%2==0;default:throw Error("bad maskPattern:"+e)}}(e,s,n))},t.getBestMask=function(e,i){let r=Object.keys(t.Patterns).length,n=0,s=1/0;for(let a=0;a<r;
5183a++){i(a),t.applyMask(a,e);let r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),r<s&&(s=r,n=a)}return n}},53494:(e,t,i)=>{"use strict";i.d(t,{W:()=>p});var r=i(92679),n=i(67066),s=i(33452),a=i(51369),o=i(18715),l=i(1024),c=i(43242),d=i(11403),h=i(44963);let u=(0,r.BX)({transactions:[],transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),p=(0,a.X)({state:u,subscribe:e=>(0,r.B1)(u,()=>e(u)),setLastNetworkInView(e){u.lastNetworkInView=e},async fetchTransactions(e){if(!e)throw Error("Transactions can't be fetched without an accountAddress");u.loading=!0;try{let t=await o.T.fetchTransactions({account:e,cursor:u.next,chainId:l.W.state.activeCaipNetwork?.caipNetworkId}),i=p.filterSpamTransactions(t.data),r=p.filterByConnectedChain(i),n=[...u.transactions,...r];u.loading=!1,u.transactions=n,u.transactionsByYear=p.groupTransactionsByYearAndMonth(u.transactionsByYear,r),u.empty=0===n.length,u.next=t.next?t.next:void 0}catch(i){let t=l.W.state.activeChain;c.E.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:e,projectId:d.H.state.projectId,cursor:u.next,isSmartAccount:(0,s.lj)(t)===n.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),h.P.showError("Failed to fetch transactions"),u.loading=!1,u.empty=!0,u.next=void 0}},groupTransactionsByYearAndMonth:(e={},t=[])=>(t.forEach(t=>{let i=new Date(t.metadata.minedAt).getFullYear(),r=new Date(t.metadata.minedAt).getMonth(),n=e[i]??{},s=(n[r]??[]).filter(e=>e.id!==t.id);e[i]={...n,[r]:[...s,t].sort((e,t)=>new Date(t.metadata.minedAt).getTime()-new Date(e.metadata.minedAt).getTime())}}),e),filterSpamTransactions:e=>e.filter(e=>!e.transfers?.every(e=>e.nft_info?.flags.is_spam===!0)),filterByConnectedChain(e){let t=l.W.state.activeCaipNetwork?.caipNetworkId;return e.filter(e=>e.metadata.chain===t)},clearCursor(){u.next=void 0},resetTransactions(){u.transactions=[],u.transactionsByYear={},u.lastNetworkInView=void 0,u.loading=!1,u.empty=!1,u.next=void 0}},"API_ERROR")},53938:(e,t,i)=>{let r=i(66513),n=r.getBCHDigit(1335);t.getEncodedBits=function(e,t){let i=e.bit<<3|t,s=i<<10;for(;r.getBCHDigit(s)-n>=0;)s^=1335<<r.getBCHDigit(s)-n;return(i<<10|s)^21522}},53973:(e,t,i)=>{"use strict";let r;function n(e){return new Promise((t,i)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>i(e.error)})}function s(e,t){let i=indexedDB.open(e);i.onupgradeneeded=()=>i.result.createObjectStore(t);let r=n(i);return(e,i)=>r.then(r=>i(r.transaction(t,e).objectStore(t)))}function a(){return r||(r=s("keyval-store","keyval")),r}function o(e,t=a()){return t("readonly",t=>n(t.get(e)))}function l(e,t,i=a()){return i("readwrite",i=>(i.put(t,e),n(i.transaction)))}function c(e,t=a()){return t("readwrite",t=>(t.delete(e),n(t.transaction)))}function d(e=a()){return e("readwrite",e=>(e.clear(),n(e.transaction)))}function h(e=a()){return e("readonly",e=>{var t;if(e.getAllKeys)return n(e.getAllKeys());let i=[];return(t=e=>i.push(e.key),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},n(e.transaction)).then(()=>i)})}i.d(t,{HP:()=>h,IU:()=>d,Jt:()=>o,hZ:()=>l,y$:()=>s,yH:()=>c})},54439:(e,t,i)=>{let r=i(46166);function n(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(e){this.degree=e,this.genPoly=r.generateECPolynomial(this.degree)},n.prototype.encode=function(e){if(!this.genPoly)throw Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let i=r.mod(t,this.genPoly),n=this.degree-i.length;if(n>0){let e=new Uint8Array(this.degree);return e.set(i,n),e}return i},e.exports=n},54623:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(82016),i(12936);var s=i(94895),a=i(69428),o=i(34175);let l=(0,o.AH)`
5184  :host {
5185    display: flex;
5186    justify-content: center;
5187    align-items: center;
5188    gap: ${({spacing:e})=>e[1]};
5189    text-transform: uppercase;
5190    white-space: nowrap;
5191  }
5192
5193  :host([data-variant='accent']) {
5194    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
5195    color: ${({tokens:e})=>e.core.textAccentPrimary};
5196  }
5197
5198  :host([data-variant='info']) {
5199    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
5200    color: ${({tokens:e})=>e.theme.textSecondary};
5201  }
5202
5203  :host([data-variant='success']) {
5204    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
5205    color: ${({tokens:e})=>e.core.textSuccess};
5206  }
5207
5208  :host([data-variant='warning']) {
5209    background-color: ${({tokens:e})=>e.core.backgroundWarning};
5210    color: ${({tokens:e})=>e.core.textWarning};
5211  }
5212
5213  :host([data-variant='error']) {
5214    background-color: ${({tokens:e})=>e.core.backgroundError};
5215    color: ${({tokens:e})=>e.core.textError};
5216  }
5217
5218  :host([data-variant='certified']) {
5219    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
5220    color: ${({tokens:e})=>e.theme.textSecondary};
5221  }
5222
5223  :host([data-size='md']) {
5224    height: 30px;
5225    padding: 0 ${({spacing:e})=>e[2]};
5226    border-radius: ${({borderRadius:e})=>e[2]};
5227  }
5228
5229  :host([data-size='sm']) {
5230    height: 20px;
5231    padding: 0 ${({spacing:e})=>e[1]};
5232    border-radius: ${({borderRadius:e})=>e[1]};
5233  }
5234`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{constructor(){super(...arguments),this.variant="accent",this.size="md",this.icon=void 0}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;let e="md"===this.size?"md-medium":"sm-medium",t="md"===this.size?"md":"sm";return(0,r.qy)`
5235      ${this.icon?(0,r.qy)`<wui-icon size=${t} name=${this.icon}></wui-icon>`:null}
5236      <wui-text
5237        display="inline"
5238        data-variant=${this.variant}
5239        variant=${e}
5240        color="inherit"
5241      >
5242        <slot></slot>
5243      </wui-text>
5244    `}};d.styles=[s.W5,l],c([(0,n.MZ)()],d.prototype,"variant",void 0),c([(0,n.MZ)()],d.prototype,"size",void 0),c([(0,n.MZ)()],d.prototype,"icon",void 0),d=c([(0,a.E)("wui-tag")],d)},56018:(e,t,i)=>{"use strict";i.d(t,{X:()=>u}),i(45027);var r=i(34386),n=i(93849),s=i(33452),a=i(37056),o=i(43587),l=i(1024),c=i(11446),d=i(79954);let h=[r.o.CONNECTOR_ID.AUTH,r.o.CONNECTOR_ID.WALLET_CONNECT];class u{constructor(e){this.availableConnectors=[],this.availableConnections=[],this.providerHandlers={},this.eventListeners=new Map,this.getCaipNetworks=e=>l.W.getCaipNetworks(e),this.getConnectorId=e=>c.a.getConnectorId(e),e&&this.construct(e)}construct(e){this.projectId=e.projectId,this.namespace=e.namespace,this.adapterType=e.adapterType}get connectors(){return this.availableConnectors}get connections(){return this.availableConnections}get networks(){return this.getCaipNetworks(this.namespace)}onAuthConnected({accounts:e,chainId:t}){let i=this.getCaipNetworks().filter(e=>e.chainNamespace===this.namespace).find(e=>e.id.toString()===t?.toString());e&&i&&this.addConnection({connectorId:r.o.CONNECTOR_ID.AUTH,accounts:e,caipNetwork:i})}setAuthProvider(e){e.onConnect(this.onAuthConnected.bind(this)),e.onSocialConnected(this.onAuthConnected.bind(this)),this.addConnector({id:r.o.CONNECTOR_ID.AUTH,type:"AUTH",
5244name:r.o.CONNECTOR_NAMES.AUTH,provider:e,imageId:void 0,chain:this.namespace,chains:[]})}addConnector(...e){let t=new Set;this.availableConnectors=[...e,...this.availableConnectors].filter(e=>!t.has(e.id)&&(t.add(e.id),!0)),this.emit("connectors",this.availableConnectors)}addConnection(...e){let t=new Set;this.availableConnections=[...e,...this.availableConnections].filter(e=>!t.has(e.connectorId.toLowerCase())&&(t.add(e.connectorId.toLowerCase()),!0)),this.emit("connections",this.availableConnections)}deleteConnection(e){this.availableConnections=this.availableConnections.filter(t=>t.connectorId.toLowerCase()!==e.toLowerCase()),this.emit("connections",this.availableConnections)}clearConnections(e=!1){this.availableConnections=[],e&&this.emit("connections",this.availableConnections)}setStatus(e,t){l.W.setAccountProp("status",e,t)}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e)?.add(t)}off(e,t){let i=this.eventListeners.get(e);i&&i.delete(t)}removeAllEventListeners(){this.eventListeners.forEach(e=>{e.clear()})}emit(e,t){let i=this.eventListeners.get(e);i&&i.forEach(e=>e(t))}async connectWalletConnect(e){try{let e=this.getWalletConnectConnector();return{clientId:(await e.connectWalletConnect()).clientId}}catch(e){if(o.k.isUserRejectedRequestError(e))throw new n.vx(e);throw e}}async switchNetwork(e){let{caipNetwork:t}=e,i=d.G.getProviderId(t.chainNamespace),r=d.G.getProvider(t.chainNamespace);if(!r)throw Error("Provider not found");if("WALLET_CONNECT"===i)return void r.setDefaultChain(t.caipNetworkId);if("AUTH"===i){let e=c.a.getAuthConnector()?.provider;if(!e)throw Error("Auth provider not found");let i=(0,s.lj)(t.chainNamespace);await e.switchNetwork({chainId:t.caipNetworkId});let r=await e.getUser({chainId:t.caipNetworkId,preferredAccountType:i});this.emit("switchNetwork",r)}}getWalletConnectConnector(){let e=this.connectors.find(e=>"walletConnect"===e.id);if(!e)throw Error("WalletConnectConnector not found");return e}onConnect(e,t){if(e.length>0){let{address:i,chainId:r}=a.w.getAccount(e[0]),n=this.getCaipNetworks().filter(e=>e.chainNamespace===this.namespace).find(e=>e.id.toString()===r?.toString()),s=this.connectors.find(e=>e.id===t);i&&(this.emit("accountChanged",{address:i,chainId:r,connector:s}),this.addConnection({connectorId:t,accounts:e.map(e=>{let{address:t}=a.w.getAccount(e);return{address:t}}),caipNetwork:n}))}}onAccountsChanged(e,t,i=!0){if(e.length>0){let{address:i}=a.w.getAccount(e[0]),n=this.getConnection({connectorId:t,connections:this.connections,connectors:this.connectors});i&&this.getConnectorId(r.o.CHAIN.EVM)?.toLowerCase()===t.toLowerCase()&&this.emit("accountChanged",{address:i,chainId:n?.caipNetwork?.id,connector:n?.connector}),this.addConnection({connectorId:t,accounts:e.map(e=>{let{address:t}=a.w.getAccount(e);return{address:t}}),caipNetwork:n?.caipNetwork})}else i&&this.onDisconnect(t)}onDisconnect(e){this.removeProviderListeners(e),this.deleteConnection(e),this.getConnectorId(r.o.CHAIN.EVM)?.toLowerCase()===e.toLowerCase()&&this.emitFirstAvailableConnection(),0===this.connections.length&&this.emit("disconnect")}onChainChanged(e,t){let i="string"==typeof e&&e.startsWith("0x")?parseInt(e,16).toString():e.toString(),n=this.getConnection({connectorId:t,connections:this.connections,connectors:this.connectors}),s=this.getCaipNetworks().filter(e=>e.chainNamespace===this.namespace).find(e=>e.id.toString()===i);n&&this.addConnection({connectorId:t,accounts:n.accounts,caipNetwork:s}),this.getConnectorId(r.o.CHAIN.EVM)?.toLowerCase()===t.toLowerCase()&&this.emit("switchNetwork",{chainId:i})}listenProviderEvents(e,t){if(h.includes(e))return;let i=t=>this.onAccountsChanged(t,e),r=t=>this.onChainChanged(t,e),n=()=>this.onDisconnect(e);this.providerHandlers[e]||(t.on("disconnect",n),t.on("accountsChanged",i),t.on("chainChanged",r),this.providerHandlers[e]={provider:t,disconnect:n,accountsChanged:i,chainChanged:r})}removeProviderListeners(e){if(this.providerHandlers[e]){let{provider:t,disconnect:i,accountsChanged:r,chainChanged:n}=this.providerHandlers[e];t.removeListener("disconnect",i),t.removeListener("accountsChanged",r),t.removeListener("chainChanged",n),this.providerHandlers[e]=null}}emitFirstAvailableConnection(){let e=this.getConnection({connections:this.connections,connectors:this.connectors});if(e){let[t]=e.accounts;
5244this.emit("accountChanged",{address:t?.address,chainId:e.caipNetwork?.id,connector:e.connector})}}getConnection({address:e,connectorId:t,connections:i,connectors:r}){if(t){let n=i.find(e=>e.connectorId.toLowerCase()===t.toLowerCase());if(!n)return null;let s=r.find(e=>e.id.toLowerCase()===n.connectorId.toLowerCase()),a=e?n.accounts.find(t=>t.address.toLowerCase()===e.toLowerCase()):n.accounts[0];return{...n,account:a,connector:s}}let n=i.find(e=>e.accounts.length>0&&r.some(t=>t.id.toLowerCase()===e.connectorId.toLowerCase()));if(n){let[e]=n.accounts,t=r.find(e=>e.id.toLowerCase()===n.connectorId.toLowerCase());return{...n,account:e,connector:t}}return null}}},56726:(e,t,i)=>{"use strict";i.d(t,{I:()=>o});var r=i(92679),n=i(3125),s=i(51369);let a=(0,r.BX)({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),o=(0,s.X)({state:a,subscribe:e=>(0,r.B1)(a,()=>e(a)),subscribeKey:(e,t)=>(0,n.u$)(a,e,t),showTooltip({message:e,triggerRect:t,variant:i}){a.open=!0,a.message=e,a.triggerRect=t,a.variant=i},hide(){a.open=!1,a.message="",a.triggerRect={width:0,height:0,top:0,left:0}}})},57247:(e,t)=>{"use strict";function i(e){let t;return"u">typeof window&&void 0!==window[e]&&(t=window[e]),t}function r(e){let t=i(e);if(!t)throw Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=i,t.getFromWindowOrThrow=r,t.getDocumentOrThrow=function(){return r("document")},t.getDocument=function(){return i("document")},t.getNavigatorOrThrow=function(){return r("navigator")},t.getNavigator=function(){return i("navigator")},t.getLocationOrThrow=function(){return r("location")},t.getLocation=function(){return i("location")},t.getCryptoOrThrow=function(){return r("crypto")},t.getCrypto=function(){return i("crypto")},t.getLocalStorageOrThrow=function(){return r("localStorage")},t.getLocalStorage=function(){return i("localStorage")}},59306:(e,t,i)=>{"use strict";i.d(t,{z8:()=>r,tt:()=>c,Zv:()=>s.Z,AH:()=>h.AH,EM:()=>d.E,RF:()=>n.RF,JX:()=>n.JX,ds:()=>n.ds,f:()=>h.f});let r={interpolate(e,t,i){if(2!==e.length||2!==t.length)throw Error("inputRange and outputRange must be an array of length 2");let r=e[0]||0,n=e[1]||0,s=t[0]||0,a=t[1]||0;return i<r?s:i>n?a:(a-s)/(n-r)*(i-r)+s}};var n=i(94895),s=i(21736),a=i(4693);let o=["receive","deposit","borrow","claim"],l=["withdraw","repay","burn"],c={getTransactionGroupTitle(e,t){let i=a.r.getYear(),r=a.r.getMonthNameByIndex(t);return e===i?r:`${r} ${e}`},getTransactionImages(e){let[t]=e;return e?.length>1?e.map(e=>this.getTransactionImage(e)):[this.getTransactionImage(t)]},getTransactionImage:e=>({type:c.getTransactionTransferTokenType(e),url:c.getTransactionImageURL(e)}),getTransactionImageURL(e){let t,i=!!e?.nft_info,r=!!e?.fungible_info;return e&&i?t=e?.nft_info?.content?.preview?.url:e&&r&&(t=e?.fungible_info?.icon?.url),t},getTransactionTransferTokenType:e=>e?.fungible_info?"FUNGIBLE":e?.nft_info?"NFT":void 0,getTransactionDescriptions(e,t){let i=e?.metadata?.operationType,r=t||e?.transfers,n=r&&r.length>0,a=r&&r.length>1,c=n&&r.every(e=>!!e?.fungible_info),[d,h]=r||[],u=this.getTransferDescription(d),p=this.getTransferDescription(h);if(!n)return("send"===i||"receive"===i)&&c?[u=s.Z.getTruncateString({string:e?.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),s.Z.getTruncateString({string:e?.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"})]:[e.metadata.status];if(a)return r?.map(e=>this.getTransferDescription(e));let f="";return o.includes(i)?f="+":l.includes(i)&&(f="-"),[u=f.concat(u)]},getTransferDescription(e){let t="";return e&&(e?.nft_info?t=e?.nft_info?.name||"-":e?.fungible_info&&(t=this.getFungibleTransferDescription(e)||"-")),t},getFungibleTransferDescription(e){return e?[this.getQuantityFixedValue(e?.quantity.numeric),e?.fungible_info?.symbol].join(" ").trim():null},mergeTransfers(e){if(e?.length<=1)return e;let t=this.filterGasFeeTransfers(e).reduce((e,t)=>
5244{let i=t?.fungible_info?.name,r=e.find(({fungible_info:e,direction:r})=>i&&i===e?.name&&r===t.direction);if(r){let e=Number(r.quantity.numeric)+Number(t.quantity.numeric);r.quantity.numeric=e.toString(),r.value=(r.value||0)+(t.value||0)}else e.push(t);return e},[]),i=t;return t.length>2&&(i=t.sort((e,t)=>(t.value||0)-(e.value||0)).slice(0,2)),i=i.sort((e,t)=>"out"===e.direction&&"in"===t.direction?-1:+("in"===e.direction&&"out"===t.direction))},filterGasFeeTransfers(e){let t=e?.reduce((e,t)=>{let i=t?.fungible_info?.name;return i&&(e[i]||(e[i]=[]),e[i].push(t)),e},{}),i=[];return Object.values(t??{}).forEach(e=>{if(1===e.length){let t=e[0];t&&i.push(t)}else{let t=e.filter(e=>"in"===e.direction),r=e.filter(e=>"out"===e.direction);if(1===t.length&&1===r.length){let n=t[0],s=r[0],a=!1;if(n&&s){let e=Number(n.quantity.numeric),t=Number(s.quantity.numeric);t<.1*e?(i.push(n),a=!0):e<.1*t&&(i.push(s),a=!0)}a||i.push(...e)}else{let t=this.filterGasFeesFromTokenGroup(e);i.push(...t)}}}),e?.forEach(e=>{e?.fungible_info?.name||i.push(e)}),i},filterGasFeesFromTokenGroup(e){if(e.length<=1)return e;let t=e?.map(e=>Number(e.quantity.numeric)),i=Math.max(...t);if(Math.min(...t)<.01*i)return e?.filter(e=>Number(e.quantity.numeric)>=.01*i);let r=e?.filter(e=>"in"===e.direction),n=e?.filter(e=>"out"===e.direction);if(1===r.length&&1===n.length){let e=r[0],t=n[0];if(e&&t){let i=Number(e.quantity.numeric),r=Number(t.quantity.numeric);if(r<.1*i)return[e];if(i<.1*r)return[t]}}return e},getQuantityFixedValue:e=>e?parseFloat(e).toFixed(3):null};var d=i(69428);i(1756);var h=i(34175)},60319:(e,t,i)=>{"use strict";let r;i.d(t,{x:()=>E});var n=i(92679),s=i(3125),a=i(34386),o=i(30840),l=i(33452),c=i(22787),d=i(11282),h=i(37056),u=i(5820),p=i(51369),f=i(1024),g=i(11446),m=i(43242),w=i(24568),y=i(83931),b=i(44458),v=i(53494);let C=(0,n.BX)({connections:new Map,recentConnections:new Map,isSwitchingConnection:!1,wcError:!1,wcFetchingUri:!1,buffering:!1,status:"disconnected"}),E=(0,p.X)({state:C,subscribe:e=>(0,n.B1)(C,()=>e(C)),subscribeKey:(e,t)=>(0,s.u$)(C,e,t),_getClient:()=>C._client,setClient(e){C._client=(0,n.KR)(e)},initialize(e){let t=e.filter(e=>!!e.namespace).map(e=>e.namespace);E.syncStorageConnections(t)},syncStorageConnections(e){let t=u.i.getConnections();for(let i of e??Array.from(f.W.state.chains.keys())){let e=t[i]??[],r=new Map(C.recentConnections);r.set(i,e),C.recentConnections=r}},getConnections:e=>e?C.connections.get(e)??[]:[],hasAnyConnection:e=>Array.from(E.state.connections.values()).flatMap(e=>e).some(({connectorId:t})=>t===e),async connectWalletConnect({cache:e="auto"}={}){C.wcFetchingUri=!0;let t=h.w.isTelegram()||h.w.isSafari()&&h.w.isIos();try{if("always"===e||"auto"===e&&t){if(r){await r,r=void 0;return}if(!h.w.isPairingExpired(C?.wcPairingExpiry)){let e=C.wcUri;C.wcUri=e;return}r=E._getClient()?.connectWalletConnect?.(),E.state.status="connecting",await r,r=void 0,C.wcPairingExpiry=void 0,E.state.status="connected"}else await E._getClient()?.connectWalletConnect?.()}catch(e){throw C.wcError=!0,C.wcFetchingUri=!1,C.status="disconnected",r=void 0,e}},async connectExternal(e,t,i=!0){let r=await E._getClient()?.connectExternal?.(e);i&&f.W.setActiveNamespace(t);let n=g.a.state.allConnectors.find(t=>t.id===e?.id),s="AUTH"===e.type?"email":"browser";return m.E.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:s,name:n?.name||"Unknown",view:b.I.state.view,walletRank:n?.explorerWallet?.order}}),r},async reconnectExternal(e){await E._getClient()?.reconnectExternal?.(e);let t=e.chain||f.W.state.activeChain;t&&g.a.setConnectorId(e.id,t)},async setPreferredAccountType(e,t){if(!t)return;w.W.setLoading(!0,f.W.state.activeChain);let i=g.a.getAuthConnector();i&&(f.W.setAccountProp("preferredAccountType",e,t),await i.provider.setPreferredAccount(e),u.i.setPreferredAccountTypes(Object.entries(f.W.state.chains).reduce((e,[t,i])=>{let r=(0,l.lj)(t);return void 0!==r&&(e[t]=r),e},{})),await E.reconnectExternal(i),w.W.setLoading(!1,f.W.state.activeChain),m.E.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:e,network:f.W.state.activeCaipNetwork?.caipNetworkId||""}}))},signMessage:async e=>E._getClient()?.signMessage(e),parseUnits:(e,t)=>E._getClient()?.parseUnits(e,t),formatUnits:(e,t)=>E._getClient()?.formatUnits(e,t),updateBalance:e=>E._getClient()?.updateBalance(e),sendTransaction:async e=>E._getClient()?.sendTransaction(e),getCapabilities:async e=>E._getClient()?.getCapabilities(e),grantPermissions:async e=>E._getClient()?.grantPermissions(e),walletGetAssets:async e=>E._getClient()?.walletGetAssets(e)??{},estimateGas:async e=>E._getClient()?.estimateGas(e),writeContract:async e=>E._getClient()?.writeContract(e),writeSolanaTransaction:async e=>E._getClient()?.writeSolanaTransaction(e),getEnsAddress:async e=>E._getClient()?.getEnsAddress(e),getEnsAvatar:async e=>E._getClient()?.getEnsAvatar(e),checkInstalled:e=>E._getClient()?.checkInstalled?.(e)||!1,resetWcConnection(){C.wcUri=void 0,C.wcPairingExpiry=void 0,C.wcLinking=void 0,C.recentWallet=void 0,C.wcFetchingUri=!1,C.status="disconnected",v.W.resetTransactions(),u.i.deleteWalletConnectDeepLink(),u.i.deleteRecentWallet(),y.z.set({connectingWallet:void 0})},resetUri(){C.wcUri=void 0,C.wcPairingExpiry=void 0,r=void 0,C.wcFetchingUri=!1,y.z.set({connectingWallet:void 0})},finalizeWcConnection(e){let{wcLinking:t,recentWallet:i}=E.state;t&&u.i.setWalletConnectDeepLink(t),i&&u.i.setAppKitRecent(i),e&&m.E.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:e,properties:{method:t?"mobile":"qrcode",name:b.I.state.data?.wallet?.name||"Unknown",view:b.I.state.view,walletRank:i?.order}})},setWcBasic(e){C.wcBasic=e},setUri(e){C.wcUri=e,C.wcFetchingUri=!1,C.wcPairingExpiry=h.w.getPairingExpiry()},setWcLinking(e){C.wcLinking=e},setWcError(e){C.wcError=e,C.wcFetchingUri=!1,C.buffering=!1},setRecentWallet(e){C.recentWallet=e},setBuffering(e){C.buffering=e},setStatus(e){C.status=e},setIsSwitchingConnection(e){C.isSwitchingConnection=e},async disconnect({id:e,namespace:t,initialDisconnect:i}={}){try{await E._getClient()?.disconnect({id:e,chainNamespace:t,initialDisconnect:i})}catch(e){throw new p.A("Failed to disconnect","INTERNAL_SDK_ERROR",e)}},async disconnectConnector({id:e,namespace:t}){try{await E._getClient()?.disconnectConnector({id:e,namespace:t})}catch(e){throw new p.A("Failed to disconnect connector","INTERNAL_SDK_ERROR",e)}},setConnections(e,t){let i=new Map(C.connections);i.set(t,e),C.connections=i},async handleAuthAccountSwitch({address:e,namespace:t}){let i=f.W.getAccountData(t),r=i?.user?.accounts?.find(e=>"smartAccount"===e.type),n=r&&r.address.toLowerCase()===e.toLowerCase()&&d.g.canSwitchToSmartAccount(t)?"smartAccount":"eoa";await E.setPreferredAccountType(n,t)},async handleActiveConnection({connection:e,namespace:t,address:i}){let r=g.a.getConnectorById(e.connectorId),n=e.connectorId===a.o.CONNECTOR_ID.AUTH;if(!r)throw Error(`No connector found for connection: ${e.connectorId}`);if(n)i&&await E.handleAuthAccountSwitch({address:i,namespace:t});else{let e=await E.connectExternal({id:r.id,type:r.type,provider:r.provider,address:i,chain:t},t);return e?.address}return i},async handleDisconnectedConnection({connection:e,namespace:t,address:i,closeModalOnConnect:r}){let n,s=g.a.getConnectorById(e.connectorId),o=e.auth?.name?.toLowerCase(),l=e.connectorId===a.o.CONNECTOR_ID.AUTH,c=e.connectorId===a.o.CONNECTOR_ID.WALLET_CONNECT;if(!s)throw Error(`No connector found for connection: ${e.connectorId}`);
5244if(l)if(o&&d.g.isSocialProvider(o)){let{address:e}=await d.g.connectSocial({social:o,closeModalOnConnect:r,onOpenFarcaster(){w.W.open({view:"ConnectingFarcaster"})},onConnect(){b.I.replace("ProfileWallets")}});n=e}else{let{address:e}=await d.g.connectEmail({closeModalOnConnect:r,onOpen(){w.W.open({view:"EmailLogin"})},onConnect(){b.I.replace("ProfileWallets")}});n=e}else if(c){let{address:e}=await d.g.connectWalletConnect({walletConnect:!0,connector:s,closeModalOnConnect:r,onOpen(e){let t=e?"AllWallets":"ConnectingWalletConnect";w.W.state.open?b.I.push(t):w.W.open({view:t})},onConnect(){b.I.replace("ProfileWallets")}});n=e}else{let e=await E.connectExternal({id:s.id,type:s.type,provider:s.provider,chain:t},t);e&&(n=e.address)}return l&&i&&await E.handleAuthAccountSwitch({address:i,namespace:t}),n},async switchConnection({connection:e,address:t,namespace:i,closeModalOnConnect:r,onChange:n}){let s,a=f.W.getAccountData(i)?.caipAddress;if(a){let{address:e}=o.C.parseCaipAddress(a);s=e}let l=c.b.getConnectionStatus(e,i);switch(l){case"connected":case"active":{let r=await E.handleActiveConnection({connection:e,namespace:i,address:t});if(s&&r){let e=r.toLowerCase()!==s.toLowerCase();n?.({address:r,namespace:i,hasSwitchedAccount:e,hasSwitchedWallet:"active"===l})}break}case"disconnected":{let s=await E.handleDisconnectedConnection({connection:e,namespace:i,address:t,closeModalOnConnect:r});s&&n?.({address:s,namespace:i,hasSwitchedAccount:!0,hasSwitchedWallet:!0});break}default:throw Error(`Invalid connection status: ${l}`)}}})},60890:(e,t,i)=>{"use strict";i.d(t,{y:()=>l});var r=i(34386),n=i(1024),s=i(11446),a=i(5820),o=i(13226);let l={getCaipTokens(e){if(!e)return;let t={};return Object.entries(e).forEach(([e,i])=>{t[`${o.o.EIP155}:${e}`]=i}),t},isLowerCaseMatch:(e,t)=>e?.toLowerCase()===t?.toLowerCase(),getActiveNamespaceConnectedToAuth(){let e=n.W.state.activeChain;return r.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(t=>s.a.getConnectorId(t)===r.o.CONNECTOR_ID.AUTH&&t===e)},withRetry({conditionFn:e,intervalMs:t,maxRetries:i}){let r=0;return new Promise(n=>{async function s(){return(r+=1,await e())?n(!0):r>=i?n(!1):(setTimeout(s,t),null)}s()})},userChainIdToChainNamespace(e){if("number"==typeof e)return r.o.CHAIN.EVM;let[t]=e.split(":");return t},getOtherAuthNamespaces:e=>e?r.o.AUTH_CONNECTOR_SUPPORTED_CHAINS.filter(t=>t!==e):[],getConnectorStorageInfo(e,t){let i=a.i.getConnections()[t]??[];return{hasDisconnected:a.i.isConnectorDisconnected(e,t),hasConnected:i.some(t=>l.isLowerCaseMatch(t.connectorId,e))}}}},60945:(e,t,i)=>{"use strict";i.d(t,{R:()=>s});var r=i(65972),n=i(11403);let s={EmbeddedWalletAbortController:new AbortController,UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:{message:"Unauthorized: origin not allowed",alertErrorKey:"ORIGIN_NOT_ALLOWED"},JWT_VALIDATION_ERROR:{message:"JWT validation error: JWT Token is not yet valid",alertErrorKey:"JWT_TOKEN_NOT_VALID"},INVALID_KEY:{message:"Unauthorized: invalid key",alertErrorKey:"INVALID_PROJECT_ID"}},ALERT_ERRORS:{SWITCH_NETWORK_NOT_FOUND:{code:"APKT001",displayMessage:"Network Not Found",debugMessage:"The specified network is not recognized. Please ensure it is included in the `networks` array of your `createAppKit` configuration."},ORIGIN_NOT_ALLOWED:{code:"APKT002",displayMessage:"Invalid App Configuration",debugMessage:()=>`The origin ${(0,r.IP)()?window.origin:"unknown"} is not in your allow list. Please update your allowed domains at https://dashboard.reown.com. [PID: ${n.H.state.projectId}]`},IFRAME_LOAD_FAILED:{code:"APKT003",displayMessage:"Network Error: Wallet Load Failed",debugMessage:()=>"Failed to load the embedded wallet. This may be due to network issues or server downtime. Please check your network connection and try again shortly. Contact support if the issue persists."},IFRAME_REQUEST_TIMEOUT:{code:"APKT004",displayMessage:"Wallet Request Timeout",debugMessage:()=>"The request to the embedded wallet timed out. Please check your network connection and try again shortly. Contact support if the issue persists."},UNVERIFIED_DOMAIN:{code:"APKT005",displayMessage:"Unverified Domain",debugMessage:()=>"Embedded wallet load failed. Ensure your domain is verified in https://dashboard.reown.com."},JWT_TOKEN_NOT_VALID:{code:"APKT006",displayMessage:"Session Expired",debugMessage:"Your session is invali
5244d or expired. Please check your system’s date and time settings, then reconnect."},INVALID_PROJECT_ID:{code:"APKT007",displayMessage:"Invalid Project ID",debugMessage:"The specified project ID is invalid. Please visit https://dashboard.reown.com to obtain a valid project ID."},PROJECT_ID_NOT_CONFIGURED:{code:"APKT008",displayMessage:"Project ID Missing",debugMessage:"No project ID is configured. You can create and configure a project ID at https://dashboard.reown.com."},SERVER_ERROR_APP_CONFIGURATION:{code:"APKT009",displayMessage:"Server Error",debugMessage:e=>`Unable to fetch App Configuration. ${e}. Please check your network connection and try again shortly. Contact support if the issue persists.`},RATE_LIMITED_APP_CONFIGURATION:{code:"APKT010",displayMessage:"Rate Limited",debugMessage:"You have been rate limited while retrieving App Configuration. Please wait a few minutes and try again. Contact support if the issue persists."}},ALERT_WARNINGS:{LOCAL_CONFIGURATION_IGNORED:{debugMessage:e=>`[Reown Config Notice] ${e}`},INACTIVE_NAMESPACE_NOT_CONNECTED:{code:"APKTW001",displayMessage:"Inactive Namespace Not Connected",debugMessage:(e,t)=>`An error occurred while connecting an inactive namespace ${e}: "${t}"`},INVALID_EMAIL:{code:"APKTW002",displayMessage:"Invalid Email Address",debugMessage:"Please enter a valid email address"}}}},61327:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(40859);i(84915),i(12936);var a=i(94895),o=i(69428),l=i(34175);let c=(0,l.AH)`
5245  :host {
5246    width: 100%;
5247  }
5248
5249  :host([data-type='primary']) > button {
5250    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
5251  }
5252
5253  :host([data-type='secondary']) > button {
5254    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5255  }
5256
5257  button {
5258    display: flex;
5259    align-items: center;
5260    justify-content: space-between;
5261    padding: ${({spacing:e})=>e[3]};
5262    width: 100%;
5263    border-radius: ${({borderRadius:e})=>e[4]};
5264    transition:
5265      background-color ${({durations:e})=>e.lg}
5266        ${({easings:e})=>e["ease-out-power-2"]},
5267      scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
5268    will-change: background-color, scale;
5269  }
5270
5271  wui-text {
5272    text-transform: capitalize;
5273  }
5274
5275  wui-image {
5276    color: ${({tokens:e})=>e.theme.textPrimary};
5277  }
5278
5279  @media (hover: hover) {
5280    :host([data-type='primary']) > button:hover:enabled {
5281      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5282    }
5283
5284    :host([data-type='secondary']) > button:hover:enabled {
5285      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
5286    }
5287  }
5288
5289  button:disabled {
5290    opacity: 0.5;
5291    cursor: not-allowed;
5292  }
5293`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(...arguments),this.type="primary",this.imageSrc="google",this.imageSize=void 0,this.loading=!1,this.boxColor="foregroundPrimary",this.disabled=!1,this.rightIcon=!0,this.boxed=!0,this.rounded=!1,this.fullSize=!1}render(){return this.dataset.rounded=this.rounded?"true":"false",this.dataset.type=this.type,(0,r.qy)`
5294      <button
5295        ?disabled=${!!this.loading||!!this.disabled}
5296        data-loading=${this.loading}
5297        tabindex=${(0,s.J)(this.tabIdx)}
5298      >
5299        <wui-flex gap="2" alignItems="center">
5300          ${this.templateLeftIcon()}
5301          <wui-flex gap="1">
5302            <slot></slot>
5303          </wui-flex>
5304        </wui-flex>
5305        ${this.templateRightIcon()}
5306      </button>
5307    `}templateLeftIcon(){return this.icon?(0,r.qy)`<wui-image
5308        icon=${this.icon}
5309        iconColor=${(0,s.J)(this.iconColor)}
5310        ?boxed=${this.boxed}
5311        ?rounded=${this.rounded}
5312        boxColor=${this.boxColor}
5313      ></wui-image>`:(0,r.qy)`<wui-image
5314      ?boxed=${this.boxed}
5315      ?rounded=${this.rounded}
5316      ?fullSize=${this.fullSize}
5317      size=${(0,s.J)(this.imageSize)}
5318      src=${this.imageSrc}
5319      boxColor=${this.boxColor}
5320    ></wui-image>`}templateRightIcon(){return this.rightIcon?this.loading?(0,r.qy)`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:(0,r.qy)`<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>`:null}};h.styles=[a.W5,a.fD,c],d([(0,n.MZ)()],h.prototype,"type",void 0),d([(0,n.MZ)()],h.prototype,"imageSrc",void 0),d([(0,n.MZ)()],h.prototype,"imageSize",void 0),d([(0,n.MZ)()],h.prototype,"icon",void 0),d([(0,n.MZ)()],h.prototype,"iconColor",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"loading",void 0),d([(0,n.MZ)()],h.prototype,"tabIdx",void 0),d([(0,n.MZ)()],h.prototype,"boxColor",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"disabled",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"rightIcon",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"boxed",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"rounded",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"fullSize",void 0),h=d([(0,o.E)("wui-list-item")],h)},61975:e=>{function t(e){if(!e||e<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,i,r){let n=e*this.size+t;this.data[n]=i,r&&(this.reservedBit[n]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},62690:e=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},62791:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(11403),a=i(59306);i(74970),i(3658),i(97745);let o=(0,a.AH)`
5321  :host wui-ux-by-reown {
5322    padding-top: 0;
5323  }
5324
5325  :host wui-ux-by-reown.branding-only {
5326    padding-top: ${({spacing:e})=>e["3"]};
5327  }
5328
5329  a {
5330    text-decoration: none;
5331    color: ${({tokens:e})=>e.core.textAccentPrimary};
5332    font-weight: 500;
5333  }
5334`;var l=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let c=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=s.H.state.remoteFeatures,this.unsubscribe.push(s.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}
5334disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=s.H.state,i=s.H.state.features?.legalCheckbox;return(e||t)&&!i?(0,r.qy)`
5335      <wui-flex flexDirection="column">
5336        <wui-flex .padding=${["4","3","3","3"]} justifyContent="center">
5337          <wui-text color="secondary" variant="md-regular" align="center">
5338            By connecting your wallet, you agree to our <br />
5339            ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
5340          </wui-text>
5341        </wui-flex>
5342        ${this.reownBrandingTemplate()}
5343      </wui-flex>
5344    `:(0,r.qy)`
5345        <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
5346      `}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=s.H.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=s.H.state;return e?(0,r.qy)`<a href=${e} target="_blank" rel="noopener noreferrer"
5347      >Terms of Service</a
5348    >`:null}privacyTemplate(){let{privacyPolicyUrl:e}=s.H.state;return e?(0,r.qy)`<a href=${e} target="_blank" rel="noopener noreferrer"
5349      >Privacy Policy</a
5350    >`:null}reownBrandingTemplate(e=!1){return this.remoteFeatures?.reownBranding?e?(0,r.qy)`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:(0,r.qy)`<wui-ux-by-reown></wui-ux-by-reown>`:null}};c.styles=[o],l([(0,n.wk)()],c.prototype,"remoteFeatures",void 0),c=l([(0,a.EM)("w3m-legal-footer")],c)},63270:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(69428),a=i(34175);let o=(0,a.AH)`
5351  :host {
5352    display: block;
5353    background: linear-gradient(
5354      90deg,
5355      ${({tokens:e})=>e.theme.foregroundPrimary} 0%,
5356      ${({tokens:e})=>e.theme.foregroundSecondary} 50%,
5357      ${({tokens:e})=>e.theme.foregroundPrimary} 100%
5358    );
5359    background-size: 200% 100%;
5360    animation: shimmer 2s linear infinite;
5361    border-radius: ${({borderRadius:e})=>e[1]};
5362  }
5363
5364  :host([data-rounded='true']) {
5365    border-radius: ${({borderRadius:e})=>e[16]};
5366  }
5367
5368  @keyframes shimmer {
5369    0% {
5370      background-position: 100% 0;
5371    }
5372    100% {
5373      background-position: -100% 0;
5374    }
5375  }
5376`;var l=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let c=class extends r.WF{constructor(){super(...arguments),this.width="",this.height="",this.variant="default",this.rounded=!1}render(){return this.style.cssText=`
5377      width: ${this.width};
5378      height: ${this.height};
5379    `,this.dataset.rounded=this.rounded?"true":"false",(0,r.qy)`<slot></slot>`}};c.styles=[o],l([(0,n.MZ)()],c.prototype,"width",void 0),l([(0,n.MZ)()],c.prototype,"height",void 0),l([(0,n.MZ)()],c.prototype,"variant",void 0),l([(0,n.MZ)({type:Boolean})],c.prototype,"rounded",void 0),c=l([(0,s.E)("wui-shimmer")],c)},64461:(e,t,i)=>{"use strict";i.d(t,{Q:()=>o});let r=/^0x(?:[A-Fa-f0-9]{64})$/u,n=/^0x(?:[a-fA-F0-9]{62,})$/u;var s=i(67066),a=i(72550);let o={checkIfAllowedToTriggerEmail(){let e=a.o.get(s.s1.LAST_EMAIL_LOGIN_TIME);if(e){let t=Date.now()-Number(e);if(t<3e4){let e=Math.ceil((3e4-t)/1e3);throw Error(`Please try again after ${e} seconds`)}}},getTimeToNextEmailLogin(){let e=a.o.get(s.s1.LAST_EMAIL_LOGIN_TIME);if(e){let t=Date.now()-Number(e);if(t<3e4)return Math.ceil((3e4-t)/1e3)}return 0},checkIfRequestExists:e=>s.Vl.NOT_SAFE_RPC_METHODS.includes(e.method)||s.Vl.SAFE_RPC_METHODS.includes(e.method),getResponseType:e=>"string"==typeof e&&(e?.match(r)||e?.match(n))?s.s1.RPC_RESPONSE_TYPE_TX:s.s1.RPC_RESPONSE_TYPE_OBJECT,checkIfRequestIsSafe:e=>s.Vl.SAFE_RPC_METHODS.includes(e.method),isClient:"u">typeof window}},64717:(e,t)=>{t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},65086:(e,t,i)=>{let r=i(66513).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];let t=Math.floor(e/7)+2,i=r(e),n=145===i?26:2*Math.ceil((i-13)/(2*t-2)),s=[i-7];for(let e=1;e<t-1;e++)s[e]=s[e-1]-n;return s.push(6),s.reverse()},t.getPositions=function(e){let i=[],r=t.getRowColCoords(e),n=r.length;for(let e=0;e<n;e++)for(let t=0;t<n;t++)(0!==e||0!==t)&&(0!==e||t!==n-1)&&(e!==n-1||0!==t)&&i.push([r[e],r[t]]);return i}},65972:(e,t,i)=>{"use strict";i.d(t,{IP:()=>a,T8:()=>n,Ud:()=>s,Ws:()=>r});let r={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit-wallet/SOCIAL_USERNAME",RECENT_WALLETS:"@appkit/recent_wallets",RECENT_WALLET:"@appkit/recent_wallet",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",ACTIVE_NAMESPACE:"@appkit/active_namespace",CONNECTED_NAMESPACES:"@appkit/connected_namespaces",CONNECTION_STATUS:"@appkit/connection_status",SIWX_AUTH_TOKEN:"@appkit/siwx-auth-token",SIWX_NONCE_TOKEN:"@appkit/siwx-nonce-token",TELEGRAM_SOCIAL_PROVIDER:"@appkit/social_provider",NATIVE_BALANCE_CACHE:"@appkit/native_balance_cache",PORTFOLIO_CACHE:"@appkit/portfolio_cac
5379he",ENS_CACHE:"@appkit/ens_cache",IDENTITY_CACHE:"@appkit/identity_cache",PREFERRED_ACCOUNT_TYPES:"@appkit/preferred_account_types",CONNECTIONS:"@appkit/connections",DISCONNECTED_CONNECTOR_IDS:"@appkit/disconnected_connector_ids",HISTORY_TRANSACTIONS_CACHE:"@appkit/history_transactions_cache",TOKEN_PRICE_CACHE:"@appkit/token_price_cache",RECENT_EMAILS:"@appkit/recent_emails",LATEST_APPKIT_VERSION:"@appkit/latest_version",TON_WALLETS_CACHE:"@appkit/ton_wallets_cache"};function n(e){if(!e)throw Error("Namespace is required for CONNECTED_CONNECTOR_ID");return`@appkit/${e}:connected_connector_id`}let s={setItem(e,t){a()&&void 0!==t&&localStorage.setItem(e,t)},getItem(e){if(a())return localStorage.getItem(e)||void 0},removeItem(e){a()&&localStorage.removeItem(e)},clear(){a()&&localStorage.clear()}};function a(){return"u">typeof window&&"u">typeof localStorage}},66395:(e,t,i)=>{"use strict";i.d(t,{D:()=>a});var r=i(11403),n=i(29400),s=i(37056);let a={getFeatureValue(e,t){let i=t?.[e];return void 0===i?n.oU.DEFAULT_FEATURES[e]:i},filterSocialsByPlatform(e){if(!e||!e.length)return e;let t=e;return s.w.isTelegram()&&(s.w.isIos()&&(t=t.filter(e=>"google"!==e)),s.w.isMac()&&(t=t.filter(e=>"x"!==e)),s.w.isAndroid()&&(t=t.filter(e=>!["facebook","x"].includes(e)))),s.w.isMobile()&&(t=t.filter(e=>"facebook"!==e)),t},isSocialsEnabled:()=>Array.isArray(r.H.state.features?.socials)&&r.H.state.features?.socials.length>0||Array.isArray(r.H.state.remoteFeatures?.socials)&&r.H.state.remoteFeatures?.socials.length>0,isEmailEnabled:()=>!!(r.H.state.features?.email||r.H.state.remoteFeatures?.email)}},66449:(e,t,i)=>{"use strict";i(82989)},66463:(e,t,i)=>{"use strict";i(84915)},66513:(e,t)=>{let i,r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw Error('"version" cannot be null or undefined');if(e<1||e>40)throw Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return r[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw Error('"toSJISFunc" is not a valid function.');i=e},t.isKanjiModeEnabled=function(){return void 0!==i},t.toSJIS=function(e){return i(e)}},67066:(e,t,i)=>{"use strict";i.d(t,{OH:()=>s,Vl:()=>l,gS:()=>a,hy:()=>n,s1:()=>o});var r=i(41463);let n=(void 0!==r&&void 0!==r.env?r.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL:void 0)||"https://secure.walletconnect.org/sdk",s=(void 0!==r&&void 0!==r.env?r.env.NEXT_PUBLIC_DEFAULT_LOG_LEVEL:void 0)||"error",a=(void 0!==r&&void 0!==r.env?r.env.NEXT_PUBLIC_SECURE_SITE_SDK_VERSION:void 0)||"4",o={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",APP_RELOAD:"@w3m-app/RELOAD",APP_RPC_ABORT:"@w3m-app/RPC_ABORT",FRAME_SWITCH_NETWORK_E
5379RROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",FRAME_RELOAD_SUCCESS:"@w3m-frame/RELOAD_SUCCESS",FRAME_RELOAD_ERROR:"@w3m-frame/RELOAD_ERROR",FRAME_RPC_ABORT_SUCCESS:"@w3m-frame/RPC_ABORT_SUCCESS",FRAME_RPC_ABORT_ERROR:"@w3m-frame/RPC_ABORT_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},l={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints","wallet_getAssets"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","wallet_revokePermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RP
5379C_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}}},67786:(e,t,i)=>{"use strict";i.d(t,{_:()=>p,K:()=>m});var r=i(87850);let{I:n}=r.ge;var s=i(70508);let a=(e,t)=>{let i=e._$AN;if(void 0===i)return!1;for(let e of i)e._$AO?.(t,!1),a(e,t);return!0},o=e=>{let t,i;do{if(void 0===(t=e._$AM))break;(i=t._$AN).delete(e),e=t}while(0===i?.size)},l=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),h(t)}};function c(e){void 0!==this._$AN?(o(this),this._$AM=e,l(this)):this._$AM=e}function d(e,t=!1,i=0){let r=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(t)if(Array.isArray(r))for(let e=i;e<r.length;e++)a(r[e],!1),o(r[e]);else null!=r&&(a(r,!1),o(r));else a(this,e)}let h=e=>{e.type==s.OA.CHILD&&(e._$AP??=d,e._$AQ??=c)};class u extends s.WL{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),l(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(a(this,e),o(this))}setValue(e){if(void 0===this._$Ct.strings)this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}let p=()=>new f;class f{}let g=new WeakMap,m=(0,s.u$)(class extends u{render(e){return r.s6}update(e,[t]){let i=t!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),r.s6}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){let t=this.ht??globalThis,i=g.get(t);void 0===i&&(i=new WeakMap,g.set(t,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?g.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})},68939:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r=i(83227);r.__exportStar(i(3685),t),r.__exportStar(i(82940),t),r.__exportStar(i(78537),t),r.__exportStar(i(29845),t)},69148:(e,t,i)=>{"use strict";i.d(t,{W:()=>c});var r=i(92679),n=i(19626),s=i(51369),a=i(11446);let o=(0,r.BX)({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),l={state:o,subscribe:e=>(0,r.B1)(o,()=>e(o)),setThemeMode(e){o.themeMode=e;try{let t=a.a.getAuthConnector();if(t){let i=l.getSnapshot().themeVariables;t.provider.syncTheme({themeMode:e,themeVariables:i,w3mThemeVariables:(0,n.o)(i,e)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(e){o.themeVariables={...o.themeVariables,...e};try{let e=a.a.getAuthConnector();if(e){let t=l.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:t,w3mThemeVariables:(0,n.o)(o.themeVariables,o.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot:()=>(0,r.P9)(o)},c=(0,s.X)(l)},69428:(e,t,i)=>{"use strict";function r(e){return function(t){return"function"==typeof t?(customElements.get(e)||customElements.define(e,t),t):function(e,t){let{kind:i,elements:r}=t;return{kind:i,elements:r,finisher(t){customElements.get(e)||customElements.define(e,t)}}}(e,t)}}i.d(t,{E:()=>r})},70508:(e,t,i)=>{"use strict";i.d(t,{OA:()=>r,WL:()=>s,u$:()=>n});let r={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},n=e=>(...t)=>({_$litDirective$:e,values:t});class s{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}},70706:(e,t,i)=>{let r=i(30567),n=i(77570),s=i(29514),a=i(82425),o=i(85410),l=i(74963),c=i(66513),d=i(19995);function h(e){return unescape(encodeURIComponent(e)).length}function u(e,t,i){let r,n=[];for(;null!==(r=e.exec(i));)n.push({data:r[0],index:r.index,mode:t,length:r[0].length});return n}function p(e){let t,i,n=u(l.NUMERIC,r.NUMERIC,e),s=u(l.ALPHANUMERIC,r.ALPHANUMERIC,e);return c.isKanjiModeEnabled()?(t=u(l.BYTE,r.BYTE,e),i=u(l.KANJI,r.KANJI,e)):(t=u(l.BYTE_KANJI,r.BYTE,e),i=[]),n.concat(s,t,i).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,t){switch(t){case r.NUMERIC:return n.getBitsLength(e);case r.ALPHANUMERIC:return s.getBitsLength(e);case r.KANJI:return o.getBitsLength(e);case r.BYTE:return a.getBitsLength(e)}}function g(e,t){let i,l=r.getBestModeForData(e);if((i=r.from(t,l))!==r.BYTE&&i.bit<l.bit)throw Error('"'+e+'" cannot be encoded with mode '+r.toString(i)+".\n Suggested mode is: "+r.toString(l));switch(i===r.KANJI&&!c.isKanjiModeEnabled()&&(i=r.BYTE),i){case r.NUMERIC:return new n(e);case r.ALPHANUMERIC:return new s(e);case r.KANJI:return new o(e);case r.BYTE:return new a(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},t.fromString=function(e,i){let n=function(e,t){let i={},n={start:{}},s=["start"];for(let a=0;a<e.length;a++){let o=e[a],l=[];for(let e=0;e<o.length;e++){let c=o[e],d=""+a+e;l.push(d),i[d]={node:c,lastCount:0},n[d]={};for(let e=0;e<s.length;e++){let a=s[e];i[a]&&i[a].node.mode===c.mode?(n[a][d]=f(i[a].lastCount+c.length,c.mode)-f(i[a].lastCount,c.mode),i[a].lastCount+=c.length):(i[a]&&(i[a].lastCount=c.length),n[a][d]=f(c.length,c.mode)+4+r.getCharCountIndicator(c.mode,t))}}s=l}for(let e=0;e<s.length;e++)n[s[e]].end=0;return{map:n,table:i}}(function(e){let t=[];for(let i=0;i<e.length;i++){let n=e[i];switch(n.mode){case r.NUMERIC:t.push([n,{data:n.data,mode:r.ALPHANUMERIC,length:n.length},{data:n.data,mode:r.BYTE,length:n.length}]);break;case r.ALPHANUMERIC:t.push([n,{data:n.data,mode:r.BYTE,length:n.length}]);break;case r.KANJI:t.push([n,{data:n.data,mode:r.BYTE,length:h(n.data)}]);break;case r.BYTE:t.push([{data:n.data,mode:r.BYTE,length:h(n.data)}])}}return t}(p(e,c.isKanjiModeEnabled())),i),s=d.find_path(n.map,"start","end"),a=[];for(let e=1;e<s.length-1;e++)a.push(n.table[s[e]].node);return t.fromArray(a.reduce(function(e,t){let i=e.length-1>=0?e[e.length-1]:null;return i&&i.mode===t.mode?e[e.length-1].data+=t.data:e.push(t),e},[]))},t.rawSplit=function(e){return t.fromArray(p(e,c.isKanjiModeEnabled()))}},71594:(e,t,i)=>{let r=i(45199),n=i(83404);e.exports={blake2b:r.blake2b,blake2bHex:r.blake2bHex,blake2bInit:r.blake2bInit,blake2bUpdate:r.blake2bUpdate,blake2bFinal:r.blake2bFinal,blake2s:n.blake2s,blake2sHex:n.blake2sHex,blake2sInit:n.blake2sInit,blake2sUpdate:n.blake2sUpdate,blake2sFinal:n.blake2sFinal}},72550:(e,t,i)=>{"use strict";i.d(t,{o:()=>s});var r=i(67066),n=i(64461);let s={set(e,t){n.Q.isClient&&localStorage.setItem(`${r.s1.STORAGE_KEY}${e}`,t)},get:e=>n.Q.isClient?localStorage.getItem(`${r.s1.STORAGE_KEY}${e}`):null,delete(e,t){n.Q.isClient&&(t?localStorage.removeItem(e):localStorage.removeItem(`${r.s1.STORAGE_KEY}${e}`))}}},72594:(e,t,i)=>{"use strict";i.d(t,{y:()=>r});let r={isLowerCaseMatch:(e,t)=>e?.toLowerCase()===t?.toLowerCase()}},73636:e=>{"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},73989:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(74016),a=i(11403),o=i(59306),l=i(40859),c=i(67786);i(82016),i(12936);var d=i(94895),h=i(69428),u=i(34175);let p=(0,u.AH)`
5380  label {
5381    display: inline-flex;
5382    align-items: center;
5383    cursor: pointer;
5384    user-select: none;
5385    column-gap: ${({spacing:e})=>e[2]};
5386  }
5387
5388  label > input[type='checkbox'] {
5389    height: 0;
5390    width: 0;
5391    opacity: 0;
5392    position: absolute;
5393  }
5394
5395  label > span {
5396    display: flex;
5397    align-items: center;
5398    justify-content: center;
5399    height: 100%;
5400    width: 100%;
5401    border: 1px solid ${({colors:e})=>e.neutrals400};
5402    color: ${({colors:e})=>e.white};
5403    background-color: transparent;
5404    will-change: border-color, background-color;
5405  }
5406
5407  label > span > wui-icon {
5408    opacity: 0;
5409    will-change: opacity;
5410  }
5411
5412  label > input[type='checkbox']:checked + span > wui-icon {
5413    color: ${({colors:e})=>e.white};
5414  }
5415
5416  label > input[type='checkbox']:not(:checked) > span > wui-icon {
5417    color: ${({colors:e})=>e.neutrals900};
5418  }
5419
5420  label > input[type='checkbox']:checked + span > wui-icon {
5421    opacity: 1;
5422  }
5423
5424  /* -- Sizes --------------------------------------------------- */
5425  label[data-size='lg'] > span {
5426    width: 24px;
5427    height: 24px;
5428    min-width: 24px;
5429    min-height: 24px;
5430    border-radius: ${({borderRadius:e})=>e[10]};
5431  }
5432
5433  label[data-size='md'] > span {
5434    width: 20px;
5435    height: 20px;
5436    min-width: 20px;
5437    min-height: 20px;
5438    border-radius: ${({borderRadius:e})=>e[2]};
5439  }
5440
5441  label[data-size='sm'] > span {
5442    width: 16px;
5443    height: 16px;
5444    min-width: 16px;
5445    min-height: 16px;
5446    border-radius: ${({borderRadius:e})=>e[1]};
5447  }
5448
5449  /* -- Focus states --------------------------------------------------- */
5450  label > input[type='checkbox']:focus-visible + span,
5451  label > input[type='checkbox']:focus + span {
5452    border: 1px solid ${({tokens:e})=>e.core.borderAccentPrimary};
5453    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
5454  }
5455
5456  /* -- Checked states --------------------------------------------------- */
5457  label > input[type='checkbox']:checked + span {
5458    background-color: ${({tokens:e})=>e.core.iconAccentPrimary};
5459    border: 1px solid transparent;
5460  }
5461
5462  /* -- Hover states --------------------------------------------------- */
5463  input[type='checkbox']:not(:checked):not(:disabled) + span:hover {
5464    border: 1px solid ${({colors:e})=>e.neutrals700};
5465    background-color: ${({colors:e})=>e.neutrals800};
5466    box-shadow: none;
5467  }
5468
5469  input[type='checkbox']:checked:not(:disabled) + span:hover {
5470    border: 1px solid transparent;
5471    background-color: ${({colors:e})=>e.accent080};
5472    box-shadow: none;
5473  }
5474
5475  /* -- Disabled state --------------------------------------------------- */
5476  label > input[type='checkbox']:checked:disabled + span {
5477    border: 1px solid transparent;
5478    opacity: 0.3;
5479  }
5480
5481  label > input[type='checkbox']:not(:checked):disabled + span {
5482    border: 1px solid ${({colors:e})=>e.neutrals700};
5483  }
5484
5485  label:has(input[type='checkbox']:disabled) {
5486    cursor: auto;
5487  }
5488
5489  label > input[type='checkbox']:disabled + span {
5490    cursor: not-allowed;
5491  }
5492`;var f=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let g={lg:"md",md:"sm",sm:"sm"},m=class extends r.WF{constructor(){super(...arguments),this.inputElementRef=(0,c._)(),this.checked=void 0,this.disabled=!1,this.size="md"}render(){let e=g[this.size];return(0,r.qy)`
5493      <label data-size=${this.size}>
5494        <input
5495          ${(0,c.K)(this.inputElementRef)}
5496          ?checked=${(0,l.J)(this.checked)}
5497          ?disabled=${this.disabled}
5498          type="checkbox"
5499          @change=${this.dispatchChangeEvent}
5500        />
5501        <span>
5502          <wui-icon name="checkmarkBold" size=${e}></wui-icon>
5503        </span>
5504        <slot></slot>
5505      </label>
5506    `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("checkboxChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};m.styles=[d.W5,p],f([(0,n.MZ)({type:Boolean})],m.prototype,"checked",void 0),f([(0,n.MZ)({type:Boolean})],m.prototype,"disabled",void 0),f([(0,n.MZ)()],m.prototype,"size",void 0),m=f([(0,h.E)("wui-checkbox")],m),i(3658);let w=(0,o.AH)`
5507  :host {
5508    display: flex;
5509    align-items: center;
5510    justify-content: center;
5511  }
5512  wui-checkbox {
5513    padding: ${({spacing:e})=>e["3"]};
5514  }
5515  a {
5516    text-decoration: none;
5517    color: ${({tokens:e})=>e.theme.textSecondary};
5518    font-weight: 500;
5519  }
5520`;var y=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let b=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.checked=s.o.state.isLegalCheckboxChecked,this.unsubscribe.push(s.o.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=a.H.state,i=a.H.state.features?.legalCheckbox;return(e||t)&&i?(0,r.qy)`
5521      <wui-checkbox
5522        ?checked=${this.checked}
5523        @checkboxChange=${this.onCheckboxChange.bind(this)}
5524        data-testid="wui-checkbox"
5525      >
5526        <wui-text color="secondary" variant="sm-regular" align="left">
5527          I agree to our ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
5528        </wui-text>
5529      </wui-checkbox>
5530    `:null}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=a.H.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=a.H.state;return e?(0,r.qy)`<a rel="noreferrer" target="_blank" href=${e}>terms of service</a>`:null}privacyTemplate(){let{privacyPolicyUrl:e}=a.H.state;return e?(0,r.qy)`<a rel="noreferrer" target="_blank" href=${e}>privacy policy</a>`:null}onCheckboxChange(){s.o.setIsLegalCheckboxChecked(!this.checked)}};b.styles=[w],y([(0,n.wk)()],b.prototype,"checked",void 0),b=y([(0,o.EM)("w3m-legal-checkbox")],b)},74016:(e,t,i)=>{"use strict";i.d(t,{o:()=>a});var r=i(92679),n=i(3125);let s=(0,r.BX)({isLegalCheckboxChecked:!1}
5530),a={state:s,subscribe:e=>(0,r.B1)(s,()=>e(s)),subscribeKey:(e,t)=>(0,n.u$)(s,e,t),setIsLegalCheckboxChecked(e){s.isLegalCheckboxChecked=e}}},74203:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(56726),a=i(59306);i(74970),i(94548),i(3658);let o=(0,a.AH)`
5531  :host {
5532    pointer-events: none;
5533  }
5534
5535  :host > wui-flex {
5536    display: var(--w3m-tooltip-display);
5537    opacity: var(--w3m-tooltip-opacity);
5538    padding: 9px ${({spacing:e})=>e["3"]} 10px ${({spacing:e})=>e["3"]};
5539    border-radius: ${({borderRadius:e})=>e["3"]};
5540    color: ${({tokens:e})=>e.theme.backgroundPrimary};
5541    position: absolute;
5542    top: var(--w3m-tooltip-top);
5543    left: var(--w3m-tooltip-left);
5544    transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
5545    max-width: calc(var(--apkt-modal-width) - ${({spacing:e})=>e["5"]});
5546    transition: opacity ${({durations:e})=>e.lg}
5547      ${({easings:e})=>e["ease-out-power-2"]};
5548    will-change: opacity;
5549    opacity: 0;
5550    animation-duration: ${({durations:e})=>e.xl};
5551    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
5552    animation-name: fade-in;
5553    animation-fill-mode: forwards;
5554  }
5555
5556  :host([data-variant='shade']) > wui-flex {
5557    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5558  }
5559
5560  :host([data-variant='shade']) > wui-flex > wui-text {
5561    color: ${({tokens:e})=>e.theme.textSecondary};
5562  }
5563
5564  :host([data-variant='fill']) > wui-flex {
5565    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
5566    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
5567  }
5568
5569  wui-icon {
5570    position: absolute;
5571    width: 12px !important;
5572    height: 4px !important;
5573    color: ${({tokens:e})=>e.theme.foregroundPrimary};
5574  }
5575
5576  wui-icon[data-placement='top'] {
5577    bottom: 0px;
5578    left: 50%;
5579    transform: translate(-50%, 95%);
5580  }
5581
5582  wui-icon[data-placement='bottom'] {
5583    top: 0;
5584    left: 50%;
5585    transform: translate(-50%, -95%) rotate(180deg);
5586  }
5587
5588  wui-icon[data-placement='right'] {
5589    top: 50%;
5590    left: 0;
5591    transform: translate(-65%, -50%) rotate(90deg);
5592  }
5593
5594  wui-icon[data-placement='left'] {
5595    top: 50%;
5596    right: 0%;
5597    transform: translate(65%, -50%) rotate(270deg);
5598  }
5599
5600  @keyframes fade-in {
5601    from {
5602      opacity: 0;
5603    }
5604    to {
5605      opacity: 1;
5606    }
5607  }
5608`;var l=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let c=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.open=s.I.state.open,this.message=s.I.state.message,this.triggerRect=s.I.state.triggerRect,this.variant=s.I.state.variant,this.unsubscribe.push(s.I.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;let e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=`
5609    --w3m-tooltip-top: ${e}px;
5610    --w3m-tooltip-left: ${t}px;
5611    --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
5612    --w3m-tooltip-display: ${this.open?"flex":"none"};
5613    --w3m-tooltip-opacity: ${+!!this.open};
5614    `,(0,r.qy)`<wui-flex>
5615      <wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon>
5616      <wui-text color="primary" variant="sm-regular">${this.message}</wui-text>
5617    </wui-flex>`}};c.styles=[o],l([(0,n.wk)()],c.prototype,"open",void 0),l([(0,n.wk)()],c.prototype,"message",void 0),l([(0,n.wk)()],c.prototype,"triggerRect",void 0),l([(0,n.wk)()],c.prototype,"variant",void 0),c=l([(0,a.EM)("w3m-tooltip")],c)},74714:(e,t,i)=>{"use strict";let r;i.d(t,{Z:()=>w});var n=i(18587),s=i(49235),a=i(34386),o=i(30840),l=i(18715),c=i(1024),d=i(60319),h=i(11446);let u={createBalance(e,t){let i={name:e.metadata.name||"",symbol:e.metadata.symbol||"",decimals:e.metadata.decimals||0,value:e.metadata.value||0,price:e.metadata.price||0,iconUrl:e.metadata.iconUrl||""};return{name:i.name,symbol:i.symbol,chainId:t,address:"native"===e.address?void 0:this.convertAddressToCAIP10Address(e.address,t),value:i.value,price:i.price,quantity:{decimals:i.decimals.toString(),numeric:this.convertHexToBalance({hex:e.balance,decimals:i.decimals})},iconUrl:i.iconUrl}},convertHexToBalance:({hex:e,decimals:t})=>(0,s.J)(BigInt(e),t),convertAddressToCAIP10Address:(e,t)=>`${t}:${e}`,createCAIP2ChainId:(e,t)=>`${t}:${parseInt(e,16)}`,getChainIdHexFromCAIP2ChainId(e){let t=e.split(":");if(t.length<2||!t[1])return"0x0";let i=parseInt(t[1],10);return isNaN(i)?"0x0":`0x${i.toString(16)}`},isWalletGetAssetsResponse(e){return"object"==typeof e&&null!==e&&Object.values(e).every(e=>Array.isArray(e)&&e.every(e=>this.isValidAsset(e)))},isValidAsset:e=>"object"==typeof e&&null!==e&&"string"==typeof e.address&&"string"==typeof e.balance&&("ERC20"===e.type||"NATIVE"===e.type)&&"object"==typeof e.metadata&&null!==e.metadata&&"string"==typeof e.metadata.name&&"string"==typeof e.metadata.symbol&&"number"==typeof e.metadata.decimals&&"number"==typeof e.metadata.price&&"string"==typeof e.metadata.iconUrl};var p=i(5820),f=i(11403);async function g(){if(!r){let{createPublicClient:e,http:t,defineChain:n}=await Promise.all([i.e(72793),i.e(27854),i.e(83208),i.e(52276),i.e(65979),i.e(21077)]).then(i.bind(i,48446));r={createPublicClient:e,http:t,defineChain:n}}return r}let m={getBlockchainApiRpcUrl(e,t){let i=new URL("https://rpc.walletconnect.org/v1/");return i.searchParams.set("chainId",e),i.searchParams.set("projectId",t),i.toString()},async getViemChain(e){let{defineChain:t}
5617=await g(),{chainId:i}=o.C.parseCaipNetworkId(e.caipNetworkId);return t({...e,id:Number(i)})},async createViemPublicClient(e){let{createPublicClient:t,http:i}=await g(),r=f.H.state.projectId,n=await m.getViemChain(e);if(!n)throw Error(`Chain ${e.caipNetworkId} not found in viem/chains`);return t({chain:n,transport:i(m.getBlockchainApiRpcUrl(e.caipNetworkId,r))})}},w={async getMyTokensWithBalance(e={forceUpdate:void 0,caipNetwork:c.W.state.activeCaipNetwork,address:c.W.getAccountData()?.address}){let{forceUpdate:t,caipNetwork:i,address:r}=e,n=h.a.getConnectorId("eip155")===a.o.CONNECTOR_ID.AUTH;if(!r)return[];let s=i?`${i.caipNetworkId}:${r}`:r,o=p.i.getBalanceCacheForCaipAddress(s);if(o)return o.balances;if(i&&i.chainNamespace===a.o.CHAIN.EVM&&n){let e=await this.getEIP155Balances(r,i);if(e)return this.filterLowQualityTokens(e)}let d=await l.T.getBalance(r,i?.caipNetworkId,t);return this.filterLowQualityTokens(d.balances)},async getEIP155Balances(e,t){try{let i=u.getChainIdHexFromCAIP2ChainId(t.caipNetworkId),r=await d.x.getCapabilities(e);if(!r?.[i]?.assetDiscovery?.supported)return null;let n=await d.x.walletGetAssets({account:e,chainFilter:[i]});if(!u.isWalletGetAssetsResponse(n))return null;let s=(n[i]||[]).map(e=>u.createBalance(e,t.caipNetworkId));return p.i.updateBalanceCache({caipAddress:`${t.caipNetworkId}:${e}`,balance:{balances:s},timestamp:Date.now()}),s}catch(e){return null}},filterLowQualityTokens:e=>e.filter(e=>"0"!==e.quantity.decimals),async fetchERC20Balance({caipAddress:e,assetAddress:t,caipNetwork:i}){let r=await m.createViemPublicClient(i),{address:a}=o.C.parseCaipAddress(e),[{result:l},{result:c},{result:d},{result:h}]=await r.multicall({contracts:[{address:t,functionName:"name",args:[],abi:n.xw},{address:t,functionName:"symbol",args:[],abi:n.xw},{address:t,functionName:"balanceOf",args:[a],abi:n.xw},{address:t,functionName:"decimals",args:[],abi:n.xw}]});return{name:l,symbol:c,decimals:h,balance:d&&h?(0,s.J)(d,h):"0"}}}},74897:(e,t,i)=>{"use strict";i.d(t,{H:()=>s});var r=i(87850),n=i(70508);let s=(0,n.u$)(class extends n.WL{constructor(e){if(super(e),e.type!==n.OA.ATTRIBUTE||"class"!==e.name||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(void 0===this.st){for(let i in this.st=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e))),t)t[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(t)}let i=e.element.classList;for(let e of this.st)e in t||(i.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(i.add(e),this.st.add(e)):(i.remove(e),this.st.delete(e)))}return r.c0}})},74946:(e,t,i)=>{"use strict";i.d(t,{_:()=>n});var r=i(88088);let n=(0,r.JW)`
5618  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10">
5619  <path d="M8.37651 0H1.62309C0.381381 0 -0.405611 1.33944 0.219059 2.42225L4.38701 9.64649C4.659 10.1182 5.3406 10.1182 5.61259 9.64649L9.78139 2.42225C10.4052 1.34117 9.61822 0 8.37736 0H8.37651ZM4.38362 7.48005L3.47591 5.72329L1.2857 1.80606C1.14121 1.55534 1.31968 1.23405 1.62225 1.23405H4.38278V7.4809L4.38362 7.48005ZM8.71221 1.80521L6.52284 5.72414L5.61513 7.48005V1.2332H8.37566C8.67823 1.2332 8.85669 1.55449 8.71221 1.80521Z" fill="var(--apkt-tokens-theme-textPrimary)" />
5620</svg>
5621`},74963:(e,t)=>{let i="[0-9]+",r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(r=r.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";t.KANJI=RegExp(r,"g"),t.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=RegExp(n,"g"),t.NUMERIC=RegExp(i,"g"),t.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let s=RegExp("^"+r+"$"),a=RegExp("^"+i+"$"),o=RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return s.test(e)},t.testNumeric=function(e){return a.test(e)},t.testAlphanumeric=function(e){return o.test(e)}},74970:(e,t,i)=>{"use strict";i(47002)},75821:(e,t,i)=>{"use strict";async function r(...e){let t=await fetch(...e);if(!t.ok)throw Error(`HTTP status code: ${t.status}`,{cause:t});return t}i.d(t,{Z:()=>n});
5621class n{constructor({baseUrl:e,clientId:t}){this.baseUrl=e,this.clientId=t}async get({headers:e,signal:t,cache:i,...n}){let s=this.createUrl(n);return(await r(s,{method:"GET",headers:e,signal:t,cache:i})).json()}async getBlob({headers:e,signal:t,...i}){let n=this.createUrl(i);return(await r(n,{method:"GET",headers:e,signal:t})).blob()}async post({body:e,headers:t,signal:i,...n}){let s=this.createUrl(n);return(await r(s,{method:"POST",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}async put({body:e,headers:t,signal:i,...n}){let s=this.createUrl(n);return(await r(s,{method:"PUT",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}async delete({body:e,headers:t,signal:i,...n}){let s=this.createUrl(n);return(await r(s,{method:"DELETE",headers:t,body:e?JSON.stringify(e):void 0,signal:i})).json()}createUrl({path:e,params:t}){let i=new URL(e,this.baseUrl);return t&&Object.entries(t).forEach(([e,t])=>{t&&i.searchParams.append(e,t)}),this.clientId&&i.searchParams.append("clientId",this.clientId),i}sendBeacon({body:e,...t}){let i=this.createUrl(t);return navigator.sendBeacon(i.toString(),e?JSON.stringify(e):void 0)}}},76581:(e,t,i)=>{"use strict";i.d(t,{j:()=>o});var r=i(92679),n=i(3125),s=i(51369);let a=(0,r.BX)({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),o=(0,s.X)({state:a,subscribeNetworkImages:e=>(0,r.B1)(a.networkImages,()=>e(a.networkImages)),subscribeKey:(e,t)=>(0,n.u$)(a,e,t),subscribe:e=>(0,r.B1)(a,()=>e(a)),setWalletImage(e,t){a.walletImages[e]=t},setNetworkImage(e,t){a.networkImages[e]=t},setChainImage(e,t){a.chainImages[e]=t},setConnectorImage(e,t){a.connectorImages={...a.connectorImages,[e]:t}},setTokenImage(e,t){a.tokenImages[e]=t},setCurrencyImage(e,t){a.currencyImages[e]=t}})},77206:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(74946);let a=(0,r.JW)`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
5622  <rect width="64" height="64" fill="#F7931A"/>
5623  <g clip-path="url(#clip0_1045_17)">
5624    <path d="M63.0394 39.7409C58.7654 56.8839 41.4024 67.3169 24.2574 63.0419C7.11937 58.7679 -3.31363 41.4039 0.962367 24.2619C5.23437 7.11686 22.5974 -3.31714 39.7374 0.956863C56.8814 5.23086 67.3134 22.5969 63.0394 39.7409Z" fill="#F7931A"/>
5625    <path d="M46.1092 27.4409C46.7462 23.1829 43.5042 20.8939 39.0712 19.3669L40.5092 13.5989L36.9982 12.7239L35.5982 18.3399C34.6752 18.1099 33.7272 17.8929 32.7852 17.6779L34.1952 12.0249L30.6862 11.1499L29.2472 16.9159C28.4832 16.7419 27.7332 16.5699 27.0052 16.3889L27.0092 16.3709L22.1672 15.1619L21.2332 18.9119C21.2332 18.9119 23.8382 19.5089 23.7832 19.5459C25.2052 19.9009 25.4622 20.8419 25.4192 21.5879L23.7812 28.1589C23.8792 28.1839 24.0062 28.2199 24.1462 28.2759C24.0292 28.2469 23.9042 28.2149 23.7752 28.1839L21.4792 37.3889C21.3052 37.8209 20.8642 38.4689 19.8702 38.2229C19.9052 38.2739 17.3182 37.5859 17.3182 37.5859L15.5752 41.6049L20.1442 42.7439C20.9942 42.9569 21.8272 43.1799 22.6472 43.3899L21.1942 49.2239L24.7012 50.0989L26.1402 44.3269C27.0982 44.5869 28.0282 44.8269 28.9382 45.0529L27.5042 50.7979L31.0152 51.6729L32.4682 45.8499C38.4552 46.9829 42.9572 46.5259 44.8522 41.1109C46.3792 36.7509 44.7762 34.2359 41.6262 32.5959C43.9202 32.0669 45.6482 30.5579 46.1092 27.4409ZM38.0872 38.6899C37.0022 43.0499 29.6612 40.6929 27.2812 40.1019L29.2092 32.3729C31.5892 32.9669 39.2212 34.1429 38.0872 38.6899ZM39.1732 27.3779C38.1832 31.3439 32.0732 29.3289 30.0912 28.8349L31.8392 21.8249C33.8212 22.3189 40.2042 23.2409 39.1732 27.3779Z" fill="white"/>
5626  </g>
5627  <defs>
5628    <clipPath id="clip0_1045_17">
5629      <rect width="64" height="64" fill="white"/>
5630    </clipPath>
5631  </defs>
5632</svg>
5633`,o=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5634  <rect width="60" height="60" fill="#1DC956" rx="30" />
5635  <circle cx="30" cy="30" r="3" fill="#fff" />
5636  <path
5637    fill="#2BEE6C"
5638    stroke="#fff"
5639    stroke-width="2"
5640    d="m45.32 17.9-.88-.42.88.42.02-.05c.1-.2.21-.44.26-.7l-.82-.15.82.16a2 2 0 0 0-.24-1.4c-.13-.23-.32-.42-.47-.57a8.42 8.42 0 0 1-.04-.04l-.04-.04a2.9 2.9 0 0 0-.56-.47l-.51.86.5-.86a2 2 0 0 0-1.4-.24c-.26.05-.5.16-.69.26l-.05.02-15.05 7.25-.1.05c-1.14.55-1.85.89-2.46 1.37a7 7 0 0 0-1.13 1.14c-.5.6-.83 1.32-1.38 2.45l-.05.11-7.25 15.05-.02.05c-.1.2-.21.43-.26.69a2 2 0 0 0 .24 1.4l.85-.5-.85.5c.13.23.32.42.47.57l.04.04.04.04c.15.15.34.34.56.47a2 2 0 0 0 1.41.24l-.2-.98.2.98c.25-.05.5-.17.69-.26l.05-.02-.42-.87.42.87 15.05-7.25.1-.05c1.14-.55 1.85-.89 2.46-1.38a7 7 0 0 0 1.13-1.13 12.87 12.87 0 0 0 1.43-2.56l7.25-15.05Z"
5641  />
5642  <path
5643    fill="#1DC956"
5644    d="M33.38 32.72 30.7 29.3 15.86 44.14l.2.2a1 1 0 0 0 1.14.2l15.1-7.27a3 3 0 0 0 1.08-4.55Z"
5645  />
5646  <path
5647    fill="#86F999"
5648    d="m26.62 27.28 2.67 3.43 14.85-14.85-.2-.2a1 1 0 0 0-1.14-.2l-15.1 7.27a3 3 0 0 0-1.08 4.55Z"
5649  />
5650  <circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)" />
5651  <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
5652</svg> `,l=(0,r.JW)`<svg viewBox="0 0 60 60" fill="none">
5653  <g clip-path="url(#clip0_7734_50402)">
5654    <path
5655      d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.
56556985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
5656      fill="#EB8B47"
5657    />
5658    <path
5659      d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
5660      stroke="#062B2B"
5661      stroke-opacity="0.1"
5662    />
5663    <path
5664      d="M19 52C24.5228 52 29 47.5228 29 42C29 36.4772 24.5228 32 19 32C13.4772 32 9 36.4772 9 42C9 47.5228 13.4772 52 19 52Z"
5665      fill="#FF974C"
5666      stroke="white"
5667      stroke-width="2"
5668    />
5669    <path
5670      fill-rule="evenodd"
5671      clip-rule="evenodd"
5672      d="M42.8437 8.3264C42.4507 7.70891 41.5493 7.70891 41.1564 8.32641L28.978 27.4638C28.5544 28.1295 29.0326 29.0007 29.8217 29.0007H54.1783C54.9674 29.0007 55.4456 28.1295 55.022 27.4638L42.8437 8.3264Z"
5673      fill="white"
5674    />
5675    <path
5676      fill-rule="evenodd"
5677      clip-rule="evenodd"
5678      d="M42.3348 11.6456C42.659 11.7608 42.9061 12.1492 43.4005 12.926L50.7332 24.4488C51.2952 25.332 51.5763 25.7737 51.5254 26.1382C51.4915 26.3808 51.3698 26.6026 51.1833 26.7614C50.9031 27 50.3796 27 49.3327 27H34.6673C33.6204 27 33.0969 27 32.8167 26.7614C32.6302 26.6026 32.5085 26.3808 32.4746 26.1382C32.4237 25.7737 32.7048 25.332 33.2669 24.4488L40.5995 12.926C41.0939 12.1492 41.341 11.7608 41.6652 11.6456C41.8818 11.5687 42.1182 11.5687 42.3348 11.6456ZM35.0001 26.999C38.8661 26.999 42.0001 23.865 42.0001 19.999C42.0001 23.865 45.1341 26.999 49.0001 26.999H35.0001Z"
5679      fill="#FF974C"
5680    />
5681    <path
5682      d="M10.1061 9.35712C9.9973 9.67775 9.99867 10.0388 9.99978 10.3323C9.99989 10.3611 10 10.3893 10 10.4167V25.5833C10 25.6107 9.99989 25.6389 9.99978 25.6677C9.99867 25.9612 9.9973 26.3222 10.1061 26.6429C10.306 27.2317 10.7683 27.694 11.3571 27.8939C11.6777 28.0027 12.0388 28.0013 12.3323 28.0002C12.3611 28.0001 12.3893 28 12.4167 28H19C24.5228 28 29 23.5228 29 18C29 12.4772 24.5228 8 19 8H12.4167C12.3893 8 12.3611 7.99989 12.3323 7.99978C12.0388 7.99867 11.6778 7.9973 11.3571 8.10614C10.7683 8.306 10.306 8.76834 10.1061 9.35712Z"
5683      fill="#FF974C"
5684      stroke="white"
5685      stroke-width="2"
5686    />
5687    <circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
5688    <circle cx="19" cy="42" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
5689  </g>
5690  <defs>
5691    <clipPath id="clip0_7734_50402">
5692      <rect width="60" height="60" fill="white" />
5693    </clipPath>
5694  </defs>
5695</svg> `,c=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5696  <g clip-path="url(#a)">
5697    <path
5698      fill="#1DC956"
5699      d="M0 25.01c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02.11 15.65.11 24.9.11h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.13 60 15.76 60 25v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-3.45 1.97-8.08 1.97-17.33 1.97H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 49.1 0 44.46 0 35.21v-10.2Z"
5700    />
5701    <path
5702      fill="#2BEE6C"
5703      d="M16.1 60c-3.82-.18-6.4-.64-8.53-1.86a15 15 0 0 1-5.6-5.6C.55 50.06.16 46.97.04 41.98L4.2 40.6a4 4 0 0 0 2.48-2.39l4.65-12.4a2 2 0 0 1 2.5-1.2l2.53.84a2 2 0 0 0 2.43-1l2.96-5.94a2 2 0 0 1 3.7.32l3.78 12.58a2 2 0 0 0 3.03 1.09l3.34-2.23a2 2 0 0 0 .65-.7l5.3-9.72a2 2 0 0 1 1.42-1.01l4.14-.69a2 2 0 0 1 1.6.44l3.9 3.24a2 2 0 0 0 2.7-.12l4.62-4.63c.08 2.2.08 4.8.08 7.93v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-2.13 1.22-4.7 1.68-8.54 1.86H16.11Z"
5704    />
5705    <path
5706      fill="#fff"
5707      d="m.07 43.03-.05-2.1 3.85-1.28a3 3 0 0 0 1.86-1.79l4.66-12.4a3 3 0 0 1 3.75-1.8l2.53.84a1 1 0 0 0 1.21-.5l2.97-5.94a3 3 0 0 1 5.56.48l3.77 12.58a1 1 0 0 0 1.51.55l3.34-2.23a1 1 0 0 0 .33-.35l5.3-9.71a3 3 0 0 1 2.14-1.53l4.13-.69a3 3 0 0 1 2.41.66l3.9 3.24a1 1 0 0 0 1.34-.06l5.28-5.28c.05.85.08 1.75.1 2.73L56 22.41a3 3 0 0 1-4.04.19l-3.9-3.25a1 1 0 0 0-.8-.21l-4.13.69a1 1 0 0 0-.72.5l-5.3 9.72a3 3 0 0 1-.97 1.05l-3.34 2.23a3 3 0 0 1-4.53-1.63l-3.78-12.58a1 1 0 0 0-1.85-.16l-2.97 5.94a3 3 0 0 1-3.63 1.5l-2.53-.84a1 1 0 0 0-1.25.6l-4.65 12.4a5 5 0 0 1-3.1 3L.07 43.02Z"
5708    />
5709    <path
5710      fill="#fff"
5711      fill-rule="evenodd"
5712      d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
5713      clip-rule="evenodd"
5714    />
5715    <path fill="#fff" d="M45 .28v59.66l-2 .1V.19c.7.02 1.37.05 2 .1Z" />
5716    <path fill="#2BEE6C" d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
5717    <path
5718      stroke="#fff"
5719      stroke-opacity=".1"
5720      d="M.5 25.01c0-4.63 0-8.08.24-10.8.25-2.7.73-4.64 1.66-6.28a14.5 14.5 0 0 1 5.42-5.41C9.46 1.58 11.39 1.1 14.1.85A133 133 0 0 1 24.9.61h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.67a14.5 14.5 0 0 1 5.42 5.4c.93 1.65 1.41 3.58 1.66 6.3.24 2.71.24 6.16.24 10.79v10.2c0 4.64 0 8.08-.24 10.8-.25 2.7-.73 4.65-1.66 6.28a14.5 14.5 0 0 1-5.42 5.42c-1.63.93-3.57 1.41-6.28 1.66-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.66a14.5 14.5 0 0 1-5.42-5.42C1.47 50.66 1 48.72.74 46.01A133 133 0 0 1 .5 35.2v-10.2Z"
5721    />
5722  </g>
5723  <defs>
5724    <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
5725  </defs>
5726</svg>`,d=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5727  <g clip-path="url(#a)">
5728    <rect width="60" height="60" fill="#C653C6" rx="30" />
5729    <path
5730      fill="#E87DE8"
5731      d="M57.98.01v19.5a4.09 4.09 0 0 0-2.63 2.29L50.7 34.2a2 2 0 0 1-2.5 1.2l-2.53-.84a2 2 0 0 0-2.42 1l-2.97 5.94a2 2 0 0 1-3.7-.32L32.8 28.6a2 2 0 0 0-3.02-1.09l-3.35 2.23a2 2 0 0 0-.64.7l-5.3 9.72a2 2 0 0 1-1.43 1.01l-4.13.69a2 2 0 0 1-1.61-.44l-3.9-3.24a2 2 0 0 0-2.69.12L2.1 42.93.02 43V.01h57.96Z"
5732    />
5733    <path
5734      fill="#fff"
5735      d="m61.95 16.94.05 2.1-3.85 1.28a3 3 0 0 0-1.86 1.79l-4.65 12.4a3 3 0 0 1-3.76 1.8l-2.53-.84a1 1 0 0 0-1.2.5l-2.98 5.94a3 3 0 0 1-5.55-.48l-3.78-12.58a1 1 0 0 0-1.5-.55l-3.35 2.23a1 1 0 0 0-.32.35l-5.3 9.72a3 3 0 0 1-2.14 1.52l-4.14.69a3 3 0 0 1-2.41-.66l-3.9-3.24a1 1 0 0 0-1.34.06l-5.28 5.28c-.05-.84-.08-1.75-.1-2.73l3.97-3.96a3 3 0 0 1 4.04-.19l3.89 3.25a1 1 0 0 0 .8.21l4.14-.68a1 1 0 0 0 .71-.51l5.3-9.71a3 3 0 0 1 .97-1.06l3.34-2.23a3 3 0 0 1 4.54 1.63l3.77 12.58a1 1 0 0 0 1.86.16l2.96-5.93a3 3 0 0 1 3.64-1.5l2.52.83a1 1 0 0 0 1.25-.6l4.66-12.4a5 5 0 0 1 3.1-2.99l4.43-1.48Z"
5736    />
5737    <path
5738      fill="#fff"
5739      fill-rule="evenodd"
5740      d="M35.5 27a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
5741      clip-rule="evenodd"
5742    />
5743    <path fill="#fff" d="M31 0v60h-2V0h2Z" />
5744    <path fill="#E87DE8" d="M33.5 27a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
5745  </g>
5746  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
5747  <defs>
5748    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
5749  </defs>
5750</svg> `,h=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5751  <g clip-path="url(#a)">
5752    <rect width="60" height="60" fill="#987DE8" rx="30" />
5753    <path
5754      fill="#fff"
5755      fill-rule="evenodd"
5756      d="m15.48 28.37 11.97-19.3a3 3 0 0 1 5.1 0l11.97 19.3a6 6 0 0 1 .9 3.14v.03a6 6 0 0 1-1.16 3.56L33.23 50.2a4 4 0 0 1-6.46 0L15.73 35.1a6 6 0 0 1-1.15-3.54v-.03a6 6 0 0 1 .9-3.16Z"
5757      clip-rule="evenodd"
5758    />
5759    <path
5760      fill="#643CDD"
5761      d="M30.84 10.11a1 1 0 0 0-.84-.46V24.5l12.6 5.53a2 2 0 0 0-.28-1.4L30.84 10.11Z"
5762    />
5763    <path
5764      fill="#BDADEB"
5765      d="M30 9.65a1 1 0 0 0-.85.46L17.66 28.64a2 2 0 0 0-.26 1.39L30 24.5V9.65Z"
5766    />
5767    <path
5768      fill="#643CDD"
5769      d="M30 50.54a1 1 0 0 0 .8-.4l11.24-15.38c.3-.44-.2-1-.66-.73l-9.89 5.68a3 3 0 0 1-1.5.4v10.43Z"
5770    />
5771    <path
5772      fill="#BDADEB"
5773      d="m17.97 34.76 11.22 15.37c.2.28.5.41.8.41V40.11a3 3 0 0 1-1.49-.4l-9.88-5.68c-.47-.27-.97.3-.65.73Z"
5774    />
5775    <path
5776      fill="#401AB3"
5777      d="M42.6 30.03 30 24.5v13.14a3 3 0 0 0 1.5-.4l10.14-5.83a2 2 0 0 0 .95-1.38Z"
5778    />
5779    <path
5780      fill="#7C5AE2"
5781      d="M30 37.64V24.46l-12.6 5.57a2 2 0 0 0 .97 1.39l10.13 5.82a3 3 0 0 0 1.5.4Z"
5782    />
5783  </g>
5784  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
5785  <defs>
5786    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
5787  </defs>
5788</svg> `,u=(0,r.JW)`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
5789  <rect width="64" height="64" rx="30" fill="#1DC956"/>
5790  <rect x="0.5" y="0.5" width="63" height="63" rx="29.5" stroke="#141414" stroke-opacity="0.1"/>
5791  <path d="M32.4053 19.8031C35.3901 19.8031 38.0431 20.8349 40.1619 22.8247L45.9656 17.0211C42.4465 13.7416 37.8773 11.7333 32.4053 11.7333C24.4829 11.7333 17.6475 16.2841 14.3127 22.9168L21.056 28.1493C22.6589 23.359 27.136 19.8031 32.4053 19.8031Z" fill="#1DC956" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5792  <path d="M32.4053 52.2667C37.8773 52.2667 42.465 50.4611 45.8182 47.3658L39.2407 42.2623C37.4351 43.4783 35.1321 44.2153 32.4053 44.2153C27.136 44.2153 22.6589 40.6594 21.056 35.8691L14.3127 41.1016C17.6475 47.7159 24.4829 52.2667 32.4053 52.2667Z" fill="#2BEE6C"/>
5793  <path d="M21.056 35.8507L19.5636 36.993L14.3127 41.0832M39.2407 42.2623L45.8182 47.3658C42.465 50.4611 37.8773 52.2667 32.4053 52.2667C24.4829 52.2667 17.6475 47.7159 14.3127 41.1016L21.056 35.8691C22.6589 40.6594 27.136 44.2153 32.4053 44.2153C35.1321 44.2153 37.4351 43.4783 39.2407 42.2623Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5794  <path d="M51.8613 32.4606C51.8613 31.0235 51.7323 29.6417 51.4928 28.3151H32.4053V36.1638H43.3124C42.8334 38.688 41.3963 40.8252 39.2407 42.2623L45.8181 47.3658C49.6503 43.8283 51.8613 38.6327 51.8613 32.4606Z" fill="#1FAD7E" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5795  <path d="M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3
5795653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" fill="#86F999"/>
5796  <path d="M21.056 35.8691L14.3127 41.1016M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5797</svg>
5798`,p=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5799  <rect width="60" height="60" fill="#1DC956" rx="3" />
5800  <path
5801    fill="#1FAD7E"
5802    stroke="#fff"
5803    stroke-width="2"
5804    d="m30.49 29.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
5805  />
5806  <path
5807    fill="#2BEE6C"
5808    stroke="#fff"
5809    stroke-width="2"
5810    d="m30.49 19.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
5811  />
5812  <path
5813    fill="#86F999"
5814    stroke="#fff"
5815    stroke-width="2"
5816    d="m46.69 21.06-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-6.32-3.51-.18-.1c-2.33-1.3-3.72-2.06-5.22-2.33a9 9 0 0 0-3.08 0c-1.5.27-2.9 1.04-5.22 2.33l-.17.1-6.33 3.51-.05.03c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45Z"
5817  />
5818  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
5819</svg>`,f=(0,r.JW)`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
5820  <g clip-path="url(#clip0_241_31636)">
5821    <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58318 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58318 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9269C60.4784 58.4159 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4159 2.1019 55.9269C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#794CFF"/>
5822    <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
5823    <path d="M40 39.4595C44.7824 36.693 48 31.5222 48 25.6C48 16.7634 40.8366 9.59998 32 9.59998C23.1634 9.59998 16 16.7634 16 25.6C16 31.5222 19.2176 36.693 24 39.4595V45.8144H40V39.4595Z" fill="#906EF7"/>
5824    <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#906EF7"/>
5825    <path d="M24 45.8144V39.4595C19.2176 36.693 16 31.5222 16 25.6C16 16.7634 23.1634 9.59998 32 9.59998C40.8366 9.59998 48 16.7634 48 25.6C48 31.5222 44.7824 36.693 40 39.4595V45.8144M24 45.8144H40M24 45.8144V49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5826    <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#643CDD" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5827    <path d="M29.6735 26.9101V29.1109H34.0753V26.9101C34.0753 25.6945 35.0607 24.7092 36.2762 24.7092C37.4917 24.7092 38.4771 25.6945 38.4771 26.9101C38.4771 28.1256 37.4917 29.1109 36.2762 29.1109H34.0753H29.6735H27.4726C26.2571 29.1109 25.2717 28.1256 25.2717 26.9101C25.2717 25.6945 26.2571 24.7092 27.4726 24.7092C28.6881 24.7092 29.6735 25.6945 29.6735 26.9101Z" fill="#906EF7"/>
5828    <path d="M29.6735 45.3183V26.9101C29.6735 25.6945 28.6881 24.7092 27.4726 24.7092V24.7092C26.2571 24.7092 25.2717 25.6945 25.2717 26.9101V26.9101C25.2717 28.1256 26.2571 29.1109 27.4726 29.1109H36.2762C37.4917 29.1109 38.4771 28.1256 38.4771 26.9101V26.9101C38.4771 25.6945 37.4917 24.7092 36.2762 24.7092V24.7092C35.0607 24.7092 34.0753 25.6945 34.0753 26.9101V45.3183" stroke="white" stroke-width="2" stroke-linejoin="round"/>
5829  </g>
5830  <defs>
5831    <clipPath id="clip0_241_31636">
5832      <rect width="64" height="64" fill="white"/>
5833    </clipPath>
5834  </defs>
5835</svg>
5836`,g=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5837  <rect width="60" height="60" fill="#C653C6" rx="3" />
5838  <path
5839    fill="#fff"
5840    d="M20.03 15.22C20 15.6 20 16.07 20 17v2.8c0 1.14 0 1.7-.2 2.12-.15.31-.3.5-.58.71-.37.28-1.06.42-2.43.7-.59.12-1.11.29-1.6.51a9 9 0 0 0-4.35 4.36C10 30 10 32.34 10 37c0 4.66 0 7 .84 8.8a9 9 0 0 0 4.36 4.36C17 51 19.34 51 24 51h12c4.66 0 7 0 8.8-.84a9 9 0 0 0 4.36-4.36C50 44 50 41.66 50 37c0-4.66 0-7-.84-8.8a9 9 0 0 0-4.36-4.36c-.48-.22-1-.39-1.6-.5-1.36-.29-2.05-.43-2.42-.7-.27-.22-.43-.4-.58-.72-.2-.42-.2-.98-.2-2.11V17c0-.93 0-1.4-.03-1.78a9 9 0 0 0-8.19-8.19C31.4 7 30.93 7 30 7s-1.4 0-1.78.03a9 9 0 0 0-8.19 8.19Z"
5841  />
5842  <path
5843    fill="#E87DE8"
5844    d="M22 17c0-.93 0-1.4.04-1.78a7 7 0 0 1 6.18-6.18C28.6 9 29.07 9 30 9s1.4 0 1.78.04a7 7 0 0 1 6.18 6.18c.04.39.04.85.04 1.78v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.4-.08-1.78a4 4 0 0 0-3.14-3.14C31.39 12 30.93 12 30 12s-1.4 0-1.78.08a4 4 0 0 0-3.14 3.14c-.08.39-.08.85-.08 1.78v4.5a1.5 1.5 0 0 1-3 0V17Z"
5845  />
5846  <path
5847    fill="#E87DE8"
5848    fill-rule="evenodd"
5849    d="M12 36.62c0-4.32 0-6.48.92-8.09a7 7 0 0 1 2.61-2.61C17.14 25 19.3 25 23.62 25h6.86c.46 0 .7 0 .9.02 2.73.22 4.37 2.43 4.62 4.98.27-2.7 2.11-5 5.02-5A6.98 6.98 0 0 1 48 31.98v5.4c0 4.32 0 6.48-.92 8.09a7 7 0 0 1-2.61 2.61c-1.61.92-3.77.92-8.09.92h-5.86c-.46 0-.7 0-.9-.02-2.73-.22-4.37-2.43-4.62-4.98-.26 2.58-1.94 4.82-4.71 4.99l-.7.01c-.55 0-.82 0-1.05-.02a7 7 0 0 1-6.52-6.52c-.02-.23-.02-.5-.02-1.05v-4.79Zm21.24-.27a4 4 0 1 0-6.48 0 31.28 31.28 0 0 1 1.57 2.23c.17.4.17.81.17 1.24V42.5a1.5 1.5 0 0 0 3 0V39.82c0-.43 0-.85.17-1.24.09-.2.58-.87 1.57-2.23Z"
5850    clip-rule="evenodd"
5851  />
5852  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
5853</svg>`,m=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5854  <g clip-path="url(#a)">
5855    <path
5856      fill="#EB8B47"
5857      d="M0 24.9c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02 0 15.65 0 24.9 0h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.02 60 15.65 60 24.9v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6C48.98 60 44.35 60 35.1 60H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 48.98 0 44.35 0 35.1V24.9Z"
5858    />
5859    <path
5860      stroke="#062B2B"
5861      stroke-opacity=".1"
5862      d="M.5 24.9c0-4.64 0-8.08.24-10.8.25-2.7.73-4.65 1.66-6.28A14.5 14.5 0 0 1 7.82 2.4C9.46 1.47 11.39 1 14.1.74A133 133 0 0 1 24.9.5h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.66a14.5 14.5 0 0 1 5.42 5.42c.93 1.63 1.41 3.57 1.66 6.28.24 2.72.24 6.16.24 10.8v10.2c0 4.63 0 8.08-.24 10.8-.25 2.7-.73 4.64-1.66 6.28a14.5 14.5 0 0 1-5.42 5.41c-1.63.94-3.57 1.42-6.28 1.67-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.67a14.5 14.5 0 0 1-5.42-5.4C1.47 50.53 1 48.6.74 45.88A133 133 0 0 1 .5 35.1V24.9Z"
5863    />
5864    <path
5865      fill="#FF974C"
5866      stroke="#fff"
5867      stroke-width="2"
5868      d="M39.2 29.2a13 13 0 1 0-18.4 0l1.3 1.28a12.82 12.82 0 0 1 2.1 2.39 6 6 0 0 1 .6 1.47c.2.76.2 1.56.2 3.17v11.24c0 1.08 0 1.61.13 2.12a4 4 0 0 0 .41.98c.26.45.64.83 1.4 1.6l.3.29c.65.65.98.98 1.36 1.09.26.07.54.07.8 0 .38-.11.7-.44 1.36-1.1l3.48-3.47c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.47-.48c-.
586865-.65-.98-.98-1.09-1.36a1.5 1.5 0 0 1 0-.8c.1-.38.44-.7 1.1-1.36l.47-.48c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.48-.5c-.65-.64-.98-.97-1.08-1.35a1.5 1.5 0 0 1 0-.79c.1-.38.42-.7 1.06-1.36l5.46-5.55Z"
5869    />
5870    <circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2" />
5871  </g>
5872  <defs>
5873    <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
5874  </defs>
5875</svg> `,w=(0,r.JW)`<svg width="40" height="42" viewBox="0 0 40 42" fill="none">
5876<path opacity="0.7" d="M19.9526 41.9076L7.3877 34.655V26.1226L19.9526 33.3751V41.9076Z" fill="url(#paint0_linear_2113_32117)"/>
5877<path opacity="0.7" d="M19.9521 41.9076L32.5171 34.655V26.1226L19.9521 33.3751V41.9076Z" fill="url(#paint1_linear_2113_32117)"/>
5878<path opacity="0.7" d="M39.9095 7.34521V21.8562L32.5166 26.1225V11.6114L39.9095 7.34521Z" fill="url(#paint2_linear_2113_32117)"/>
5879<path d="M39.9099 7.34536L27.345 0.0927734L19.9521 4.359L32.5171 11.6116L39.9099 7.34536Z" fill="url(#paint3_linear_2113_32117)"/>
5880<path d="M0 7.34536L12.5649 0.0927734L19.9519 4.359L7.387 11.6116L0 7.34536Z" fill="#F969D3"/>
5881<path opacity="0.7" d="M0 7.34521V21.8562L7.387 26.1225V11.6114L0 7.34521Z" fill="url(#paint4_linear_2113_32117)"/>
5882<defs>
5883<linearGradient id="paint0_linear_2113_32117" x1="18.6099" y1="41.8335" x2="7.73529" y2="8.31842" gradientUnits="userSpaceOnUse">
5884<stop stop-color="#E98ADA"/>
5885<stop offset="1" stop-color="#7E4DBD"/>
5886</linearGradient>
5887<linearGradient id="paint1_linear_2113_32117" x1="26.2346" y1="26.1226" x2="26.2346" y2="41.9076" gradientUnits="userSpaceOnUse">
5888<stop stop-color="#719DED"/>
5889<stop offset="1" stop-color="#2545BE"/>
5890</linearGradient>
5891<linearGradient id="paint2_linear_2113_32117" x1="36.213" y1="7.34521" x2="36.213" y2="26.1225" gradientUnits="userSpaceOnUse">
5892<stop stop-color="#93EBFF"/>
5893<stop offset="1" stop-color="#197DDB"/>
5894</linearGradient>
5895<linearGradient id="paint3_linear_2113_32117" x1="29.931" y1="0.0927734" x2="38.2156" y2="14.8448" gradientUnits="userSpaceOnUse">
5896<stop stop-color="#F969D3"/>
5897<stop offset="1" stop-color="#4F51C0"/>
5898</linearGradient>
5899<linearGradient id="paint4_linear_2113_32117" x1="18.1251" y1="44.2539" x2="-7.06792" y2="15.2763" gradientUnits="userSpaceOnUse">
5900<stop stop-color="#E98ADA"/>
5901<stop offset="1" stop-color="#7E4DBD"/>
5902</linearGradient>
5903</defs>
5904</svg>`,y=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5905  <g clip-path="url(#a)">
5906    <rect width="60" height="60" fill="#00ACE6" rx="30" />
5907    <circle cx="64" cy="39" r="50" fill="#1AC6FF" stroke="#fff" stroke-width="2" />
5908    <circle cx="78" cy="30" r="50" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
5909    <circle cx="72" cy="15" r="35" fill="#80DFFF" stroke="#fff" stroke-width="2" />
5910    <circle cx="34" cy="-17" r="45" stroke="#fff" stroke-width="2" />
5911    <circle cx="34" cy="-5" r="50" stroke="#fff" stroke-width="2" />
5912    <circle cx="30" cy="45" r="4" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
5913    <circle cx="39.5" cy="27.5" r="4" fill="#80DFFF" stroke="#fff" stroke-width="2" />
5914    <circle cx="16" cy="24" r="4" fill="#19C6FF" stroke="#fff" stroke-width="2" />
5915  </g>
5916  <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
5917  <defs>
5918    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
5919  </defs>
5920</svg>`,b=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5921  <g clip-path="url(#a)">
5922    <rect width="60" height="60" fill="#C653C6" rx="3" />
5923    <path
5924      fill="#E87DE8"
5925      stroke="#fff"
5926      stroke-width="2"
5927      d="M52.1 47.34c0-4.24-1.44-9.55-5.9-12.4a2.86 2.86 0 0 0-1.6-3.89v-.82c0-1.19-.52-2.26-1.35-3a4.74 4.74 0 0 0-2.4-6.26v-5.5a11.31 11.31 0 1 0-22.63 0v2.15a3.34 3.34 0 0 0-1.18 5.05 4.74 4.74 0 0 0-.68 6.44A5.22 5.22 0 0 0 14 35.92c-3.06 4.13-6.1 8.3-6.1 15.64 0 2.67.37 4.86.74 6.39a20.3 20.3 0 0 0 .73 2.39l.02.04v.01l.92-.39-.92.4.26.6h38.26l.3-.49-.87-.51.86.5.02-.01.03-.07a16.32 16.32 0 0 0 .57-1.05c.36-.72.85-1.74 1.33-2.96a25.51 25.51 0 0 0 1.94-9.07Z"
5928    />
5929    <path
5930      fill="#fff"
5931      fill-rule="evenodd"
5932      d="M26.5 29.5c-3-.5-5.5-3-5.5-7v-7c0-.47 0-.7.03-.9a3 3 0 0 1 2.58-2.57c.2-.03.42-.03.89-.03 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.4 0 2.1 0 2.65.23a3 3 0 0 1 1.62 1.62c.23.55.23 1.25.23 2.65v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.5 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z"
5933      clip-rule="evenodd"
5934    />
5935  </g>
5936  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
5937  <defs>
5938    <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="3" /></clipPath>
5939  </defs>
5940</svg> `,v=(0,r.JW)`<svg fill="none" viewBox="0 0 60 60">
5941  <rect width="60" height="60" fill="#794CFF" rx="3" />
5942  <path
5943    fill="#987DE8"
5944    stroke="#fff"
5945    stroke-width="2"
5946    d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"
5947  />
5948  <path fill="#fff" d="M37.5 25h10v10h-10z" />
5949  <path fill="#4019B2" d="M42.5 25h5v10h-5z" />
5950  <path fill="#fff" d="M19.5 25h10v10h-10z" />
5951  <path fill="#4019B2" d="M24.5 25h5v10h-5z" />
5952  <path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z" />
5953  <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
5954</svg>
5954`,C=(0,r.JW)`<svg width="60" height="60" viewBox="0 0 60 60" fill="none">
5955<g clip-path="url(#clip0_13859_31161)">
5956  <path d="M0 24.8995C0 15.6481 0 11.0223 1.97053 7.56763C3.3015 5.2342 5.23468 3.30101 7.56812 1.97004C11.0228 -0.000488281 15.6485 -0.000488281 24.9 -0.000488281H35.1C44.3514 -0.000488281 48.9772 -0.000488281 52.4319 1.97004C54.7653 3.30101 56.6985 5.2342 58.0295 7.56763C60 11.0223 60 15.6481 60 24.8995V35.0995C60 44.351 60 48.9767 58.0295 52.4314C56.6985 54.7648 54.7653 56.698 52.4319 58.029C48.9772 59.9995 44.3514 59.9995 35.1 59.9995H24.9C15.6485 59.9995 11.0228 59.9995 7.56812 58.029C5.23468 56.698 3.3015 54.7648 1.97053 52.4314C0 48.9767 0 44.351 0 35.0995V24.8995Z" fill="#EB8B47"/>
5957  <path d="M0.5 24.8995C0.5 20.2647 0.50047 16.8216 0.744315 14.1045C0.987552 11.3941 1.46987 9.45455 2.40484 7.81536C3.69145 5.55971 5.56019 3.69096 7.81585 2.40435C9.45504 1.46938 11.3946 0.987064 14.105 0.743826C16.8221 0.499981 20.2652 0.499512 24.9 0.499512H35.1C39.7348 0.499512 43.1779 0.499981 45.895 0.743826C48.6054 0.987064 50.545 1.46938 52.1841 2.40435C54.4398 3.69096 56.3086 5.55971 57.5952 7.81536C58.5301 9.45455 59.0124 11.3941 59.2557 14.1045C59.4995 16.8216 59.5 20.2647 59.5 24.8995V35.0995C59.5 39.7343 59.4995 43.1774 59.2557 45.8945C59.0124 48.6049 58.5301 50.5445 57.5952 52.1837C56.3086 54.4393 54.4398 56.3081 52.1841 57.5947C50.545 58.5296 48.6054 59.012 45.895 59.2552C43.1779 59.499 39.7348 59.4995 35.1 59.4995H24.9C20.2652 59.4995 16.8221 59.499 14.105 59.2552C11.3946 59.012 9.45504 58.5296 7.81585 57.5947C5.56019 56.3081 3.69145 54.4393 2.40484 52.1837C1.46987 50.5445 0.987552 48.6049 0.744315 45.8945C0.50047 43.1774 0.5 39.7343 0.5 35.0995V24.8995Z" stroke="#141414" stroke-opacity="0.1"/>
5958  <path d="M13 26.0335C13 21.7838 13 19.659 14.0822 18.1694C14.4318 17.6883 14.8548 17.2653 15.3359 16.9157C16.8255 15.8335 18.9503 15.8335 23.2 15.8335H36.8C41.0497 15.8335 43.1745 15.8335 44.6641 16.9157C45.1452 17.2653 45.5682 17.6883 45.9178 18.1694C47 19.659 47 21.7838 47 26.0335V33.9668C47 38.2165 47 40.3414 45.9178 41.831C45.5682 42.312 45.1452 42.7351 44.6641 43.0846C43.1745 44.1668 41.0497 44.1668 36.8 44.1668H23.2C18.9503 44.1668 16.8255 44.1668 15.3359 43.0846C14.8548 42.7351 14.4318 42.312 14.0822 41.831C13 40.3414 13 38.2165 13 33.9668V26.0335Z" fill="#FF974C" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5959  <path d="M39.5 36.667H36.6666" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
5960  <path d="M45.2 23.0645H14.8C14.0501 23.0645 13.6751 23.0645 13.4122 23.2554C13.3273 23.3171 13.2527 23.3918 13.191 23.4767C13 23.7395 13 24.1145 13 24.8645V27.2645C13 28.0144 13 28.3894 13.191 28.6522C13.2527 28.7371 13.3273 28.8118 13.4122 28.8735C13.6751 29.0645 14.0501 29.0645 14.8 29.0645H45.2C45.9499 29.0645 46.3249 29.0645 46.5878 28.8735C46.6727 28.8118 46.7473 28.7371 46.809 28.6522C47 28.3894 47 28.0144 47 27.2645V24.8645C47 24.1145 47 23.7395 46.809 23.4767C46.7473 23.3918 46.6727 23.3171 46.5878 23.2554C46.3249 23.0645 45.9499 23.0645 45.2 23.0645Z" fill="white" fill-opacity="0.4" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5961</g>
5962<defs>
5963  <clipPath id="clip0_13859_31161">
5964    <rect width="60" height="60" fill="white"/>
5965  </clipPath>
5966</defs>
5967</svg>`,E=(0,r.JW)`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
5968  <g clip-path="url(#clip0_241_31635)">
5969    <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58317 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58317 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9268C60.4784 58.4158 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4158 2.1019 55.9268C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#EB8B47"/>
5970    <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199
5970C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
5971    <path d="M28.1042 49.2329L13.1024 51.2077L15.0772 36.2059L37.1015 14.1815C39.2441 12.039 40.3154 10.9677 41.5718 10.624C42.4205 10.3918 43.3159 10.3918 44.1645 10.624C45.421 10.9677 46.4922 12.039 48.6348 14.1815L50.1286 15.6753C52.2711 17.8179 53.3424 18.8891 53.6861 20.1456C53.9183 20.9942 53.9183 21.8896 53.6861 22.7383C53.3424 23.9947 52.2711 25.066 50.1286 27.2086L28.1042 49.2329Z" fill="#FF974C" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5972    <path d="M38.5962 20.5376L22.4199 36.7139" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5973    <path d="M43.7727 25.714L27.5964 41.8903" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5974    <path d="M22.3703 36.7635C19.3258 39.808 16.0198 36.6395 16.2616 35.0324" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5975    <path d="M27.5466 41.9399C24.5034 44.9831 28.155 48.7098 29.2738 48.0475" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5976    <path d="M27.5468 41.9398C23.428 46.0586 18.2516 40.8822 22.3704 36.7634" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5977    <path d="M15.8191 50.5214C15.4711 49.5823 14.728 48.8392 13.7889 48.4912" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5978    <path d="M49.2862 29.5805L34.7275 15.0219" stroke="#E4E7E7" stroke-width="2" stroke-linejoin="round"/>
5979  </g>
5980  <defs>
5981    <clipPath id="clip0_241_31635">
5982      <rect width="64" height="64" fill="white"/>
5983    </clipPath>
5984  </defs>
5985</svg>
5986`,x=(0,r.JW)`<svg
5987  viewBox="0 0 60 60"
5988  fill="none"
5989>
5990  <g clip-path="url(#1)">
5991    <rect width="60" height="60" rx="30" fill="#00ACE6" />
5992    <path
5993      d="M59 73C59 89.0163 46.0163 102 30 102C13.9837 102 1 89.0163 1 73C1 56.9837 12 44 30 44C48 44 59 56.9837 59 73Z"
5994      fill="#1AC6FF"
5995      stroke="white"
5996      stroke-width="2"
5997    />
5998    <path
5999      d="M18.6904 19.9015C19.6264 15.3286 23.3466 11.8445 27.9708 11.2096C29.3231 11.024 30.6751 11.0238 32.0289 11.2096C36.6532 11.8445 40.3733 15.3286 41.3094 19.9015C41.4868 20.7681 41.6309 21.6509 41.7492 22.5271C41.8811 23.5041 41.8811 24.4944 41.7492 25.4715C41.6309 26.3476 41.4868 27.2304 41.3094 28.097C40.3733 32.6699 36.6532 36.154 32.0289 36.7889C30.6772 36.9744 29.3216 36.9743 27.9708 36.7889C23.3466 36.154 19.6264 32.6699 18.6904 28.097C18.513 27.2304 18.3689 26.3476 18.2506 25.4715C18.1186 24.4944 18.1186 23.5041 18.2506 22.5271C18.3689 21.6509 18.513 20.7681 18.6904 19.9015Z"
6000      fill="#1AC6FF"
6001      stroke="white"
6002      stroke-width="2"
6003    />
6004    <circle cx="24.5" cy="23.5" r="1.5" fill="white" />
6005    <circle cx="35.5" cy="23.5" r="1.5" fill="white" />
6006    <path
6007      d="M31 20L28 28H32"
6008      stroke="white"
6009      stroke-width="2"
6010      stroke-linecap="round"
6011      stroke-linejoin="round"
6012    />
6013  </g>
6014  <rect x="0.5" y="0.5" width="59" height="59" rx="29.5" stroke="white" stroke-opacity="0.1" />
6015  <defs>
6016    <clipPath id="1">
6017      <rect width="60" height="60" rx="30" fill="white" />
6018    </clipPath>
6019  </defs>
6020</svg> `,A=(0,r.JW)`<svg fill="none" viewBox="0 0 80 80">
6021  <g clip-path="url(#a)">
6022    <path fill="url(#b)" d="M40 80a40 40 0 1 0 0-80 40 40 0 0 0 0 80Z" />
6023    <path
6024      stroke="#fff"
6025      stroke-opacity=".1"
6026      d="M79.5 40a39.5 39.5 0 1 1-79 0 39.5 39.5 0 0 1 79 0Z"
6027    />
6028    <path
6029      fill="#fff"
6030      d="m62.62 51.54-7.54 7.91a1.75 1.75 0 0 1-1.29.55H18.02a.9.9 0 0 1-.8-.52.84.84 0 0 1 .16-.92l7.55-7.92a1.75 1.75 0 0 1 1.28-.55h35.77a.87.87 0 0 1 .8.52.84.84 0 0 1-.16.93Zm-7.54-15.95a1.75 1.75 0 0 0-1.29-.54H18.02a.89.89 0 0 0-.8.51.84.84 0 0 0 .16.93l7.55 7.92a1.75 1.75 0 0 0 1.28.54h35.77a.89.89 0 0 0 .8-.51.84.84 0 0 0-.16-.93l-7.54-7.92ZM18.02 29.9h35.77a1.79 1.79 0 0 0 1.29-.54l7.54-7.92a.85.85 0 0 0 .16-.93.87.87 0 0 0-.8-.51H26.21a1.79 1.79 0 0 0-1.28.54l-7.55 7.92a.85.85 0 0 0-.16.93.89.89 0 0 0 .8.52Z"
6031    />
6032  </g>
6033  <defs>
6034    <linearGradient id="b" x1="6.75" x2="80.68" y1="81.91" y2="7.37" gradientUnits="userSpaceOnUse">
6035      <stop offset=".08" stop-color="#9945FF" />
6036      <stop offset=".3" stop-color="#8752F3" />
6037      <stop offset=".5" stop-color="#5497D5" />
6038      <stop offset=".6" stop-color="#43B4CA" />
6039      <stop offset=".72" stop-color="#28E0B9" />
6040      <stop offset=".97" stop-color="#19FB9B" />
6041    </linearGradient>
6042    <clipPath id="a"><path fill="#fff" d="M0 0h80v80H0z" /></clipPath>
6043  </defs>
6044</svg> `,_=(0,r.JW)`<svg viewBox="0 0 60 60" fill="none">
6045  <g clip-path="url(#1)">
6046    <path
6047      d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
6048      fill="#794CFF"
6049    />
6050    <path
6051      d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
6052      stroke="#062B2B"
6053      stroke-opacity="0.1"
6054    />
6055    <path
6056      d="M35.1403 31.5016C35.1193 30.9637 35.388 30.4558 35.8446 30.1707C36.1207 29.9982 36.4761 29.8473 36.7921 29.7685C37.3143 29.6382 37.8664 29.7977 38.2386 30.1864C38.8507 30.8257 39.3004 31.6836 39.8033 32.408C40.2796 33.0942 41.4695 33.2512 41.9687 32.5047C42.4839 31.7341 42.9405 30.8229 43.572 30.1399C43.9375 29.7447 44.4866 29.5756 45.0111 29.6967C45.3283 29.7701 45.6863 29.9147 45.9655 30.0823C46.4269 30.3595 46.7045 30.8626 46.6928 31.4008C46.6731 32.3083 46.3764 33.2571 46.2158 34.1473C46.061 35.0048 46.9045 35.8337 47.7592 35.664C48.6464 35.4878 49.5899 35.1747 50.497 35.1391C51.0348 35.1181 51.5427 35.3868 51.8279 35.8433C52.0004 36.1195 52.1513 36.4749 52.2301 36.7908C52.3604 37.3131 52.2009 37.8651 51.8121 38.2374C51.1729 38.8495 50.3151 39.2991 49.5908 39.8019C48.9046 40.2782 48.7473 41.4683 49.4939 41.9675C50.2644 42.4827 51.1757 42.9393 51.8587 43.5708C52.2539 43.9362 52.423 44.4854 52.3018 45.0099C52.2285 45.3271 52.0839 45.6851 51.9162 45.9642C51.6391 46.4257 51.1359 46.7032 50.5978 46.6916C49.6903 46.6719 48.7417 46.3753 47.8516 46.2146C46.9939 46.0598 46.1648 46.9035 46.3346 47.7583C46.5108 48.6454 46.8239 49.5888 46.8594 50.4958C46.8805 51.0336 46.6117 51.5415 46.1552 51.8267C45.879 51.9992 45.5236 52.15 45.2077 52.2289C44.6854 52.3592 44.1334 52.1997 43.7611 51.8109C43.1491 51.1718 42.6996 50.314 42.1968 49.5897C41.7203 48.9034 40.5301 48.7463 40.0309 49.493C39.5157 50.2634 39.0592 51.1746 38.4278 51.8574C38.0623 52.2527 37.5132 52.4218 36.9887 52.3006C36.6715 52.2273 36.3135 52.0826 36.0343 51.915C35.5729 51.6379 35.2953 51.1347 35.307 50.5966C35.3267 49.6891 35.6233 48.7405 35.7839 47.8505C35.9388 46.9928 35.0951 46.1636 34.2402 46.3334C33.3531 46.5096 32.4098 46.8227 31.5028 46.8582C30.9649 46.8793 30.457 46.6105 30.1719 46.154C29.9994 45.8778 29.8485 45.5224 29.7697 45.2065C29.6394 44.6842 29.7989 44.1322 30.1877 43.7599C30.8269 43.1479 31.6847 42.6982 32.4091 42.1954C33.0954 41.7189 33.2522 40.5289 32.5056 40.0297C31.7351 39.5145 30.824 39.058 30.1411 38.4265C29.7459 38.0611 29.5768 37.5119 29.698 36.9875C29.7713 36.6702 29.9159 36.3122 30.0836 36.0331C30.3607 35.5
6056717 30.8638 35.2941 31.402 35.3058C32.3095 35.3255 33.2583 35.6221 34.1485 35.7828C35.006 35.9376 35.8349 35.094 35.6652 34.2393C35.489 33.3521 35.1759 32.4087 35.1403 31.5016Z"
6057      fill="#906EF7"
6058      stroke="white"
6059      stroke-width="2"
6060    />
6061    <path
6062      d="M20.7706 8.22357C20.9036 7.51411 21.5231 7 22.2449 7H23.7551C24.4769 7 25.0964 7.51411 25.2294 8.22357C25.5051 9.69403 25.4829 11.6321 27.1202 12.2606C27.3092 12.3331 27.4958 12.4105 27.6798 12.4926C29.2818 13.2072 30.6374 11.8199 31.8721 10.9752C32.4678 10.5676 33.2694 10.6421 33.7798 11.1525L34.8477 12.2204C35.3581 12.7308 35.4326 13.5323 35.025 14.128C34.1802 15.3627 32.7931 16.7183 33.5077 18.3202C33.5898 18.5043 33.6672 18.6909 33.7398 18.88C34.3683 20.5171 36.3061 20.4949 37.7764 20.7706C38.4859 20.9036 39 21.5231 39 22.2449V23.7551C39 24.4769 38.4859 25.0964 37.7764 25.2294C36.3061 25.5051 34.3685 25.483 33.7401 27.1201C33.6675 27.3093 33.59 27.4961 33.5079 27.6803C32.7934 29.282 34.1803 30.6374 35.025 31.8719C35.4326 32.4677 35.3581 33.2692 34.8477 33.7796L33.7798 34.8475C33.2694 35.3579 32.4678 35.4324 31.8721 35.0248C30.6376 34.1801 29.2823 32.7934 27.6806 33.508C27.4962 33.5903 27.3093 33.6678 27.12 33.7405C25.483 34.3688 25.5051 36.3062 25.2294 37.7764C25.0964 38.4859 24.4769 39 23.7551 39H22.2449C21.5231 39 20.9036 38.4859 20.7706 37.7764C20.4949 36.3062 20.517 34.3688 18.88 33.7405C18.6908 33.6678 18.5039 33.5903 18.3196 33.5081C16.7179 32.7936 15.3625 34.1804 14.1279 35.0251C13.5322 35.4327 12.7307 35.3582 12.2203 34.8478L11.1524 33.7799C10.642 33.2695 10.5675 32.4679 10.9751 31.8722C11.8198 30.6376 13.2067 29.2822 12.4922 27.6804C12.41 27.4962 12.3325 27.3093 12.2599 27.1201C11.6315 25.483 9.69392 25.5051 8.22357 25.2294C7.51411 25.0964 7 24.4769 7 23.7551V22.2449C7 21.5231 7.51411 20.9036 8.22357 20.7706C9.69394 20.4949 11.6317 20.5171 12.2602 18.88C12.3328 18.6909 12.4103 18.5042 12.4924 18.3201C13.207 16.7181 11.8198 15.3625 10.975 14.1278C10.5674 13.5321 10.6419 12.7305 11.1523 12.2201L12.2202 11.1522C12.7306 10.6418 13.5322 10.5673 14.1279 10.9749C15.3626 11.8197 16.7184 13.2071 18.3204 12.4925C18.5044 12.4105 18.6909 12.3331 18.8799 12.2606C20.5171 11.6321 20.4949 9.69403 20.7706 8.22357Z"
6063      fill="#906EF7"
6064      stroke="white"
6065      stroke-width="2"
6066    />
6067    <circle cx="23" cy="23" r="6" fill="#794CFF" stroke="white" stroke-width="2" />
6068    <circle cx="41" cy="41" r="4" fill="#794CFF" stroke="white" stroke-width="2" />
6069  </g>
6070  <defs>
6071    <clipPath id="1">
6072      <rect width="60" height="60" fill="white" />
6073    </clipPath>
6074  </defs>
6075</svg> `;var I=i(94895),S=i(69428);let N=(0,r.AH)`
6076  :host {
6077    display: block;
6078    width: var(--local-size);
6079    height: var(--local-size);
6080  }
6081
6082  :host svg {
6083    width: 100%;
6084    height: 100%;
6085  }
6086`;var k=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let T={browser:o,dao:l,defi:c,defiAlt:d,eth:h,layers:p,lock:g,login:m,network:y,nft:b,noun:v,profile:x,system:_,meld:w,onrampCard:C,google:u,pencil:E,lightbulb:f,solana:A,ton:s._,bitcoin:a},O=class extends r.WF{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=`
6087       --local-size: var(--apkt-visual-size-${this.size});
6088   `,(0,r.qy)`${T[this.name]}`}};O.styles=[I.W5,N],k([(0,n.MZ)()],O.prototype,"name",void 0),k([(0,n.MZ)()],O.prototype,"size",void 0),O=k([(0,S.E)("wui-visual")],O)},77241:(e,t,i)=>{"use strict";i(19493)},77570:(e,t,i)=>{let r=i(30567);function n(e){this.mode=r.NUMERIC,this.data=e.toString()}n.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){let t,i;for(t=0;t+3<=this.data.length;t+=3)i=parseInt(this.data.substr(t,3),10),e.put(i,10);let r=this.data.length-t;r>0&&(i=parseInt(this.data.substr(t),10),e.put(i,3*r+1))},e.exports=n},78462:(e,t)=>
6088{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class i{}t.IWatch=i},78537:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i(83227).__exportStar(i(78462),t)},78920:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(56726),a=i(44458),o=i(24568),l=i(59306);let c=(0,r.AH)`
6089  :host {
6090    width: 100%;
6091    display: block;
6092  }
6093`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.text="",this.open=s.I.state.open,this.unsubscribe.push(a.I.subscribeKey("view",()=>{s.I.hide()}),o.W.subscribeKey("open",e=>{e||s.I.hide()}),s.I.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),s.I.hide()}render(){return(0,r.qy)`
6094      <div
6095        @pointermove=${this.onMouseEnter.bind(this)}
6096        @pointerleave=${this.onMouseLeave.bind(this)}
6097      >
6098        ${this.renderChildren()}
6099      </div>
6100    `}renderChildren(){return(0,r.qy)`<slot></slot> `}onMouseEnter(){let e=this.getBoundingClientRect();if(!this.open){let t=document.querySelector("w3m-modal"),i={width:e.width,height:e.height,left:e.left,top:e.top};if(t){let r=t.getBoundingClientRect();i.left=e.left-(window.innerWidth-r.width)/2,i.top=e.top-(window.innerHeight-r.height)/2}s.I.showTooltip({message:this.text,triggerRect:i,variant:"shade"})}}onMouseLeave(e){this.contains(e.relatedTarget)||s.I.hide()}};h.styles=[c],d([(0,n.MZ)()],h.prototype,"text",void 0),d([(0,n.wk)()],h.prototype,"open",void 0),h=d([(0,l.EM)("w3m-tooltip-trigger")],h)},79954:(e,t,i)=>{"use strict";i.d(t,{G:()=>o});var r=i(92679),n=i(3125);let s={eip155:void 0,solana:void 0,polkadot:void 0,bip122:void 0,cosmos:void 0,sui:void 0,stacks:void 0,ton:void 0,tron:void 0},a=(0,r.BX)({providers:{...s},providerIds:{...s}}),o={state:a,subscribeKey:(e,t)=>(0,n.u$)(a,e,t),subscribe:e=>(0,r.B1)(a,()=>{e(a)}),subscribeProviders:e=>(0,r.B1)(a.providers,()=>e(a.providers)),setProvider(e,t){e&&t&&(a.providers[e]=(0,r.KR)(t))},getProvider(e){if(e)return a.providers[e]},setProviderId(e,t){t&&(a.providerIds[e]=t)},getProviderId(e){if(e)return a.providerIds[e]},reset(){a.providers={...s},a.providerIds={...s}},resetChain(e){a.providers[e]=void 0,a.providerIds[e]=void 0}}},80912:(e,t,i)=>{"use strict";var r=i(88088),n=i(11403),s=i(43242),a=i(33452),o=i(1024),l=i(44458),c=i(59306);i(74970),i(94548),i(45667),i(3658);var d=i(67066);let h=(0,r.AH)``,u=class extends r.WF{render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state;return e||t?(0,r.qy)`
6101      <wui-flex
6102        .padding=${["4","3","3","3"]}
6103        flexDirection="column"
6104        alignItems="center"
6105        justifyContent="center"
6106        gap="3"
6107      >
6108        <wui-text color="secondary" variant="md-regular" align="center">
6109          We work with the best providers to give you the lowest fees and best support. More options
6110          coming soon!
6111        </wui-text>
6112
6113        ${this.howDoesItWorkTemplate()}
6114      </wui-flex>
6115    `:null}howDoesItWorkTemplate(){return(0,r.qy)` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
6116      <wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
6117      How does it work?
6118    </wui-link>`}onWhatIsBuy(){s.E.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:(0,a.lj)(o.W.state.activeChain)===d.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),l.I.push("WhatIsABuy")}};u.styles=[h],u=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,c.EM)("w3m-onramp-providers-footer")],u)},82016:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(87850);let a=Symbol.for(""),o=e=>{if(e?.r===a)return e?._$litStatic$},l=new Map,c=e=>(t,...i)=>{let r,n,s=i.length,a=[],c=[],d,h=0,u=!1;for(;h<s;){for(d=t[h];h<s&&void 0!==(r=o(n=i[h]));)d+=r+t[++h],u=!0;h!==s&&c.push(n),a.push(d),h++}if(h===s&&a.push(t[s]),u){let e=a.join("$$lit$$");void 0===(t=l.get(e))&&(a.raw=a,l.set(e,t=a)),i=c}return e(t,...i)},d=c(s.qy);c(s.JW),c(s.ej);let h=(0,r.JW)`<svg width="30" height="30" viewBox="0 0 30 30" fill="none">
6119  <g clip-path="url(#clip0_87_33)">
6120    <path d="M23.9367 2.29447e-07H6.05917C5.26333 -0.000218805 4.47526 0.156384 3.73997 0.46086C3.00469 0.765337 2.33661 1.21172 1.77391 1.7745C1.21121 2.33727 0.7649
612017 3.00542 0.460542 3.74074C0.156167 4.47607 -0.000327963 5.26417 5.16031e-07 6.06V23.9433C4.48257e-07 24.7389 0.156744 25.5267 0.461276 26.2617C0.765808 26.9967 1.21216 27.6645 1.77484 28.2269C2.33752 28.7894 3.0055 29.2355 3.74061 29.5397C4.47573 29.8439 5.26358 30.0003 6.05917 30H23.9417C25.5486 29.9996 27.0895 29.3609 28.2257 28.2245C29.3618 27.0881 30 25.5469 30 23.94V6.06C29.9993 4.45241 29.3602 2.91091 28.2232 1.77449C27.0861 0.638064 25.5443 -0.000220881 23.9367 2.29447e-07Z" fill="url(#paint0_linear_87_33)"/>
6121    <path d="M14.8708 6.89259L15.4783 5.84259C15.5679 5.68703 15.6873 5.55064 15.8296 5.44122C15.9719 5.3318 16.1344 5.25148 16.3078 5.20486C16.4812 5.15824 16.662 5.14622 16.8401 5.1695C17.0181 5.19277 17.1898 5.25088 17.3453 5.34051C17.5009 5.43013 17.6373 5.54952 17.7467 5.69186C17.8561 5.83419 17.9364 5.99669 17.9831 6.17006C18.0297 6.34344 18.0417 6.5243 18.0184 6.70232C17.9952 6.88034 17.9371 7.05203 17.8474 7.20759L11.9949 17.3401H16.2283C17.5999 17.3401 18.3691 18.9526 17.7724 20.0701H5.36159C5.18215 20.0707 5.00436 20.0359 4.83845 19.9675C4.67254 19.8992 4.5218 19.7986 4.39492 19.6718C4.26803 19.5449 4.16751 19.3941 4.09915 19.2282C4.03079 19.0623 3.99593 18.8845 3.99659 18.7051C3.99659 17.9476 4.60492 17.3401 5.36159 17.3401H8.84159L13.2958 9.61926L11.9041 7.20426C11.738 6.89096 11.7 6.52543 11.7982 6.18469C11.8963 5.84395 12.1229 5.5546 12.4301 5.37763C12.7374 5.20065 13.1014 5.14987 13.4454 5.23599C13.7893 5.3221 14.0864 5.53838 14.2741 5.83926L14.8708 6.89259ZM9.60659 21.4759L8.29409 23.7526C8.20446 23.9082 8.08506 24.0446 7.94271 24.1541C7.80035 24.2636 7.63783 24.344 7.46441 24.3906C7.291 24.4373 7.11009 24.4493 6.93202 24.4261C6.75395 24.4028 6.58221 24.3447 6.42659 24.2551C6.27097 24.1655 6.13454 24.0461 6.02506 23.9037C5.91559 23.7613 5.83523 23.5988 5.78857 23.4254C5.74191 23.252 5.72986 23.0711 5.75311 22.893C5.77637 22.715 5.83446 22.5432 5.92409 22.3876L6.89909 20.7001C8.00159 20.3584 8.89742 20.6209 9.60659 21.4759ZM20.9066 17.3476H24.4583C25.2158 17.3476 25.8233 17.9551 25.8233 18.7126C25.8233 19.4701 25.2149 20.0776 24.4583 20.0776H22.4858L23.8166 22.3876C24.1916 23.0443 23.9708 23.8726 23.3149 24.2551C23.0006 24.4359 22.6274 24.4845 22.2772 24.3903C21.927 24.2961 21.6286 24.0667 21.4474 23.7526C19.2058 19.8643 17.5216 16.9534 16.4041 15.0151C15.2608 13.0426 16.0783 11.0626 16.8841 10.3909C17.7799 11.9293 19.1191 14.2501 20.9074 17.3476H20.9066Z" fill="white"/>
6122  </g>
6123  <defs>
6124    <linearGradient id="paint0_linear_87_33" x1="15" y1="2.29447e-07" x2="15" y2="30" gradientUnits="userSpaceOnUse">
6125      <stop stop-color="#18BFFB"/>
6126      <stop offset="1" stop-color="#2072F3"/>
6127    </linearGradient>
6128    <clipPath id="clip0_87_33">
6129      <rect width="30" height="30" fill="white"/>
6130    </clipPath>
6131  </defs>
6132</svg>`,u=(0,r.JW)`<svg fill="none" viewBox="0 0 40 40">
6133  <g clip-path="url(#a)">
6134    <g clip-path="url(#b)">
6135      <circle cx="20" cy="19.89" r="20" fill="#000" />
6136      <g clip-path="url(#c)">
6137        <path
6138          fill="#fff"
6139          d="M28.77 23.3c-.69 1.99-2.75 5.52-4.87 5.56-1.4.03-1.86-.84-3.46-.84-1.61 0-2.12.81-3.45.86-2.25.1-5.72-5.1-5.72-9.62 0-4.15 2.9-6.2 5.42-6.25 1.36-.02 2.64.92 3.47.92.83 0 2.38-1.13 4.02-.97.68.03 2.6.28 3.84 2.08-3.27 2.14-2.76 6.61.75 8.25ZM24.2 7.88c-2.47.1-4.49 2.69-4.2 4.84 2.28.17 4.47-2.39 4.2-4.84Z"
6140        />
6141      </g>
6142    </g>
6143  </g>
6144  <defs>
6145    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
6146    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
6147    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
6148  </defs>
6149</svg>`,p=(0,r.JW)`
6150  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 8 11">
6151    <path
6152      fill="var(--apkt-tokens-theme-textPrimary)"
6153      d="M7.862 4.86c.159-1.064-.652-1.637-1.76-2.018l.36-1.443-.879-.218-.35 1.404c-.23-.058-.468-.112-.703-.166l.352-1.413-.877-.219-.36 1.442a29.02 29.02 0 0 1-.56-.132v-.005l-1.21-.302-.234.938s.652.15.638.158c.356.089.42.324.41.51l-.41 1.644a.715.715 0 0 1 .09.03l-.092-.024-.574 2.302c-.044.108-.154.27-.402.208.008.013-.639-.16-.639-.16L.227 8.403l1.142.285c.213.053.42.109.626.161l-.363 1.459.877.218.36-1.443c.239.065.472.125.7.
6153182l-.36 1.436.879.219.363-1.456c1.497.283 2.623.17 3.097-1.185.381-1.09-.02-1.719-.807-2.129.574-.132 1.006-.51 1.12-1.289ZM5.856 7.673c-.272 1.09-2.107.5-2.702.353l.482-1.933c.595.149 2.503.443 2.22 1.58Zm.271-2.829c-.247.992-1.775.488-2.27.365l.436-1.753c.496.124 2.092.354 1.834 1.388Z"
6154    />
6155  </svg>
6156`,f=(0,r.JW)`<svg viewBox="0 0 32 32" fill="none">
6157<path d="M29.0612 10.0613L13.0612 26.0613C12.9218 26.2011 12.7563 26.3121 12.5739 26.3878C12.3916 26.4635 12.1961 26.5024 11.9987 26.5024C11.8013 26.5024 11.6058 26.4635 11.4235 26.3878C11.2411 26.3121 11.0756 26.2011 10.9362 26.0613L3.9362 19.0613C3.79667 18.9217 3.68599 18.7561 3.61047 18.5738C3.53496 18.3915 3.49609 18.1961 3.49609 17.9988C3.49609 17.8014 3.53496 17.606 3.61047 17.4237C3.68599 17.2414 3.79667 17.0758 3.9362 16.9363C4.07573 16.7967 4.24137 16.686 4.42367 16.6105C4.60598 16.535 4.80137 16.4962 4.9987 16.4962C5.19602 16.4962 5.39141 16.535 5.57372 16.6105C5.75602 16.686 5.92167 16.7967 6.0612 16.9363L11.9999 22.875L26.9387 7.93876C27.2205 7.65697 27.6027 7.49866 28.0012 7.49866C28.3997 7.49866 28.7819 7.65697 29.0637 7.93876C29.3455 8.22055 29.5038 8.60274 29.5038 9.00126C29.5038 9.39977 29.3455 9.78197 29.0637 10.0638L29.0612 10.0613Z" fill="currentColor"/>
6158</svg>
6159`,g=(0,r.JW)`<svg width="30" height="30" viewBox="0 0 30 30" fill="none">
6160<path d="M14.9978 7.80003H27.4668C26.2032 5.61107 24.3857 3.79333 22.1968 2.52955C20.008 1.26577 17.525 0.600485 14.9975 0.600586C12.47 0.600687 9.98712 1.26617 7.79838 2.53012C5.60964 3.79408 3.79221 5.61197 2.52881 7.80103L8.76281 18.599L8.76881 18.598C8.13412 17.5044 7.79906 16.2628 7.79743 14.9983C7.79579 13.7339 8.12764 12.4914 8.7595 11.3961C9.39136 10.3008 10.3009 9.39159 11.3963 8.76005C12.4918 8.12851 13.7344 7.79702 14.9988 7.79903L14.9978 7.80003Z" fill="url(#paint0_linear_87_32)"/>
6161<path d="M21.237 18.5981L15.003 29.3961C17.5305 29.3961 20.0134 28.7308 22.2022 27.467C24.391 26.2032 26.2086 24.3854 27.4721 22.1965C28.7356 20.0075 29.4006 17.5245 29.4003 14.997C29.3999 12.4695 28.7342 9.9867 27.47 7.7981H15.002L15 7.8041C16.2642 7.80168 17.5067 8.13257 18.6022 8.76342C19.6977 9.39428 20.6076 10.3028 21.2401 11.3974C21.8726 12.492 22.2053 13.734 22.2048 14.9982C22.2042 16.2623 21.8704 17.504 21.237 18.5981Z" fill="url(#paint1_linear_87_32)"/>
6162<path d="M8.76502 18.601L2.53102 7.80298C1.26664 9.99172 0.600848 12.4748 0.600586 15.0025C0.600324 17.5302 1.2656 20.0134 2.52953 22.2024C3.79345 24.3914 5.61145 26.209 7.80071 27.4725C9.98998 28.736 12.4733 29.4008 15.001 29.4L21.236 18.602L21.232 18.598C20.6022 19.6941 19.6944 20.6049 18.6003 21.2383C17.5062 21.8717 16.2644 22.2055 15.0002 22.2059C13.7359 22.2063 12.4939 21.8733 11.3994 21.2406C10.3049 20.6079 9.39657 19.6977 8.76602 18.602L8.76502 18.601Z" fill="url(#paint2_linear_87_32)"/>
6163<path d="M14.9998 22.2C16.9094 22.2 18.7407 21.4415 20.091 20.0912C21.4412 18.741 22.1998 16.9096 22.1998 15C22.1998 13.0905 21.4412 11.2591 20.091 9.90888C18.7407 8.55862 16.9094 7.80005 14.9998 7.80005C13.0902 7.80005 11.2589 8.55862 9.90864 9.90888C8.55837 11.2591 7.7998 13.0905 7.7998 15C7.7998 16.9096 8.55837 18.741 9.90864 20.0912C11.2589 21.4415 13.0902 22.2 14.9998 22.2Z" fill="white"/>
6164<path d="M14.9998 20.7C16.5115 20.7 17.9614 20.0995 19.0303 19.0306C20.0993 17.9616 20.6998 16.5118 20.6998 15C20.6998 13.4883 20.0993 12.0385 19.0303 10.9695C17.9614 9.90058 16.5115 9.30005 14.9998 9.30005C13.4881 9.30005 12.0383 9.90058 10.9693 10.9695C9.90034 12.0385 9.2998 13.4883 9.2998 15C9.2998 16.5118 9.90034 17.9616 10.9693 19.0306C12.0383 20.0995 13.4881 20.7 14.9998 20.7Z" fill="#1A73E8"/>
6165<defs>
6166  <linearGradient id="paint0_linear_87_32" x1="3.29381" y1="2.99503" x2="38.0998" y2="2.99503" gradientUnits="userSpaceOnUse">
6167    <stop stop-color="#D93025"/>
6168    <stop offset="1" stop-color="#EA4335"/>
6169  </linearGradient>
6170  <linearGradient id="paint1_linear_87_32" x1="17.953" y1="29.1431" x2="34.194" y2="-0.298904" gradientUnits="userSpaceOnUse">
6171    <stop stop-color="#FCC934"/>
6172    <stop offset="1" stop-color="#FBBC04"/>
6173  </linearGradient>
6174  <linearGradient id="paint2_linear_87_32" x1="22.873" y1="28.2" x2="6.63202" y2="-1.24102" gradientUnits="userSpaceOnUse">
6175    <stop stop-color="#1E8E3E"/>
6176    <stop offset="1" stop-color="#34A853"/>
6177  </linearGradient>
6178</defs>
6179</svg>`,m=(0,r.JW)`<svg width="32" height="32" viewBox="0 0 32 32" fill="none">
6180<path d="M23 11.1962V10.5C23 7.365 18.2712 5 12 5C5.72875 5 1 7.365 1 10.5V15.5C1 18.1112 4.28125 20.1863 9 20.8075V21.5C9 24.635 13.7288 27 20 27C26.2712 27 31 24.635 31 21.5V16.5C31 13.9125 27.8225 11.835 23 11.1962ZM7 18.3587C4.55125 17.675 3 16.5487 3 15.5V13.7413C4.02 14.4637 5.38625 15.0463 7 15.4375V18.3587ZM17 15.4375C18.6138 15.0463 19.98 14.4637 21 13.7413V15.5C21 16.5487 19.4487 17.675 17 18.3587V15.4375ZM15 24.3587C12.5513 23.675 11 22.5487 11 21.5V20.9788C11.3287 20.9913 11.6613 21 12 21C12.485 21 12.9587 20.9837 13.4237 20.9562C13.9403 21.1412 14.4665 21.2981 15 21.4263V24.3587ZM15 18.7812C14.0068 18.928 13.004 19.0011 12 19C10.996 19.0011 9.99324 18.928 9 18.7812V15.8075C9.99472 15.9371 10.9969 16.0014 12 16C13.0031 16.0014 14.0053 15.9371 15 15.8075V18.7812ZM23 24.7812C21.0106 25.0729 18.9894 25.0729 17 24.7812V21.8C17.9944 21.9337 18.9967 22.0005 20 22C21.0031 22.0014 22.0053 21.9371 23 21.8075V24.7812ZM29 21.5C29 22.5487 27.4487 23.675 25 24.3587V21.4375C26.6138 21.0462 27.98 20.4637 29 19.7412V21.5Z" fill="currentColor"/>
6181</svg>
6182`,w=(0,r.JW)` <svg fill="none" viewBox="0 0 13 4">
6183  <path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
6184</svg>`,y=(0,r.JW)`<svg fill="none" viewBox="0 0 40 40">
6185  <g clip-path="url(#a)">
6186    <g clip-path="url(#b)">
6187      <circle cx="20" cy="19.89" r="20" fill="#5865F2" />
6188      <path
6189        fill="#fff"
6190        fill-rule="evenodd"
6191        d="M25.71 28.15C30.25 28 32 25.02 32 25.02c0-6.61-2.96-11.98-2.96-11.98-2.96-2.22-5.77-2.15-5.77-2.15l-.29.32c3.5 1.07 5.12 2.61 5.12 2.61a16.75 16.75 0 0 0-10.34-1.93l-.35.04a15.43 15.43 0 0 0-5.88 1.9s1.71-1.63 5.4-2.7l-.2-.24s-2.81-.07-5.77 2.15c0 0-2.96 5.37-2.96 11.98 0 0 1.73 2.98 6.27 3.13l1.37-1.7c-2.6-.79-3.6-2.43-3.6-2.43l.58.35.09.06.08.04.02.01.08.05a17.25 17.25 0 0 0 4.52 1.58 14.4 14.4 0 0 0 8.3-.86c.72-.27 1.52-.66 2.37-1.21 0 0-1.03 1.68-3.72 2.44.61.78 1.35 1.67 1.35 1.67Zm-9.55-9.6c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28.01-1.25-.93-2.28-2.1-2.28Zm7.5 0c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28 0-1.25-.93-2.28-2.1-2.28Z"
6192        clip-rule="evenodd"
6193      />
6194    </g>
6195  </g>
6196  <defs>
6197    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
6198    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
6199  </defs>
6200</svg>`,b=(0,r.JW)`<svg
6201  xmlns="http://www.w3.org/2000/svg"
6202  fill="none"
6203  viewBox="0 0 9 12"
6204>
6205  <path
6206    fill="var(--apkt-tokens-theme-textPrimary)"
6207    d="M4.666.001v4.435l3.748 1.675L4.666.001Zm0 0L.917 6.111l3.749-1.675V.001Zm0 8.984V12l3.75-5.19-3.75 2.176Zm0 3.014V8.985L.917 6.81 4.666 12Zm0-3.712 3.748-2.176-3.748-1.675v3.851Z"
6208  />
6209  <path fill="var(--apkt-tokens-theme-textPrimary)" d="m.917 6.111 3.749 2.176v-3.85L.917 6.11Z" />
6210</svg>`,v=(0,r.JW)`<svg fill="none" viewBox="0 0 16 16">
6211  <path
6212    fill="currentColor"
6213    d="M4.25 7a.63.63 0 0 0-.63.63v3.97c0 .28-.2.51-.47.54l-.75.07a.93.93 0 0 1-.9-.47A7.51 7.51 0 0 1 5.54.92a7.5 7.5 0 0 1 9.54 4.62c.12.35.06.72-.16 1-.74.97-1.68 1.78-2.6 2.44V4.44a.64.64 0 0 0-.63-.64h-1.06c-.35 0-.63.3-.63.64v5.5c0 .23-.12.42-.32.5l-.52.23V6.05c0-.36-.3-.64-.64-.64H7.45c-.35 0-.64.3-.64.64v4.97c0 .25-.17.46-.4.52a5.8 5.8 0 0 0-.45.11v-4c0-.36-.3-.65-.64-.65H4.25ZM14.07 12.4A7.49 7.49 0 0 1 3.6 14.08c4.09-.58 9.14-2.5 11.87-6.6v.03a7.56 7.56 0 0 1-1.41 4.91Z"
6214  />
6215</svg>`,C=(0,r.JW)`<svg fill="none" viewBox="0 0 40 40">
6216  <g clip-path="url(#a)">
6217    <g clip-path="url(#b)">
6218      <circle cx="20" cy="19.89" r="20" fill="#1877F2" />
6219      <g clip-path="url(#c)">
6220        <path
6221          fill="#fff"
6222          d="M26 12.38h-2.89c-.92 0-1.61.38-1.61 1.34v1.66H26l-.36 4.5H2
62221.5v12H17v-12h-3v-4.5h3V12.5c0-3.03 1.6-4.62 5.2-4.62H26v4.5Z"
6223        />
6224      </g>
6225    </g>
6226    <path
6227      fill="#1877F2"
6228      d="M40 20a20 20 0 1 0-23.13 19.76V25.78H11.8V20h5.07v-4.4c0-5.02 3-7.79 7.56-7.79 2.19 0 4.48.4 4.48.4v4.91h-2.53c-2.48 0-3.25 1.55-3.25 3.13V20h5.54l-.88 5.78h-4.66v13.98A20 20 0 0 0 40 20Z"
6229    />
6230    <path
6231      fill="#fff"
6232      d="m27.79 25.78.88-5.78h-5.55v-3.75c0-1.58.78-3.13 3.26-3.13h2.53V8.2s-2.3-.39-4.48-.39c-4.57 0-7.55 2.77-7.55 7.78V20H11.8v5.78h5.07v13.98a20.15 20.15 0 0 0 6.25 0V25.78h4.67Z"
6233    />
6234  </g>
6235  <defs>
6236    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
6237    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
6238    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
6239  </defs>
6240</svg>`,E=(0,r.JW)`<svg style="border-radius: 9999px; overflow: hidden;"  fill="none" viewBox="0 0 1000 1000">
6241  <rect width="1000" height="1000" rx="9999" ry="9999" fill="#855DCD"/>
6242  <path fill="#855DCD" d="M0 0h1000v1000H0V0Z" />
6243  <path
6244    fill="#fff"
6245    d="M320 248h354v504h-51.96V521.13h-.5c-5.76-63.8-59.31-113.81-124.54-113.81s-118.78 50-124.53 113.81h-.5V752H320V248Z"
6246  />
6247  <path
6248    fill="#fff"
6249    d="m225 320 21.16 71.46h17.9v289.09a16.29 16.29 0 0 0-16.28 16.24v19.49h-3.25a16.3 16.3 0 0 0-16.28 16.24V752h182.26v-19.48a16.22 16.22 0 0 0-16.28-16.24h-3.25v-19.5a16.22 16.22 0 0 0-16.28-16.23h-19.52V320H225Zm400.3 360.55a16.3 16.3 0 0 0-15.04 10.02 16.2 16.2 0 0 0-1.24 6.22v19.49h-3.25a16.29 16.29 0 0 0-16.27 16.24V752h182.24v-19.48a16.23 16.23 0 0 0-16.27-16.24h-3.25v-19.5a16.2 16.2 0 0 0-10.04-15 16.3 16.3 0 0 0-6.23-1.23v-289.1h17.9L775 320H644.82v360.55H625.3Z"
6250  />
6251</svg>`,x=(0,r.JW)`<svg fill="none" viewBox="0 0 40 40">
6252  <g clip-path="url(#a)">
6253    <g clip-path="url(#b)">
6254      <circle cx="20" cy="19.89" r="20" fill="#1B1F23" />
6255      <g clip-path="url(#c)">
6256        <path
6257          fill="#fff"
6258          d="M8 19.89a12 12 0 1 1 15.8 11.38c-.6.12-.8-.26-.8-.57v-3.3c0-1.12-.4-1.85-.82-2.22 2.67-.3 5.48-1.31 5.48-5.92 0-1.31-.47-2.38-1.24-3.22.13-.3.54-1.52-.12-3.18 0 0-1-.32-3.3 1.23a11.54 11.54 0 0 0-6 0c-2.3-1.55-3.3-1.23-3.3-1.23a4.32 4.32 0 0 0-.12 3.18 4.64 4.64 0 0 0-1.24 3.22c0 4.6 2.8 5.63 5.47 5.93-.34.3-.65.83-.76 1.6-.69.31-2.42.84-3.5-1 0 0-.63-1.15-1.83-1.23 0 0-1.18-.02-.09.73 0 0 .8.37 1.34 1.76 0 0 .7 2.14 4.03 1.41v2.24c0 .31-.2.68-.8.57A12 12 0 0 1 8 19.9Z"
6259        />
6260      </g>
6261    </g>
6262  </g>
6263  <defs>
6264    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
6265    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
6266    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
6267  </defs>
6268</svg>`,A=(0,r.JW)`<svg fill="none" viewBox="0 0 40 40">
6269  <path
6270    fill="#4285F4"
6271    d="M32.74 20.3c0-.93-.08-1.81-.24-2.66H20.26v5.03h7a6 6 0 0 1-2.62 3.91v3.28h4.22c2.46-2.27 3.88-5.6 3.88-9.56Z"
6272  />
6273  <path
6274    fill="#34A853"
6275    d="M20.26 33a12.4 12.4 0 0 0 8.6-3.14l-4.22-3.28a7.74 7.74 0 0 1-4.38 1.26 7.76 7.76 0 0 1-7.28-5.36H8.65v3.36A12.99 12.99 0 0 0 20.26 33Z"
6276  />
6277  <path
6278    fill="#FBBC05"
6279    d="M12.98 22.47a7.79 7.79 0 0 1 0-4.94v-3.36H8.65a12.84 12.84 0 0 0 0 11.66l3.37-2.63.96-.73Z"
6280  />
6281  <path
6282    fill="#EA4335"
6283    d="M20.26 12.18a7.1 7.1 0 0 1 4.98 1.93l3.72-3.72A12.47 12.47 0 0 0 20.26 7c-5.08 0-9.47 2.92-11.6 7.17l4.32 3.36a7.76 7.76 0 0 1 7.28-5.35Z"
6284  />
6285</svg>`,_=(0,r.JW)`<svg width="10" height="10" viewBox="0 0 10 10" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
6286<path d="M4.875 0C3.91082 0 2.96829 0.285914 2.1666 0.821586C1.36491 1.35726 0.740067 2.11863 0.371089 3.00942C0.00211226 3.90021 -0.094429 4.88041 0.093674 5.82607C0.281777 6.77172 0.746076 7.64036 1.42786 8.32215C2.10964 9.00393 2.97828 9.46823 3.92394 9.65633C4.86959 9.84443 5.84979 9.74789 6.74058 9.37891C7.63137 9.00994 8.39274 8.38509 8.92842 7.5834C9.46409 6.78171 9.75 5.83918 9.75 4.875C9.74864 3.58249 9.23458 2.34331 8.32064 1.42936C7.4067 0.515418 6.16751 0.00136492 4.875 0ZM4.6875 2.25C4.79875 2.25 4.90751 2.28299 5.00001 2.3448C5.09251 2.40661 5.16461 2.49446 5.20718 2.59724C5.24976 2.70002 5.2609 2.81312 5.23919 2.92224C5.21749 3.03135 5.16392 3.13158 5.08525 3.21025C5.00658 3.28891 4.90635 3.34249 4.79724 3.36419C4.68813 3.3859 4.57503 3.37476 4.47224 3.33218C4.36946 3.28961 4.28161 3.21751 4.2198 3.12501C4.15799 3.03251 4.125 2.92375 4.125 2.8125C4.125 2.66332 4.18427 2.52024 4.28975 2.41475C4.39524 2.30926 4.53832 2.25 4.6875 2.25ZM5.25 7.5C5.05109 7.5 4.86032 7.42098 4.71967 7.28033C4.57902 7.13968 4.5 6.94891 4.5 6.75V4.875C4.40055 4.875 4.30516 4.83549 4.23484 4.76516C4.16451 4.69484 4.125 4.59946 4.125 4.5C4.125 4.40054 4.16451 4.30516 4.23484 4.23484C4.30516 4.16451 4.40055 4.125 4.5 4.125C4.69891 4.125 4.88968 4.20402 5.03033 4.34467C5.17098 4.48532 5.25 4.67609 5.25 4.875V6.75C5.34946 6.75 5.44484 6.78951 5.51517 6.85983C5.58549 6.93016 5.625 7.02554 5.625 7.125C5.625 7.22446 5.58549 7.31984 5.51517 7.39017C5.44484 7.46049 5.34946 7.5 5.25 7.5Z" fill="#9A9A9A"/>
6287</svg>
6288`,I=(0,r.JW)`<svg width="32" height="32" viewBox="0 0 32 32" fill="none">
6289<path d="M28.925 5.5425C28.925 5.5425 28.925 5.555 28.925 5.56125L21.65 29.5537C21.5399 29.9434 21.3132 30.2901 21.0004 30.5473C20.6876 30.8045 20.3036 3
62890.9598 19.9 30.9925C19.8425 30.9975 19.785 31 19.7275 31C19.3493 31.0012 18.9786 30.8941 18.6592 30.6915C18.3398 30.4888 18.085 30.199 17.925 29.8563L13.375 20.5187C13.3295 20.4252 13.3143 20.3197 13.3315 20.2171C13.3488 20.1145 13.3976 20.0198 13.4713 19.9463L20.7113 12.7063C20.8909 12.5172 20.9895 12.2654 20.9862 12.0047C20.9829 11.7439 20.8778 11.4948 20.6934 11.3104C20.509 11.126 20.2599 11.0209 19.9991 11.0176C19.7383 11.0142 19.4866 11.1129 19.2975 11.2925L12.0538 18.5325C11.9802 18.6061 11.8855 18.655 11.7829 18.6722C11.6803 18.6895 11.5748 18.6743 11.4813 18.6287L2.13502 14.08C1.76954 13.9047 1.46598 13.6224 1.26454 13.2706C1.06311 12.9189 0.973316 12.5142 1.00707 12.1102C1.04082 11.7063 1.19652 11.3221 1.45354 11.0087C1.71056 10.6952 2.05676 10.4673 2.44627 10.355L26.4388 3.08H26.4575C26.7991 2.98403 27.1601 2.98066 27.5034 3.07025C27.8468 3.15984 28.1601 3.33916 28.4113 3.58981C28.6624 3.84045 28.8424 4.15341 28.9326 4.49656C29.0229 4.83971 29.0203 5.2007 28.925 5.5425Z" fill="currentColor"/>
6290</svg>
6291`,S=(0,r.JW)` <svg width="27" height="30" viewBox="0 0 27 30" fill="none">
6292  <path d="M12.5395 14.3237L0.116699 27.5049V27.5188C0.251527 28.0177 0.49972 28.4788 0.841941 28.866C1.18416 29.2533 1.61117 29.5563 2.0897 29.7515C2.56823 29.9467 3.08536 30.0287 3.60081 29.9913C4.11625 29.9538 4.61609 29.7979 5.06139 29.5356L5.0975 29.512L19.0718 21.4519L12.5395 14.3237Z" fill="#EA4335"/>
6293  <path d="M25.103 12.0833L25.0919 12.0722L19.0611 8.57202L12.2607 14.6279L19.0847 21.4504L25.0919 17.9864C25.6229 17.6983 26.0665 17.2725 26.376 16.7537C26.6854 16.2349 26.8493 15.6422 26.8505 15.0381C26.8516 14.434 26.6899 13.8408 26.3824 13.3208C26.0749 12.8008 25.633 12.3734 25.103 12.0833Z" fill="#FBBC04"/>
6294  <path d="M0.116672 2.49553C0.047224 2.7761 0 3.05528 0 3.35946V26.6537C0 26.9565 0.0347234 27.237 0.116672 27.5162L12.959 14.6725L0.116672 2.49553Z" fill="#4285F4"/>
6295  <path d="M12.634 15.0001L19.0607 8.57198L5.0975 0.477133C4.65115 0.210463 4.14916 0.0506574 3.63079 0.0102139C3.11242 -0.0302296 2.59172 0.0497852 2.10941 0.244001C1.6271 0.438216 1.19625 0.741368 0.850556 1.12975C0.504864 1.51813 0.253698 1.98121 0.116699 2.48279L12.634 15.0001Z" fill="#34A853"/>
6296</svg>`,N=(0,r.JW)`<svg width="75" height="20" viewBox="0 0 75 20" fill="none" xmlns="http://www.w3.org/2000/svg">
6297<path d="M11.6666 5.83334C11.6666 2.61168 14.2783 0 17.5 0H25.8334C29.055 0 31.6666 2.61168 31.6666 5.83334V14.1666C31.6666 17.3883 29.055 20 25.8334 20H17.5C14.2783 20 11.6666 17.3883 11.6666 14.1666V5.83334Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
6298<path d="M19.5068 13.7499L22.4309 5.83331H23.2895L20.3654 13.7499H19.5068Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6299<path d="M0 5.41666C0 2.42513 2.42513 0 5.41666 0C8.40821 0 10.8334 2.42513 10.8334 5.41666V14.5833C10.8334 17.5748 8.40821 20 5.41666 20C2.42513 20 0 17.5748 0 14.5833V5.41666Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
6300<path d="M4.89581 12.4997V11.458H5.93747V12.4997H4.89581Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6301<path d="M32.5 10C32.5 4.47715 36.6896 0 41.8578 0H65.6422C70.8104 0 75 4.47715 75 10C75 15.5229 70.8104 20 65.6422 20H41.8578C36.6896 20 32.5 15.5229 32.5 10Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
6302<path d="M61.7108 12.4475V7.82751H62.5266V8.52418C62.8199 8.01084 63.4157 7.70834 64.0757 7.70834C65.0749 7.70834 65.7715 8.34084 65.7715 9.56918V12.4475H64.9649V9.61503C64.9649 8.80831 64.5066 8.38668 63.8374 8.38668C63.1132 8.38668 62.5266 8.9642 62.5266 9.78001V12.4475H61.7108Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6303<path d="M56.5671 12.4475L55.7147 7.82748H56.4846L57.0896 11.6409L57.8871 9.12916H58.6479L59.4363 11.6134L60.0505 7.82748H60.8204L59.9679 12.4475H59.0513L58.2721 10.0458L57.4838 12.4475H56.5671Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6304<path d="M52.9636 12.5666C51.5611 12.5666 50.7361 11.5217 50.7361 10.1375C50.7361 8.76254 51.5611 7.70834 52.9636 7.70834C54.3661 7.70834 55.1911 8.76254 55.1911 10.1375C55.1911 11.5217 54.3661 12.5666 52.9636 12.5666ZM52.9636 11.8883C53.9719 11.8883 54.357 11.0266 54.357 10.1283C54.357 9.23914 53.9719 8.38668 52.9636 8.38668C51.9552 8.38668 51.5702 9.23914 51.5702 10.1283C51.5702 11.0266 51.9552 11.8883 52.9636 11.8883Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6305<path d="M47.8507 12.5666C46.494 12.5666 45.6415 11.5308 45.6415 10.1375C45.6415 8.75337 46.494 7.70834 47.8507 7.70834C48.9965 7.70834 50.0048 8.35917 49.8948 10.3483H46.4756C46.5398 11.2009 46.934 11.8975 47.8507 11.8975C48.4648 11.8975 48.8681 11.5217 49.0057 11.0908H49.8123C49.684 11.8609 48.9598 12.5666 47.8507 12.5666ZM46.494 9.73416H49.1065C49.0423 8.80831 48.6114 8.37751 47.8507 8.37751C47.0165 8.37751 46.604 8.98254 46.494 9.73416Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6306<path d="M41.7284 12.4475V7.82748H42.5625V8.60665C42.8559 8.09332 43.3601 7.82748 43.8825 7.82748H44.9917V8.60665H43.8184C43.0851 8.60665 42.5625 9.08331 42.5625 10.0092V12.4475H41.7284Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6307</svg>
6308
6309`,k=(0,r.JW)`
6310  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 8">
6311    <path
6312      fill="var(--apkt-tokens-theme-textPrimary)"
6313      d="m9.524 6.307-1.51 1.584A.35.35 0 0 1 7.76 8H.604a.178.178 0 0 1-.161-.103.168.168 0 0 1 .033-.186l1.51-1.583a.35.35 0 0 1 .256-.11h7.154c.034 0 .068.01.096.029a.168.168 0 0 1 .032.26Zm-1.51-3.189a.35.35 0 0 0-.255-.109H.604a.178.178 0 0 0-.161.103.168.168 0 0 0 .033.186l1.51 1.583a.35.35 0 0 0 .256.11h7.154a.178.178 0 0 0 .16-.104.168.168 0 0 0-.032-.185l-1.51-1.584ZM.605 1.981H7.76a.357.357 0 0 0 .256-.11L9.525.289a.17.17 0 0 0 .032-.185.173.173 0 0 0-.16-.103H2.241a.357.357 0 0 0-.256.109L.476 1.692a.17.17 0 0 0-.033.185.178.178 0 0 0 .16.103Z"
6314    />
6315  </svg>
6316`,T=(0,r.JW)`<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
6317  <g clip-path="url(#a)">
6318    <path fill="url(#b)" d="M0 0h32v32H0z"/>
6319    <path fill-rule="evenodd" clip-rule="evenodd" d="M7.034 15.252c4.975-2.167 8.293-3.596 9.953-4.287 4.74-1.971 5.725-2.314 6.366-2.325.142-.002.457.033.662.198.172.14.22.33.243.463.022.132.05.435.028.671-.257 2.7-1.368 9.248-1.933 12.27-.24 1.28-.71 1.708-1.167 1.75-.99.091-1.743-.655-2.703-1.284-1.502-.985-2.351-1.598-3.81-2.558-1.684-1.11-.592-1.721.368-2.718.252-.261 4.619-4.233 4.703-4.594.01-.045.02-.213-.08-.301-.1-.09-.246-.059-.353-.035-.15.034-2.55 1.62-7.198 4.758-.682.468-1.298.696-1.851.684-.61-.013-1.782-.344-2.653-.628-1.069-.347-1.918-.53-1.845-1.12.039-.308.462-.623 1.27-.944Z" fill="#fff"/>
6320  </g>
6321  <path d="M.5 16C.5 7.44 7.44.5 16 .5 24.56.5 31.5 7.44 31.5 16c0 8.56-6.94 15.5-15.5 15.5C7.44 31.5.5 24.56.5 16Z" stroke="#141414" stroke-opacity=".05"/>
6322  <defs>
6323    <linearGradient id="b" x1="1600" y1="0" x2="1600" y2="3176.27" gradientUnits="userSpaceOnUse">
6324      <stop stop-color="#2AABEE"/>
6325      <stop offset="1" stop-color="#229ED9"/>
6326    </linearGradient>
6327    <clipPath id="a">
6328      <path d="M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16Z" fill="#fff"/>
6329    </clipPath>
6330  </defs>
6331</svg>`;var O=i(74946);let R=(0,r.JW)`
6332  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewB
6332ox="0 0 64 64">
6333    <path fill="var(--apkt-tokens-theme-textPrimary)" d="M61.55 19.28c-3-2.77-7.15-7-10.53-10l-.2-.14a3.82 3.82 0 0 0-1.11-.62l0 0C41.56 7 3.63-.09 2.89 0a1.4 1.4 0 0 0-.58.22L2.12.37a2.23 2.23 0 0 0-.52.84l-.05.13v.71l0 .11C5.82 14.05 22.68 53 26 62.14c.2.62.58 1.8 1.29 1.86h.16c.38 0 2-2.14 2-2.14S58.41 26.74 61.34 23a9.46 9.46 0 0 0 1-1.48A2.41 2.41 0 0 0 61.55 19.28ZM36.88 23.37 49.24 13.12l7.25 6.68Zm-4.8-.67L10.8 5.26l34.43 6.35ZM34 27.27l21.78-3.51-24.9 30ZM7.91 7 30.3 26 27.06 53.78Z"/>
6334  </svg>
6335`,P=(0,r.JW)`<svg fill="none" viewBox="0 0 40 40">
6336  <g clip-path="url(#a)">
6337    <g clip-path="url(#b)">
6338      <circle cx="20" cy="19.89" r="20" fill="#5A3E85" />
6339      <g clip-path="url(#c)">
6340        <path
6341          fill="#fff"
6342          d="M18.22 25.7 20 23.91h3.34l2.1-2.1v-6.68H15.4v8.78h2.82v1.77Zm3.87-8.16h1.25v3.66H22.1v-3.66Zm-3.34 0H20v3.66h-1.25v-3.66ZM20 7.9a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.69 14.56-3.66 3.66h-2.72l-1.77 1.78h-1.88V26.1H13.3v-9.82l.94-2.4H26.7v8.56Z"
6343        />
6344      </g>
6345    </g>
6346  </g>
6347  <defs>
6348    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
6349    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
6350    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
6351  </defs>
6352</svg>`,$=(0,r.JW)`<svg fill="none" viewBox="0 0 16 16">
6353  <path
6354    fill="currentColor"
6355    d="m14.36 4.74.01.42c0 4.34-3.3 9.34-9.34 9.34A9.3 9.3 0 0 1 0 13.03a6.6 6.6 0 0 0 4.86-1.36 3.29 3.29 0 0 1-3.07-2.28c.5.1 1 .07 1.48-.06A3.28 3.28 0 0 1 .64 6.11v-.04c.46.26.97.4 1.49.41A3.29 3.29 0 0 1 1.11 2.1a9.32 9.32 0 0 0 6.77 3.43 3.28 3.28 0 0 1 5.6-3 6.59 6.59 0 0 0 2.08-.8 3.3 3.3 0 0 1-1.45 1.82A6.53 6.53 0 0 0 16 3.04c-.44.66-1 1.23-1.64 1.7Z"
6356  />
6357</svg>`,U=(0,r.JW)`
6358<svg xmlns="http://www.w3.org/2000/svg" width="89" height="89" viewBox="0 0 89 89" fill="none">
6359<path d="M60.0468 39.2502L65.9116 33.3854C52.6562 20.13 36.1858 20.13 22.9304 33.3854L28.7952 39.2502C38.8764 29.169 49.9725 29.169 60.0536 39.2502H60.0468Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6360<path d="M58.0927 52.9146L44.415 39.2369L30.7373 52.9146L17.0596 39.2369L11.2017 45.0949L30.7373 64.6374L44.415 50.9597L58.0927 64.6374L77.6284 45.0949L71.7704 39.2369L58.0927 52.9146Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
6361</svg>`,M=(0,r.JW)`
6362<svg xmlns="http://www.w3.org/2000/svg" width="89" height="89" viewBox="0 0 89 89" fill="none">
6363<path d="M60.0468 39.2502L65.9116 33.3854C52.6562 20.13 36.1858 20.13 22.9304 33.3854L28.7952 39.2502C38.8764 29.169 49.9725 29.169 60.0536 39.2502H60.0468Z" fill="var(--apkt-tokens-theme-textInvert)"/>
6364<path d="M58.0927 52.9146L44.415 39.2369L30.7373 52.9146L17.0596 39.2369L11.2017 45.0949L30.7373 64.6374L44.415 50.9597L58.0927 64.6374L77.6284 45.0949L71.7704 39.2369L58.0927 52.9146Z" fill="var(--apkt-tokens-theme-textInvert)"/>
6365</svg>`,D=(0,r.JW)`
6366<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
6367<g clip-path="url(#clip0_22274_4692)">
6368<path d="M0 6.64C0 4.17295 0 2.93942 0.525474 2.01817C0.880399 1.39592 1.39592 0.880399 2.01817 0.525474C2.93942 0 4.17295 0 6.64 0H9.36C11.8271 0 13.0606 0 13.9818 0.525474C14.6041 0.880399 15.1196 1.39592 15.4745 2.01817C16 2.93942 16 4.17295 16 6.64V9.36C16 11.8271 16 13.0606 15.4745 13.9818C15.1196 14.6041 14.6041 15.1196 13.9818 15.4745C13.0606 16 11.8271 16 9.36 16H6.64C4.17295 16 2.93942 16 2.01817 15.4745C1.39592 15.1196 0.880399 14.6041 0.525474 13.9818C0 13.0606 0 11.8271 0 9.36V6.64Z" fill="#C7B994"/>
6369<path d="M4.49038 5.76609C6.42869 3.86833 9.5713 3.86833 11.5096 5.76609L11.7429 5.99449C11.8398 6.08938 11.8398 6.24323 11.7429 6.33811L10.9449 7.11942C10.8964 7.16686 10.8179 7.16686 10.7694 7.11942L10.4484 6.80512C9.09617 5.48119 6.90381 5.48119 5.5516 6.80512L5.20782 7.14171C5.15936 7.18915 5.08079 7.18915 5.03234 7.14171L4.23434 6.3604C4.13742 6.26552 4.13742 6.11167 4.23434 6.01678L4.49038 5.76609ZM13.1599 7.38192L13.8702 8.07729C13.9671 8.17217 13.9671 8.32602 13.8702 8.4209L10.6677 11.5564C10.5708 11.6513 10.4137 11.6513 10.3168 11.5564L8.04388 9.33105C8.01965 9.30733 7.98037 9.30733 7.95614 9.33105L5.6833 11.5564C5.58638 11.6513 5.42925 11.6513 5.33234 11.5564L2.12982 8.42087C2.0329 8.32598 2.0329 8.17213 2.12982 8.07724L2.84004 7.38188C2.93695 7.28699 3.09408 7.28699 3.191 7.38188L5.46392 9.60726C5.48815 9.63098 5.52743 9.63098 5.55166 9.60726L7.82447 7.38188C7.92138 7.28699 8.07851 7.28699 8.17543 7.38187L10.4484 9.60726C10.4726 9.63098 10.5119 9.63098 10.5361 9.60726L12.809 7.38192C12.9059 7.28703 13.063 7.28703 13.1599 7.38192Z" fill="currentColor"/>
6370</g>
6371<defs>
6372<clipPath id="clip0_22274_4692">
6373<path d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8Z" fill="white"/>
6374</clipPath>
6375</defs>
6376</svg>
6377`,L=(0,r.JW)`
6378<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
6379<circle cx="11" cy="11" r="11" transform="matrix(-1 0 0 1 23 1)" fill="#202020"/>
6380<circle cx="11" cy="11" r="11.5" transform="matrix(-1 0 0 1 23 1)" stroke="#C7B994" stroke-opacity="0.7"/>
6381<path d="M15.4523 11.0686L16.7472 9.78167C13.8205 6.87297 10.1838 6.87297 7.25708 9.78167L8.55201 11.0686C10.7779 8.85645 13.2279 8.85645 15.4538 11.0686H15.4523Z" fill="#C7B994"/>
6382<path d="M15.0199 14.067L12 11.0656L8.98 14.067L5.96004 11.0656L4.66663 12.3511L8.98 16.6393L12 13.638L15.0199 16.6393L19.3333 12.3511L18.0399 11.0656L15.0199 14.067Z" fill="#C7B994"/>
6383</svg>
6384`,W=(0,r.JW)`<svg fill="none" viewBox="0 0 41 40">
6385  <g clip-path="url(#a)">
6386    <path fill="#000" d="M.8 0h40v40H.8z" />
6387    <path
6388      fill="#fff"
6389      d="m22.63 18.46 7.14-8.3h-1.69l-6.2 7.2-4.96-7.2H11.2l7.5 10.9-7.5 8.71h1.7l6.55-7.61 5.23 7.61h5.72l-7.77-11.31Zm-9.13-7.03h2.6l11.98 17.13h-2.6L13.5 11.43Z"
6390    />
6391  </g>
6392  <defs>
6393    <clipPath id="a"><path fill="#fff" d="M.8 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z" /></clipPath>
6394  </defs>
6395</svg>`;var B=i(34175),j=i(94895),F=i(69428);let H=(0,r.AH)`
6396  :host {
6397    display: flex;
6398    justify-content: center;
6399    align-items: center;
6400    aspect-ratio: 1 / 1;
6401    color: var(--local-color);
6402    width: var(--local-width);
6403  }
6404
6405  svg {
6406    height: inherit;
6407    width: inherit;
6408    object-fit: contain;
6409    object-position: center;
6410  }
6411`;var q=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let z={add:"ph-plus",allWallets:"ph-dots-three",arrowBottom:"ph-arrow-down",arrowBottomCircle:"ph-arrow-circle-down",arrowClockWise:"ph-arrow-clockwise",arrowLeft:"ph-arrow-left",arrowRight:"ph-arrow-right",arrowTop:"ph-arrow-up",arrowTopRight:"ph-arrow-up-right",bank:"ph-bank",bin:"ph-trash",browser:"ph-browser",card:"ph-credit-card",checkmarkBold:"ph-check",chevronBottom:"ph-caret-down",chevronLeft:"ph-caret-left",chevronRight:"ph-caret-right",chevronTop:"ph-caret-up",clock:"ph-clock",close:"ph-x",coinPlaceholder:"ph-circle-half",compass:"ph-compass",copy:"ph-copy",desktop:"ph-desktop",dollar:"ph-currency-dollar",download:"ph-vault",exclamationCircle:"ph-warning-circle",extension:"ph-puzzle-piece",externalLink:"ph-arrow-square-out",filters:"ph-funnel-simple",helpCircle:"ph-question",id:"ph-identification-card",image:"ph-image",info:"ph-info",lightbulb:"ph-lightbulb",mail:"ph-envelope",mobile:"ph-device-mobile",more:"ph-dots-three",networkPlaceholder:"ph-globe",nftPlaceholder:"ph-image",plus:"ph-plus",power:"ph-power",qrCode:"ph-qr-code",questionMark:"ph-question",refresh:"ph-arrow-clockwise",recycleHorizontal:"ph-arrows-clockwise",search:"ph-magnifying-glass",sealCheck:"ph-seal-check",send:"ph-paper-plane-right",signOut:"ph-sign-out",spinner:"ph-spinner",swapHorizontal:"ph-arrows-left-right",swapVertical:"ph-arrows-down-up",threeDots:"ph-dots-three",user:"ph-user",verify:"ph-seal-check",verifyFilled:"ph-seal-check",wallet:"ph-wallet",warning:"ph-warning",warningCircle:"ph-warning-circle",appStore:"",apple:"",bitcoin:"",coins:"",chromeStore:"",cursor:"",discord:"",ethereum:"",etherscan:"",facebook:"",farcaster:"",github:"",google:"",playStore:"",paperPlaneTitle:"",reown:"",solana:"",ton:"",tron:"",telegram:"",twitch:"",twitterIcon:"",twitter:"",walletConnect:"",walletConnectBrown:"",walletConnectLightBrown:"",x:"",infoSeal:"",checkmark:""},V={"ph-arrow-circle-down":()=>Promise.all([i.e(24020),i.e(69335)]).then(i.bind(i,69335)),"ph-arrow-clockwise":()=>Promise.all([i.e(24020),i.e(51245)]).then(i.bind(i,51245)),"ph-arrow-down":()=>Promise.all([i.e(24020),i.e(69067)]).then(i.bind(i,69067)),"ph-arrow-left":()=>Promise.all([i.e(24020),i.e(88924)]).then(i.bind(i,88924)),"ph-arrow-right":()=>Promise.all([i.e(24020),i.e(28145)]).then(i.bind(i,28145)),"ph-arrow-square-out":()=>Promise.all([i.e(24020),i.e(97116)]).then(i.bind(i,97116)),"ph-arrows-down-up":()=>Promise.all([i.e(24020),i.e(92875)]).then(i.bind(i,92875)),"ph-arrows-left-right":()=>Promise.all([i.e(24020),i.e(11277)]).then(i.bind(i,11277)),"ph-arrow-up":()=>Promise.all([i.e(24020),i.e(91944)]).then(i.bind(i,91944)),"ph-arrow-up-right":()=>Promise.all([i.e(24020),i.e(33120)]).then(i.bind(i,33120)),"ph-arrows-clockwise":()=>Promise.all([i.e(24020),i.e(47244)]).then(i.bind(i,47244)),"ph-bank":()=>Promise.all([i.e(24020),i.e(37436)]).then(i.bind(i,37436)),"ph-browser":()=>Promise.all([i.e(24020),i.e(6644)]).then(i.bind(i,6644)),"ph-caret-down":()=>Promise.all([i.e(24020),i.e(41641)]).then(i.bind(i,64022)),"ph-caret-left":()=>Promise.all([i.e(24020),i.e(38010)]).then(i.bind(i,38010)),"ph-caret-right":()=>Promise.all([i.e(24020),i.e(94135)]).then(i.bind(i,94135)),"ph-caret-up":()=>Promise.all([i.e(24020),i.e(87890)]).then(i.bind(i,87890)),"ph-check":()=>Promise.all([i.e(24020),i.e(98264)]).then(i.bind(i,98264)),"ph-circle-half":()=>Promise.all([i.e(24020),i.e(86157)]).then(i.bind(i,86157)),"ph-clock":()=>Promise.all([i.e(24020),i.e(91554)]).then(i.bind(i,91554)),"ph-compass":()=>Promise.all([i.e(24020),i.e(88076)]).then(i.bind(i,88076)),"ph-copy":()=>Promise.all([i.e(24020),i.e(52409)]).then(i.bind(i,52409)),"ph-credit-card":()=>Promise.all([i.e(24020),i.e(7495)]).then(i.bind(i,7495)),"ph-currency-dollar":()=>Promise.all([i.e(24020),i.e(5157)]).then(i.bind(i,5157)),"ph-desktop":()=>Promise.all([i.e(24020),i.e(15428)]).then(i.bind(i,15428)),"ph-device-mobile":()=>Promise.all([i.e(24020),i.e(726)]).then(i.bind(i,726)),"ph-dots-three":()=>Promise.all([i.e(24020),i.e(29136)]).then(i.bind(i,29136)),"ph-vault":()=>Promise.all([i.e(24020),i.e(66256)]).then(i.bind(i,66256)),"ph-envelope":()=>Promise.all([i.e(24020),i.e(13546)]).then(i.bind(i,13546)),"ph-funnel-simple":()=>Promise.all([i.e(24020),i.e(36388)]).then(i.bind(i,36388)),"ph-globe":()=>Promise.all([i.e(24020),i.e(91175)]).then(i.bind(i,91175)),"ph-identification-card":()=>Promise.all([i.e(24020),i.e(32410)]).then(i.bind(i,32410)),"ph-image":()=>Promise.all([i.e(24020),i.e(66015)]).then(i.bind(i,66015)),"ph-info":()=>Promise.all([i.e(24020),i.e(32946)]).then(i.bind(i,32946)),"ph-l
6411ightbulb":()=>Promise.all([i.e(24020),i.e(94913)]).then(i.bind(i,94913)),"ph-magnifying-glass":()=>Promise.all([i.e(24020),i.e(49965)]).then(i.bind(i,49965)),"ph-paper-plane-right":()=>Promise.all([i.e(24020),i.e(50422)]).then(i.bind(i,50422)),"ph-plus":()=>Promise.all([i.e(24020),i.e(84554)]).then(i.bind(i,84554)),"ph-power":()=>Promise.all([i.e(24020),i.e(97427)]).then(i.bind(i,97427)),"ph-puzzle-piece":()=>Promise.all([i.e(24020),i.e(52702)]).then(i.bind(i,52702)),"ph-qr-code":()=>Promise.all([i.e(24020),i.e(41244)]).then(i.bind(i,41244)),"ph-question":()=>Promise.all([i.e(24020),i.e(43170)]).then(i.bind(i,43170)),"ph-question-circle":()=>Promise.all([i.e(24020),i.e(64025)]).then(i.bind(i,64025)),"ph-seal-check":()=>Promise.all([i.e(24020),i.e(25993)]).then(i.bind(i,25993)),"ph-sign-out":()=>Promise.all([i.e(24020),i.e(89145)]).then(i.bind(i,89145)),"ph-spinner":()=>Promise.all([i.e(24020),i.e(25239)]).then(i.bind(i,25239)),"ph-trash":()=>Promise.all([i.e(24020),i.e(71730)]).then(i.bind(i,71730)),"ph-user":()=>Promise.all([i.e(24020),i.e(4583)]).then(i.bind(i,4583)),"ph-wallet":()=>Promise.all([i.e(24020),i.e(51437)]).then(i.bind(i,51437)),"ph-warning":()=>Promise.all([i.e(24020),i.e(67872)]).then(i.bind(i,67872)),"ph-warning-circle":()=>Promise.all([i.e(24020),i.e(12012)]).then(i.bind(i,12012)),"ph-x":()=>Promise.all([i.e(24020),i.e(33620)]).then(i.bind(i,33620))},Z={appStore:h,apple:u,bitcoin:p,coins:m,chromeStore:g,cursor:w,discord:y,ethereum:b,etherscan:v,facebook:C,farcaster:E,github:x,google:A,playStore:S,paperPlaneTitle:I,reown:N,solana:k,ton:O._,tron:R,telegram:T,twitch:P,twitter:W,twitterIcon:$,walletConnect:U,walletConnectInvert:M,walletConnectBrown:L,walletConnectLightBrown:D,x:W,infoSeal:_,checkmark:f},K={"accent-primary":B.f.tokens.core.iconAccentPrimary,"accent-certified":B.f.tokens.core.iconAccentCertified,"foreground-secondary":B.f.tokens.theme.foregroundSecondary,default:B.f.tokens.theme.iconDefault,success:B.f.tokens.core.iconSuccess,error:B.f.tokens.core.iconError,warning:B.f.tokens.core.iconWarning,inverse:B.f.tokens.theme.iconInverse},G=class extends r.WF{constructor(){super(...arguments),this.size="md",this.name="copy",this.weight="bold",this.color="inherit"}render(){this.style.cssText=`
6412      --local-width: ${"inherit"===this.size?"inherit":`var(--apkt-spacing-${({xxs:"2",xs:"3",sm:"3",md:"4",mdl:"5",lg:"5",xl:"6",xxl:"7",inherit:"inherit"})[this.size]})`};
6413      --local-color: ${"inherit"===this.color?"inherit":K[this.color]}
6414    `;let e=z[this.name];if(e&&""!==e){let t=V[e];t&&t();let i={_$litStatic$:e,r:a};return d`<${i} size=${({xxs:"0.5em",xs:"0.75em",sm:"0.75em",md:"1em",mdl:"1.25em",lg:"1.25em",xl:"1.5em",xxl:"1.75em"})[this.size]} weight="${this.weight}"></${i}>`}return Z[this.name]||d``}};G.styles=[j.W5,H],q([(0,n.MZ)()],G.prototype,"size",void 0),q([(0,n.MZ)()],G.prototype,"name",void 0),q([(0,n.MZ)()],G.prototype,"weight",void 0),q([(0,n.MZ)()],G.prototype,"color",void 0),G=q([(0,F.E)("wui-icon")],G)},82425:(e,t,i)=>{let r=i(17078),n=i(30567);function s(e){this.mode=n.BYTE,"string"==typeof e&&(e=r(e)),this.data=new Uint8Array(e)}s.getBitsLength=function(e){return 8*e},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){for(let t=0,i=this.data.length;t<i;t++)e.put(this.data[t],8)},e.exports=s},82940:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class i{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let i=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:i})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=i,t.default=i},82989:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(82016),i(84915),i(12936);var s=i(94895),a=i(69428),o=i(34175);let l=(0,o.AH)`
6415  :host {
6416    width: var(--local-width);
6417  }
6418
6419  button {
6420    width: var(--local-width);
6421    white-space: nowrap;
6422    column-gap: ${({spacing:e})=>e[2]};
6423    transition:
6424      scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]},
6425      background-color ${({durations:e})=>e.lg}
6426        ${({easings:e})=>e["ease-out-power-2"]},
6427      border-radius ${({durations:e})=>e.lg}
6428        ${({easings:e})=>e["ease-out-power-1"]};
6429    will-change: scale, background-color, border-radius;
6430    cursor: pointer;
6431  }
6432
6433  /* -- Sizes --------------------------------------------------- */
6434  button[data-size='sm'] {
6435    border-radius: ${({borderRadius:e})=>e[2]};
6436    padding: 0 ${({spacing:e})=>e[2]};
6437    height: 28px;
6438  }
6439
6440  button[data-size='md'] {
6441    border-radius: ${({borderRadius:e})=>e[3]};
6442    padding: 0 ${({spacing:e})=>e[4]};
6443    height: 38px;
6444  }
6445
6446  button[data-size='lg'] {
6447    border-radius: ${({borderRadius:e})=>e[4]};
6448    padding: 0 ${({spacing:e})=>e[5]};
6449    height: 48px;
6450  }
6451
6452  /* -- Variants --------------------------------------------------------- */
6453  button[data-variant='accent-primary'] {
6454    background-color: ${({tokens:e})=>e.core.backgroundAccentPrimary};
6455    color: ${({tokens:e})=>e.theme.textInvert};
6456  }
6457
6458  button[data-variant='accent-secondary'] {
6459    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
6460    color: ${({tokens:e})=>e.core.textAccentPrimary};
6461  }
6462
6463  button[data-variant='neutral-primary'] {
6464    background-color: ${({tokens:e})=>e.theme.backgroundInvert};
6465    color: ${({tokens:e})=>e.theme.textInvert};
6466  }
6467
6468  button[data-variant='neutral-secondary'] {
6469    background-color: transparent;
6470    border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
6471    color: ${({tokens:e})=>e.theme.textPrimary};
6472  }
6473
6474  button[data-variant='neutral-tertiary'] {
6475    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
6476    color: ${({tokens:e})=>e.theme.textPrimary};
6477  }
6478
6479  button[data-variant='error-primary'] {
6480    background-color: ${({tokens:e})=>e.core.textError};
6481    color: ${({tokens:e})=>e.theme.textInvert};
6482  }
6483
6484  button[data-variant='error-secondary'] {
6485    background-color: ${({tokens:e})=>e.core.backgroundError};
6486    color: ${({tokens:e})=>e.core.textError};
6487  }
6488
6489  button[data-variant='shade'] {
6490    background: var(--wui-color-gray-glass-002);
6491    color: var(--wui-color-fg-200);
6492    border: none;
6493    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
6494  }
6495
6496  /* -- Focus states --------------------------------------------------- */
6497  button[data-size='sm']:focus-visible:enabled {
6498    border-radius: 28px;
6499  }
6500
6501  button[data-size='md']:focus-visible:enabled {
6502    border-radius: 38px;
6503  }
6504
6505  button[data-size='lg']:focus-visible:enabled {
6506    border-radius: 48px;
6507  }
6508  button[data-variant='shade']:focus-visible:enabled {
6509    background: var(--wui-color-gray-glass-005);
6510    box-shadow:
6511      inset 0 0 0 1px var(--wui-color-gray-glass-010),
6512      0 0 0 4px var(--wui-color-gray-glass-002);
6513  }
6514
6515  /* -- Hover & Active states ----------------------------------------------------------- */
6516  @media (hover: hover) {
6517    button[data-size='sm']:hover:enabled {
6518      border-radius: 28px;
6519    }
6520
6521    button[data-size='md']:hover:enabled {
6522      border-radius: 38px;
6523    }
6524
6525    button[data-size='lg']:hover:enabled {
6526      border-radius: 48px;
6527    }
6528
6529    button[data-variant='shade']:hover:enabled {
6530      background: var(--wui-color-gray-glass-002);
6531    }
6532
6533    button[data-variant='shade']:active:enabled {
6534      background: var(--wui-color-gray-glass-005);
6535    }
6536  }
6537
6538  button[data-size='sm']:active:enabled {
6539    border-radius: 28px;
6540  }
6541
6542  button[data-size='md']:active:enabled {
6543    border-radius: 38px;
6544  }
6545
6546  button[data-size='lg']:active:enabled {
6547    border-radius: 48px;
6548  }
6549
6550  /* -- Disabled states --------------------------------------------------- */
6551  button:disabled {
6552    opacity: 0.3;
6553  }
6554`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d={lg:"lg-regular-mono",md:"md-regular-mono",sm:"sm-regular-mono"},h={lg:"md",md:"md",sm:"sm"},u=class extends r.WF{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="accent-primary"}render(){this.style.cssText=`
6555    --local-width: ${this.fullWidth?"100%":"auto"};
6556     `;let e=this.textVariant??d[this.size];return(0,r.qy)`
6557      <button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}>
6558        ${this.loadingTemplate()}
6559        <slot name="iconLeft"></slot>
6560        <wui-text variant=${e} color="inherit">
6561          <slot></slot>
6562        </wui-text>
6563        <slot name="iconRight"></slot>
6564      </button>
6565    `}loadingTemplate(){if(this.loading){let e=h[this.size],t="neutral-primary"===this.variant||"accent-primary"===this.variant?"invert":"primary";return(0,r.qy)`<wui-loading-spinner color=${t} size=${e}></wui-loading-spinner>`}return null}};u.styles=[s.W5,s.fD,l],c([(0,n.MZ)()],u.prototype,"size",void 0),c([(0,n.MZ)({type:Boolean})],u.prototype,"disabled",void 0),c([(0,n.MZ)({type:Boolean})],u.prototype,"fullWidth",void 0),c([(0,n.MZ)({type:Boolean})],u.prototype,"loading",void 0),c([(0,n.MZ)()],u.prototype,"variant",void 0),c([(0,n.MZ)()],u.prototype,"textVariant",void 0),u=c([(0,a.E)("wui-button")],u)},83215:(e,t,i)=>{let r=i(549);function n(e,t){let i=e.a/255,r=t+'="'+e.hex+'"';return i<1?r+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':r}function s(e,t,i){let r=e+t;return void 0!==i&&(r+=" "+i),r}t.render=function(e,t,i){let a=r.getOptions(t),o=e.modules.size,l=e.modules.data,c=o+2*a.margin,d=a.color.light.a?"<path "+n(a.c
6565olor.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",h="<path "+n(a.color.dark,"stroke")+' d="'+function(e,t,i){let r="",n=0,a=!1,o=0;for(let l=0;l<e.length;l++){let c=Math.floor(l%t),d=Math.floor(l/t);c||a||(a=!0),e[l]?(o++,l>0&&c>0&&e[l-1]||(r+=a?s("M",c+i,.5+d+i):s("m",n,0),n=0,a=!1),c+1<t&&e[l+1]||(r+=s("h",o),o=0)):n++}return r}(l,o,a.margin)+'"/>',u='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+('viewBox="0 0 '+c+" ")+c+'" shape-rendering="crispEdges">'+d+h+"</svg>\n";return"function"==typeof i&&i(null,u),u}},83227:(e,t,i)=>{"use strict";i.r(t),i.d(t,{__assign:()=>s,__asyncDelegator:()=>v,__asyncGenerator:()=>b,__asyncValues:()=>C,__await:()=>y,__awaiter:()=>d,__classPrivateFieldGet:()=>_,__classPrivateFieldSet:()=>I,__createBinding:()=>u,__decorate:()=>o,__exportStar:()=>p,__extends:()=>n,__generator:()=>h,__importDefault:()=>A,__importStar:()=>x,__makeTemplateObject:()=>E,__metadata:()=>c,__param:()=>l,__read:()=>g,__rest:()=>a,__spread:()=>m,__spreadArrays:()=>w,__values:()=>f});var r=function(e,t){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function n(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var s=function(){return(s=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function a(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)0>t.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(i[r[n]]=e[r[n]]);return i}function o(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}function l(e,t){return function(i,r){t(i,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function d(e,t,i,r){return new(i||(i=Promise))(function(n,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})}function h(e,t){var i,r,n,s,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){var l=[s,o];if(i)throw TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(n=2&l[0]?r.return:l[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,l[1])).done)return n;switch(r=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){a.label=l[1];break}if(6===l[0]&&a.label<n[1]){a.label=n[1],n=l;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(l);break}n[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{i=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function u(e,t,i,r){void 0===r&&(r=i),e[r]=t[i]}function p(e,t){for(var i in e)"default"===i||t.hasOwnProperty(i)||(t[i]=e[i])}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],r=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var r,n,s=i.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function w(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<i;t++)for(var s=arguments[t],a=0,o=s.length;a<o;a++,n++)r[n]=s[a];return r}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function b(e,t,i){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var r,n=i.apply(e,t||[]),s=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){n[e]&&(r[e]=function(t){return new Promise(function(i,r){s.push([e,t,i,r])>1||o(e,t)})})}function o(e,t){try{var i;(i=n[e](t)).value instanceof y?Promise.resolve(i.value.v).then(l,c):d(s[0][2],i)}catch(e){d(s[0][3],e)}}function l(e){o("next",e)}function c(e){o("throw",e)}function d(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function v(e){var t,i;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(i=!i)?{value:y(e[r](t)),done:"return"===r}:n?n(t):t}:n}}function C(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=f(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=e[i]&&function(t){return new Promise(function(r,n){var s,a,o;s=r,a=n,o=(t=e[i](t)).done,Promise.resolve(t.value).then(function(e){s({value:e,done:o})},a)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
6565function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function _(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,i){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,i),i}},83366:(e,t,i)=>{"use strict";i.d(t,{g:()=>w});var r=i(92679),n=i(3125),s=i(17008),a=i(33452),o=i(29400),l=i(37056),c=i(8586),d=i(18715),h=i(1024),u=i(43242),p=i(11403),f=i(44963);let g={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},m=(0,r.BX)(g),w={state:m,subscribe:e=>(0,r.B1)(m,()=>e(m)),subscribeKey:(e,t)=>(0,n.u$)(m,e,t),resetState(){Object.assign(m,{...g})},async getAssetsForNetwork(e){let t=(0,c.nj)(e),i=await w.getAssetsImageAndPrice(t),r=t.map(e=>{let t="native"===e.asset?(0,a.K1)():`${e.network}:${e.asset}`,r=i.find(e=>e.fungibles?.[0]?.address?.toLowerCase()===t.toLowerCase());return{...e,price:r?.fungibles?.[0]?.price||1,metadata:{...e.metadata,iconUrl:r?.fungibles?.[0]?.iconUrl}}});return m.assets=r,r},async getAssetsImageAndPrice(e){let t=e.map(e=>"native"===e.asset?(0,a.K1)():`${e.network}:${e.asset}`);return await Promise.all(t.map(e=>d.T.fetchTokenPrice({addresses:[e]})))},getTokenAmount(){if(!m?.paymentAsset?.price)throw Error("Cannot get token price");let e=s.S.bigNumber(m.amount??0).round(8),t=s.S.bigNumber(m.paymentAsset.price).round(8);return e.div(t).round(8).toNumber()},setAmount(e){m.amount=e,m.paymentAsset?.price&&(m.tokenAmount=w.getTokenAmount())},setPaymentAsset(e){m.paymentAsset=e},isPayWithExchangeEnabled:()=>p.H.state.remoteFeatures?.payWithExchange,isPayWithExchangeSupported:()=>w.isPayWithExchangeEnabled()&&h.W.state.activeCaipNetwork&&o.oU.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(h.W.state.activeCaipNetwork.chainNamespace),async fetchExchanges(){try{let e=w.isPayWithExchangeSupported();if(!m.paymentAsset||!e){m.exchanges=[],m.isLoading=!1;return}m.isLoading=!0;let t=await (0,c.ro)({page:0,asset:(0,c.lZ)(m.paymentAsset.network,m.paymentAsset.asset),amount:m.amount?.toString()??"0"});m.exchanges=t.exchanges.slice(0,2)}catch(e){throw f.P.showError("Unable to get exchanges"),Error("Unable to get exchanges")}finally{m.isLoading=!1}},async getPayUrl(e,t){try{let i=Number(t.amount),r=await (0,c.cz)({exchangeId:e,asset:(0,c.lZ)(t.network,t.asset),amount:i.toString(),recipient:`${t.network}:${t.recipient}`});return u.E.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:e},configuration:{network:t.network,asset:t.asset,recipient:t.recipient,amount:i},currentPayment:{type:"exchange",exchangeId:e},source:"fund-from-exchange",headless:!1}}),r}catch(e){if(e instanceof Error&&e.message.includes("is not supported"))throw Error("Asset not supported");throw Error(e.message)}},async handlePayWithExchange(e){try{let t=h.W.getAccountData()?.address;if(!t)throw Error("No account connected");if(!m.paymentAsset)throw Error("No payment asset selected");let i=l.w.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!i)throw Error("Could not create popup window");m.isPaymentInProgress=!0,m.paymentId=crypto.randomUUID(),m.currentPayment={type:"exchange",exchangeId:e};let{network:r,asset:n}=m.paymentAsset,s={network:r,asset:n,amount:m.tokenAmount,recipient:t},a=await w.getPayUrl(e,s);if(!a){try{i.close()}catch(e){console.error("Unable to close popup window",e)}throw Error("Unable to initiate payment")}m.currentPayment.sessionId=a.sessionId,m.currentPayment.status="IN_PROGRESS",m.currentPayment.exchangeId=e,i.location.href=a.url}catch(e){m.error="Unable to initiate payment",f.P.showError(m.error)}},async waitUntilComplete({exchangeId:e,sessionId:t,paymentId:i,retries:r=20}){let n=await w.getBuyStatus(e,t,i);if("SUCCESS"===n.status||"FAILED"===n.status)return n;if(0===r)throw Error("Unable to get deposit status");return await new Promise(e=>{setTimeout(e,5e3)}),w.waitUntilComplete({exchangeId:e,sessionId:t,paymentId:i,retries:r-1})},async getBuyStatus(e,t,i){try{if(!m.currentPayment)throw Error("No current payment");let r=await (0,c.V1)({sessionId:t,exchangeId:e});if(m.currentPayment.status=r.status,"SUCCESS"===r.status||"FAILED"===r.status){let e=h.W.getAccountData()?.address;m.currentPayment.result=r.txHash,m.isPaymentInProgress=!1,u.E.sendEvent({type:"track",event:"SUCCESS"===r.status?"PAY_SUCCESS":"PAY_ERROR",properties:{message:"FAILED"===r.status?l.w.parseError(m.error):void 0,source:"fund-from-exchange",paymentId:i,configuration:{network:m.paymentAsset?.network||"",asset:m.paymentAsset?.asset||"",recipient:e||"",amount:m.amount??0},currentPayment:{type:"exchange",exchangeId:m.currentPayment?.exchangeId,sessionId:m.currentPayment?.sessionId,result:r.txHash}}})}return r}catch(e){return{status:"UNKNOWN",txHash:""}}},reset(){m.currentPayment=void 0,m.isPaymentInProgress=!1,m.paymentId="",m.paymentAsset=null,m.amount=0,m.tokenAmount=0,m.priceLoading=!1,m.error=null,m.exchanges=[],m.isLoading=!1}}},83404:(e,t,i)=>{let r=i(94762);function n(e,t,i,r,n,a){l[e]=l[e]+l[t]+n,l[r]=s(l[r]^l[e],16),l[i]=l[i]+l[r],l[t]=s(l[t]^l[i],12),l[e]=l[e]+l[t]+a,l[r]=s(l[r]^l[e],8),l[i]=l[i]+l[r],l[t]=s(l[t]^l[i],7)}function s(e,t){return e>>>t^e<<32-t}
6565let a=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),l=new Uint32Array(16),c=new Uint32Array(16);function d(e,t){let i=0;for(i=0;i<8;i++)l[i]=e.h[i],l[i+8]=a[i];for(l[12]^=e.t,l[13]^=e.t/0x100000000,t&&(l[14]=~l[14]),i=0;i<16;i++){var r,s;c[i]=(r=e.b)[s=4*i]^r[s+1]<<8^r[s+2]<<16^r[s+3]<<24}for(i=0;i<10;i++)n(0,4,8,12,c[o[16*i+0]],c[o[16*i+1]]),n(1,5,9,13,c[o[16*i+2]],c[o[16*i+3]]),n(2,6,10,14,c[o[16*i+4]],c[o[16*i+5]]),n(3,7,11,15,c[o[16*i+6]],c[o[16*i+7]]),n(0,5,10,15,c[o[16*i+8]],c[o[16*i+9]]),n(1,6,11,12,c[o[16*i+10]],c[o[16*i+11]]),n(2,7,8,13,c[o[16*i+12]],c[o[16*i+13]]),n(3,4,9,14,c[o[16*i+14]],c[o[16*i+15]]);for(i=0;i<8;i++)e.h[i]^=l[i]^l[i+8]}function h(e,t){if(!(e>0&&e<=32))throw Error("Incorrect output length, should be in [1, 32]");let i=t?t.length:0;if(t&&!(i>0&&i<=32))throw Error("Incorrect key length, should be in [1, 32]");let r={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return r.h[0]^=0x1010000^i<<8^e,i>0&&(u(r,t),r.c=64),r}function u(e,t){for(let i=0;i<t.length;i++)64===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[i]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;d(e,!0);let t=new Uint8Array(e.outlen);for(let i=0;i<e.outlen;i++)t[i]=e.h[i>>2]>>8*(3&i)&255;return t}function f(e,t,i){i=i||32,e=r.normalizeInput(e);let n=h(i,t);return u(n,e),p(n)}e.exports={blake2s:f,blake2sHex:function(e,t,i){let n=f(e,t,i);return r.toHex(n)},blake2sInit:h,blake2sUpdate:u,blake2sFinal:p}},83630:(e,t,i)=>{"use strict";i.d(t,{aG:()=>m});var r=i(92679),n=i(3125),s=i(34386),a=i(29400),o=i(51369),l=i(92929),c=i(18715),d=i(1024),h=i(11403);let u={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},p={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},f={providers:a.tM,selectedProvider:null,error:null,purchaseCurrency:u,paymentCurrency:p,purchaseCurrencies:[u],paymentCurrencies:[],quotesLoading:!1},g=(0,r.BX)(f),m=(0,o.X)({state:g,subscribe:e=>(0,r.B1)(g,()=>e(g)),subscribeKey:(e,t)=>(0,n.u$)(g,e,t),setSelectedProvider(e){if(e&&"meld"===e.name){let t=d.W.state.activeChain,i=t===s.o.CHAIN.SOLANA?"SOL":"USDC",r=t?d.W.state.chains.get(t)?.accountState?.address??"":"",n=new URL(e.url);n.searchParams.append("publicKey",a.Db),n.searchParams.append("destinationCurrencyCode",i),n.searchParams.append("walletAddress",r),n.searchParams.append("externalCustomerId",h.H.state.projectId),g.selectedProvider={...e,url:n.toString()}}else g.selectedProvider=e},setOnrampProviders(e){Array.isArray(e)&&e.every(e=>"string"==typeof e)?g.providers=a.tM.filter(t=>e.includes(t.name)):g.providers=[]},setPurchaseCurrency(e){g.purchaseCurrency=e},setPaymentCurrency(e){g.paymentCurrency=e},setPurchaseAmount(e){m.state.purchaseAmount=e},setPaymentAmount(e){m.state.paymentAmount=e},async getAvailableCurrencies(){let e=await c.T.getOnrampOptions();g.purchaseCurrencies=e.purchaseCurrencies,g.paymentCurrencies=e.paymentCurrencies,g.paymentCurrency=e.paymentCurrencies[0]||p,g.purchaseCurrency=e.purchaseCurrencies[0]||u,await l.N.fetchCurrencyImages(e.paymentCurrencies.map(e=>e.id)),await l.N.fetchTokenImages(e.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){g.quotesLoading=!0;try{let e=await c.T.getOnrampQuote({purchaseCurrency:g.purchaseCurrency,paymentCurrency:g.paymentCurrency,amount:g.paymentAmount?.toString()||"0",network:g.purchaseCurrency?.symbol});return g.quotesLoading=!1,g.purchaseAmount=Number(e?.purchaseAmount.amount),e}catch(e){return g.error=e.message,g.quotesLoading=!1,null}finally{g.quotesLoading=!1}},resetState(){g.selectedProvider=null,g.error=null,g.purchaseCurrency=u,g.paymentCurrency=p,g.purchaseCurrencies=[u],g.paymentCurrencies=[],g.paymentAmount=void 0,g.purchaseAmount=void 0,g.quotesLoading=!1}})},83931:(e,t,i)=>{"use strict";i.d(t,{z:()=>a});var r=i(92679),n=i(3125);let s=(0,r.BX)({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0,initialized:!1,connectingWallet:void 0}),a={state:s,subscribe:e=>(0,r.B1)(s,()=>e(s)),subscribeOpen:e=>(0,n.u$)(s,"open",e),set(e){Object.assign(s,{...s,...e})}}},84915:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(34175),a=i(94895),o=i(69428);let l=(0,r.AH)`
6566  :host {
6567    display: flex;
6568  }
6569
6570  :host([data-size='sm']) > svg {
6571    width: 12px;
6572    height: 12px;
6573  }
6574
6575  :host([data-size='md']) > svg {
6576    width: 16px;
6577    height: 16px;
6578  }
6579
6580  :host([data-size='lg']) > svg {
6581    width: 24px;
6582    height: 24px;
6583  }
6584
6585  :host([data-size='xl']) > svg {
6586    width: 32px;
6587    height: 32px;
6588  }
6589
6590  svg {
6591    animation: rotate 1.4s linear infinite;
6592    color: var(--local-color);
6593  }
6594
6595  :host([data-size='md']) > svg > circle {
6596    stroke-width: 6px;
6597  }
6598
6599  :host([data-size='sm']) > svg > circle {
6600    stroke-width: 8px;
6601  }
6602
6603  @keyframes rotate {
6604    100% {
6605      transform: rotate(360deg);
6606    }
6607  }
6608`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{constructor(){super(...arguments),this.color="primary",this.size="lg"}render(){let e={primary:s.f.tokens.theme.textPrimary,secondary:s.f.tokens.theme.textSecondary,tertiary:s.f.tokens.theme.textTertiary,invert:s.f.tokens.theme.textInvert,error:s.f.tokens.core.textError,warning:s.f.tokens.core.textWarning,"accent-primary":s.f.tokens.core.textAccentPrimary};return this.style.cssText=`
6609      --local-color: ${"inherit"===this.color?"inherit":e[this.color]};
6610      `,this.dataset.size=this.size,(0,r.qy)`<svg viewBox="0 0 16 17" fill="none">
6611      <path
6612        d="M8.75 2.65625V4.65625C8.75 4.85516 8.67098 5.04593 8.53033 5.18658C8.38968 5.32723 8.19891 5.40625 8 5.40625C7.80109 5.40625 7.61032 5.32723 7.46967 5.18658C7.32902 5.04593 7.25 4.85516 7.25 4.65625V2.65625C7.25 2.45734 7.32902 2.26657 7.46967 2.12592C7.61032 1.98527 7.80109 1.90625 8 1.90625C8.19891 1.90625 8.38968 1.98527 8.53033 2.12592C8.67098 2.26657 8.75 2.45734 8.75 2.65625ZM14 7.90625H12C11.8011 7.90625 11.6103 7.98527 11.4697 8.12592C11.329 8.26657 11.25 8.45734 11.25 8.65625C11.25 8.85516 11.329 9.04593 11.4697 9.18658C11.6103 9.32723 11.8011 9.40625 12 9.40625H14C14.1989 9.40625 14.3897 9.32723 14.5303 9.18658C14.671 9.04593 14.75 8.85516 14.75 8.65625C14.75 8.45734 14.671 8.26657 14.5303 8.12592C14.3897 7.98527 14.1989 7.90625 14 7.90625ZM11.3588 10.9544C11.289 10.8846 11.2062 10.8293 11.115 10.7915C11.0239 10.7538 10.9262 10.7343 10.8275 10.7343C10.7288 10.7343 10.6311 10.7538 10.54 10.7915C10.4488 10.8293 10.366 10.8846 10.2963 10.9544C10.2265 11.0241 10.1711 11.107 10.1334 11.1981C10.0956 11.2893 10.0762 11.387 10.0762 11.4856C10.0762 11.5843 10.0956 11.682 10.1334 11.7731C10.1711 11.8643 10.2265 11.9471 10.2963 12.0169L11.7106 13.4312C11.8515 13.5721 12.0426 13.6513 12.2419 13.6513C12.4411 13.6513 12.6322 13.5721 12.7731 13.4312C12.914 13.2904 12.9932 13.0993 12.9932 12.9C12.9932 12.7007 12.914 12.5096 12.7731 12.3687L11.3588 10.9544ZM8 11.9062C7.80109 11.9062 7.61032 11.9853 7.46967 12.1259C7.32902 12.2666 7.25 12.4573 7.25 12.6562V14.6562C7.25 14.8552 7.32902 15.0459 7.46967 15.1866C7.61032 15.3272 7.80109 15.4062 8 15.4062C8.19891 15.4062 8.38968 15.3272 8.53033 15.1866C8.67098 15.0459 8.75 14.8552 8.75 14.6562V12.6562C8.75 12.4573 8.67098 12.2666 8.53033 12.1259C8.38968 11.9853 8.19891 11.9062 8 11.9062ZM4.64125 10.9544L3.22688 12.3687C3.08598 12.5096 3.00682 12.7007 3.00682 12.9C3.00682 13.0993 3.08598 13.2904 3.22688 13.4312C3.36777 13.5721 3.55887 13.6513 3.75813 13.6513C3.95738 13.6513 4.14848 13.5721 4.28937 13.4312L5.70375 12.0169C5.84465 11.876 5.9238 11.6849 5.9238 11.4856C5.9238 11.2864 5.84465 11.0953 5.70375 10.9544C5.56285 10.8135 5.37176 10.7343 5.1725 10.7343C4.97324 10.7343 4.78215 10.8135 4.64125 10.9544ZM4.75 8.65625C4.75 8.45734 4.67098 8.26657 4.53033 8.12592C4.38968 7.98527 4.19891 7.90625 4 7.90625H2C1.80109 7.90625 1.61032 7.98527 1.46967 8.12592C1.32902 8.26657 1.25 8.45734 1.25 8.65625C1.25 8.85516 1.32902 9.04593 1.46967 9.18658C1.61032 9.32723 1.80109 9.40625 2 9.40625H4C4.19891 9.40625 4.38968 9.32723 4.53033 9.18658C4.67098 9.04593 4.75 8.85516 4.75 8.65625ZM4.2875 3.88313C4.1466 3.74223 3.95551 3.66307 3.75625 3.66307C3.55699 3.66307 3.3659 3.74223 3.225 3.88313C3.0841 4.02402 3.00495 4.21512 3.00495 4.41438C3.00495 4.61363 3.0841 4.80473 3.225 4.94562L4.64125 6.35813C4.78215 6.49902 4.97324 6.57818 5.1725 6.57818C5.37176 6.57818 5.56285 6.49902 5.70375 6.35813C5.84465 6.21723 5.9238 6.02613 5.9238 5.82688C5.9238 5.62762 5.84465 5.43652 5.70375 5.29563L4.2875 3.88313Z"
6613        fill="currentColor"
6614      />
6615    </svg>`}};d.styles=[a.W5,l],c([(0,n.MZ)()],d.prototype,"color",void 0),c([(0,n.MZ)()],d.prototype,"size",void 0),d=c([(0,o.E)("wui-loading-spinner")],d)},85291:(e,t,i)=>
6615{let r=i(66513).getSymbolSize;t.getPositions=function(e){let t=r(e);return[[0,0],[t-7,0],[0,t-7]]}},85410:(e,t,i)=>{let r=i(30567),n=i(66513);function s(e){this.mode=r.KANJI,this.data=e}s.getBitsLength=function(e){return 13*e},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let i=n.toSJIS(this.data[t]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");i=(i>>>8&255)*192+(255&i),e.put(i,13)}},e.exports=s},86212:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(82016);var s=i(94895),a=i(69428),o=i(34175);let l=(0,o.AH)`
6616  :host {
6617    display: flex;
6618    justify-content: center;
6619    align-items: center;
6620    width: 40px;
6621    height: 40px;
6622    border-radius: ${({borderRadius:e})=>e["20"]};
6623    overflow: hidden;
6624  }
6625
6626  wui-icon {
6627    width: 100%;
6628    height: 100%;
6629  }
6630`;var c=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends r.WF{constructor(){super(...arguments),this.logo="google"}render(){return(0,r.qy)`<wui-icon color="inherit" size="inherit" name=${this.logo}></wui-icon> `}};d.styles=[s.W5,l],c([(0,n.MZ)()],d.prototype,"logo",void 0),d=c([(0,a.E)("wui-logo")],d)},87850:(e,t,i)=>{"use strict";i.d(t,{JW:()=>I,XX:()=>z,c0:()=>N,ej:()=>S,ge:()=>H,qy:()=>_,s6:()=>k});let r=globalThis,n=e=>e,s=r.trustedTypes,a=s?s.createPolicy("lit-html",{createHTML:e=>e}):void 0,o="$lit$",l=`lit$${Math.random().toFixed(9).slice(2)}$`,c="?"+l,d=`<${c}>`,h=document,u=()=>h.createComment(""),p=e=>null===e||"object"!=typeof e&&"function"!=typeof e,f=Array.isArray,g=e=>f(e)||"function"==typeof e?.[Symbol.iterator],m="[ 	\n\f\r]",w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,b=/>/g,v=RegExp(`>|${m}(?:([^\\s"'>=/]+)(${m}*=${m}*(?:[^ 	
6631\f\r"'\`<>=]|("|')|))|$)`,"g"),C=/'/g,E=/"/g,x=/^(?:script|style|textarea|title)$/i,A=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),_=A(1),I=A(2),S=A(3),N=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),T=new WeakMap,O=h.createTreeWalker(h,129);function R(e,t){if(!f(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==a?a.createHTML(t):t}let P=(e,t)=>{let i=e.length-1,r=[],n,s=2===t?"<svg>":3===t?"<math>":"",a=w;for(let t=0;t<i;t++){let i=e[t],c,h,u=-1,p=0;for(;p<i.length&&(a.lastIndex=p,null!==(h=a.exec(i)));)p=a.lastIndex,a===w?"!--"===h[1]?a=y:void 0!==h[1]?a=b:void 0!==h[2]?(x.test(h[2])&&(n=RegExp("</"+h[2],"g")),a=v):void 0!==h[3]&&(a=v):a===v?">"===h[0]?(a=n??w,u=-1):void 0===h[1]?u=-2:(u=a.lastIndex-h[2].length,c=h[1],a=void 0===h[3]?v:'"'===h[3]?E:C):a===E||a===C?a=v:a===y||a===b?a=w:(a=v,n=void 0);let f=a===v&&e[t+1].startsWith("/>")?" ":"";s+=a===w?i+d:u>=0?(r.push(c),i.slice(0,u)+o+i.slice(u)+l+f):i+l+(-2===u?t:f)}return[R(e,s+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),r]};class ${constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let n=0,a=0;const d=e.length-1,h=this.parts,[p,f]=P(e,t);if(this.el=$.createElement(p,i),O.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(r=O.nextNode())&&h.length<d;){if(1===r.nodeType){if(r.hasAttributes())for(const e of r.getAttributeNames())if(e.endsWith(o)){const t=f[a++],i=r.getAttribute(e).split(l),s=/([.?@])?(.*)/.exec(t);h.push({type:1,index:n,name:s[2],strings:i,ctor:"."===s[1]?W:"?"===s[1]?B:"@"===s[1]?j:L}),r.removeAttribute(e)}else e.startsWith(l)&&(h.push({type:6,index:n}),r.removeAttribute(e));if(x.test(r.tagName)){const e=r.textContent.split(l),t=e.length-1;if(t>0){r.textContent=s?s.emptyScript:"";for(let i=0;i<t;i++)r.append(e[i],u()),O.nextNode(),h.push({type:2,index:++n});r.append(e[t],u())}}}else if(8===r.nodeType)if(r.data===c)h.push({type:2,index:n});else{let e=-1;for(;-1!==(e=r.data.indexOf(l,e+1));)h.push({type:7,index:n}),e+=l.length-1}n++}}static createElement(e,t){let i=h.createElement("template");return i.innerHTML=e,i}}function U(e,t,i=e,r){if(t===N)return t;let n=void 0!==r?i._$Co?.[r]:i._$Cl,s=p(t)?void 0:t._$litDirective$;return n?.constructor!==s&&(n?._$AO?.(!1),void 0===s?n=void 0:(n=new s(e))._$AT(e,i,r),void 0!==r?(i._$Co??=[])[r]=n:i._$Cl=n),void 0!==n&&(t=U(e,n._$AS(e,t.values),n,r)),t}class M{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,r=(e?.creationScope??h).importNode(t,!0);O.currentNode=r;let n=O.nextNode(),s=0,a=0,o=i[0];for(;void 0!==o;){if(s===o.index){let t;2===o.type?t=new D(n,n.nextSibling,this,e):1===o.type?t=new o.ctor(n,o.name,o.strings,this,e):6===o.type&&(t=new F(n,this,e)),this._$AV.push(t),o=i[++a]}s!==o?.index&&(n=O.nextNode(),s++)}return O.currentNode=h,r}p(e){let t=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class D{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.
6631isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){p(e=U(this,e,t))?e===k||null==e||""===e?(this._$AH!==k&&this._$AR(),this._$AH=k):e!==this._$AH&&e!==N&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):g(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==k&&p(this._$AH)?this._$AA.nextSibling.data=e:this.T(h.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,r="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=$.createElement(R(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new M(r,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=T.get(e.strings);return void 0===t&&T.set(e.strings,t=new $(e)),t}k(e){f(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,r=0;for(let n of e)r===t.length?t.push(i=new D(this.O(u()),this.O(u()),this,this.options)):i=t[r],i._$AI(n),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=n(e).nextSibling;n(e).remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class L{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,n){this.type=1,this._$AH=k,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=k}_$AI(e,t=this,i,r){let n=this.strings,s=!1;if(void 0===n)(s=!p(e=U(this,e,t,0))||e!==this._$AH&&e!==N)&&(this._$AH=e);else{let r,a,o=e;for(e=n[0],r=0;r<n.length-1;r++)(a=U(this,o[i+r],t,r))===N&&(a=this._$AH[r]),s||=!p(a)||a!==this._$AH[r],a===k?e=k:e!==k&&(e+=(a??"")+n[r+1]),this._$AH[r]=a}s&&!r&&this.j(e)}j(e){e===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class W extends L{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===k?void 0:e}}class B extends L{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==k)}}class j extends L{constructor(e,t,i,r,n){super(e,t,i,r,n),this.type=5}
6631_$AI(e,t=this){if((e=U(this,e,t,0)??k)===N)return;let i=this._$AH,r=e===k&&i!==k||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==k&&(i===k||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class F{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){U(this,e)}}let H={M:o,P:l,A:c,C:1,L:P,R:M,D:g,V:U,I:D,H:L,N:B,U:j,B:W,F:F},q=r.litHtmlPolyfillSupport;q?.($,D),(r.litHtmlVersions??=[]).push("3.3.2");let z=(e,t,i)=>{let r=i?.renderBefore??t,n=r._$litPart$;if(void 0===n){let e=i?.renderBefore??null;r._$litPart$=n=new D(t.insertBefore(u(),e),e,void 0,i??{})}return n._$AI(e),n}},88088:(e,t,i)=>{"use strict";i.d(t,{WF:()=>a,AH:()=>r.AH,qy:()=>n.qy,JW:()=>n.JW,iz:()=>r.iz});var r=i(36424),n=i(87850);let s=globalThis;class a extends r.mN{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=(0,n.XX)(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return n.c0}}a._$litElement$=!0,a.finalized=!0,s.litElementHydrateSupport?.({LitElement:a});let o=s.litElementPolyfillSupport;o?.({LitElement:a}),(s.litElementVersions??=[]).push("4.2.2")},88120:(e,t,i)=>{let r=i(549);t.render=function(e,t,i){var n;let s=i,a=t;void 0!==s||t&&t.getContext||(s=t,t=void 0),t||(a=function(){try{return document.createElement("canvas")}catch(e){throw Error("You need to specify a canvas element")}}()),s=r.getOptions(s);let o=r.getImageWidth(e.modules.size,s),l=a.getContext("2d"),c=l.createImageData(o,o);return r.qrToImageData(c.data,e,s),n=a,l.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=o,n.width=o,n.style.height=o+"px",n.style.width=o+"px",l.putImageData(c,0,0),a},t.renderToDataURL=function(e,i,r){let n=r;void 0!==n||i&&i.getContext||(n=i,i=void 0),n||(n={});let s=t.render(e,i,n),a=n.type||"image/png",o=n.rendererOpts||{};return s.toDataURL(a,o.quality)}},88364:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(40859),a=i(94895),o=i(69428),l=i(34175);let c=(0,l.AH)`
6632  :host {
6633    display: block;
6634    width: var(--local-width);
6635    height: var(--local-height);
6636  }
6637
6638  img {
6639    display: block;
6640    width: 100%;
6641    height: 100%;
6642    object-fit: cover;
6643    object-position: center center;
6644    border-radius: inherit;
6645    user-select: none;
6646    user-drag: none;
6647    -webkit-user-drag: none;
6648    -khtml-user-drag: none;
6649    -moz-user-drag: none;
6650    -o-user-drag: none;
6651  }
6652
6653  :host([data-boxed='true']) {
6654    width: 40px;
6655    height: 40px;
6656    display: flex;
6657    align-items: center;
6658    justify-content: center;
6659    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
6660    border-radius: ${({borderRadius:e})=>e[2]};
6661  }
6662
6663  :host([data-boxed='true']) img {
6664    width: 20px;
6665    height: 20px;
6666    border-radius: ${({borderRadius:e})=>e[16]};
6667  }
6668
6669  :host([data-full='true']) img {
6670    width: 100%;
6671    height: 100%;
6672  }
6673
6674  :host([data-boxed='true']) wui-icon {
6675    width: 20px;
6676    height: 20px;
6677  }
6678
6679  :host([data-icon='error']) {
6680    background-color: ${({tokens:e})=>e.core.backgroundError};
6681  }
6682
6683  :host([data-rounded='true']) {
6684    border-radius: ${({borderRadius:e})=>e[16]};
6685  }
6686`;var d=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let h=class extends r.WF{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0,this.boxed=!1,this.rounded=!1,this.fullSize=!1}
6686render(){let e={inherit:"inherit",xxs:"2",xs:"3",sm:"4",md:"4",mdl:"5",lg:"5",xl:"6",xxl:"7","3xl":"8","4xl":"9","5xl":"10"};return(this.style.cssText=`
6687      --local-width: ${this.size?`var(--apkt-spacing-${e[this.size]});`:"100%"};
6688      --local-height: ${this.size?`var(--apkt-spacing-${e[this.size]});`:"100%"};
6689      `,this.dataset.boxed=this.boxed?"true":"false",this.dataset.rounded=this.rounded?"true":"false",this.dataset.full=this.fullSize?"true":"false",this.dataset.icon=this.iconColor||"inherit",this.icon)?(0,r.qy)`<wui-icon
6690        color=${this.iconColor||"inherit"}
6691        name=${this.icon}
6692        size="lg"
6693      ></wui-icon> `:this.logo?(0,r.qy)`<wui-icon size="lg" color="inherit" name=${this.logo}></wui-icon> `:(0,r.qy)`<img src=${(0,s.J)(this.src)} alt=${this.alt} @error=${this.handleImageError} />`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};h.styles=[a.W5,c],d([(0,n.MZ)()],h.prototype,"src",void 0),d([(0,n.MZ)()],h.prototype,"logo",void 0),d([(0,n.MZ)()],h.prototype,"icon",void 0),d([(0,n.MZ)()],h.prototype,"iconColor",void 0),d([(0,n.MZ)()],h.prototype,"alt",void 0),d([(0,n.MZ)()],h.prototype,"size",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"boxed",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"rounded",void 0),d([(0,n.MZ)({type:Boolean})],h.prototype,"fullSize",void 0),h=d([(0,o.E)("wui-image")],h)},88570:(e,t,i)=>{"use strict";i.d(t,{g:()=>f});var r=i(72594),n=i(34386),s=i(92929),a=i(1024),o=i(60319),l=i(11446),c=i(11403),d=i(37056),h=i(66395),u=i(5820),p=i(7046);let f={getConnectorsByType(e,t,i){let{customWallets:r}=c.H.state,n=u.i.getRecentWallets(),s=p.A.filterOutDuplicateWallets(t),a=p.A.filterOutDuplicateWallets(i),o=e.filter(e=>"MULTI_CHAIN"===e.type),l=e.filter(e=>"ANNOUNCED"===e.type),d=e.filter(e=>"INJECTED"===e.type);return{custom:r,recent:n,external:e.filter(e=>"EXTERNAL"===e.type),multiChain:o,announced:l,injected:d,recommended:s,featured:a}},showConnector(e){let t=e.info?.rdns,i=!!t&&s.N.state.excludedWallets.some(e=>!!e.rdns&&e.rdns===t),n=!!e.name&&s.N.state.excludedWallets.some(t=>r.y.isLowerCaseMatch(t.name,e.name));if("INJECTED"===e.type&&("Browser Wallet"===e.name&&(!d.w.isMobile()||d.w.isMobile()&&!t&&!o.x.checkInstalled())||i||n))return!1;return"ANNOUNCED"!==e.type&&"EXTERNAL"!==e.type||!i&&!n},getIsConnectedWithWC:()=>Array.from(a.W.state.chains.values()).some(e=>l.a.getConnectorId(e.namespace)===n.o.CONNECTOR_ID.WALLET_CONNECT),getConnectorTypeOrder({recommended:e,featured:t,custom:i,recent:r,announced:n,injected:s,multiChain:a,external:o,overriddenConnectors:l=c.H.state.features?.connectorTypeOrder??[]}){let d=[{type:"walletConnect",isEnabled:!0},{type:"recent",isEnabled:r.length>0},{type:"injected",isEnabled:[...s,...n,...a].length>0},{type:"featured",isEnabled:t.length>0},{type:"custom",isEnabled:i&&i.length>0},{type:"external",isEnabled:o.length>0},{type:"recommended",isEnabled:e.length>0}].filter(e=>e.isEnabled),h=new Set(d.map(e=>e.type)),u=l.filter(e=>h.has(e)).map(e=>({type:e,isEnabled:!0})),p=d.filter(({type:e})=>!u.some(({type:t})=>t===e));return Array.from(new Set([...u,...p].map(({type:e})=>e)))},sortConnectorsByExplorerWallet:e=>[...e].sort((e,t)=>e.explorerWallet&&t.explorerWallet?(e.explorerWallet.order??0)-(t.explorerWallet.order??0):e.explorerWallet?-1:+!!t.explorerWallet),getPriority:e=>e.id===n.o.CONNECTOR_ID.BASE_ACCOUNT?0:e.id===n.o.CONNECTOR_ID.COINBASE||e.id===n.o.CONNECTOR_ID.COINBASE_SDK?1:2,sortConnectorsByPriority:e=>[...e].sort((e,t)=>f.getPriority(e)-f.getPriority(t)),getAuthName:({email:e,socialUsername:t,socialProvider:i})=>t?i&&"discord"===i&&t.endsWith("0")?t.slice(0,-1):t:e.length>30?`${e.slice(0,-3)}...`:e,async fetchProviderData(e){try{if("Browser Wallet"===e.name&&!d.w.isMobile()||e.id===n.o.CONNECTOR_ID.AUTH)return{accounts:[],chainId:void 0};let[t,i]=await Promise.all([e.provider?.request({method:"eth_accounts"}),e.provider?.request({method:"eth_chainId"}).then(e=>Number(e))]);return{accounts:t,chainId:i}}catch(t){return console.warn(`Failed to fetch provider data for ${e.name}`,t),{accounts:[],chainId:void 0}}},getFilteredCustomWallets(e){let t=u.i.getRecentWallets(),i=l.a.state.connectors.map(e=>
6693e.info?.rdns).filter(Boolean),r=t.map(e=>e.rdns).filter(Boolean),n=i.concat(r);if(n.includes("io.metamask.mobile")&&d.w.isMobile()){let e=n.indexOf("io.metamask.mobile");n[e]="io.metamask"}return e.filter(e=>!n.includes(String(e?.rdns)))},hasWalletConnector:e=>l.a.state.connectors.some(t=>t.id===e.id||t.name===e.name),isWalletCompatibleWithCurrentChain(e){let t=a.W.state.activeChain;return!t||!e.chains||e.chains.some(e=>t===e.split(":")[0])},getFilteredRecentWallets(){return u.i.getRecentWallets().filter(e=>!p.A.isExcluded(e)).filter(e=>!this.hasWalletConnector(e)).filter(e=>this.isWalletCompatibleWithCurrentChain(e))},getCappedRecommendedWallets(e){let{connectors:t}=l.a.state,{customWallets:i,featuredWalletIds:r}=c.H.state,n=t.find(e=>"walletConnect"===e.id),s=t.filter(e=>"INJECTED"===e.type||"ANNOUNCED"===e.type||"MULTI_CHAIN"===e.type);if(!n&&!s.length&&!i?.length)return[];let a=h.D.isEmailEnabled(),o=h.D.isSocialsEnabled(),d=s.filter(e=>"Browser Wallet"!==e.name&&"WalletConnect"!==e.name),u=Math.max(0,4-((r?.length||0)+(i?.length||0)+(d.length||0)+ +!!a+ +!!o));return u<=0?[]:p.A.filterOutDuplicateWallets(e).slice(0,u)},processConnectorsByType(e,t=!0){let i=f.sortConnectorsByExplorerWallet([...e]);return t?i.filter(f.showConnector):i},connectorList(){let e=f.getConnectorsByType(l.a.state.connectors,s.N.state.recommended,s.N.state.featured),t=this.processConnectorsByType(e.announced.filter(e=>"walletConnect"!==e.id)),i=this.processConnectorsByType(e.injected),r=this.processConnectorsByType(e.multiChain.filter(e=>"WalletConnect"!==e.name),!1),a=e.custom,o=e.recent,c=this.processConnectorsByType(e.external.filter(e=>e.id!==n.o.CONNECTOR_ID.COINBASE_SDK&&e.id!==n.o.CONNECTOR_ID.BASE_ACCOUNT)),h=e.recommended,u=e.featured,p=f.getConnectorTypeOrder({custom:a,recent:o,announced:t,injected:i,multiChain:r,recommended:h,featured:u,external:c}),g=l.a.state.connectors.find(e=>"walletConnect"===e.id),m=d.w.isMobile(),w=[];for(let e of p)switch(e){case"walletConnect":!m&&g&&w.push({kind:"connector",subtype:"walletConnect",connector:g});break;case"recent":f.getFilteredRecentWallets().forEach(e=>w.push({kind:"wallet",subtype:"recent",wallet:e}));break;case"injected":r.forEach(e=>w.push({kind:"connector",subtype:"multiChain",connector:e})),t.forEach(e=>w.push({kind:"connector",subtype:"announced",connector:e}
6693)),i.forEach(e=>w.push({kind:"connector",subtype:"injected",connector:e}));break;case"featured":u.forEach(e=>w.push({kind:"wallet",subtype:"featured",wallet:e}));break;case"custom":f.getFilteredCustomWallets(a??[]).forEach(e=>w.push({kind:"wallet",subtype:"custom",wallet:e}));break;case"external":c.forEach(e=>w.push({kind:"connector",subtype:"external",connector:e}));break;case"recommended":f.getCappedRecommendedWallets(h).forEach(e=>w.push({kind:"wallet",subtype:"recommended",wallet:e}));break;default:console.warn(`Unknown connector type: ${e}`)}return w},hasInjectedConnectors:()=>l.a.state.connectors.filter(e=>("INJECTED"===e.type||"ANNOUNCED"===e.type||"MULTI_CHAIN"===e.type)&&"Browser Wallet"!==e.name&&"WalletConnect"!==e.name).length}},88893:function(e){e.exports={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],i=e%100;return"["+e+(t[(i-20)%10]||t[i]||t[0])+"]"}}},89219:(e,t,i)=>{"use strict";i.d(t,{F:()=>l}),i(45027);var r=i(34386),n=i(41300),s=i(43587),a=i(1024),o=i(11403);class l{constructor({provider:e,namespace:t}){this.id=r.o.CONNECTOR_ID.WALLET_CONNECT,this.name="WalletConnect",this.type="WALLET_CONNECT",this.imageId="ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",this.getCaipNetworks=a.W.getCaipNetworks.bind(a.W),this.caipNetworks=this.getCaipNetworks(),this.provider=e,this.chain=t}get chains(){return this.getCaipNetworks()}async connectWalletConnect(){if(!await this.authenticate()){let e=this.getCaipNetworks(),t=o.H.state.universalProviderConfigOverride,i=s.k.createNamespaces(e,t);await this.provider.connect({optionalNamespaces:i})}return{clientId:await this.provider.client.core.crypto.getClientId(),session:this.provider.session}}async disconnect(){await this.provider.disconnect()}async authenticate(){let e=this.chains.map(e=>e.caipNetworkId);return n.U.universalProviderAuthenticate({universalProvider:this.provider,chains:e,methods:c})}}let c=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"]},89373:(e,t,i)=>{"use strict";i.d(t,{Up:()=>f});var r=i(92679),n=i(34386),s=i(1024),a=i(11446),o=i(43242),l=i(44458),c=i(44963),d=i(37056),h=i(5820);async function u(){l.I.push("ConnectingFarcaster");let e=a.a.getAuthConnector();if(e){let t=s.W.getAccountData();if(!t?.farcasterUrl)try{let{url:t}=await e.provider.getFarcasterUri();s.W.setAccountProp("farcasterUrl",t,s.W.state.activeChain)}catch(e){l.I.goBack(),c.P.showError(e)}}}async function p(e){l.I.push("ConnectingSocial");let t=a.a.getAuthConnector(),i=null;try{let a=setTimeout(()=>{throw Error("Social login timed out. Please try again.")},45e3);if(t&&e){if(d.w.isTelegram()||(i=function(){try{return d.w.returnOpenHref(`${n.o.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes")}catch(e){throw Error("Could not open social popup")}}()),i)s.W.setAccountProp("socialWindow",(0,r.KR)(i),s.W.state.activeChain);else if(!d.w.isTelegram())throw Error("Could not create social popup");let{uri:o}=await t.provider.getSocialRedirectUri({provider:e});if(!o)throw i?.close(),Error("Could not fetch the social redirect uri");if(i&&(i.location.href=o),d.w.isTelegram()){h.i.setTelegramSocialProvider(e);let t=d.w.formatTelegramSocialLoginUrl(o);d.w.openHref(t,"_top")}clearTimeout(a)}}catch(r){i?.close();let t=d.w.parseError(r);c.P.showError(t),o.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:t}})}}async function f(e){s.W.setAccountProp("socialProvider",e,s.W.state.activeChain),o.E.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}
6693),"farcaster"===e?await u():await p(e)}},92087:(e,t,i)=>{"use strict";i.d(t,{v:()=>o});let r=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],n=[{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],s=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}];var a=i(34386);let o={getERC20Abi:e=>a.o.USDT_CONTRACT_ADDRESSES.includes(e)?s:r,getSwapAbi:()=>n}},92122:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227);i(82016),i(88364),i(47002);var s=i(768);function a(e,t,i){return e!==t&&(e-t<0?t-e:e-t)<=i+.1}let o={generate({uri:e,size:t,logoSize:i,padding:n=8,dotColor:o="var(--apkt-colors-black)"}){let l,c,d=[],h=(c=Math.sqrt((l=Array.prototype.slice.call(s.create(e,{errorCorrectionLevel:"Q"}).modules.data,0)).length),l.reduce((e,t,i)=>(i%c==0?e.push([t]):e[e.length-1].push(t))&&e,[])),u=(t-2*n)/h.length,p=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];p.forEach(({x:e,y:t})=>{let i=(h.length-7)*u*e+n,s=(h.length-7)*u*t+n;for(let e=0;e<p.length;e+=1){let t=u*(7-2*e);d.push((0,r.JW)`
6694            <rect
6695              fill=${2===e?"var(--apkt-colors-black)":"var(--apkt-colors-white)"}
6696              width=${0===e?t-10:t}
6697              rx= ${0===e?(t-10)*.45:.45*t}
6698              ry= ${0===e?(t-10)*.45:.45*t}
6699              stroke=${o}
6700              stroke-width=${10*(0===e)}
6701              height=${0===e?t-10:t}
6702              x= ${0===e?s+u*e+5:s+u*e}
6703              y= ${0===e?i+u*e+5:i+u*e}
6704            />
6705          `)}});let f=Math.floor((i+25)/u),g=h.length/2-f/2,m=h.length/2+f/2-1,w=[];h.forEach((e,t)=>{e.forEach((e,i)=>{!h[t][i]||t<7&&i<7||t>h.length-8&&i<7||t<7&&i>h.length-8||t>g&&t<m&&i>g&&i<m||w.push([t*u+u/2+n,i*u+u/2+n])})});let y={};return w.forEach(([e,t])=>{y[e]?y[e]?.push(t):y[e]=[t]}),Object.entries(y).map(([e,t])=>{let i=t.filter(e=>t.every(t=>!a(e,t,u)));return[Number(e),i]}).forEach(([e,t])=>{t.forEach(t=>{d.push((0,r.JW)`<circle cx=${e} cy=${t} fill=${o} r=${u/2.5} />`)})}),Object.entries(y).filter(([e,t])=>t.length>1).map(([e,t])=>{let i=t.filter(e=>t.some(t=>a(e,t,u)));return[Number(e),i]}).map(([e,t])=>{t.sort((e,t)=>e<t?-1:1);let i=[];for(let e of t){let t=i.find(t=>t.some(t=>a(e,t,u)));t?t.push(e):i.push([e])}return[e,i.map(e=>[e[0],e[e.length-1]])]}).forEach(([e,t])=>{t.forEach(([t,i])=>{d.push((0,r.JW)`
6706              <line
6707                x1=${e}
6708                x2=${e}
6709                y1=${t}
6710                y2=${i}
6711                stroke=${o}
6712                stroke-width=${u/1.25}
6713                stroke-linecap="round"
6714              />
6715            `)})}),d}};var l=i(94895),c=i(69428),d=i(34175);let h=(0,d.AH)`
6716  :host {
6717    position: relative;
6718    user-select: none;
6719    display: block;
6720    overflow: hidden;
6721    aspect-ratio: 1 / 1;
6722    width: 100%;
6723    height: 100%;
6724    background-color: ${({colors:e})=>e.white};
6725    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
6726  }
6727
6728  :host {
6729    border-radius: ${({borderRadius:e})=>e[4]};
6730    display: flex;
6731    align-items: center;
6732    justify-content: center;
6733  }
6734
6735  :host([data-clear='true']) > wui-icon {
6736    display: none;
6737  }
6738
6739  svg:first-child,
6740  wui-image,
6741  wui-icon {
6742    position: absolute;
6743    top: 50%;
6744    left: 50%;
6745    transform: translateY(-50%) translateX(-50%);
6746    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
6747    box-shadow: inset 0 0 0 4px ${({tokens:e})=>e.theme.backgroundPrimary};
6748    border-radius: ${({borderRadius:e})=>e[6]};
6749  }
6750
6751  wui-image {
6752    width: 25%;
6753    height: 25%;
6754    border-radius: ${({borderRadius:e})=>e[2]};
6755  }
6756
6757  wui-icon {
6758    width: 100%;
6759    height: 100%;
6760    color: #3396ff !important;
6761    transform: translateY(-50%) translateX(-50%) scale(0.25);
6762  }
6763
6764  wui-icon > svg {
6765    width: inherit;
6766    height: inherit;
6767  }
6768`;var u=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let p=class extends r.WF{constructor(){super(...arguments),this.uri="",this.size=500,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),(0,r.qy)`<wui-flex
6769      alignItems="center"
6770      justifyContent="center"
6771      class="wui-qr-code"
6772      direction="column"
6773      gap="4"
6774      width="100%"
6775      style="height: 100%"
6776    >
6777      ${this.templateVisual()} ${this.templateSvg()}
6778    </wui-flex>`}templateSvg(){return(0,r.JW)`
6779      <svg viewBox="0 0 ${this.size} ${this.size}" width="100%" height="100%">
6780        ${o.generate({uri:this.uri,size:this.size,logoSize:this.arenaClear?0:this.size/4})}
6781      </svg>
6782    `}templateVisual(){return this.imageSrc?(0,r.qy)`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?(0,r.qy)`<wui-icon
6783        class="farcaster"
6784        size="inherit"
6785        color="inherit"
6786        name="farcaster"
6787      ></wui-icon>`:(0,r.qy)`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};p.styles=[l.W5,h],u([(0,n.MZ)()],p.prototype,"uri",void 0),u([(0,n.MZ)({type:Number})],p.prototype,"size",void 0),u([(0,n.MZ)()],p.prototype,"theme",void 0),u([(0,n.MZ)()],p.prototype,"imageSrc",void 0),u([(0,n.MZ)()],p.prototype,"alt",void 0),u([(0,n.MZ)({type:Boolean})],p.prototype,"arenaClear",void 0),u([(0,n.MZ)({type:Boolean})],p.prototype,"farcaster",void 0),p=u([(0,c.E)("wui-qr-code")],p)},92679:(e,t,i)=>{"use strict";i.d(t,{B1:()=>u,BX:()=>function e(t={}){let i,s,l;if(!n(t))throw Error("object required");let u=d.get(t);if(u)return u;let p=c[0],f=new Set,g=(e,t=++c[0])=>{p!==t&&(m=p=t,f.forEach(i=>
6787i(e,t)))},m=p,w=e=>(t,i)=>{let r=[...t];r[1]=[e,...r[1]],g(r,i)},y=new Map,b=!0,v=new Proxy(t,(i=()=>b,s=(e,t)=>{let i=!o.has(t)&&a.get(t);if(i){if(y.has(e))throw Error("prop listener already exists");if(f.size){let t=i[2](w(e));y.set(e,[i,t])}else y.set(e,[i])}},l=e=>{var t;let i=y.get(e);i&&(y.delete(e),null==(t=i[1])||t.call(i))},{deleteProperty(e,t){let i=Reflect.get(e,t);l(t);let r=Reflect.deleteProperty(e,t);return r&&g(["delete",[t],i]),r},set(t,c,u,p){let f,m=!i()&&Reflect.has(t,c),w=Reflect.get(t,c,p);if(m&&(h(w,u)||d.has(u)&&h(w,d.get(u))))return!0;l(c),n(u)&&(u=(0,r.Ai)(u)||u);let y=!a.has(u)&&n(f=u)&&!o.has(f)&&(Array.isArray(f)||!(Symbol.iterator in f))&&!(f instanceof WeakMap)&&!(f instanceof WeakSet)&&!(f instanceof Error)&&!(f instanceof Number)&&!(f instanceof Date)&&!(f instanceof String)&&!(f instanceof RegExp)&&!(f instanceof ArrayBuffer)&&!(f instanceof Promise)?e(u):u;return s(c,y),Reflect.set(t,c,y,p),g(["set",[c],u,w]),!0}}));d.set(t,v);let C=[t,(e=c[0])=>(m!==e&&(m=e,y.forEach(([t])=>{let i=t[1](e);i>p&&(p=i)})),p),e=>(f.add(e),1===f.size&&y.forEach(([e,t],i)=>{if(t)throw Error("remove already exists");let r=e[2](w(i));y.set(i,[e,r])}),()=>{f.delete(e),0===f.size&&y.forEach(([e,t],i)=>{t&&(t(),y.set(i,[e]))})})];return a.set(v,C),Reflect.ownKeys(t).forEach(e=>{let i=Object.getOwnPropertyDescriptor(t,e);"value"in i&&i.writable&&(v[e]=t[e])}),b=!1,v},KR:()=>f,P9:()=>p,h2:()=>g});var r=i(32535);let n=e=>"object"==typeof e&&null!==e,s=(e,t)=>{let i=l.get(e);if((null==i?void 0:i[0])===t)return i[1];let n=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return(0,r.OC)(n,!0),l.set(e,[t,n]),Reflect.ownKeys(e).forEach(t=>{if(Object.getOwnPropertyDescriptor(n,t))return;let i=Reflect.get(e,t),{enumerable:l}=Reflect.getOwnPropertyDescriptor(e,t),c={value:i,enumerable:l,configurable:!0};if(o.has(i))(0,r.OC)(i,!1);else if(a.has(i)){let[e,t]=a.get(i);c.value=s(e,t())}Object.defineProperty(n,t,c)}),Object.preventExtensions(n)},a=new WeakMap,o=new WeakSet,l=new WeakMap,c=[1],d=new WeakMap,h=Object.is;function u(e,t,i){let r,n=a.get(e);n||console.warn("Please use proxy object");let s=[],o=n[2],l=!1,c=o(e=>{(s.push(e),i)?t(s.splice(0)):r||(r=Promise.resolve().then(()=>{r=void 0,l&&t(s.splice(0))}))});return l=!0,()=>{l=!1,c()}}function p(e){let t=a.get(e);t||console.warn("Please use proxy object");let[i,r]=t;return s(i,r())}function f(e){return o.add(e),e}function g(){return{proxyStateMap:a,refSet:o,snapCache:l,versionHolder:c,proxyCache:d}}},92929:(e,t,i)=>{"use strict";i.d(t,{N:()=>b});var r=i(92679),n=i(3125),s=i(34386),a=i(48789),o=i(37056),l=i(75821),c=i(39564),d=i(5820),h=i(76581),u=i(1024),p=i(11446),f=i(43242),g=i(11403);let m=o.w.getApiUrl(),w=new l.Z({baseUrl:m,clientId:null}),y=(0,r.BX)({promises:{},page:1,count:0,featured:[],allFeatured:[],recommended:[],allRecommended:[],wallets:[],filteredWallets:[],search:[],isAnalyticsEnabled:!1,excludedWallets:[],isFetchingRecommendedWallets:!1,explorerWallets:[],explorerFilteredWallets:[],plan:{tier:"none",hasExceededUsageLimit:!1,limits:{isAboveRpcLimit:!1,isAboveMauLimit:!1}}}),b={state:y,subscribeKey:(e,t)=>(0,n.u$)(y,e,t),_getSdkProperties(){let{projectId:e,sdkType:t,sdkVersion:i}=g.H.state;return{projectId:e,st:t||"appkit",sv:i||"html-wagmi-4.2.2"}},_filterOutExtensions:e=>g.H.state.isUniversalProvider?e.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):e,async _fetchWalletImage(e){let t=`${w.baseUrl}/getWalletImage/${e}`,i=await w.getBlob({path:t,params:b._getSdkProperties()});h.j.setWalletImage(e,URL.createObjectURL(i))},async _fetchNetworkImage(e){let t=`${w.baseUrl}/public/getAssetImage/${e}`,i=await w.getBlob({path:t,params:b._getSdkProperties()});h.j.setNetworkImage(e,URL.createObjectURL(i))},async _fetchConnectorImage(e){let t=`${w.baseUrl}/public/getAssetImage/${e}`,i=await w.getBlob({path:t,params:b._getSdkProperties()});h.j.setConnectorImage(e,URL.createObjectURL(i))},async _fetchCurrencyImage(e){let t=`${w.baseUrl}/public/getCurrencyImage/${e}`,i=await w.getBlob({path:t,params:b._getSdkProperties()});h.j.setCurrencyImage(e,URL.createObjectURL(i))},async _fetchTokenImage(e){let t=`${w.baseUrl}/public/getTokenImage/${e}`,i=await w.getBlob({path:t,params:b._getSdkProperties()});h.j.setTokenImage(e,URL.createObjectURL(i))},_filterWalletsByPlatform(e){let t=e.length,i=o.w.isMobile()?e?.filter(e=>!!e.mobile_link||!!e.webapp_link||Object.values(c.O).map(e=>e.id).includes(e.id)):e,r=t-i.length;return{filteredWallets:i,mobileFilteredOutWalletsLength:r}},fetchProjectConfig:async()=>(await w.get({path:"/appkit/v1/config",params:b._getSdkProperties()})).features,async fetchUsage(){try{let{tier:e,isAboveMauLimit:t,isAboveRpcLim
6787it:i}=(await w.get({path:"/appkit/v1/project-limits",params:b._getSdkProperties()})).planLimits;b.state.plan={tier:e,hasExceededUsageLimit:"starter"===e&&(t||i),limits:{isAboveRpcLimit:i,isAboveMauLimit:t}}}catch(e){console.warn("Failed to fetch usage",e)}},async fetchAllowedOrigins(){try{let{allowedOrigins:e}=await w.get({path:"/projects/v1/origins",params:b._getSdkProperties()});return e}catch(e){if(e instanceof Error&&e.cause instanceof Response){let t=e.cause.status;if(t===s.o.HTTP_STATUS_CODES.TOO_MANY_REQUESTS)throw Error("RATE_LIMITED",{cause:e});if(t>=s.o.HTTP_STATUS_CODES.SERVER_ERROR&&t<600)throw Error("SERVER_ERROR",{cause:e})}return[]}},async fetchNetworkImages(){let e=u.W.getAllRequestedCaipNetworks(),t=e?.map(({assets:e})=>e?.imageId).filter(Boolean).filter(e=>!a.$.getNetworkImageById(e));t&&await Promise.allSettled(t.map(e=>b._fetchNetworkImage(e)))},async fetchConnectorImages(){let{connectors:e}=p.a.state,t=e.map(({imageId:e})=>e).filter(Boolean);await Promise.allSettled(t.map(e=>b._fetchConnectorImage(e)))},async fetchCurrencyImages(e=[]){await Promise.allSettled(e.map(e=>b._fetchCurrencyImage(e)))},async fetchTokenImages(e=[]){await Promise.allSettled(e.map(e=>b._fetchTokenImage(e)))},async fetchWallets(e){let t=e.exclude??[];
6787b._getSdkProperties().sv.startsWith("html-core-")&&t.push(...Object.values(c.O).map(e=>e.id));let i=await w.get({path:"/getWallets",params:{...b._getSdkProperties(),...e,page:String(e.page),entries:String(e.entries),include:e.include?.join(","),exclude:t.join(",")}}),{filteredWallets:r,mobileFilteredOutWalletsLength:n}=b._filterWalletsByPlatform(i?.data);return{data:r||[],count:i?.count,mobileFilteredOutWalletsLength:n}},async prefetchWalletRanks(){let e=p.a.state.connectors;if(!e?.length)return;let t={page:1,entries:20,badge:"certified"};if(t.names=e.map(e=>e.name).join(","),u.W.state.activeChain===s.o.CHAIN.EVM){let i=[...e.flatMap(e=>e.connectors?.map(e=>e.info?.rdns)||[]),...e.map(e=>e.info?.rdns)].filter(e=>"string"==typeof e&&e.length>0);i.length&&(t.rdns=i.join(","))}let{data:i}=await b.fetchWallets(t);y.explorerWallets=i,p.a.extendConnectorsWithExplorerWallets(i);let r=u.W.getRequestedCaipNetworkIds().join(",");y.explorerFilteredWallets=i.filter(e=>e.chains?.some(e=>r.includes(e)))},async fetchFeaturedWallets(){let{featuredWalletIds:e}=g.H.state;if(e?.length){let t={...b._getSdkProperties(),page:1,entries:e?.length??4,include:e},{data:i}=await b.fetchWallets(t),r=[...i].sort((t,i)=>e.indexOf(t.id)-e.indexOf(i.id)),n=r.map(e=>e.image_id).filter(Boolean);await Promise.allSettled(n.map(e=>b._fetchWalletImage(e))),y.featured=r,y.allFeatured=r}},async fetchRecommendedWallets(){try{y.isFetchingRecommendedWallets=!0;let{includeWalletIds:e,excludeWalletIds:t,featuredWalletIds:i}=g.H.state,r=[...t??[],...i??[]].filter(Boolean),n=u.W.getRequestedCaipNetworkIds().join(","),{data:s,count:a}=await b.fetchWallets({page:1,entries:4,include:e,exclude:r,chains:n}),o=d.i.getRecentWallets(),l=s.map(e=>e.image_id).filter(Boolean),c=o.map(e=>e.image_id).filter(Boolean);await Promise.allSettled([...l,...c].map(e=>b._fetchWalletImage(e))),y.recommended=s,y.allRecommended=s,y.count=a??0}catch{}finally{y.isFetchingRecommendedWallets=!1}},async fetchWalletsByPage({page:e,entries:t,badge:i,include:r,exclude:n}){let{includeWalletIds:s,excludeWalletIds:a,featuredWalletIds:l}=g.H.state,c=u.W.getRequestedCaipNetworkIds().join(","),d=[...y.recommended.map(({id:e})=>e),...a??[],...l??[]].filter(Boolean),{data:h,count:p,mobileFilteredOutWalletsLength:f}=await b.fetchWallets({page:e,entries:t??40,include:r??s,exclude:n??d,badge_type:i,chains:c});y.mobileFilteredOutWalletsLength=f+(y.mobileFilteredOutWalletsLength??0);let m=h.slice(0,20).map(e=>e.image_id).filter(Boolean);await Promise.allSettled(m.map(e=>b._fetchWalletImage(e))),y.wallets=o.w.uniqueBy([...y.wallets,...b._filterOutExtensions(h)],"id").filter(e=>e.chains?.some(e=>c.includes(e))),y.count=p>y.count?p:y.count,y.page=e},async initializeExcludedWallets({ids:e}){let t={page:1,entries:e.length,include:e},{data:i}=await b.fetchWallets(t);i&&i.forEach(e=>{y.excludedWallets.push({rdns:e.rdns,name:e.name})})},async searchWallet({search:e,badge:t,entries:i,page:r,include:n,exclude:s}){let{includeWalletIds:a,excludeWalletIds:l}=g.H.state,c=u.W.getRequestedCaipNetworkIds().join(",");y.search=[];let d={page:r??1,entries:i??100,search:e?.trim(),badge_type:t,include:n??a,exclude:s??l,chains:c},{data:h}=await b.fetchWallets(d);f.E.sendEvent({type:"track",event:"SEARCH_WALLET",properties:{badge:t??"",search:e??""}});let p=h.map(e=>e.image_id).filter(Boolean);await Promise.allSettled([...p.map(e=>b._fetchWalletImage(e)),o.w.wait(300)]),y.search=b._filterOutExtensions(h)},initPromise(e,t){let i=y.promises[e];return i||(y.promises[e]=t())},prefetch:({fetchConnectorImages:e=!0,fetchFeaturedWallets:t=!0,fetchRecommendedWallets:i=!0,fetchNetworkImages:r=!0,fetchWalletRanks:n=!0}={})=>Promise.allSettled([e&&b.initPromise("connectorImages",b.fetchConnectorImages),t&&b.initPromise("featuredWallets",b.fetchFeaturedWallets),i&&b.initPromise("recommendedWallets",b.fetchRecommendedWallets),r&&b.initPromise("networkImages",b.fetchNetworkImages),n&&b.initPromise("walletRanks",b.prefetchWalletRanks)].filter(Boolean)),prefetchAnalyticsConfig(){g.H.state.features?.anal
6787ytics&&b.fetchAnalyticsConfig()},async fetchAnalyticsConfig(){try{let{isAnalyticsEnabled:e}=await w.get({path:"/getAnalyticsConfig",params:b._getSdkProperties()});g.H.setFeatures({analytics:e})}catch(e){g.H.setFeatures({analytics:!1})}},filterByNamespaces(e){if(!e?.length){y.featured=y.allFeatured,y.recommended=y.allRecommended;return}let t=u.W.getRequestedCaipNetworkIds().join(",");y.featured=y.allFeatured.filter(e=>e.chains?.some(e=>t.includes(e))),y.recommended=y.allRecommended.filter(e=>e.chains?.some(e=>t.includes(e))),y.filteredWallets=y.wallets.filter(e=>e.chains?.some(e=>t.includes(e)))},clearFilterByNamespaces(){y.filteredWallets=[]},setFilterByNamespace(e){if(!e){y.featured=y.allFeatured,y.recommended=y.allRecommended;return}let t=u.W.getRequestedCaipNetworkIds().join(",");y.featured=y.allFeatured.filter(e=>e.chains?.some(e=>t.includes(e))),y.recommended=y.allRecommended.filter(e=>e.chains?.some(e=>t.includes(e))),y.filteredWallets=y.wallets.filter(e=>e.chains?.some(e=>t.includes(e)))}}},93849:(e,t,i)=>{"use strict";i.d(t,{RQ:()=>r,vx:()=>s});let r={RPC_ERROR_CODE:{USER_REJECTED_REQUEST:4001,USER_REJECTED_METHODS:5002,USER_REJECTED:5e3,SEND_TRANSACTION_ERROR:5001},PROVIDER_RPC_ERROR_NAME:{PROVIDER_RPC:"ProviderRpcError",USER_REJECTED_REQUEST:"UserRejectedRequestError",SEND_TRANSACTION_ERROR:"SendTransactionError"},isRpcProviderError(e){try{if("object"==typeof e&&null!==e){let t="string"==typeof e.message,i="number"==typeof e.code;return t&&i}return!1}catch{return!1}},isUserRejectedMessage:e=>e.toLowerCase().includes("user rejected")||e.toLowerCase().includes("user cancelled")||e.toLowerCase().includes("user canceled"),isUserRejectedRequestError(e){if(r.isRpcProviderError(e)){let t=e.code===r.RPC_ERROR_CODE.USER_REJECTED_REQUEST,i=e.code===r.RPC_ERROR_CODE.USER_REJECTED_METHODS;return t||i||r.isUserRejectedMessage(e.message)}return e instanceof Error&&r.isUserRejectedMessage(e.message)}};class n extends Error{constructor(e,t){super(t.message,{cause:e}),this.name=r.PROVIDER_RPC_ERROR_NAME.PROVIDER_RPC,this.code=t.code}}class s extends n{constructor(e){super(e,{code:r.RPC_ERROR_CODE.USER_REJECTED_REQUEST,message:"User rejected the request"}),this.name=r.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST}}},94326:(e,t,i)=>{"use strict";var r=i(41463);function n(){return"u"<typeof document&&"u">typeof navigator&&"ReactNative"===navigator.product}function s(){return void 0!==r&&void 0!==r.versions&&void 0!==r.versions.node}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=s,t.isBrowser=function(){return!n()&&!s()}},94392:(e,t,i)=>{"use strict";var r=i(88088),n=i(53227),s=i(40859);i(82016),i(88364),i(12936),i(47002);var a=i(94895),o=i(21736),l=i(69428),c=i(34175);let d=(0,c.AH)`
6788  button {
6789    display: flex;
6790    align-items: center;
6791    height: 40px;
6792    padding: ${({spacing:e})=>e[2]};
6793    border-radius: ${({borderRadius:e})=>e[4]};
6794    column-gap: ${({spacing:e})=>e[1]};
6795    background-color: transparent;
6796    transition: background-color ${({durations:e})=>e.lg}
6797      ${({easings:e})=>e["ease-out-power-2"]};
6798    will-change: background-color;
6799  }
6800
6801  wui-image,
6802  .icon-box {
6803    width: ${({spacing:e})=>e[6]};
6804    height: ${({spacing:e})=>e[6]};
6805    border-radius: ${({borderRadius:e})=>e[4]};
6806  }
6807
6808  wui-text {
6809    flex: 1;
6810  }
6811
6812  .icon-box {
6813    position: relative;
6814  }
6815
6816  .icon-box[data-active='true'] {
6817    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
6818  }
6819
6820  .circle {
6821    position: absolute;
6822    left: 16px;
6823    top: 15px;
6824    width: 8px;
6825    height: 8px;
6826    background-color: ${({tokens:e})=>e.core.textSuccess};
6827    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.foregroundPrimary};
6828    border-radius: 50%;
6829  }
6830
6831  /* -- Hover & Active states ----------------------------------------------------------- */
6832  @media (hover: hover) {
6833    button:hover:enabled,
6834    button:active:enabled {
6835      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
6836    }
6837  }
6838`;var h=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends r.WF{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.enableGreenCircle=!0,this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,r.qy)`
6839      <button>
6840        ${this.leftImageTemplate()} ${this.textTemplate()} ${this.rightImageTemplate()}
6841      </button>
6842    `}leftImageTemplate(){let e=this.icon?(0,r.qy)`<wui-icon
6843          size=${(0,s.J)(this.iconSize)}
6844          color="default"
6845          name=${this.icon}
6846          class="icon"
6847        ></wui-icon>`:(0,r.qy)`<wui-image src=${this.imageSrc} alt=${this.alt}></wui-image>`;return(0,r.qy)`
6848      <wui-flex
6849        alignItems="center"
6850        justifyContent="center"
6851        class="icon-box"
6852        data-active=${!!this.icon}
6853      >
6854        ${e}
6855        ${this.enableGreenCircle?(0,r.qy)`<wui-flex class="circle"></wui-flex>`:null}
6856      </wui-flex>
6857    `}textTemplate(){return(0,r.qy)`
6858      <wui-text variant="lg-regular" color="primary">
6859        ${o.Z.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
6860      </wui-text>
6861    `}rightImageTemplate(){return(0,r.qy)`<wui-icon name="chevronBottom" size="sm" color="default"></wui-icon>`}};u.styles=[a.W5,a.fD,d],h([(0,n.MZ)()],u.prototype,"address",void 0),h([(0,n.MZ)()],u.prototype,"profileName",void 0),h([(0,n.MZ)()],u.prototype,"alt",void 0),h([(0,n.MZ)()],u.prototype,"imageSrc",void 0),h([(0,n.MZ)()],u.prototype,"icon",void 0),h([(0,n.MZ)()],u.prototype,"iconSize",void 0),h([(0,n.MZ)({type:Boolean})],u.prototype,"enableGreenCircle",void 0),h([(0,n.MZ)({type:Boolean})],u.prototype,"loading",void 0),h([(0,n.MZ)({type:Number})],u.prototype,"charsStart",void 0),h([(0,n.MZ)({type:Number})],u.prototype,"charsEnd",void 0),u=h([(0,l.E)("wui-wallet-switch")],u)},94548:(e,t,i)=>{"use strict";i(82016)},94762:e=>{function t(e){return(0x100000000+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else if("string"==typeof e)t=new TextEncoder().encode(e);else throw Error("Input must be an string, Buffer or Uint8Array");return t},toHex:function(e){return Array.prototype.map.call(e,function(e){return(e<16?"0":"")+e.toString(16)}).join("")},debugPrint:function(e,i,r){let n="\n"+e+" = ";for(let s=0;s<i.length;s+=2){if(32===r)n+=t(i[s]).toUpperCase(),n+=" ",n+=t(i[s+1]).toUpperCase();else if(64===r)n+=t(i[s+1]).toUpperCase(),n+=t(i[s]).toUpperCase();else throw Error("Invalid size "+r);s%6==4?n+="\n"+Array(e.length+4).join(" "):s<i.length-2&&(n+=" ")}console.log(n)},testSpeed:function(e,t,i){let r=new Date().getTime(),n=new Uint8Array(t);for(let e=0;e<t;e++)n[e]=e%256;let s=new Date().getTime();console.log("Generated random input in "+(s-r)+"ms"),r=s;for(let s=0;s<i;s++){let i=e(n),s=new Date().getTime(),a=s-r;r=s,console.log("Hashed in "+a+"ms: "+i.substring(0,20)+"..."),console.log(Math.round(t/1048576/(a/1e3)*100)/100+" MB PER SECOND")}}}},94796:(e,t,i)=>{"use strict";i.d(t,{J:()=>c});var r=i(88088),n=i(53227),s=i(44458),a=i(59306);i(42854);let o=(0,a.AH)`
6862  :host {
6863    display: block;
6864    width: inherit;
6865  }
6866`;var l=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};let c=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.viewState=s.I.state.view,this.history=s.I.state.history.join(","),this.unsubscribe.push(s.I.subscribeKey("view",()=>{this.history=s.I.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")}))}
6866disconnectedCallback(){this.unsubscribe.forEach(e=>e()),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return(0,r.qy)`${this.templatePageContainer()}`}templatePageContainer(){return(0,r.qy)`<w3m-router-container
6867      history=${this.history}
6868      .setView=${()=>{this.viewState=s.I.state.view}}
6869    >
6870      ${this.viewTemplate(this.viewState)}
6871    </w3m-router-container>`}viewTemplate(e){switch(e){case"AccountSettings":return(0,r.qy)`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return(0,r.qy)`<w3m-account-view></w3m-account-view>`;case"AllWallets":return(0,r.qy)`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return(0,r.qy)`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return(0,r.qy)`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return(0,r.qy)`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":default:return(0,r.qy)`<w3m-connect-view></w3m-connect-view>`;case"Create":return(0,r.qy)`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return(0,r.qy)`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return(0,r.qy)`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return(0,r.qy)`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return(0,r.qy)`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return(0,r.qy)`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return(0,r.qy)`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return(0,r.qy)`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return(0,r.qy)`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return(0,r.qy)`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return(0,r.qy)`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return(0,r.qy)`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return(0,r.qy)`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return(0,r.qy)`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return(0,r.qy)`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return(0,r.qy)`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return(0,r.qy)`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return(0,r.qy)`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return(0,r.qy)`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return(0,r.qy)`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return(0,r.qy)`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return(0,r.qy)`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return(0,r.qy)`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return(0,r.qy)`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return(0,r.qy)`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return(0,r.qy)`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return(0,r.qy)`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return(0,r.qy)`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return(0,r.qy)`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return(0,r.qy)`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return(0,r.qy)`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return(0,r.qy)`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return(0,r.qy)`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return(0,r.qy)`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return(0,r.qy)`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return(0,r.qy)`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return(0,r.qy)`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return(0,r.qy)`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return(0,r.qy)`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return(0,r.qy)`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return(0,r.qy)`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return(0,r.qy)`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return(0,r.qy)`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return(0,r.qy)`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return(0,r.qy)`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return(0,r.qy)`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return(0,r.qy)`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return(0,r.qy)`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return(0,r.qy)`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"PayQuote":return(0,r.qy)`<w3m-pay-quote-view></w3m-pay-quote-view>`;case"FundWallet":return(0,r.qy)`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return(0,r.qy)`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return(0,r.qy)`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;case"UsageExceeded":return(0,r.qy)`<w3m-usage-exceeded-view></w3m-usage-exceeded-view>`;case"SmartAccountSettings":return(0,r.qy)`<w3m-smart-account-settings-view></w3m-smart-account-settings-view>`}}};c.styles=[o],l([(0,n.wk)()],c.prototype,"viewState",void 0),l([(0,n.wk)()],c.prototype,"history",void 0),c=l([(0,a.EM)("w3m-router")],c)},94895:(e,t,i)=>{"use strict";let r,n,s,a,o;i.d(t,{JX:()=>p,RF:()=>u,W5:()=>m,ds:()=>f,fD:()=>w});var l=i(88088),c=i(34175);let d={"KHTeka-500-woff2":"https://fonts.reown.com/KHTeka-Medium.woff2","KHTeka-400-woff2":"https://fonts.reown.com/KHTeka-Regular.woff2","KHTeka-300-woff2":"https://fonts.reown.com/KHTeka-Light.woff2","KHTekaMono-400-woff2":"https://fonts.reown.com/KHTekaMono-Regular.woff2","KHTeka-500-woff":"https://fonts.reown.com/KHTeka-Light.woff","KHTeka-400-woff":"https://fonts.reown.com/KHTeka-Regular.woff","KHTeka-300-woff":"https://fonts.reown.com/KHTeka-Light.woff","KHTekaMono-400-woff":"https://fonts.reown.com/KHTekaMono-Regular.woff"};function h(e,t="dark"){r&&document.head.removeChild(r),(r=document.createElement("style")).textContent=c.CV.createRootStyles(t,e),document.head.appendChild(r)}function u(e,t="dark"){if(o=e,n=document.createElement("style"),s=document.createElement("style"),a=document.createElement("style"),n.textContent=g(e).core.cssText,s.textContent=g(e).dark.cssText,a.textContent=g(e).light.cssText,document.head.appendChild(n),document.head.appendChild(s),document.head.appendChild(a),h(e,t),p(t),!(e?.["--apkt-font-family"]||e?.["--w3m-font-family"]))for(let[e,t]of Object.entries(d)){let i=document.createElement("link");i.rel="preload",i.href=t,i.as="font",i.type=e.includes("woff2")?"font/woff2":"font/woff",i.crossOrigin="anonymous",document.head.appendChild(i)}p(t)}function p(e="dark"){s&&a&&r&&("light"===e?(h(o,e),s.removeAttribute("media"),a.media="enabled"):(h(o,e),a.removeAttribute("media"),s.media="enabled"))}function f(e){if(o=e,n&&s&&a){n.textContent=g(e).core.cssText,s.textContent=g(e).dark.cssText,a.textContent=g(e).light.cssText;let t=e?.["--apkt-font-family"]||e?.["--w3m-font-family"];t&&(n.textContent=n.textContent?.replace("font-family: KHTeka",`font-family: ${t}`),s.textContent=s.textContent?.replace("font-family: KHTeka",`font-family: ${t}`),a.textContent=a.textContent?.replace("font-family: KHTeka",`font-family: ${t}`))}r&&h(e,a?.media==="enabled"?"light":"dark")}function g(e){let t=!!(e?.["--apkt-font-family"]||e?.["--w3m-font-family"]);return{core:(0,l.AH)`
6872      ${t?(0,l.AH)``:(0,l.AH)`
6873            @font-face {
6874              font-family: 'KHTeka';
6875              src:
6876                url(${(0,l.iz)(d["KHTeka-400-woff2"])}) format('woff2'),
6877                url(${(0,l.iz)(d["KHTeka-400-woff"])}) format('woff');
6878              font-weight: 400;
6879              font-style: normal;
6880              font-display: swap;
6881            }
6882
6883            @font-face {
6884              font-family: 'KHTeka';
6885              src:
6886                url(${(0,l.iz)(d["KHTeka-300-woff2"])}) format('woff2'),
6887                url(${(0,l.iz)(d["KHTeka-300-woff"])}) format('woff');
6888              font-weight: 300;
6889              font-style: normal;
6890            }
6891
6892            @font-face {
6893              font-family: 'KHTekaMono';
6894              src:
6895                url(${(0,l.iz)(d["KHTekaMono-400-woff2"])}) format('woff2'),
6896                url(${(0,l.iz)(d["KHTekaMono-400-woff"])}) format('woff');
6897              font-weight: 400;
6898              font-style: normal;
6899            }
6900
6901            @font-face {
6902              font-family: 'KHTeka';
6903              src:
6904                url(${(0,l.iz)(d["KHTeka-400-woff2"])}) format('woff2'),
6905                url(${(0,l.iz)(d["KHTeka-400-woff"])}) format('woff');
6906              font-weight: 400;
6907              font-style: normal;
6908            }
6909          `}
6910
6911      @keyframes w3m-shake {
6912        0% {
6913          transform: scale(1) rotate(0deg);
6914        }
6915        20% {
6916          transform: scale(1) rotate(-1deg);
6917        }
6918        40% {
6919          transform: scale(1) rotate(1.5deg);
6920        }
6921        60% {
6922          transform: scale(1) rotate(-1.5deg);
6923        }
6924        80% {
6925          transform: scale(1) rotate(1deg);
6926        }
6927        100% {
6928          transform: scale(1) rotate(0deg);
6929        }
6930      }
6931      @keyframes w3m-iframe-fade-out {
6932        0% {
6933          opacity: 1;
6934        }
6935        100% {
6936          opacity: 0;
6937        }
6938      }
6939      @keyframes w3m-iframe-zoom-in {
6940        0% {
6941          transform: translateY(50px);
6942          opacity: 0;
6943        }
6944        100% {
6945          transform: translateY(0px);
6946          opacity: 1;
6947        }
6948      }
6949      @keyframes w3m-iframe-zoom-in-mobile {
6950        0% {
6951          transform: scale(0.95);
6952          opacity: 0;
6953        }
6954        100% {
6955          transform: scale(1);
6956          opacity: 1;
6957        }
6958      }
6959      :root {
6960        --apkt-modal-width: 370px;
6961
6962        --apkt-visual-size-inherit: inherit;
6963        --apkt-visual-size-sm: 40px;
6964        --apkt-visual-size-md: 55px;
6965        --apkt-visual-size-lg: 80px;
6966
6967        --apkt-path-network-sm: path(
6968          'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.
696861 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z'
6969        );
6970
6971        --apkt-path-network-md: path(
6972          'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z'
6973        );
6974
6975        --apkt-path-network-lg: path(
6976          'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z'
6977        );
6978
6979        --apkt-width-network-sm: 36px;
6980        --apkt-width-network-md: 48px;
6981        --apkt-width-network-lg: 86px;
6982
6983        --apkt-duration-dynamic: 0ms;
6984        --apkt-height-network-sm: 40px;
6985        --apkt-height-network-md: 54px;
6986        --apkt-height-network-lg: 96px;
6987      }
6988    `,dark:(0,l.AH)`
6989      :root {
6990      }
6991    `,light:(0,l.AH)`
6992      :root {
6993      }
6994    `}}let m=(0,l.AH)`
6995  div,
6996  span,
6997  iframe,
6998  a,
6999  img,
7000  form,
7001  button,
7002  label,
7003  *::after,
7004  *::before {
7005    margin: 0;
7006    padding: 0;
7007    box-sizing: border-box;
7008    font-style: normal;
7009    text-rendering: optimizeSpeed;
7010    -webkit-font-smoothing: antialiased;
7011    -moz-osx-font-smoothing: grayscale;
7012    -webkit-tap-highlight-color: transparent;
7013    backface-visibility: hidden;
7014  }
7015
7016  :host {
7017    font-family: var(--apkt-fontFamily-regular);
7018  }
7019`,w=(0,l.AH)`
7020  button,
7021  a {
7022    cursor: pointer;
7023    display: flex;
7024    justify-content: center;
7025    align-items: center;
7026    position: relative;
7027
7028    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
7029    outline: none;
7030    border: none;
7031    text-decoration: none;
7032    transition:
7033      background-color var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7034      color var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7035      border var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7036      box-shadow var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7037      width var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7038      height var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7039      transform var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7040      opacity var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7041      scale var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
7042      border-radius var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2);
7043    will-change:
7044      background-color, color, border, box-shadow, width, height, transform, opacity, scale,
7045      border-radius;
7046  }
7047
7048  a:active:not([disabled]),
7049  button:active:not([disabled]) {
7050    scale: 0.975;
7051    transform-origin: center;
7052  }
7053
7054  button:disabled {
7055    cursor: default;
7056  }
7057
7058  input {
7059    border: none;
7060    outline: none;
7061    appearance: none;
7062  }
7063`},97734:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});var r=i(42608);function n(e){return(0,r.M)({...e,state:!0,attribute:!1})}},97745:(e,t,i)=>{"use strict";var r=i(88088);i(82016),i(12936),i(47002);var n=i(94895),s=i(69428),a=i(34175);let o=(0,a.AH)`
7064  .reown-logo {
7065    height: 24px;
7066  }
7067
7068  a {
7069    text-decoration: none;
7070    cursor: pointer;
7071    color: ${({tokens:e})=>e.theme.textSecondary};
7072  }
7073
7074  a:hover {
7075    opacity: 0.9;
7076  }
7077`,l=class extends r.WF{render(){return(0,r.qy)`
7078      <a
7079        data-testid="ux-branding-reown"
7080        href=${"https://reown.com"}
7081        rel="noreferrer"
7082        target="_blank"
7083        style="text-decoration: none;"
7084      >
7085        <wui-flex
7086          justifyContent="center"
7087          alignItems="center"
7088          gap="1"
7089          .padding=${["01","0","3","0"]}
7090        >
7091          <wui-text variant="sm-regular" color="inherit"> UX by </wui-text>
7092          <wui-icon name="reown" size="inherit" class="reown-logo"></wui-icon>
7093        </wui-flex>
7094      </a>
7095    `}};l.styles=[n.W5,n.fD,o],l=function(e,t,i,r){var n,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(s<3?n(a):s>3?n(t,i,a):n(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a}([(0,s.E)("wui-ux-by-reown")],l)},99405:(e,t,i)=>{"use strict";
7095Object.defineProperty(t,"__esModule",{value:!0});let r=i(24393);r.__exportStar(i(45082),t),r.__exportStar(i(94326),t)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.