import*as e from"lit";import*as t from"lit/directives/if-defined.js";import*as s from"lit/directives/class-map.js";import*as i from"lit/decorators.js";var r,d,a={2927(t,s,i){var r,d;t.exports=(r={LitElement:()=>e.LitElement,css:()=>e.css,html:()=>e.html},d={},i.d(d,r),d)},3517(e,s,i){var r,d;e.exports=(r={ifDefined:()=>t.ifDefined},d={},i.d(d,r),d)},4955(e,t,i){var r,d;e.exports=(r={classMap:()=>s.classMap},d={},i.d(d,r),d)},5410(e,t,s){s.d(t,{D:()=>i});var i,r=s(9609),d=s(4084),a=s(2927),l=s(8899),o=s(4955),n=s(3517),p=s(3051),c=function(e,t,s,i){var r,d=arguments.length,a=d<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(d<3?r(a):d>3?r(t,s,a):r(t,s))||a);return d>3&&a&&Object.defineProperty(t,s,a),a};!function(e){let t=class extends a.LitElement{constructor(){super(...arguments),this.href="",this.label="",this.tabIndex=-1,this._disabled=!1,this._selected=!1}get disabled(){return this._disabled}set disabled(e){const t=this._disabled;this._disabled=e,this.setAttribute("aria-disabled",`${e}`),this.tabIndex=e?-1:0,this.requestUpdate("disabled",t)}get selected(){return this._selected}set selected(e){const t=this._selected;this._selected=e,e&&this.notifySelectedItem(),this.setAttribute("aria-selected",`${e}`),this.requestUpdate("selected",t)}static get styles(){return[d.A,p.A]}setupEvents(){this.addEventListener("mousedown",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}firstUpdated(e){super.firstUpdated(e),this.label&&this.setAttribute("aria-label",this.label),this.setupEvents()}update(e){super.update(e),e.has("disabled")&&(this.selected=!1,this.setAttribute("aria-disabled",`${this.disabled}`))}handleClick(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("menu-item-click",{detail:{id:this.id},bubbles:!0,composed:!0}))}handleKeyDown(e){this.dispatchEvent(new CustomEvent("menu-item-keydown",{detail:{id:this.id,key:e.code,srcEvent:e},bubbles:!0,composed:!0}))}notifySelectedItem(){this.dispatchEvent(new CustomEvent("focus-visible",{composed:!0,bubbles:!0}))}get menuItemClassMap(){return{"md-menu-item--selected":this.selected,disabled:this.disabled}}render(){return a.html`
        <li
          role="menuitem"
          part="menu-item"
          class="md-menu-item ${(0,o.classMap)(this.menuItemClassMap)}"
          ?disabled=${this.disabled}
          tabindex="-1"
          aria-hidden="true"
          aria-selected="false"
          aria-label=${(0,n.ifDefined)(this.label)}
        >
          <a href="${(0,n.ifDefined)(this.href||void 0)}">
            <slot></slot>
          </a>
        </li>
      `}};c([(0,l.property)({type:String})],t.prototype,"href",void 0),c([(0,l.property)({type:String})],t.prototype,"label",void 0),c([(0,l.property)({type:Number,reflect:!0})],t.prototype,"tabIndex",void 0),c([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"disabled",null),c([(0,l.property)({type:Boolean,reflect:!0})],t.prototype,"selected",null),t=c([(0,r.w)("md-menu-item")],t),e.ELEMENT=t}(i||(i={}))},8899(e,t,s){var r,d;e.exports=(r={property:()=>i.property},d={},s.d(d,r),d)}},l={};function o(e){var t=l[e];if(void 0!==t)return t.exports;var s=l[e]={exports:{}};return a[e](s,s.exports,o),s.exports}o.m=a,r=[],o.O=(e,t,s,i)=>{if(!t){var d=1/0;for(p=0;p<r.length;p++){for(var[t,s,i]=r[p],a=!0,l=0;l<t.length;l++)(!1&i||d>=i)&&Object.keys(o.O).every(e=>o.O[e](t[l]))?t.splice(l--,1):(a=!1,i<d&&(d=i));if(a){r.splice(p--,1);var n=s();void 0!==n&&(e=n)}}return e}i=i||0;for(var p=r.length;p>0&&r[p-1][2]>i;p--)r[p]=r[p-1];r[p]=[t,s,i]},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);export{o as __webpack_require__};d={502:0,1745:0,4825:0,4928:0,5369:0,5410:0,6060:0,8111:0,8442:0},o.C=e=>{var t,s,{__webpack_esm_ids__:i,__webpack_esm_modules__:r,__webpack_esm_runtime__:a}=e,l=0;for(t in r)o.o(r,t)&&(o.m[t]=r[t]);for(a&&a(o);l<i.length;l++)s=i[l],o.o(d,s)&&d[s]&&d[s][0](),d[i[l]]=0;o.O()},o.O.j=e=>0===d[e];import*as n from"../9609.js";o.C(n);import*as p from"../4084.js";o.C(p);import*as c from"../3051.js";o.C(c);var h=o.O(void 0,[9609,4084,3051],()=>o(5410));const m=(h=o.O(h)).D;export{m as MenuItem};