import { h, Host } from "@stencil/core";
export class EclMegaMenuItem {
    constructor() {
        this.oneLevelOnly = false;
        this.isPromotional = false;
        this.external = false;
        this.seeAll = false;
        this.hasInfo = false;
        this.hasFeatured = false;
        this.hasChildren = false;
        this.isContainer = 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__item`,
            `sc-ecl-mega-menu-${this.theme}`,
            this.styleClass
        ];
        if (this.isPromotional) {
            styleClasses.push('ecl-mega-menu__item--promotional');
        }
        if (this.hasChildren) {
            styleClasses.push('ecl-mega-menu__item--has-children');
        }
        if (this.isContainer) {
            styleClasses.push('ecl-mega-menu__item--has-container');
        }
        if (this.oneLevelOnly) {
            styleClasses.push('ecl-mega-menu__item--one-level-only');
        }
        return styleClasses.join(' ');
    }
    render() {
        return (h(Host, Object.assign({ key: 'c098e3c5d9db91a67e2e71dc0b367f1b06aafccd', class: this.getClass(), "data-ecl-mega-menu-item": true }, (this.hasChildren && { 'data-ecl-has-children': '' }), (this.isContainer && { 'data-ecl-has-container': '' })), this.hasChildren || this.isContainer ?
            h("ecl-button", { type: "button", "style-class": `ecl-mega-menu__link sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-link": true, "aria-expanded": "false", "aria-haspopup": true }, this.label, h("ecl-icon", { "style-class": `sc-ecl-mega-menu-${this.theme} is-first`, icon: "corner-arrow", size: "2xs", rotate: "90", slot: "icon-after" }), h("ecl-icon", { "style-class": `sc-ecl-mega-menu-${this.theme}`, icon: "arrow-left", flip: "horizontal", size: "s", slot: "icon-after" })) :
            h("ecl-link", { variant: "standalone", "data-ecl-mega-menu-link": true, path: this.path, "style-class": `ecl-mega-menu__link sc-ecl-mega-menu-${this.theme}` }, this.label), this.isContainer &&
            h("div", { key: '3bf4da05014131d81ed273962db1a70242f046d4', class: `
            ecl-mega-menu__mega
            ecl-mega-menu__mega-container
            sc-ecl-mega-menu-${this.theme}
            ${!this.hasInfo ? 'ecl-mega-menu__mega--no-info' : ''}
          `, "data-ecl-mega-menu-mega": true }, h("ecl-grid", { key: '797ce98a03434beabc2e2236585f7c1ed8ed9b06', container: true }, h("div", { key: 'a838e6d673b79aa15016d74a17e71781c2fbeb88', class: "ecl-mega-menu__mega-container-scrollable" }, h("slot", { key: 'add0fee85cf5d54ad07e6c64e6a3c16be30e1a4a', name: "container" })))), (this.hasChildren || this.hasFeatured) &&
            h("div", { key: '4b386aa9e2497283f40a8433032c5d7f87e3bb02', class: `ecl-mega-menu__wrapper sc-ecl-mega-menu-${this.theme}` }, h("div", { key: '34eaa21eb0b18fe00ade435b706a9738be0b1879', class: `ecl-container sc-ecl-mega-menu-${this.theme}` }, this.hasInfo &&
                h("div", { key: 'b6aabff657aa9e5c53dd91b9edde857c0b85e679', class: `ecl-mega-menu__info sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-mega": true }, h("span", { key: 'c9380f2c155ab5af06452824d3bc8acad02fa120', class: `ecl-mega-menu__info-title sc-ecl-mega-menu-${this.theme}` }, this.infoTitle), h("div", { key: 'b1bcff7b3242f778d5254abf6dd783bc131af367', class: `ecl-mega-menu__info-scrollable sc-ecl-mega-menu-${this.theme}` }, h("div", { key: 'cd52122daa9ec2aa1eb42f465f25be07607654cc', class: `ecl-mega-menu__info-content sc-ecl-mega-menu-${this.theme}` }, h("slot", { key: '42f0d4081ef41e9ee3966717cc1610af1fa3d028', name: "info" })))), h("div", { key: '0eeabaa32bd030ac62a93e9d7e7ba203c750fd80', class: `
                ecl-mega-menu__mega
                sc-ecl-mega-menu-${this.theme}
                ${!this.hasInfo ? 'ecl-mega-menu__mega--no-info' : ''}
                ${this.hasFeatured ? 'ecl-mega-menu__mega--has-featured' : ''}
              `, "data-ecl-mega-menu-mega": true }, h("ul", Object.assign({ key: '4c56569b45da83442593fb2f8f73ae45df8535d3', class: `ecl-mega-menu__sublist sc-ecl-mega-menu-${this.theme}` }, (this.ariaLabel && { 'aria-label': this.ariaLabel })), h("slot", { key: '51324e0dca9192fa822aa1045c5be962dd80a1c8' }), h("li", { key: '78a0e0b9b9aaabd0f4520235057892ad526217d1', class: `ecl-mega-menu__spacer sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-subitem": true }, "\u00A0"), this.seeAll && (h("li", { key: '481675f423b6872c8da9b3cd9946d453840c7bf1', class: `ecl-mega-menu__subitem ecl-mega-menu__see-all sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-subitem": true }, h("ecl-link", { key: '7d0f006d827a9a2fd0033e50374f039233092e8d', "style-class": `ecl-mega-menu__info-link sc-ecl-mega-menu-${this.theme}`, path: this.path }, this.seeAllLabel, h("ecl-icon", { key: 'f1580831d1b26087ed8b97cae0b94fe91d4cfd34', "style-class": `sc-ecl-mega-menu-${this.theme}`, icon: "arrow-left", size: "xs", slot: "icon-after", rotate: "180" }))))), this.hasFeatured &&
                h("div", { key: 'a084e751215d910c6753e956a82cb3f7c018f02d', class: `ecl-mega-menu__featured sc-ecl-mega-menu-${this.theme}`, "data-ecl-mega-menu-featured": true }, h("div", { key: 'd54c810f22cea6c9f99fac70335284848b0cbd94', class: `ecl-mega-menu__featured-scrollable sc-ecl-mega-menu-${this.theme}` }, this.featuredTitle &&
                    h("div", { key: '9ebbbf8afe1d16eae9ff3bba1ec1ee6526d691aa', class: `ecl-mega-menu__featured-title sc-ecl-mega-menu-${this.theme}` }, this.featuredTitle), h("ul", { key: 'cfa58d8c410b1f6d6b6f891f506ee3a266afc54d', class: `ecl-mega-menu__featured-list sc-ecl-mega-menu-${this.theme}` }, h("slot", { key: '620763869e678fd690e154be875dce64342a1dfc', name: "featured" })))))))));
    }
    static get is() { return "ecl-mega-menu-item"; }
    static get properties() {
        return {
            "theme": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "theme"
            },
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "style-class"
            },
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "label"
            },
            "path": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "path"
            },
            "featuredImage": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "featured-image"
            },
            "oneLevelOnly": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "one-level-only",
                "defaultValue": "false"
            },
            "isPromotional": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-promotional",
                "defaultValue": "false"
            },
            "external": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "external",
                "defaultValue": "false"
            },
            "seeAll": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "see-all",
                "defaultValue": "false"
            },
            "hasInfo": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "has-info",
                "defaultValue": "false"
            },
            "hasFeatured": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "has-featured",
                "defaultValue": "false"
            },
            "featuredTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "featured-title"
            },
            "hasChildren": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "has-children",
                "defaultValue": "false"
            },
            "seeAllLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "see-all-label"
            },
            "infoTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "info-title"
            },
            "isContainer": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "is-container",
                "defaultValue": "false"
            },
            "ariaLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "aria-label"
            }
        };
    }
}
