import{j as e,l as t,R as i,m as a,E as n,r,k as s}from"./p-BxEPsDRj.js";import{r as o,c as w,n as c}from"./p-CrMmJdZ6.js";import"./p-CsctQ88z.js";import{H as l}from"./p-DO7_rlGh.js";import{o as m}from"./p-zNe_7rLp.js";import"./p-DJATscC5.js";import"./p-4_J16YIF.js";var u=e`
  :host {
    display: block;
  }

  div.container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    height: auto;
    display: block;
  }

  div.container[status='hide'] {
    animation: fade-out;
    animation-duration: var(--apkt-duration-dynamic);
    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
    animation-fill-mode: both;
    animation-delay: 0s;
  }

  div.container[status='show'] {
    animation: fade-in;
    animation-duration: var(--apkt-duration-dynamic);
    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
    animation-fill-mode: both;
    animation-delay: var(--apkt-duration-dynamic);
  }

  @keyframes fade-in {
    from {
      opacity: 0;
      filter: blur(6px);
    }
    to {
      opacity: 1;
      filter: blur(0px);
    }
  }

  @keyframes fade-out {
    from {
      opacity: 1;
      filter: blur(0px);
    }
    to {
      opacity: 0;
      filter: blur(6px);
    }
  }
`;var d=undefined&&undefined.__decorate||function(e,t,i,a){var n=arguments.length,r=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,i):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])r=(n<3?s(r):n>3?s(t,i,r):s(t,i))||r;return n>3&&r&&Object.defineProperty(t,i,r),r};let p=class e extends t{constructor(){super(...arguments);this.resizeObserver=undefined;this.unsubscribe=[];this.status="hide";this.view=i.state.view}firstUpdated(){this.status=l.hasFooter()?"show":"hide";this.unsubscribe.push(i.subscribeKey("view",(e=>{this.view=e;this.status=l.hasFooter()?"show":"hide";if(this.status==="hide"){const e=document.documentElement.style;e.setProperty("--apkt-footer-height","0px")}})));this.resizeObserver=new ResizeObserver((e=>{for(const t of e){if(t.target===this.getWrapper()){const e=`${t.contentRect.height}px`;const i=document.documentElement.style;i.setProperty("--apkt-footer-height",e)}}}));this.resizeObserver.observe(this.getWrapper())}render(){return a`
      <div class="container" status=${this.status}>${this.templatePageContainer()}</div>
    `}templatePageContainer(){if(l.hasFooter()){return a` ${this.templateFooter()}`}return null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return a`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return a`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return a` <wui-flex
      class="footer-in"
      padding="3"
      flexDirection="column"
      gap="3"
      alignItems="center"
    >
      <wui-text variant="md-regular" color="secondary" align="center">
        Your connected wallet may not support some of the networks available for this dApp
      </wui-text>
      <wui-link @click=${this.onNetworkHelp.bind(this)}>
        <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
        What is a network
      </wui-link>
    </wui-flex>`}onNetworkHelp(){n.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"});i.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};p.styles=[u];d([o()],p.prototype,"status",void 0);d([o()],p.prototype,"view",void 0);p=d([w("w3m-footer")],p);var v=e`
  :host {
    display: block;
    width: inherit;
  }
`;var h=undefined&&undefined.__decorate||function(e,t,i,a){var n=arguments.length,r=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,i):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])r=(n<3?s(r):n>3?s(t,i,r):s(t,i))||r;return n>3&&r&&Object.defineProperty(t,i,r),r};let f=class e extends t{constructor(){super();this.unsubscribe=[];this.viewState=i.state.view;this.history=i.state.history.join(",");this.unsubscribe.push(i.subscribeKey("view",(()=>{this.history=i.state.history.join(",");document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")})))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()));document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return a`${this.templatePageContainer()}`}templatePageContainer(){return a`<w3m-router-container
      history=${this.history}
      .setView=${()=>{this.viewState=i.state.view}}
    >
      ${this.viewTemplate(this.viewState)}
    </w3m-router-container>`}viewTemplate(e){switch(e){case"AccountSettings":return a`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return a`<w3m-account-view></w3m-account-view>`;case"AllWallets":return a`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return a`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return a`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return a`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return a`<w3m-connect-view></w3m-connect-view>`;case"Create":return a`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return a`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return a`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return a`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return a`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return a`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return a`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return a`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return a`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return a`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return a`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return a`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return a`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return a`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return a`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return a`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return a`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return a`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return a`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return a`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return a`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return a`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return a`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return a`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return a`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return a`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return a`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return a`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return a`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return a`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return a`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return a`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return a`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return a`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return a`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return a`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return a`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return a`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return a`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return a`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return a`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return a`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return a`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return a`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return a`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return a`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return a`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return a`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return a`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"PayQuote":return a`<w3m-pay-quote-view></w3m-pay-quote-view>`;case"FundWallet":return a`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return a`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return a`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;case"UsageExceeded":return a`<w3m-usage-exceeded-view></w3m-usage-exceeded-view>`;case"SmartAccountSettings":return a`<w3m-smart-account-settings-view></w3m-smart-account-settings-view>`;default:return a`<w3m-connect-view></w3m-connect-view>`}}};f.styles=[v];h([o()],f.prototype,"viewState",void 0);h([o()],f.prototype,"history",void 0);f=h([w("w3m-router")],f);var g=e`
  :host {
    position: relative;
    border-radius: ${({borderRadius:e})=>e[2]};
    width: 40px;
    height: 40px;
    overflow: hidden;
    background: ${({tokens:e})=>e.theme.foregroundPrimary};
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    column-gap: ${({spacing:e})=>e[1]};
    padding: ${({spacing:e})=>e[1]};
  }

  :host > wui-wallet-image {
    width: 14px;
    height: 14px;
    border-radius: 2px;
  }
`;var b=undefined&&undefined.__decorate||function(e,t,i,a){var n=arguments.length,r=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,i):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])r=(n<3?s(r):n>3?s(t,i,r):s(t,i))||r;return n>3&&r&&Object.defineProperty(t,i,r),r};const y=4;let k=class e extends t{constructor(){super(...arguments);this.walletImages=[]}render(){const e=this.walletImages.length<y;return a`${this.walletImages.slice(0,y).map((({src:e,walletName:t})=>a`
          <wui-wallet-image
            size="sm"
            imageSrc=${e}
            name=${m(t)}
          ></wui-wallet-image>
        `))}
    ${e?[...Array(y-this.walletImages.length)].map((()=>a` <wui-wallet-image size="sm" name=""></wui-wallet-image>`)):null} `}};k.styles=[r,g];b([c({type:Array})],k.prototype,"walletImages",void 0);k=b([w("wui-all-wallets-image")],k);var x=e`
  :host {
    width: 100%;
  }

  button {
    column-gap: ${({spacing:e})=>e[2]};
    padding: ${({spacing:e})=>e[3]};
    width: 100%;
    background-color: transparent;
    border-radius: ${({borderRadius:e})=>e[4]};
    color: ${({tokens:e})=>e.theme.textPrimary};
  }

  button > wui-wallet-image {
    background: ${({tokens:e})=>e.theme.foregroundSecondary};
  }

  button > wui-text:nth-child(2) {
    display: flex;
    flex: 1;
  }

  button:hover:enabled {
    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
  }

  button[data-all-wallets='true'] {
    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
  }

  button[data-all-wallets='true']:hover:enabled {
    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
  }

  button:focus-visible:enabled {
    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
  }

  button:disabled {
    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
    opacity: 0.5;
    cursor: not-allowed;
  }

  button:disabled > wui-tag {
    background-color: ${({tokens:e})=>e.core.glass010};
    color: ${({tokens:e})=>e.theme.foregroundTertiary};
  }

  wui-flex.namespace-icon {
    width: 16px;
    height: 16px;
    border-radius: ${({borderRadius:e})=>e.round};
    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.backgroundPrimary};
    transition: box-shadow var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2);
  }

  button:hover:enabled wui-flex.namespace-icon {
    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.foregroundPrimary};
  }

  wui-flex.namespace-icon > wui-icon {
    width: 10px;
    height: 10px;
  }

  wui-flex.namespace-icon:not(:first-child) {
    margin-left: -4px;
  }
`;var $=undefined&&undefined.__decorate||function(e,t,i,a){var n=arguments.length,r=n<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,i):a,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;o>=0;o--)if(s=e[o])r=(n<3?s(r):n>3?s(t,i,r):s(t,i))||r;return n>3&&r&&Object.defineProperty(t,i,r),r};const S={eip155:"ethereum",solana:"solana",bip122:"bitcoin",polkadot:undefined,cosmos:undefined,sui:undefined,stacks:undefined,ton:"ton"};let C=class e extends t{constructor(){super(...arguments);this.walletImages=[];this.imageSrc="";this.name="";this.size="md";this.tabIdx=undefined;this.namespaces=[];this.disabled=false;this.showAllWallets=false;this.loading=false;this.loadingSpinnerColor="accent-100"}render(){this.dataset["size"]=this.size;return a`
      <button
        ?disabled=${this.disabled}
        data-all-wallets=${this.showAllWallets}
        tabindex=${m(this.tabIdx)}
      >
        ${this.templateAllWallets()} ${this.templateWalletImage()}
        <wui-flex flexDirection="column" justifyContent="center" alignItems="flex-start" gap="1">
          <wui-text variant="lg-regular" color="inherit">${this.name}</wui-text>
          ${this.templateNamespaces()}
        </wui-flex>
        ${this.templateStatus()}
        <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
      </button>
    `}templateNamespaces(){if(this.namespaces?.length){return a`<wui-flex alignItems="center" gap="0">
        ${this.namespaces.map(((e,t)=>a`<wui-flex
              alignItems="center"
              justifyContent="center"
              zIndex=${(this.namespaces?.length??0)*2-t}
              class="namespace-icon"
            >
              <wui-icon
                name=${m(S[e])}
                size="sm"
                color="default"
              ></wui-icon>
            </wui-flex>`))}
      </wui-flex>`}return null}templateAllWallets(){if(this.showAllWallets&&this.imageSrc){return a` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `}else if(this.showAllWallets&&this.walletIcon){return a` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `}return null}templateWalletImage(){if(!this.showAllWallets&&this.imageSrc){return a`<wui-wallet-image
        size=${m(this.size==="sm"?"sm":"md")}
        imageSrc=${this.imageSrc}
        name=${this.name}
      ></wui-wallet-image>`}else if(!this.showAllWallets&&!this.imageSrc){return a`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`}return null}templateStatus(){if(this.loading){return a`<wui-loading-spinner size="lg" color="accent-primary"></wui-loading-spinner>`}else if(this.tagLabel&&this.tagVariant){return a`<wui-tag size="sm" variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`}return null}};C.styles=[r,s,x];$([c({type:Array})],C.prototype,"walletImages",void 0);$([c()],C.prototype,"imageSrc",void 0);$([c()],C.prototype,"name",void 0);$([c()],C.prototype,"size",void 0);$([c()],C.prototype,"tagLabel",void 0);$([c()],C.prototype,"tagVariant",void 0);$([c()],C.prototype,"walletIcon",void 0);$([c()],C.prototype,"tabIdx",void 0);$([c({type:Array})],C.prototype,"namespaces",void 0);$([c({type:Boolean})],C.prototype,"disabled",void 0);$([c({type:Boolean})],C.prototype,"showAllWallets",void 0);$([c({type:Boolean})],C.prototype,"loading",void 0);$([c({type:String})],C.prototype,"loadingSpinnerColor",void 0);C=$([w("wui-list-wallet")],C);export{f as W,p as a};
//# sourceMappingURL=p-Cesxc720.js.map