import{h}from"../edel-elements.core.js";var EdelMenuItemComponent=function(){function e(){this.active=!1,this.class="menu-item"}return e.prototype.onClick=function(e){this.handleClick(e)},e.prototype.render=function(){return h("a",null,h("slot",null))},e.prototype.handleClick=function(e){this.emit.emit(e)},e.prototype.componentDidLoad=function(){this.active?this.hostElement.classList.add("menu-item--on"):this.hostElement.classList.remove("menu-item--on")},e.prototype.didChange=function(e,t){void 0===t&&(t=""),hasActiveClass(e)?this.active=!0:hasActiveClass(t)&&(this.active=!1)},Object.defineProperty(e,"is",{get:function(){return"edel-menu-item"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{active:{type:Boolean,attr:"active",reflectToAttr:!0,mutable:!0,watchCallbacks:["componentDidLoad"]},class:{type:String,attr:"class",reflectToAttr:!0,mutable:!0,watchCallbacks:["didChange"]},hostElement:{elementRef:!0}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"emit",method:"emit",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),Object.defineProperty(e,"listeners",{get:function(){return[{name:"click",method:"onClick"}]},enumerable:!0,configurable:!0}),e}();function hasActiveClass(e){return null!=e&&("string"==typeof e?-1!==e.split(" ").indexOf("active"):e.active||!1)}export{EdelMenuItemComponent as EdelMenuItem};