import{r as e,g as t,h as i}from"./p-e42dfa95.js";import{i as s}from"./p-cc0aeb50.js";const a=class{constructor(t){e(this,t)}get el(){return t(this)}key="";disabled=false;icon;active=false;handleClick=()=>{if(this.disabled)return;const e=this.el.closest("hb-menu");if(e){e.dispatchEvent(new CustomEvent("hbMenuItemSelect",{detail:this.key,bubbles:true}))}};handleKeydown=e=>{if(this.disabled)return;if(s(e.key)){e.preventDefault();this.handleClick()}};render(){return i("li",{key:"34b8ae3ee2a580757cd0c01261772e6de97bf332",class:{"hb-menu-item":true,"hb-menu-item--active":this.active,"hb-menu-item--disabled":this.disabled},role:"menuitem",tabindex:this.disabled?-1:0,"aria-disabled":this.disabled?"true":undefined,"aria-current":this.active?"page":undefined,onClick:this.handleClick,onKeyDown:this.handleKeydown},this.icon&&i("span",{key:"a0b70a81ce4f8ed1cef7bd37c5b194a02554bc22",class:"hb-menu-item__icon"},this.icon),i("span",{key:"8ef65eda6376d1e16ed614fa30e7cef532abc2ad",class:"hb-menu-item__text"},i("slot",{key:"716cf4bc2cd4cd6d992010759d55f2924662cd9a"})))}};export{a as hb_menu_item};
//# sourceMappingURL=p-ebd04656.entry.js.map