import{__decorate as e}from"tslib";import{html as t}from"lit";import{property as i,customElement as n}from"lit/decorators.js";import{s as o}from"./nile-side-bar-expand.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import"../internal/accessibility/a11y.state.enum.esm.js";import"../internal/accessibility/a11y.property.enum.esm.js";import"../internal/accessibility/role.enum.esm.js";let l=class extends r{constructor(){super(...arguments),this.collapsed=!1,this.expandTooltipText="Expand Sidebar",this.collapseTooltipText="Collapse Sidebar"}static get styles(){return[o]}connectedCallback(){super.connectedCallback();const e=this.closest("nile-side-bar");e&&(this.collapsed=e.hasAttribute("collapsed"))}toggleSidebar(){const e=this.closest("nile-side-bar");if(!e)return;e.hasAttribute("collapsed")?(e.removeAttribute("collapsed"),this.collapsed=!1):(e.setAttribute("collapsed",""),this.collapsed=!0)}render(){return t`
      <button class="expand-btn" part="expand-btn" @click=${this.toggleSidebar}>
        ${this.collapsed?t`
              <nile-lite-tooltip placement="right" hoist content=${this.expandTooltipText}>
                <span part="icon"><nile-icon color="var(--nile-colors-dark-500, var(--ng-colors-fg-quaternary-400))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" size="var(--nile-spacing-14px, var(--ng-spacing-2xl))" name="var(--nile-icon-move-right, var(--ng-icon-chevron-right-double))"></nile-icon></span>
              </nile-lite-tooltip>
            `:t`
              <nile-lite-tooltip placement="right" hoist content=${this.collapseTooltipText}>
                <span part="icon"><nile-icon color="var(--nile-colors-dark-500, var(--ng-colors-fg-quaternary-400))" method="var(--nile-svg-method-fill, var(--ng-svg-method-stroke))" size="var(--nile-spacing-14px, var(--ng-spacing-2xl))" name="var(--nile-icon-move-left, var(--ng-icon-chevron-left-double))"></nile-icon></span>
              </nile-lite-tooltip>
            `}
      </button>
    `}};e([i({type:Boolean,reflect:!0})],l.prototype,"collapsed",void 0),e([i({type:String,reflect:!0,attribute:!0})],l.prototype,"expandTooltipText",void 0),e([i({type:String,reflect:!0,attribute:!0})],l.prototype,"collapseTooltipText",void 0),l=e([n("nile-side-bar-expand")],l);export{l as N};
