`}onAllWallets(){A.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),f.push("AllWallets")}};Ye([c()],Re.prototype,"tabIdx",void 0);Ye([u()],Re.prototype,"connectors",void 0);Ye([u()],Re.prototype,"count",void 0);Ye([u()],Re.prototype,"filteredCount",void 0);Ye([u()],Re.prototype,"isFetchingRecommendedWallets",void 0);Re=Ye([h("w3m-all-wallets-widget")],Re);var zt=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let ot=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=m.state.connectors,this.connections=x.state.connections,this.unsubscribe.push(m.subscribeKey("connectors",e=>this.connectors=e),x.subscribeKey("connections",e=>this.connections=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(t=>t.type==="ANNOUNCED");return e!=null&&e.length?l`
${e.filter(_e.showConnector).map(t=>{const o=(this.connections.get(t.chain)??[]).some(i=>Q.isLowerCaseMatch(i.connectorId,t.id));return l`
this.onConnector(t)}
tagVariant=${o?"shade":"success"}
tagLabel=${o?"connected":"installed"}
data-testid=${`wallet-selector-${t.id}`}
.installed=${!0}
tabIdx=${p(this.tabIdx)}
>
`})}
`:(this.style.cssText="display: none",null)}onConnector(e){e.id==="walletConnect"?b.isMobile()?f.push("AllWallets"):f.push("ConnectingWalletConnect"):f.push("ConnectingExternal",{connector:e})}};zt([c()],ot.prototype,"tabIdx",void 0);zt([u()],ot.prototype,"connectors",void 0);zt([u()],ot.prototype,"connections",void 0);ot=zt([h("w3m-connect-announced-widget")],ot);var Mt=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let st=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=m.state.connectors,this.loading=!1,this.unsubscribe.push(m.subscribeKey("connectors",e=>this.connectors=e)),b.isTelegram()&&b.isIos()&&(this.loading=!x.state.wcUri,this.unsubscribe.push(x.subscribeKey("wcUri",e=>this.loading=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{customWallets:e}=v.state;if(!(e!=null&&e.length))return this.style.cssText="display: none",null;const t=this.filterOutDuplicateWallets(e),n=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT);return l`
${t.map(o=>l`
this.onConnectWallet(o)}
data-testid=${`wallet-selector-${o.id}`}
tabIdx=${p(this.tabIdx)}
?loading=${this.loading}
?disabled=${n}
>
`)}
`}filterOutDuplicateWallets(e){const t=re.getRecentWallets(),n=this.connectors.map(r=>{var g;return(g=r.info)==null?void 0:g.rdns}).filter(Boolean),o=t.map(r=>r.rdns).filter(Boolean),i=n.concat(o);if(i.includes("io.metamask.mobile")&&b.isMobile()){const r=i.indexOf("io.metamask.mobile");i[r]="io.metamask"}return e.filter(r=>!i.includes(String(r==null?void 0:r.rdns)))}onConnectWallet(e){this.loading||f.push("ConnectingWalletConnect",{wallet:e})}};Mt([c()],st.prototype,"tabIdx",void 0);Mt([u()],st.prototype,"connectors",void 0);Mt([u()],st.prototype,"loading",void 0);st=Mt([h("w3m-connect-custom-widget")],st);var xi=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let St=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=m.state.connectors,this.unsubscribe.push(m.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const n=this.connectors.filter(i=>i.type==="EXTERNAL").filter(_e.showConnector).filter(i=>i.id!==S.CONNECTOR_ID.COINBASE_SDK);if(!(n!=null&&n.length))return this.style.cssText="display: none",null;const o=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT);return l`
${n.map(i=>l`
this.onConnector(i)}
tabIdx=${p(this.tabIdx)}
?disabled=${o}
>
`)}
`}onConnector(e){f.push("ConnectingExternal",{connector:e})}};xi([c()],St.prototype,"tabIdx",void 0);xi([u()],St.prototype,"connectors",void 0);St=xi([h("w3m-connect-external-widget")],St);var vi=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let It=class extends w{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){if(!this.wallets.length)return this.style.cssText="display: none",null;const e=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT);return l`
${this.wallets.map(t=>l`
this.onConnectWallet(t)}
tabIdx=${p(this.tabIdx)}
?disabled=${e}
>
`)}
`}onConnectWallet(e){m.selectWalletConnector(e)}};vi([c()],It.prototype,"tabIdx",void 0);vi([c()],It.prototype,"wallets",void 0);It=vi([h("w3m-connect-featured-widget")],It);var Ft=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let at=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=[],this.connections=x.state.connections,this.unsubscribe.push(x.subscribeKey("connections",e=>this.connections=e))}render(){const e=this.connectors.filter(_e.showConnector);return e.length===0?(this.style.cssText="display: none",null):l`
${e.map(t=>{const o=(this.connections.get(t.chain)??[]).some(i=>Q.isLowerCaseMatch(i.connectorId,t.id));return l`
this.onConnector(t)}
tabIdx=${p(this.tabIdx)}
>
`})}
`}onConnector(e){m.setActiveConnector(e),f.push("ConnectingExternal",{connector:e})}};Ft([c()],at.prototype,"tabIdx",void 0);Ft([c()],at.prototype,"connectors",void 0);Ft([u()],at.prototype,"connections",void 0);at=Ft([h("w3m-connect-injected-widget")],at);var yi=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let kt=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=m.state.connectors,this.unsubscribe.push(m.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(t=>t.type==="MULTI_CHAIN"&&t.name!=="WalletConnect");return e!=null&&e.length?l`
${e.map(t=>l`
this.onConnector(t)}
tabIdx=${p(this.tabIdx)}
>
`)}
`:(this.style.cssText="display: none",null)}onConnector(e){m.setActiveConnector(e),f.push("ConnectingMultiChain")}};yi([c()],kt.prototype,"tabIdx",void 0);yi([u()],kt.prototype,"connectors",void 0);kt=yi([h("w3m-connect-multi-chain-widget")],kt);var Vt=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let rt=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=m.state.connectors,this.loading=!1,this.unsubscribe.push(m.subscribeKey("connectors",e=>this.connectors=e)),b.isTelegram()&&b.isIos()&&(this.loading=!x.state.wcUri,this.unsubscribe.push(x.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const t=re.getRecentWallets().filter(o=>!Te.isExcluded(o)).filter(o=>!this.hasWalletConnector(o)).filter(o=>this.isWalletCompatibleWithCurrentChain(o));if(!t.length)return this.style.cssText="display: none",null;const n=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT);return l`
${t.map(o=>l`
this.onConnectWallet(o)}
tagLabel="recent"
tagVariant="shade"
tabIdx=${p(this.tabIdx)}
?loading=${this.loading}
?disabled=${n}
>
`)}
`}onConnectWallet(e){this.loading||m.selectWalletConnector(e)}hasWalletConnector(e){return this.connectors.some(t=>t.id===e.id||t.name===e.name)}isWalletCompatibleWithCurrentChain(e){const t=d.state.activeChain;return t&&e.chains?e.chains.some(n=>{const o=n.split(":")[0];return t===o}):!0}};Vt([c()],rt.prototype,"tabIdx",void 0);Vt([u()],rt.prototype,"connectors",void 0);Vt([u()],rt.prototype,"loading",void 0);rt=Vt([h("w3m-connect-recent-widget")],rt);var Kt=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let lt=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,b.isTelegram()&&b.isIos()&&(this.loading=!x.state.wcUri,this.unsubscribe.push(x.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const{connectors:e}=m.state,{customWallets:t,featuredWalletIds:n}=v.state,o=re.getRecentWallets(),i=e.find(W=>W.id==="walletConnect"),r=e.filter(W=>W.type==="INJECTED"||W.type==="ANNOUNCED"||W.type==="MULTI_CHAIN").filter(W=>W.name!=="Browser Wallet");if(!i)return null;if(n||t||!this.wallets.length)return this.style.cssText="display: none",null;const g=r.length+o.length,I=Math.max(0,2-g),k=Te.filterOutDuplicateWallets(this.wallets).slice(0,I);if(!k.length)return this.style.cssText="display: none",null;const P=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT);return l`
${k.map(W=>l`
this.onConnectWallet(W)}
tabIdx=${p(this.tabIdx)}
?loading=${this.loading}
?disabled=${P}
>
`)}
`}onConnectWallet(e){if(this.loading)return;const t=m.getConnector({id:e.id,rdns:e.rdns});t?f.push("ConnectingExternal",{connector:t}):f.push("ConnectingWalletConnect",{wallet:e})}};Kt([c()],lt.prototype,"tabIdx",void 0);Kt([c()],lt.prototype,"wallets",void 0);Kt([u()],lt.prototype,"loading",void 0);lt=Kt([h("w3m-connect-recommended-widget")],lt);var Gt=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let ct=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=m.state.connectors,this.connectorImages=Ee.state.connectorImages,this.unsubscribe.push(m.subscribeKey("connectors",e=>this.connectors=e),Ee.subscribeKey("connectorImages",e=>this.connectorImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(b.isMobile())return this.style.cssText="display: none",null;const e=this.connectors.find(o=>o.id==="walletConnect");if(!e)return this.style.cssText="display: none",null;const t=e.imageUrl||this.connectorImages[(e==null?void 0:e.imageId)??""],n=x.hasAnyConnection(S.CONNECTOR_ID.WALLET_CONNECT);return l`
this.onConnector(e)}
tagLabel="qr code"
tagVariant="main"
tabIdx=${p(this.tabIdx)}
data-testid="wallet-selector-walletconnect"
?disabled=${n}
>
`}onConnector(e){m.setActiveConnector(e),f.push("ConnectingWalletConnect")}};Gt([c()],ct.prototype,"tabIdx",void 0);Gt([u()],ct.prototype,"connectors",void 0);Gt([u()],ct.prototype,"connectorImages",void 0);ct=Gt([h("w3m-connect-walletconnect-widget")],ct);const wo=y`
:host {
margin-top: var(--wui-spacing-3xs);
}
wui-separator {
margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
calc(var(--wui-spacing-m) * -1);
width: calc(100% + var(--wui-spacing-s) * 2);
}
`;var wt=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Oe=class extends w{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=m.state.connectors,this.recommended=E.state.recommended,this.featured=E.state.featured,this.unsubscribe.push(m.subscribeKey("connectors",e=>this.connectors=e),E.subscribeKey("recommended",e=>this.recommended=e),E.subscribeKey("featured",e=>this.featured=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.connectorListTemplate()}
`}connectorListTemplate(){const{custom:e,recent:t,announced:n,injected:o,multiChain:i,recommended:s,featured:r,external:g}=_e.getConnectorsByType(this.connectors,this.recommended,this.featured);return _e.getConnectorTypeOrder({custom:e,recent:t,announced:n,injected:o,multiChain:i,recommended:s,featured:r,external:g}).map(k=>{switch(k){case"injected":return l`
${i.length?l``:null}
${n.length?l``:null}
${o.length?l``:null}
`;case"walletConnect":return l``;case"recent":return l``;case"featured":return l``;case"custom":return l``;case"external":return l``;case"recommended":return l``;default:return console.warn(`Unknown connector type: ${k}`),null}})}};Oe.styles=wo;wt([c()],Oe.prototype,"tabIdx",void 0);wt([u()],Oe.prototype,"connectors",void 0);wt([u()],Oe.prototype,"recommended",void 0);wt([u()],Oe.prototype,"featured",void 0);Oe=wt([h("w3m-connector-list")],Oe);var on=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let si=class extends w{constructor(){super(...arguments),this.tabIdx=void 0}render(){return l`
`}};on([c()],si.prototype,"tabIdx",void 0);si=on([h("w3m-wallet-login-list")],si);const fo=y`
:host {
--connect-scroll--top-opacity: 0;
--connect-scroll--bottom-opacity: 0;
--connect-mask-image: none;
}
.connect {
max-height: clamp(360px, 470px, 80vh);
scrollbar-width: none;
overflow-y: scroll;
overflow-x: hidden;
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: opacity;
mask-image: var(--connect-mask-image);
}
.guide {
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: opacity;
}
.connect::-webkit-scrollbar {
display: none;
}
.all-wallets {
flex-flow: column;
}
.connect.disabled,
.guide.disabled {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
wui-separator {
margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1);
width: calc(100% + var(--wui-spacing-s) * 2);
}
`;var se=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};const mo=470;let H=class extends w{constructor(){var e,t;super(),this.unsubscribe=[],this.connectors=m.state.connectors,this.authConnector=this.connectors.find(n=>n.type==="AUTH"),this.features=v.state.features,this.remoteFeatures=v.state.remoteFeatures,this.enableWallets=v.state.enableWallets,this.noAdapters=d.state.noAdapters,this.walletGuide="get-started",this.checked=bt.state.isLegalCheckboxChecked,this.isEmailEnabled=((e=this.remoteFeatures)==null?void 0:e.email)&&!d.state.noAdapters,this.isSocialEnabled=((t=this.remoteFeatures)==null?void 0:t.socials)&&this.remoteFeatures.socials.length>0&&!d.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(m.subscribeKey("connectors",n=>{this.connectors=n,this.authConnector=this.connectors.find(o=>o.type==="AUTH"),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),v.subscribeKey("features",n=>{this.features=n}),v.subscribeKey("remoteFeatures",n=>{this.remoteFeatures=n,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),v.subscribeKey("enableWallets",n=>this.enableWallets=n),d.subscribeKey("noAdapters",n=>this.setEmailAndSocialEnableCheck(n,this.remoteFeatures)),bt.subscribeKey("isLegalCheckboxChecked",n=>this.checked=n))}disconnectedCallback(){var t,n;this.unsubscribe.forEach(o=>o()),(t=this.resizeObserver)==null||t.disconnect();const e=(n=this.shadowRoot)==null?void 0:n.querySelector(".connect");e==null||e.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){var t,n;const e=(t=this.shadowRoot)==null?void 0:t.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e==null||e.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),(n=this.resizeObserver)==null||n.observe(e),this.handleConnectListScroll())}render(){var W;const{termsConditionsUrl:e,privacyPolicyUrl:t}=v.state,n=(W=v.state.features)==null?void 0:W.legalCheckbox,s=!!(e||t)&&!!n&&this.walletGuide==="get-started"&&!this.checked,r={connect:!0,disabled:s},g=v.state.enableWalletGuide,I=this.enableWallets,k=this.isSocialEnabled||this.authConnector,P=s?-1:void 0;return l`
${this.legalCheckboxTemplate()}
${this.renderConnectMethod(P)}
${this.guideTemplate(s)}
`}setEmailAndSocialEnableCheck(e,t){this.isEmailEnabled=(t==null?void 0:t.email)&&!e,this.isSocialEnabled=(t==null?void 0:t.socials)&&t.socials.length>0&&!e,this.remoteFeatures=t,this.noAdapters=e}checkIfAuthEnabled(e){const t=e.filter(o=>o.type===bn.CONNECTOR_TYPE_AUTH).map(o=>o.chain);return S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(o=>t.includes(o))}renderConnectMethod(e){const t=Te.getConnectOrderMethod(this.features,this.connectors);return l`${t.map((n,o)=>{switch(n){case"email":return l`${this.emailTemplate(e)} ${this.separatorTemplate(o,"email")}`;case"social":return l`${this.socialListTemplate(e)}
${this.separatorTemplate(o,"social")}`;case"wallet":return l`${this.walletListTemplate(e)}
${this.separatorTemplate(o,"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){const n=Te.getConnectOrderMethod(this.features,this.connectors)[e+1];return n?this.checkMethodEnabled(n)?n:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,t){const n=this.checkIsThereNextMethod(e),o=this.walletGuide==="explore";switch(t){case"wallet":return this.enableWallets&&n&&!o?l``:null;case"email":{const i=n==="social";return this.isAuthEnabled&&this.isEmailEnabled&&!i&&n?l``:null}case"social":{const i=n==="email";return this.isAuthEnabled&&this.isSocialEnabled&&!i&&n?l``:null}default:return null}}emailTemplate(e){return!this.isEmailEnabled||!this.isAuthEnabled?null:l``}socialListTemplate(e){return!this.isSocialEnabled||!this.isAuthEnabled?null:l``}walletListTemplate(e){var r,g;const t=this.enableWallets,n=((r=this.features)==null?void 0:r.emailShowWallets)===!1,o=(g=this.features)==null?void 0:g.collapseWallets,i=n||o;return!t||(b.isTelegram()&&(b.isSafari()||b.isIos())&&x.connectWalletConnect().catch(I=>({})),this.walletGuide==="explore")?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&i?l``:l``}guideTemplate(e=!1){if(!v.state.enableWalletGuide)return null;const n={guide:!0,disabled:e},o=e?-1:void 0;return!this.authConnector&&!this.isSocialEnabled?null:l`
${this.walletGuide==="explore"&&!d.state.noAdapters?l``:null}
`}legalCheckboxTemplate(){return this.walletGuide==="explore"?null:l``}handleConnectListScroll(){var n;const e=(n=this.shadowRoot)==null?void 0:n.querySelector(".connect");if(!e)return;e.scrollHeight>mo?(e.style.setProperty("--connect-mask-image",`linear-gradient(
to bottom,
rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
black 40px,
black calc(100% - 40px),
rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
)`),e.style.setProperty("--connect-scroll--top-opacity",mt.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",mt.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(){f.push("ConnectWallets")}};H.styles=fo;se([u()],H.prototype,"connectors",void 0);se([u()],H.prototype,"authConnector",void 0);se([u()],H.prototype,"features",void 0);se([u()],H.prototype,"remoteFeatures",void 0);se([u()],H.prototype,"enableWallets",void 0);se([u()],H.prototype,"noAdapters",void 0);se([c()],H.prototype,"walletGuide",void 0);se([u()],H.prototype,"checked",void 0);se([u()],H.prototype,"isEmailEnabled",void 0);se([u()],H.prototype,"isSocialEnabled",void 0);se([u()],H.prototype,"isAuthEnabled",void 0);H=se([h("w3m-connect-view")],H);const bo=y`
wui-flex {
width: 100%;
background-color: var(--wui-color-gray-glass-002);
border-radius: var(--wui-border-radius-xs);
}
`;var Ht=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Ke=class extends w{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return l`
${this.label}
`}};Ke.styles=[T,N,bo];Ht([c({type:Boolean})],Ke.prototype,"disabled",void 0);Ht([c()],Ke.prototype,"label",void 0);Ht([c()],Ke.prototype,"buttonLabel",void 0);Ke=Ht([h("wui-cta-button")],Ke);const go=y`
:host {
display: block;
padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl);
}
`;var sn=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let At=class extends w{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:t,play_store:n,chrome_store:o,homepage:i}=this.wallet,s=b.isMobile(),r=b.isIos(),g=b.isAndroid(),I=[t,n,i,o].filter(Boolean).length>1,k=F.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return I&&!s?l`
f.push("Downloads",{wallet:this.wallet})}
>
`:!I&&i?l`
`:t&&r?l`
`:n&&g?l`
`:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&b.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&b.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&b.openHref(this.wallet.homepage,"_blank")}};At.styles=[go];sn([c({type:Object})],At.prototype,"wallet",void 0);At=sn([h("w3m-mobile-download-links")],At);const xo=y`
@keyframes shake {
0% {
transform: translateX(0);
}
25% {
transform: translateX(3px);
}
50% {
transform: translateX(-3px);
}
75% {
transform: translateX(3px);
}
100% {
transform: translateX(0);
}
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-loading-thumbnail {
position: absolute;
}
wui-icon-box {
position: absolute;
right: calc(var(--wui-spacing-3xs) * -1);
bottom: calc(var(--wui-spacing-3xs) * -1);
opacity: 0;
transform: scale(0.5);
transition-property: opacity, transform;
transition-duration: var(--wui-duration-lg);
transition-timing-function: var(--wui-ease-out-power-2);
will-change: opacity, transform;
}
wui-text[align='center'] {
width: 100%;
padding: 0px var(--wui-spacing-l);
}
[data-error='true'] wui-icon-box {
opacity: 1;
transform: scale(1);
}
[data-error='true'] > wui-flex:first-child {
animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
[data-retry='false'] wui-link {
display: none;
}
[data-retry='true'] wui-link {
display: block;
opacity: 1;
}
`;var pe=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};class O extends w{constructor(){var e,t,n,o,i;super(),this.wallet=(e=f.state.data)==null?void 0:e.wallet,this.connector=(t=f.state.data)==null?void 0:t.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=$.getWalletImage(this.wallet)??$.getConnectorImage(this.connector),this.name=((n=this.wallet)==null?void 0:n.name)??((o=this.connector)==null?void 0:o.name)??"Wallet",this.isRetrying=!1,this.uri=x.state.wcUri,this.error=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.subscribeKey("wcUri",s=>{var r;this.uri=s,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(r=this.onConnect)==null||r.call(this))}),x.subscribeKey("wcError",s=>this.error=s)),(b.isTelegram()||b.isSafari())&&b.isIos()&&x.state.wcUri&&((i=this.onConnect)==null||i.call(this))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),x.setWcError(!1),clearTimeout(this.timeout)}render(){var n;(n=this.onRender)==null||n.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let t="";return this.label?t=this.label:(t=`Continue in ${this.name}`,this.error&&(t="Connection declined")),l`
${this.error?null:this.loaderTemplate()}
${t}
${e}
${this.secondaryBtnLabel?l`
${this.secondaryBtnLabel}
`:null}
${this.isWalletConnect?l`
Copy link
`:null}
`}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");t==null||t.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,t;x.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(t=this.onConnect)==null||t.call(this)}loaderTemplate(){const e=Zt.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return l``}onCopyUri(){try{this.uri&&(b.copyToClopboard(this.uri),_.showSuccess("Link copied"))}catch{_.showError("Failed to copy")}}}O.styles=xo;pe([u()],O.prototype,"isRetrying",void 0);pe([u()],O.prototype,"uri",void 0);pe([u()],O.prototype,"error",void 0);pe([u()],O.prototype,"ready",void 0);pe([u()],O.prototype,"showRetry",void 0);pe([u()],O.prototype,"label",void 0);pe([u()],O.prototype,"secondaryBtnLabel",void 0);pe([u()],O.prototype,"secondaryLabel",void 0);pe([u()],O.prototype,"isLoading",void 0);pe([c({type:Boolean})],O.prototype,"isMobile",void 0);pe([c()],O.prototype,"onRetry",void 0);var vo=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Mi=class extends O{constructor(){var t,n,o,i;if(super(),this.externalViewUnsubscribe=[],this.connectionsByNamespace=x.getConnections((t=this.connector)==null?void 0:t.chain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.remoteFeatures=v.state.remoteFeatures,this.currentActiveConnectorId=m.state.activeConnectorIds[(n=this.connector)==null?void 0:n.chain],!this.connector)throw new Error("w3m-connecting-view: No connector provided");const e=(o=this.connector)==null?void 0:o.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`),A.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser",displayIndex:(i=this.wallet)==null?void 0:i.display_index}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(m.subscribeKey("activeConnectorIds",s=>{var I;const r=s[e],g=(I=this.remoteFeatures)==null?void 0:I.multiWallet;r!==this.currentActiveConnectorId&&(this.hasMultipleConnections&&g?(f.replace("ProfileWallets"),_.showSuccess("New Wallet Added")):D.close())}),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!==S.CONNECTOR_ID.COINBASE_SDK||!this.error)&&(await x.connectExternal(this.connector,this.connector.chain),A.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}}catch(e){A.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}onConnectionsChange(e){var t,n;if((t=this.connector)!=null&&t.chain&&e.get(this.connector.chain)&&this.isAlreadyConnected(this.connector)){const o=e.get(this.connector.chain)??[],i=(n=this.remoteFeatures)==null?void 0:n.multiWallet;if(o.length===0)f.replace("Connect");else{const s=ve.getConnectionsByConnectorId(this.connectionsByNamespace,this.connector.id).flatMap(g=>g.accounts),r=ve.getConnectionsByConnectorId(o,this.connector.id).flatMap(g=>g.accounts);r.length===0?this.hasMultipleConnections&&i?(f.replace("ProfileWallets"),_.showSuccess("Wallet deleted")):D.close():!s.every(I=>r.some(k=>Q.isLowerCaseMatch(I.address,k.address)))&&i&&f.replace("ProfileWallets")}}}isAlreadyConnected(e){return!!e&&this.connectionsByNamespace.some(t=>Q.isLowerCaseMatch(t.connectorId,e.id))}};Mi=vo([h("w3m-connecting-external-view")],Mi);const yo=y`
wui-flex,
wui-list-wallet {
width: 100%;
}
`;var an=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Wt=class extends w{constructor(){super(),this.unsubscribe=[],this.activeConnector=m.state.activeConnector,this.unsubscribe.push(m.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return l`
Select Chain for ${(e=this.activeConnector)==null?void 0:e.name}
Select which chain to connect to your multi chain wallet
${this.networksTemplate()}
`}networksTemplate(){var e,t;return(t=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:t.map(n=>n.name?l`
this.onConnector(n)}
data-testid="wui-list-chain-${n.chain}"
>
`:null)}onConnector(e){var n,o;const t=(o=(n=this.activeConnector)==null?void 0:n.connectors)==null?void 0:o.find(i=>i.chain===e.chain);if(!t){_.showError("Failed to find connector");return}t.id==="walletConnect"?b.isMobile()?f.push("AllWallets"):f.push("ConnectingWalletConnect"):f.push("ConnectingExternal",{connector:t})}};Wt.styles=yo;an([u()],Wt.prototype,"activeConnector",void 0);Wt=an([h("w3m-connecting-multi-chain-view")],Wt);var Ci=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Et=class extends w{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return l`
`}generateTabs(){const e=this.platforms.map(t=>t==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:t==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:t==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:t==="web"?{label:"Webapp",icon:"browser",platform:"web"}:t==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:t})=>t),e}onTabChange(e){var n;const t=this.platformTabs[e];t&&((n=this.onSelectPlatfrom)==null||n.call(this,t))}};Ci([c({type:Array})],Et.prototype,"platforms",void 0);Ci([c()],Et.prototype,"onSelectPlatfrom",void 0);Et=Ci([h("w3m-connecting-header")],Et);var Co=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Fi=class extends O{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),A.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}async onConnectProxy(){var e;try{this.error=!1;const{connectors:t}=m.state,n=t.find(o=>{var i,s,r;return o.type==="ANNOUNCED"&&((i=o.info)==null?void 0:i.rdns)===((s=this.wallet)==null?void 0:s.rdns)||o.type==="INJECTED"||o.name===((r=this.wallet)==null?void 0:r.name)});if(n)await x.connectExternal(n,n.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");D.close(),A.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown"}})}catch(t){A.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(t==null?void 0:t.message)??"Unknown"}}),this.error=!0}}};Fi=Co([h("w3m-connecting-wc-browser")],Fi);var $o=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Vi=class extends O{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),A.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:t,name:n}=this.wallet,{redirect:o,href:i}=b.formatNativeUrl(t,this.uri);x.setWcLinking({name:n,href:i}),x.setRecentWallet(this.wallet),b.openHref(o,"_blank")}catch{this.error=!0}}};Vi=$o([h("w3m-connecting-wc-desktop")],Vi);var Xe=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Pe=class extends O{constructor(){var e;if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=v.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{var t;if((t=this.wallet)!=null&&t.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:n,link_mode:o,name:i}=this.wallet,{redirect:s,redirectUniversalLink:r,href:g}=b.formatNativeUrl(n,this.uri,o);this.redirectDeeplink=s,this.redirectUniversalLink=r,this.target=b.isIframe()?"_top":"_self",x.setWcLinking({name:i,href:g}),x.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?b.openHref(this.redirectUniversalLink,this.target):b.openHref(this.redirectDeeplink,this.target)}catch(n){A.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:n instanceof Error?n.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=V.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(x.subscribeKey("wcUri",()=>{this.onHandleURI()})),A.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){var e;this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onTryAgain(){var e;x.setWcError(!1),(e=this.onConnect)==null||e.call(this)}};Xe([u()],Pe.prototype,"redirectDeeplink",void 0);Xe([u()],Pe.prototype,"redirectUniversalLink",void 0);Xe([u()],Pe.prototype,"target",void 0);Xe([u()],Pe.prototype,"preferUniversalLinks",void 0);Xe([u()],Pe.prototype,"isLoading",void 0);Pe=Xe([h("w3m-connecting-wc-mobile")],Pe);const So=y`
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
wui-shimmer {
width: 100%;
aspect-ratio: 1 / 1;
border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
}
wui-qr-code {
opacity: 0;
animation-duration: 200ms;
animation-timing-function: ease;
animation-name: fadein;
animation-fill-mode: forwards;
}
`;var Io=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let ai=class extends O{constructor(){var e,t;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),A.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode",displayIndex:(t=this.wallet)==null?void 0:t.display_index}})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribe)==null||e.forEach(t=>t()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),l`
${this.qrCodeTemplate()}
Scan this QR Code with your phone
${this.copyTemplate()}
`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,t=this.wallet?this.wallet.name:void 0;return x.setWcLinking(void 0),x.setRecentWallet(this.wallet),l` `}copyTemplate(){const e=!this.uri||!this.ready;return l`
Copy link
`}};ai.styles=So;ai=Io([h("w3m-connecting-wc-qrcode")],ai);var ko=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Ki=class extends w{constructor(){var e,t;if(super(),this.wallet=(e=f.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");A.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(t=this.wallet)==null?void 0:t.display_index}})}render(){return l`
Not Detected
`}};Ki=ko([h("w3m-connecting-wc-unsupported")],Ki);var rn=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let ri=class extends O{constructor(){var e;if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=V.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(x.subscribeKey("wcUri",()=>{this.updateLoadingState()})),A.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:t,name:n}=this.wallet,{redirect:o,href:i}=b.formatUniversalUrl(t,this.uri);x.setWcLinking({name:n,href:i}),x.setRecentWallet(this.wallet),b.openHref(o,"_blank")}catch{this.error=!0}}};rn([u()],ri.prototype,"isLoading",void 0);ri=rn([h("w3m-connecting-wc-web")],ri);var Qe=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let De=class extends w{constructor(){var e;super(),this.wallet=(e=f.state.data)==null?void 0:e.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!v.state.siwx,this.remoteFeatures=v.state.remoteFeatures,this.displayBranding=!0,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(v.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.headerTemplate()}
${this.platformTemplate()}
${this.reownBrandingTemplate()}
`}reownBrandingTemplate(){var e;return!((e=this.remoteFeatures)!=null&&e.reownBranding)||!this.displayBranding?null:l``}async initializeConnection(e=!1){var t,n;if(!(this.platform==="browser"||v.state.manualWCControl&&!e))try{const{wcPairingExpiry:o,status:i}=x.state;if(e||v.state.enableEmbedded||b.isPairingExpired(o)||i==="connecting"){const s=x.getConnections(d.state.activeChain),r=(t=this.remoteFeatures)==null?void 0:t.multiWallet,g=s.length>0;await x.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(g&&r?(f.replace("ProfileWallets"),_.showSuccess("New Wallet Added")):D.close())}}catch(o){if(o instanceof Error&&o.message.includes("An error occurred when attempting to switch chain")&&!v.state.enableNetworkSwitch&&d.state.activeChain){d.setActiveCaipNetwork(gn.getUnsupportedNetwork(`${d.state.activeChain}:${(n=d.state.activeCaipNetwork)==null?void 0:n.id}`)),d.showUnsupportedChainUI();return}A.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(o==null?void 0:o.message)??"Unknown"}}),x.setWcError(!0),_.showError(o.message??"Connection error"),x.resetWcConnection(),f.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:t,webapp_link:n,injected:o,rdns:i}=this.wallet,s=o==null?void 0:o.map(({injected_id:Yt})=>Yt).filter(Boolean),r=[...i?[i]:s??[]],g=v.state.isUniversalProvider?!1:r.length,I=e,k=n,P=x.checkInstalled(r),W=g&&P,Wi=t&&!b.isMobile();W&&!d.state.noAdapters&&this.platforms.push("browser"),I&&this.platforms.push(b.isMobile()?"mobile":"qrcode"),k&&this.platforms.push("web"),Wi&&this.platforms.push("desktop"),!W&&g&&!d.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return l``;case"web":return l``;case"desktop":return l`
this.initializeConnection(!0)}>
`;case"mobile":return l`
this.initializeConnection(!0)}>
`;case"qrcode":return l``;default:return l``}}headerTemplate(){return this.platforms.length>1?l`
`:null}async onSelectPlatform(e){var n;const t=(n=this.shadowRoot)==null?void 0:n.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"}))}};Qe([u()],De.prototype,"platform",void 0);Qe([u()],De.prototype,"platforms",void 0);Qe([u()],De.prototype,"isSiwxEnabled",void 0);Qe([u()],De.prototype,"remoteFeatures",void 0);Qe([c({type:Boolean})],De.prototype,"displayBranding",void 0);De=Qe([h("w3m-connecting-wc-view")],De);var $i=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let _t=class extends w{constructor(){super(),this.unsubscribe=[],this.isMobile=b.isMobile(),this.remoteFeatures=v.state.remoteFeatures,this.unsubscribe.push(v.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(this.isMobile){const{featured:e,recommended:t}=E.state,{customWallets:n}=v.state,o=re.getRecentWallets(),i=e.length||t.length||(n==null?void 0:n.length)||o.length;return l`
${i?l``:null}
`}return l`
${this.reownBrandingTemplate()} `}reownBrandingTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.reownBranding?l`
`:null}};$i([u()],_t.prototype,"isMobile",void 0);$i([u()],_t.prototype,"remoteFeatures",void 0);_t=$i([h("w3m-connecting-wc-basic-view")],_t);const Ao=y`
.continue-button-container {
width: 100%;
}
`;var ln=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Tt=class extends w{constructor(){super(...arguments),this.loading=!1}render(){return l`
${this.onboardingTemplate()} ${this.buttonsTemplate()}
{b.openHref(Cn.URLS.FAQ,"_blank")}}
>
Learn more about names
`}onboardingTemplate(){return l`
Choose your account name
Finally say goodbye to 0x addresses, name your account to make it easier to exchange
assets
`}buttonsTemplate(){return l`
Choose name
`}handleContinue(){f.push("RegisterAccountName"),A.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:ye(d.state.activeChain)===ae.ACCOUNT_TYPES.SMART_ACCOUNT}})}};Tt.styles=Ao;ln([u()],Tt.prototype,"loading",void 0);Tt=ln([h("w3m-choose-account-name-view")],Tt);var Wo=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Gi=class extends w{constructor(){var e;super(...arguments),this.wallet=(e=f.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return l`
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
${this.homepageTemplate()}
`}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?l`
Chrome Extension
`:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?l`
iOS App
`:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?l`
Android App
`:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?l`
Website
`:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&b.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&b.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&b.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&b.openHref(this.wallet.homepage,"_blank")}};Gi=Wo([h("w3m-downloads-view")],Gi);var Eo=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};const _o="https://walletconnect.com/explorer";let Hi=class extends w{render(){return l`
${this.recommendedWalletsTemplate()}
{b.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
>
`}recommendedWalletsTemplate(){const{recommended:e,featured:t}=E.state,{customWallets:n}=v.state;return[...t,...n??[],...e].slice(0,4).map(i=>l`
{b.openHref(i.homepage??_o,"_blank")}}
>
`)}};Hi=Eo([h("w3m-get-wallet-view")],Hi);var cn=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let li=class extends w{constructor(){super(...arguments),this.data=[]}render(){return l`
${this.data.map(e=>l`
${e.images.map(t=>l``)}
${e.title}
${e.text}
`)}
`}};cn([c({type:Array})],li.prototype,"data",void 0);li=cn([h("w3m-help-widget")],li);var To=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};const No=[{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."}];let qi=class extends w{render(){return l`
Get a wallet
`}onGetWallet(){A.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),f.push("GetWallet")}};qi=To([h("w3m-what-is-a-wallet-view")],qi);const Ro=y`
wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: opacity;
}
wui-flex::-webkit-scrollbar {
display: none;
}
wui-flex.disabled {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
`;var un=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Nt=class extends w{constructor(){super(),this.unsubscribe=[],this.checked=bt.state.isLegalCheckboxChecked,this.unsubscribe.push(bt.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var g;const{termsConditionsUrl:e,privacyPolicyUrl:t}=v.state,n=(g=v.state.features)==null?void 0:g.legalCheckbox,i=!!(e||t)&&!!n,s=i&&!this.checked,r=s?-1:void 0;return l`
`}};Nt.styles=Ro;un([u()],Nt.prototype,"checked",void 0);Nt=un([h("w3m-connect-wallets-view")],Nt);const Oo=y`
:host {
display: block;
width: var(--wui-box-size-lg);
height: var(--wui-box-size-lg);
}
svg {
width: var(--wui-box-size-lg);
height: var(--wui-box-size-lg);
fill: none;
stroke: transparent;
stroke-linecap: round;
}
use {
stroke: var(--wui-color-accent-100);
stroke-width: 2px;
stroke-dasharray: 54, 118;
stroke-dashoffset: 172;
animation: dash 1s linear infinite;
}
@keyframes dash {
to {
stroke-dashoffset: 0px;
}
}
`;var Po=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let ci=class extends w{render(){return l`
`}};ci.styles=[T,Oo];ci=Po([h("wui-loading-hexagon")],ci);const Do=y`
@keyframes shake {
0% {
transform: translateX(0);
}
25% {
transform: translateX(3px);
}
50% {
transform: translateX(-3px);
}
75% {
transform: translateX(3px);
}
100% {
transform: translateX(0);
}
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-loading-hexagon {
position: absolute;
}
wui-icon-box {
position: absolute;
right: 4px;
bottom: 0;
opacity: 0;
transform: scale(0.5);
z-index: 1;
}
wui-button {
display: none;
}
[data-error='true'] wui-icon-box {
opacity: 1;
transform: scale(1);
}
[data-error='true'] > wui-flex:first-child {
animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
wui-button[data-retry='true'] {
display: block;
opacity: 1;
}
`;var Si=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let ut=class extends w{constructor(){var e;super(),this.network=(e=f.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),t=this.getSubLabel();return l`
${this.error?null:l``}
${e}
${t}
Try again
`}getSubLabel(){const e=m.getConnectorId(d.state.activeChain);return m.getAuthConnector()&&e===S.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(){var n;const e=m.getConnectorId(d.state.activeChain);return m.getAuthConnector()&&e===S.CONNECTOR_ID.AUTH?`Switching to ${((n=this.network)==null?void 0:n.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");t==null||t.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){var e;try{this.error=!1,d.state.activeChain!==((e=this.network)==null?void 0:e.chainNamespace)&&d.setIsSwitchingNamespace(!0),this.network&&await d.switchActiveNetwork(this.network)}catch{this.error=!0}}};ut.styles=Do;Si([u()],ut.prototype,"showRetry",void 0);Si([u()],ut.prototype,"error",void 0);ut=Si([h("w3m-network-switch-view")],ut);const Lo=y`
button {
column-gap: var(--wui-spacing-s);
padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
width: 100%;
transition: all var(--wui-ease-out-power-1) var(--wui-duration-md);
border-radius: var(--wui-border-radius-xs);
color: var(--wui-color-fg-100);
}
button > wui-text:nth-child(2) {
display: flex;
flex: 1;
}
button[data-transparent='true'] {
pointer-events: none;
background-color: transparent;
}
button:hover {
background-color: var(--wui-color-gray-glass-002);
}
button:active {
background-color: var(--wui-color-gray-glass-005);
}
wui-image {
width: var(--wui-spacing-3xl);
height: var(--wui-spacing-3xl);
border-radius: 100%;
}
button:disabled {
background-color: var(--wui-color-gray-glass-002);
opacity: 0.5;
cursor: not-allowed;
}
button:disabled > wui-tag {
background-color: var(--wui-color-gray-glass-010);
color: var(--wui-color-fg-300);
}
`;var Ze=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Se=class extends w{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.selected=!1,this.transparent=!1}render(){return l`
`}checkmarkTemplate(){return this.selected?l``:null}templateNetworkImage(){return this.imageSrc?l``:this.imageSrc?null:l``}};Se.styles=[T,N,Lo];Ze([c()],Se.prototype,"imageSrc",void 0);Ze([c()],Se.prototype,"name",void 0);Ze([c({type:Boolean})],Se.prototype,"disabled",void 0);Ze([c({type:Boolean})],Se.prototype,"selected",void 0);Ze([c({type:Boolean})],Se.prototype,"transparent",void 0);Se=Ze([h("wui-list-network")],Se);const jo=y`
.container {
max-height: 360px;
overflow: auto;
}
.container::-webkit-scrollbar {
display: none;
}
`;var ft=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Le=class extends w{constructor(){super(),this.unsubscribe=[],this.network=d.state.activeCaipNetwork,this.requestedCaipNetworks=d.getCaipNetworks(),this.search="",this.onDebouncedSearch=b.debounce(e=>{this.search=e},100),this.unsubscribe.push(Ee.subscribeNetworkImages(()=>this.requestUpdate()),d.subscribeKey("activeCaipNetwork",e=>this.network=e),d.subscribe(()=>{this.requestedCaipNetworks=d.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.templateSearchInput()}
${this.networksTemplate()}
Your connected wallet may not support some of the networks available for this dApp
What is a network
`}templateSearchInput(){return l`
`}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){A.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),f.push("WhatIsANetwork")}networksTemplate(){var n;const e=d.getAllApprovedCaipNetworkIds(),t=b.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=t==null?void 0:t.filter(o=>{var i;return(i=o==null?void 0:o.name)==null?void 0:i.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=t,(n=this.filteredNetworks)==null?void 0:n.map(o=>{var i;return l`
this.onSwitchNetwork(o)}
.disabled=${this.getNetworkDisabled(o)}
data-testid=${`w3m-network-switch-${o.name??o.id}`}
>
`})}getNetworkDisabled(e){const t=e.chainNamespace,n=C.getCaipAddress(t),o=d.getAllApprovedCaipNetworkIds(),i=d.getNetworkProp("supportsAllNetworks",t)!==!1,s=m.getConnectorId(t),r=m.getAuthConnector(),g=s===S.CONNECTOR_ID.AUTH&&r;return!n||i||g?!1:!(o!=null&&o.includes(e.caipNetworkId))}onSwitchNetwork(e){xn.onSwitchNetwork({network:e})}};Le.styles=jo;ft([u()],Le.prototype,"network",void 0);ft([u()],Le.prototype,"requestedCaipNetworks",void 0);ft([u()],Le.prototype,"filteredNetworks",void 0);ft([u()],Le.prototype,"search",void 0);Le=ft([h("w3m-networks-view")],Le);const Bo=y`
@keyframes shake {
0% {
transform: translateX(0);
}
25% {
transform: translateX(3px);
}
50% {
transform: translateX(-3px);
}
75% {
transform: translateX(3px);
}
100% {
transform: translateX(0);
}
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-loading-thumbnail {
position: absolute;
}
wui-visual {
width: var(--wui-wallet-image-size-lg);
height: var(--wui-wallet-image-size-lg);
border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
position: relative;
overflow: hidden;
}
wui-visual::after {
content: '';
display: block;
width: 100%;
height: 100%;
position: absolute;
inset: 0;
border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
}
wui-icon-box {
position: absolute;
right: calc(var(--wui-spacing-3xs) * -1);
bottom: calc(var(--wui-spacing-3xs) * -1);
opacity: 0;
transform: scale(0.5);
transition:
opacity var(--wui-ease-out-power-2) var(--wui-duration-lg),
transform var(--wui-ease-out-power-2) var(--wui-duration-lg);
will-change: opacity, transform;
}
wui-text[align='center'] {
width: 100%;
padding: 0px var(--wui-spacing-l);
}
[data-error='true'] wui-icon-box {
opacity: 1;
transform: scale(1);
}
[data-error='true'] > wui-flex:first-child {
animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
[data-retry='false'] wui-link {
display: none;
}
[data-retry='true'] wui-link {
display: block;
opacity: 1;
}
wui-link {
padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
}
.capitalize {
text-transform: capitalize;
}
`;var dn=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};const Uo={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0};let Rt=class extends w{constructor(){var e,t;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=f.state.data)==null?void 0:e.switchToChain,this.caipNetwork=(t=f.state.data)==null?void 0:t.network,this.activeChain=d.state.activeChain}firstUpdated(){this.unsubscribe.push(d.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?S.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const t=S.CHAIN_NAME_MAP[this.switchToChain];return l`
Switch to ${t}
Connected wallet doesn't support connecting to ${e} chain. You
need to connect with a different wallet.
Switch
`}async switchActiveChain(){this.switchToChain&&(d.setIsSwitchingNamespace(!0),m.setFilterByNamespace(this.switchToChain),this.caipNetwork?await d.switchActiveNetwork(this.caipNetwork):d.setActiveNamespace(this.switchToChain),f.reset("Connect"))}};Rt.styles=Bo;dn([c()],Rt.prototype,"activeChain",void 0);Rt=dn([h("w3m-switch-active-chain-view")],Rt);var zo=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};const Mo=[{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."}];let Yi=class extends w{render(){return l`
{b.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
>
Learn more
`}};Yi=zo([h("w3m-what-is-a-network-view")],Yi);const Fo=y`
:host > wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
}
:host > wui-flex::-webkit-scrollbar {
display: none;
}
`;var Ii=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let dt=class extends w{constructor(){var e;super(),this.swapUnsupportedChain=(e=f.state.data)==null?void 0:e.swapUnsupportedChain,this.unsubscribe=[],this.disconnecting=!1,this.remoteFeatures=v.state.remoteFeatures,this.unsubscribe.push(Ee.subscribeNetworkImages(()=>this.requestUpdate()),v.subscribeKey("remoteFeatures",t=>{this.remoteFeatures=t}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.descriptionTemplate()}
${this.networksTemplate()}
Disconnect
`}descriptionTemplate(){return this.swapUnsupportedChain?l`
The swap feature doesn’t support your current network. Switch to an available option to
continue.
`:l`
This app doesn’t support your current network. Switch to an available option to continue.
`}networksTemplate(){const e=d.getAllRequestedCaipNetworks(),t=d.getAllApprovedCaipNetworkIds(),n=b.sortRequestedNetworks(t,e);return(this.swapUnsupportedChain?n.filter(i=>V.SWAP_SUPPORTED_NETWORKS.includes(i.caipNetworkId)):n).map(i=>l`
this.onSwitchNetwork(i)}
>
`)}async onDisconnect(){var e;try{this.disconnecting=!0;const t=d.state.activeChain,o=x.getConnections(t).length>0,i=t&&m.state.activeConnectorIds[t],s=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await x.disconnect(s?{id:i,namespace:t}:{}),o&&s&&(f.push("ProfileWallets"),_.showSuccess("Wallet deleted"))}catch{A.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),_.showError("Failed to disconnect")}finally{this.disconnecting=!1}}async onSwitchNetwork(e){const t=C.state.caipAddress,n=d.getAllApprovedCaipNetworkIds(),o=d.getNetworkProp("supportsAllNetworks",e.chainNamespace),i=f.state.data;t?n!=null&&n.includes(e.caipNetworkId)?await d.switchActiveNetwork(e):o?f.push("SwitchNetwork",{...i,network:e}):f.push("SwitchNetwork",{...i,network:e}):t||(d.setActiveCaipNetwork(e),f.push("Connect"))}};dt.styles=Fo;Ii([u()],dt.prototype,"disconnecting",void 0);Ii([u()],dt.prototype,"remoteFeatures",void 0);dt=Ii([h("w3m-unsupported-chain-view")],dt);const Vo=y`
wui-flex {
width: 100%;
background-color: var(--wui-color-gray-glass-005);
border-radius: var(--wui-border-radius-s);
padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs)
var(--wui-spacing-1xs);
}
`;var ki=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let pt=class extends w{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return l`
${this.text}
`}};pt.styles=[T,N,Vo];ki([c()],pt.prototype,"icon",void 0);ki([c()],pt.prototype,"text",void 0);pt=ki([h("wui-banner")],pt);const Ko=y`
:host > wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
}
:host > wui-flex::-webkit-scrollbar {
display: none;
}
`;var Go=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let ui=class extends w{constructor(){super(),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.networkTemplate()}
`}networkTemplate(){const e=d.getAllRequestedCaipNetworks(),t=d.getAllApprovedCaipNetworkIds(),n=d.state.activeCaipNetwork,o=d.checkIfSmartAccountEnabled();let i=b.sortRequestedNetworks(t,e);if(o&&ye(n==null?void 0:n.chainNamespace)===ae.ACCOUNT_TYPES.SMART_ACCOUNT){if(!n)return null;i=[n]}return i.filter(r=>r.chainNamespace===(n==null?void 0:n.chainNamespace)).map(r=>l`
`)}};ui.styles=Ko;ui=Go([h("w3m-wallet-compatible-networks-view")],ui);const Ho=y`
:host {
display: flex;
justify-content: center;
align-items: center;
width: var(--wui-icon-box-size-xl);
height: var(--wui-icon-box-size-xl);
box-shadow: 0 0 0 8px var(--wui-thumbnail-border);
border-radius: var(--local-border-radius);
overflow: hidden;
}
wui-icon {
width: 32px;
height: 32px;
}
`;var qt=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Ge=class extends w{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"}; background-color: var(--wui-color-modal-bg);`,l`${this.templateVisual()}`}templateVisual(){return this.imageSrc?l``:l``}};Ge.styles=[T,Ho];qt([c()],Ge.prototype,"imageSrc",void 0);qt([c()],Ge.prototype,"alt",void 0);qt([c({type:Boolean})],Ge.prototype,"borderRadiusFull",void 0);Ge=qt([h("wui-visual-thumbnail")],Ge);const qo=y`
:host {
display: flex;
justify-content: center;
gap: var(--wui-spacing-2xl);
}
wui-visual-thumbnail:nth-child(1) {
z-index: 1;
}
`;var Yo=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let di=class extends w{constructor(){var e,t;super(...arguments),this.dappImageUrl=(e=v.state.metadata)==null?void 0:e.icons,this.walletImageUrl=(t=C.state.connectedWalletInfo)==null?void 0:t.icon}firstUpdated(){var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return l`
`}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})}};di.styles=qo;di=Yo([h("w3m-siwx-sign-message-thumbnails")],di);var Ai=function(a,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,e,t,n);else for(var r=a.length-1;r>=0;r--)(s=a[r])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i};let Ot=class extends w{constructor(){var e;super(...arguments),this.dappName=(e=v.state.metadata)==null?void 0:e.name,this.isCancelling=!1,this.isSigning=!1}render(){return l`
${this.dappName??"Dapp"} needs to connect to your wallet
Sign this message to prove you own this wallet and proceed. Canceling will disconnect
you.
${this.isCancelling?"Cancelling...":"Cancel"}
${this.isSigning?"Signing...":"Sign"}
`}async onSign(){this.isSigning=!0;try{await Ei.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){_.showError({message:"Something went wrong. We need to verify your account again."}),f.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await Ei.cancelSignMessage().finally(()=>this.isCancelling=!1)}};Ai([u()],Ot.prototype,"isCancelling",void 0);Ai([u()],Ot.prototype,"isSigning",void 0);Ot=Ai([h("w3m-siwx-sign-message-view")],Ot);export{Ti as AppKitAccountButton,Ri as AppKitButton,Pi as AppKitConnectButton,Li as AppKitNetworkButton,_i as W3mAccountButton,le as W3mAccountSettingsView,ni as W3mAccountView,Ct as W3mAllWalletsView,Ni as W3mButton,Tt as W3mChooseAccountNameView,Oi as W3mConnectButton,H as W3mConnectView,Nt as W3mConnectWalletsView,Mi as W3mConnectingExternalView,Wt as W3mConnectingMultiChainView,_t as W3mConnectingWcBasicView,De as W3mConnectingWcView,Gi as W3mDownloadsView,Hi as W3mGetWalletView,Di as W3mNetworkButton,ut as W3mNetworkSwitchView,Le as W3mNetworksView,j as W3mProfileWalletsView,lr as W3mRouter,Ot as W3mSIWXSignMessageView,Rt as W3mSwitchActiveChainView,dt as W3mUnsupportedChainView,ui as W3mWalletCompatibleNetworksView,Yi as W3mWhatIsANetworkView,qi as W3mWhatIsAWalletView};