import { r as registerInstance, h, H as Host } from './index-ytAlchvh.js';

const EclMegaMenuFeaturedListItem = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.hasDescription = false;
        this.external = false;
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    getClass() {
        const styleClasses = [
            `ecl-mega-menu__featured-list__item`,
            `sc-ecl-mega-menu-${this.theme}`,
            this.styleClass
        ];
        if (this.image && !this.path && !this.hasDescription) {
            styleClasses.push('ecl-mega-menu__featured-list__item--image-only');
        }
        if (this.image && this.path && this.hasDescription) {
            styleClasses.push('ecl-mega-menu__featured-list__item--combo');
        }
        return styleClasses.join(' ');
    }
    render() {
        return (h(Host, { key: '6bf6d5c7f2d9e1480153eb23cfe80f89dd883639', class: this.getClass() }, this.image &&
            h("ecl-picture", { key: '5ff4d295b7181a0331fa9b6c7c8e8e7c3d5685a1', image: this.image, "style-class": `ecl-mega-menu__featured-picture sc-ecl-mega-menu-${this.theme}`, "img-class": `ecl-mega-menu__featured-image sc-ecl-mega-menu-${this.theme}` }, h("slot", { key: 'aa2027fee8d2a3c95c5a88b211c2c470e953f888', name: "sources" })), this.path &&
            h("ecl-link", Object.assign({ key: '56d7bc163e5e020ae285d02a2e70d2a3842716fb', path: this.path, variant: "standalone", "style-class": `ecl-mega-menu__featured-link sc-ecl-mega-menu-${this.theme}` }, (this.external && { 'external': null })), this.label), this.hasDescription &&
            h("div", { key: 'eb6d5da2afcbbabf91eda4f0c8420fa7a0c0dc59', class: `ecl-mega-menu__featured-list__item-description sc-ecl-mega-menu-${this.theme}` }, h("slot", { key: 'e4989a833e21558580a5946ad1fd114018e2039c' }))));
    }
};

export { EclMegaMenuFeaturedListItem as ecl_mega_menu_featured_list_item };
