import{n as e,l as t,M as i,O as s,m as n,z as o,T as a,Y as r,j as c,r as u,k as d,d as l,C as p,Z as h,q as f,t as m,W as w,o as g,_ as x,$ as b,a as v,E as $,S as y,R as k}from"./p-BxEPsDRj.js";import{r as R,c as j,n as z}from"./p-CrMmJdZ6.js";import"./p-CbOrugAV.js";import{e as S,n as A}from"./p-B9-TeWdB.js";import"./p-WZF-tHaR.js";import{H as O}from"./p-DO7_rlGh.js";import{o as T}from"./p-zNe_7rLp.js";import"./p-CGIQ9z_e.js";import"./p-DntCYpai.js";import"./p-CG_zIdXa.js";import"./p-DJATscC5.js";import"./p-YV_GhS6X.js";import{N as C}from"./p-C1fP8Aff.js";import"./p-BId5WtRC.js";import"buffer";import"events";import"ox";import"viem";import"viem/chains";import"./p-DtZPtFUa.js";var _=e`
  div {
    width: 100%;
  }

  [data-ready='false'] {
    transform: scale(1.05);
  }

  @media (max-width: 430px) {
    [data-ready='false'] {
      transform: translateY(-50px);
    }
  }
`;var E=undefined&&undefined.__decorate||function(e,t,i,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)if(a=e[r])o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o;return n>3&&o&&Object.defineProperty(t,i,o),o};const I=600;const D=360;const B=64;let N=class e extends t{constructor(){super();this.bodyObserver=undefined;this.unsubscribe=[];this.iframe=document.getElementById("w3m-iframe");this.ready=false;this.unsubscribe.push(...[i.subscribeKey("open",(e=>{if(!e){this.onHideIframe()}})),i.subscribeKey("shake",(e=>{if(e){this.iframe.style.animation=`w3m-shake 500ms var(--apkt-easings-ease-out-power-2)`}else{this.iframe.style.animation="none"}}))])}disconnectedCallback(){this.onHideIframe();this.unsubscribe.forEach((e=>e()));this.bodyObserver?.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme();this.iframe.style.display="block";const e=this?.renderRoot?.querySelector("div");this.bodyObserver=new ResizeObserver((t=>{const i=t?.[0]?.contentBoxSize;const n=i?.[0]?.inlineSize;this.iframe.style.height=`${I}px`;e.style.height=`${I}px`;if(s.state.enableEmbedded){this.updateFrameSizeForEmbeddedMode()}else if(n&&n<=430){this.iframe.style.width="100%";this.iframe.style.left="0px";this.iframe.style.bottom="0px";this.iframe.style.top="unset";this.onShowIframe()}else{this.iframe.style.width=`${D}px`;this.iframe.style.left=`calc(50% - ${D/2}px)`;this.iframe.style.top=`calc(50% - ${I/2}px + ${B/2}px)`;this.iframe.style.bottom="unset";this.onShowIframe()}}));this.bodyObserver.observe(window.document.body)}render(){return n`<div data-ready=${this.ready} id="w3m-frame-container"></div>`}onShowIframe(){const e=window.innerWidth<=430;this.ready=true;this.iframe.style.animation=e?"w3m-iframe-zoom-in-mobile 200ms var(--apkt-easings-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--apkt-easings-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none";this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--apkt-easings-ease-out-power-2)"}async syncTheme(){const e=o.getAuthConnector();if(e){const t=a.getSnapshot().themeMode;const i=a.getSnapshot().themeVariables;await e.provider.syncTheme({themeVariables:i,w3mThemeVariables:r(i,t)})}}async updateFrameSizeForEmbeddedMode(){const e=this?.renderRoot?.querySelector("div");await new Promise((e=>{setTimeout(e,300)}));const t=this.getBoundingClientRect();e.style.width="100%";this.iframe.style.left=`${t.left}px`;this.iframe.style.top=`${t.top}px`;this.iframe.style.width=`${t.width}px`;this.iframe.style.height=`${t.height}px`;this.onShowIframe()}};N.styles=_;E([R()],N.prototype,"ready",void 0);N=E([j("w3m-approve-transaction-view")],N);var M=c`
  a {
    border: none;
    border-radius: ${({borderRadius:e})=>e["20"]};
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: ${({spacing:e})=>e[1]};
    transition:
      background-color ${({durations:e})=>e["lg"]}
        ${({easings:e})=>e["ease-out-power-2"]},
      box-shadow ${({durations:e})=>e["lg"]}
        ${({easings:e})=>e["ease-out-power-2"]},
      border ${({durations:e})=>e["lg"]} ${({easings:e})=>e["ease-out-power-2"]};
    will-change: background-color, box-shadow, border;
  }

  /* -- Variants --------------------------------------------------------------- */
  a[data-type='success'] {
    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
    color: ${({tokens:e})=>e.core.textSuccess};
  }

  a[data-type='error'] {
    background-color: ${({tokens:e})=>e.core.backgroundError};
    color: ${({tokens:e})=>e.core.textError};
  }

  a[data-type='warning'] {
    background-color: ${({tokens:e})=>e.core.backgroundWarning};
    color: ${({tokens:e})=>e.core.textWarning};
  }

  /* -- Sizes --------------------------------------------------------------- */
  a[data-size='sm'] {
    height: 24px;
  }

  a[data-size='md'] {
    height: 28px;
  }

  a[data-size='lg'] {
    height: 32px;
  }

  a[data-size='sm'] > wui-image,
  a[data-size='sm'] > wui-icon {
    width: 16px;
    height: 16px;
  }

  a[data-size='md'] > wui-image,
  a[data-size='md'] > wui-icon {
    width: 20px;
    height: 20px;
  }

  a[data-size='lg'] > wui-image,
  a[data-size='lg'] > wui-icon {
    width: 24px;
    height: 24px;
  }

  wui-text {
    padding-left: ${({spacing:e})=>e[1]};
    padding-right: ${({spacing:e})=>e[1]};
  }

  wui-image {
    border-radius: ${({borderRadius:e})=>e[3]};
    overflow: hidden;
    user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-drag: none;
    -webkit-user-select: none;
    -ms-user-select: none;
  }

  /* -- States --------------------------------------------------------------- */
  @media (hover: hover) and (pointer: fine) {
    a[data-type='success']:not(:disabled):hover {
      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
      box-shadow: 0px 0px 0px 1px ${({tokens:e})=>e.core.borderSuccess};
    }

    a[data-type='error']:not(:disabled):hover {
      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
      box-shadow: 0px 0px 0px 1px ${({tokens:e})=>e.core.borderError};
    }

    a[data-type='warning']:not(:disabled):hover {
      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
      box-shadow: 0px 0px 0px 1px ${({tokens:e})=>e.core.borderWarning};
    }
  }

  a[data-type='success']:not(:disabled):focus-visible {
    box-shadow:
      0px 0px 0px 1px ${({tokens:e})=>e.core.backgroundAccentPrimary},
      0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent020};
  }

  a[data-type='error']:not(:disabled):focus-visible {
    box-shadow:
      0px 0px 0px 1px ${({tokens:e})=>e.core.backgroundAccentPrimary},
      0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent020};
  }

  a[data-type='warning']:not(:disabled):focus-visible {
    box-shadow:
      0px 0px 0px 1px ${({tokens:e})=>e.core.backgroundAccentPrimary},
      0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent020};
  }

  a:disabled {
    opacity: 0.5;
  }
`;var V=undefined&&undefined.__decorate||function(e,t,i,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)if(a=e[r])o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o;return n>3&&o&&Object.defineProperty(t,i,o),o};const Y={sm:"md-regular",md:"lg-regular",lg:"lg-regular"};const G={success:"sealCheck",error:"warning",warning:"exclamationCircle"};let P=class e extends t{constructor(){super(...arguments);this.type="success";this.size="md";this.imageSrc=undefined;this.disabled=false;this.href="";this.text=undefined}render(){return n`
      <a
        rel="noreferrer"
        target="_blank"
        href=${this.href}
        class=${this.disabled?"disabled":""}
        data-type=${this.type}
        data-size=${this.size}
      >
        ${this.imageTemplate()}
        <wui-text variant=${Y[this.size]} color="inherit">${this.text}</wui-text>
      </a>
    `}imageTemplate(){if(this.imageSrc){return n`<wui-image src=${this.imageSrc} size="inherit"></wui-image>`}return n`<wui-icon
      name=${G[this.type]}
      weight="fill"
      color="inherit"
      size="inherit"
      class="image-icon"
    ></wui-icon>`}};P.styles=[u,d,M];V([z()],P.prototype,"type",void 0);V([z()],P.prototype,"size",void 0);V([z()],P.prototype,"imageSrc",void 0);V([z({type:Boolean})],P.prototype,"disabled",void 0);V([z()],P.prototype,"href",void 0);V([z()],P.prototype,"text",void 0);P=V([j("wui-semantic-chip")],P);var F=undefined&&undefined.__decorate||function(e,t,i,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)if(a=e[r])o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o;return n>3&&o&&Object.defineProperty(t,i,o),o};let K=class e extends t{render(){return n`
      <wui-flex flexDirection="column" alignItems="center" gap="5" padding="5">
        <wui-text variant="md-regular" color="primary">Follow the instructions on</wui-text>
        <wui-semantic-chip
          icon="externalLink"
          variant="fill"
          text=${l.SECURE_SITE_DASHBOARD}
          href=${l.SECURE_SITE_DASHBOARD}
          imageSrc=${l.SECURE_SITE_FAVICON}
          data-testid="w3m-secure-website-button"
        >
        </wui-semantic-chip>
        <wui-text variant="sm-regular" color="secondary">
          You will have to reconnect for security reasons
        </wui-text>
      </wui-flex>
    `}};K=F([j("w3m-upgrade-wallet-view")],K);var L=undefined&&undefined.__decorate||function(e,t,i,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)if(a=e[r])o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o;return n>3&&o&&Object.defineProperty(t,i,o),o};let W=class e extends t{constructor(){super(...arguments);this.loading=false;this.switched=false;this.text="";this.network=p.state.activeCaipNetwork}render(){return n`
      <wui-flex flexDirection="column" gap="2" .padding=${["6","4","3","4"]}>
        ${this.togglePreferredAccountTypeTemplate()} ${this.toggleSmartAccountVersionTemplate()}
      </wui-flex>
    `}toggleSmartAccountVersionTemplate(){return n`
      <w3m-tooltip-trigger text="Changing the smart account version will reload the page">
        <wui-list-item
          icon=${this.isV6()?"arrowTop":"arrowBottom"}
          ?rounded=${true}
          ?chevron=${true}
          data-testid="account-toggle-smart-account-version"
          @click=${this.toggleSmartAccountVersion.bind(this)}
        >
          <wui-text variant="lg-regular" color="primary"
            >Force Smart Account Version ${this.isV6()?"7":"6"}</wui-text
          >
        </wui-list-item>
      </w3m-tooltip-trigger>
    `}isV6(){const e=h.get("dapp_smart_account_version")||"v6";return e==="v6"}toggleSmartAccountVersion(){h.set("dapp_smart_account_version",this.isV6()?"v7":"v6");if(typeof window!=="undefined"){window?.location?.reload()}}togglePreferredAccountTypeTemplate(){const e=this.network?.chainNamespace;const t=p.checkIfSmartAccountEnabled();const i=o.getConnectorId(e);const s=o.getAuthConnector();if(!s||i!==f.CONNECTOR_ID.AUTH||!t){return null}if(!this.switched){this.text=m(e)===w.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account"}return n`
      <wui-list-item
        icon="swapHorizontal"
        ?rounded=${true}
        ?chevron=${true}
        ?loading=${this.loading}
        @click=${this.changePreferredAccountType.bind(this)}
        data-testid="account-toggle-preferred-account-type"
      >
        <wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
      </wui-list-item>
    `}async changePreferredAccountType(){const e=this.network?.chainNamespace;const t=p.checkIfSmartAccountEnabled();const i=m(e)===w.ACCOUNT_TYPES.SMART_ACCOUNT||!t?w.ACCOUNT_TYPES.EOA:w.ACCOUNT_TYPES.SMART_ACCOUNT;const s=o.getAuthConnector();if(!s){return}this.loading=true;await g.setPreferredAccountType(i,e);this.text=i===w.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account";this.switched=true;x.resetSend();this.loading=false;this.requestUpdate()}};L([R()],W.prototype,"loading",void 0);L([R()],W.prototype,"switched",void 0);L([R()],W.prototype,"text",void 0);L([R()],W.prototype,"network",void 0);W=L([j("w3m-smart-account-settings-view")],W);var H=c`
  :host {
    width: 100%;
  }

  button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
    border-radius: ${({borderRadius:e})=>e[4]};
    padding: ${({spacing:e})=>e[4]};
  }

  .name {
    max-width: 75%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  @media (hover: hover) and (pointer: fine) {
    button:hover:enabled {
      cursor: pointer;
      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
      border-radius: ${({borderRadius:e})=>e[6]};
    }
  }

  button:disabled {
    opacity: 0.5;
    cursor: default;
  }

  button:focus-visible:enabled {
    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
  }
`;var U=undefined&&undefined.__decorate||function(e,t,i,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)if(a=e[r])o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o;return n>3&&o&&Object.defineProperty(t,i,o),o};let Z=class e extends t{constructor(){super(...arguments);this.name="";this.registered=false;this.loading=false;this.disabled=false}render(){return n`
      <button ?disabled=${this.disabled}>
        <wui-text class="name" color="primary" variant="md-regular">${this.name}</wui-text>
        ${this.templateRightContent()}
      </button>
    `}templateRightContent(){if(this.loading){return n`<wui-loading-spinner size="lg" color="primary"></wui-loading-spinner>`}return this.registered?n`<wui-tag variant="info" size="sm">Registered</wui-tag>`:n`<wui-tag variant="success" size="sm">Available</wui-tag>`}};Z.styles=[u,d,H];U([z()],Z.prototype,"name",void 0);U([z({type:Boolean})],Z.prototype,"registered",void 0);U([z({type:Boolean})],Z.prototype,"loading",void 0);U([z({type:Boolean})],Z.prototype,"disabled",void 0);Z=U([j("wui-account-name-suggestion-item")],Z);var J=c`
  :host {
    position: relative;
    width: 100%;
    display: inline-block;
  }

  :host([disabled]) {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .base-name {
    position: absolute;
    right: ${({spacing:e})=>e[4]};
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    padding: ${({spacing:e})=>e[1]};
    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
    border-radius: ${({borderRadius:e})=>e[1]};
  }
`;var X=undefined&&undefined.__decorate||function(e,t,i,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)if(a=e[r])o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o;return n>3&&o&&Object.defineProperty(t,i,o),o};let q=class e extends t{constructor(){super(...arguments);this.disabled=false;this.loading=false}render(){return n`
      <wui-input-text
        value=${T(this.value)}
        ?disabled=${this.disabled}
        .value=${this.value||""}
        data-testid="wui-ens-input"
        icon="search"
        inputRightPadding="5xl"
        .onKeyDown=${this.onKeyDown}
      ></wui-input-text>
    `}};q.styles=[u,J];X([z()],q.prototype,"errorMessage",void 0);X([z({type:Boolean})],q.prototype,"disabled",void 0);X([z()],q.prototype,"value",void 0);X([z({type:Boolean})],q.prototype,"loading",void 0);X([z({attribute:false})],q.prototype,"onKeyDown",void 0);q=X([j("wui-ens-input")],q);var Q=c`
  wui-flex {
    width: 100%;
  }

  .suggestion {
    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
    border-radius: ${({borderRadius:e})=>e[4]};
  }

  .suggestion:hover:not(:disabled) {
    cursor: pointer;
    border: none;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
    border-radius: ${({borderRadius:e})=>e[6]};
    padding: ${({spacing:e})=>e[4]};
  }

  .suggestion:disabled {
    opacity: 0.5;
    cursor: default;
  }

  .suggestion:focus-visible:not(:disabled) {
    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
  }

  .suggested-name {
    max-width: 75%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  form {
    width: 100%;
    position: relative;
  }

  .input-submit-button,
  .input-loading-spinner {
    position: absolute;
    top: 22px;
    transform: translateY(-50%);
    right: 10px;
  }
`;var ee=undefined&&undefined.__decorate||function(e,t,i,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)if(a=e[r])o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o;return n>3&&o&&Object.defineProperty(t,i,o),o};let te=class e extends t{constructor(){super();this.formRef=S();this.usubscribe=[];this.name="";this.error="";this.loading=b.state.loading;this.suggestions=b.state.suggestions;this.profileName=p.getAccountData()?.profileName;this.onDebouncedNameInputChange=v.debounce((e=>{if(e.length<4){this.error="Name must be at least 4 characters long"}else if(!O.isValidReownName(e)){this.error="The value is not a valid username"}else{this.error="";b.getSuggestions(e)}}));this.usubscribe.push(...[b.subscribe((e=>{this.suggestions=e.suggestions;this.loading=e.loading})),p.subscribeChainProp("accountState",(e=>{this.profileName=e?.profileName;if(e?.profileName){this.error="You already own a name"}}))])}firstUpdated(){this.formRef.value?.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){super.disconnectedCallback();this.usubscribe.forEach((e=>e()));this.formRef.value?.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return n`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="4"
        .padding=${["1","3","4","3"]}
      >
        <form ${A(this.formRef)} @submit=${this.onSubmitName.bind(this)}>
          <wui-ens-input
            @inputChange=${this.onNameInputChange.bind(this)}
            .errorMessage=${this.error}
            .value=${this.name}
            .onKeyDown=${this.onKeyDown.bind(this)}
          >
          </wui-ens-input>
          ${this.submitButtonTemplate()}
          <input type="submit" hidden />
        </form>
        ${this.templateSuggestions()}
      </wui-flex>
    `}submitButtonTemplate(){const e=this.suggestions.find((e=>e.name?.split(".")?.[0]===this.name&&e.registered));if(this.loading){return n`<wui-loading-spinner
        class="input-loading-spinner"
        color="secondary"
      ></wui-loading-spinner>`}const t=`${this.name}${f.WC_NAME_SUFFIX}`;return n`
      <wui-icon-link
        ?disabled=${Boolean(e)}
        class="input-submit-button"
        size="sm"
        icon="chevronRight"
        iconColor=${e?"default":"accent-primary"}
        @click=${()=>this.onSubmitName(t)}
      >
      </wui-icon-link>
    `}onNameInputChange(e){const t=O.validateReownName(e.detail||"");this.name=t;this.onDebouncedNameInputChange(t)}onKeyDown(e){if(e.key.length===1&&!O.isValidReownName(e.key)){e.preventDefault()}}templateSuggestions(){if(!this.name||this.name.length<4||this.error){return null}return n`<wui-flex flexDirection="column" gap="1" alignItems="center">
      ${this.suggestions.map((e=>n`<wui-account-name-suggestion-item
            name=${e.name}
            ?registered=${e.registered}
            ?loading=${this.loading}
            ?disabled=${e.registered||this.loading}
            data-testid="account-name-suggestion"
            @click=${()=>this.onSubmitName(e.name)}
          ></wui-account-name-suggestion-item>`))}
    </wui-flex>`}isAllowedToSubmit(e){const t=e.split(".")?.[0];const i=this.suggestions.find((e=>e.name?.split(".")?.[0]===t&&e.registered));return!this.loading&&!this.error&&!this.profileName&&t&&b.validateName(t)&&!i}async onSubmitName(e){try{if(!this.isAllowedToSubmit(e)){return}$.sendEvent({type:"track",event:"REGISTER_NAME_INITIATED",properties:{isSmartAccount:m(p.state.activeChain)===w.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}});await b.registerName(e);$.sendEvent({type:"track",event:"REGISTER_NAME_SUCCESS",properties:{isSmartAccount:m(p.state.activeChain)===w.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e}})}catch(t){y.showError(t.message);$.sendEvent({type:"track",event:"REGISTER_NAME_ERROR",properties:{isSmartAccount:m(p.state.activeChain)===w.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:e,error:v.parseError(t)}})}}onEnterKey(e){if(e.key==="Enter"&&this.name&&this.isAllowedToSubmit(this.name)){const e=`${this.name}${f.WC_NAME_SUFFIX}`;this.onSubmitName(e)}}};te.styles=Q;ee([z()],te.prototype,"errorMessage",void 0);ee([R()],te.prototype,"name",void 0);ee([R()],te.prototype,"error",void 0);ee([R()],te.prototype,"loading",void 0);ee([R()],te.prototype,"suggestions",void 0);ee([R()],te.prototype,"profileName",void 0);te=ee([j("w3m-register-account-name-view")],te);var ie=e`
  .continue-button-container {
    width: 100%;
  }
`;var se=undefined&&undefined.__decorate||function(e,t,i,s){var n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s,a;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")o=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)if(a=e[r])o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o;return n>3&&o&&Object.defineProperty(t,i,o),o};let ne=class e extends t{render(){return n`
      <wui-flex
        flexDirection="column"
        alignItems="center"
        gap="6"
        .padding=${["0","0","4","0"]}
      >
        ${this.onboardingTemplate()} ${this.buttonsTemplate()}
        <wui-link
          @click=${()=>{v.openHref(C.URLS.FAQ,"_blank")}}
        >
          Learn more
          <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
        </wui-link>
      </wui-flex>
    `}onboardingTemplate(){return n` <wui-flex
      flexDirection="column"
      gap="6"
      alignItems="center"
      .padding=${["0","6","0","6"]}
    >
      <wui-flex gap="3" alignItems="center" justifyContent="center">
        <wui-icon-box size="xl" color="success" icon="checkmark"></wui-icon-box>
      </wui-flex>
      <wui-flex flexDirection="column" alignItems="center" gap="3">
        <wui-text align="center" variant="md-medium" color="primary">
          Account name chosen successfully
        </wui-text>
        <wui-text align="center" variant="md-regular" color="primary">
          You can now fund your account and trade crypto
        </wui-text>
      </wui-flex>
    </wui-flex>`}buttonsTemplate(){return n`<wui-flex
      .padding=${["0","4","0","4"]}
      gap="3"
      class="continue-button-container"
    >
      <wui-button fullWidth size="lg" borderRadius="xs" @click=${this.redirectToAccount.bind(this)}
        >Let's Go!
      </wui-button>
    </wui-flex>`}redirectToAccount(){k.replace("Account")}};ne.styles=ie;ne=se([j("w3m-register-account-name-success-view")],ne);export{N as W3mApproveTransactionView,ne as W3mRegisterAccountNameSuccess,te as W3mRegisterAccountNameView,W as W3mSmartAccountSettingsView,K as W3mUpgradeWalletView};
//# sourceMappingURL=p-DbgBq9QA.js.map