export const __webpack_esm_id__=6131;export const __webpack_esm_ids__=[6131];export const __webpack_esm_modules__={6131(t,e,s){s.d(e,{B:()=>i});var i,l=s(2900),o=s(7704),r=s(9609),n=s(4084),d=s(2927),a=s(8899),c=s(3517),h=s(740),b=function(t,e,s,i){var l,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,i);else for(var n=t.length-1;n>=0;n--)(l=t[n])&&(r=(o<3?l(r):o>3?l(e,s,r):l(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r};!function(t){let e=class extends((0,o.Io)(d.LitElement)){constructor(){super(...arguments),this.alignment="vertical",this.label="option",this.activated=-1,this._role="listbox"}firstUpdated(t){super.firstUpdated(t),"none"!==this._role&&this.setAttribute("aria-label",this.label)}notifySelectedChange(){this.dispatchEvent(new CustomEvent("list-item-change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}isFocusable(t){return!t.hasAttribute("hidden")}connectedCallback(){super.connectedCallback();const t=this.getAttribute("role");this._role=t||"listbox",this.removeAttribute("role"),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("click",this.handleClick)}findListItemIndex(t){const e=t.composedPath();return this.slotted.findIndex(t=>e.includes(t))}switchListItemOnArrowPress(t,e=1){const s=super.getAvailableSelectedIndex(t,e);-1!==s&&(this.selected=s)}setActivated(t){-1!==t&&(this.activated=t,this.selected=t,this.setSelected(t))}findSelectedListItemIndex(){return this.slotted.findIndex(t=>t.selected)}setSelected(t){const e=this.findSelectedListItemIndex();-1!==e&&e!==t&&(this.slotted[e].selected=!1),this.slotted[t]&&(this.slotted[t].selected=!0)}updated(t){super.updated(t),t.has("slotted")&&this.setActivated(this.activated),t.has("activated")&&this.setActivated(this.activated),t.has("label")&&"none"!==this._role&&this.setAttribute("aria-label",this.label)}isListItemDisabled(t){var e;const s=this.slotted[t];return null===(e=null==s?void 0:s.disabled)||void 0===e||e}handleClick(t){const e=this.findListItemIndex(t);-1!==e&&(this.isListItemDisabled(e)||(this.setActivated(e),this.notifySelectedChange()))}shouldElementHandleKey(t,e){if(t.hasAttribute("data-handles-keys")||t.closest("[data-handles-keys]"))return!0;const s=t.tagName.toLowerCase(),i=t.nodeName.toLowerCase(),o="input"===i||"textarea"===i||"select"===i,r=t.getAttribute("role"),n=t.hasAttribute("contenteditable")||"false"===t.getAttribute("aria-readonly"),d=[l.Uz.ArrowUp,l.Uz.ArrowDown,l.Uz.ArrowLeft,l.Uz.ArrowRight],a=[l.Uz.Enter,l.Uz.Space];return d.includes(e)?o||n||"textbox"===r||"combobox"===r||"listbox"===r||"menu"===r||"slider"===r||"scrollbar"===r||"tablist"===r||s.startsWith("md-")&&("md-input"===s||"md-select"===s||"md-combobox"===s):a.includes(e)?"button"===r||"link"===r||"checkbox"===r||"radio"===r||"button"===s||"a"===s||"md-button"===s||"md-checkbox"===s||"md-radio"===s||o:(e===l.Uz.Home||e===l.Uz.End)&&(o||n||"textbox"===r||"md-input"===s)}handleKeyDown(t){const e=t.composedPath()[0];if(this.shouldElementHandleKey(e,t.code))return;const{code:s}=t;switch(s){case l.Uz.End:this.switchListItemOnArrowPress(this.slotted.length-1);break;case l.Uz.Home:this.switchListItemOnArrowPress(0);break;case l.Uz.ArrowUp:case l.Uz.ArrowLeft:t.preventDefault(),0===this.selected?this.switchListItemOnArrowPress(this.slotted.length-1,-1):this.switchListItemOnArrowPress(this.selected-1,-1);break;case l.Uz.ArrowDown:case l.Uz.ArrowRight:t.preventDefault(),this.selected===this.slotted.length-1?this.switchListItemOnArrowPress(0):this.switchListItemOnArrowPress(this.selected+1);break;case l.Uz.Enter:case l.Uz.Space:this.isListItemDisabled(this.selected)||(this.setActivated(this.selected),this.notifySelectedChange())}}get slotElement(){return this.listItemSlot}static get styles(){return[n.A,h.A]}render(){return d.html`
        <ul role=${(0,c.ifDefined)("list"!==this._role?this._role:void 0)} class="md-list" part="list">
          <slot name="list-item"></slot>
        </ul>
      `}};b([(0,a.property)({type:String,reflect:!0})],e.prototype,"alignment",void 0),b([(0,a.property)({type:String})],e.prototype,"label",void 0),b([(0,a.property)({type:Number,reflect:!0})],e.prototype,"activated",void 0),b([(0,a.query)("slot[name='list-item']")],e.prototype,"listItemSlot",void 0),e=b([(0,r.w)("md-list")],e),t.ELEMENT=e}(i||(i={}))}};