import { p as proxyCustomElement, H, h, F as Fragment } from './p-BhqVmlhr.js';
import { d as defineCustomElement$4 } from './p-Cv0O724A.js';
import { d as defineCustomElement$3 } from './p-Dtjf-x_g.js';
import { d as defineCustomElement$2 } from './p-CKJRIdCd.js';
import { d as defineCustomElement$1 } from './p-ChPSsZAS.js';

const TabComponent = /*@__PURE__*/ proxyCustomElement(class TabComponent extends H {
    constructor() {
        super();
        this.__registerHost();
        this.isExpanded = false;
    }
    handleExpanded(expanded) {
        this.isExpanded = expanded;
        if (expanded) {
            this.submenuElement.style.maxHeight = 'fit-content';
        }
        else {
            this.submenuElement.style.maxHeight = '';
        }
    }
    render() {
        return (h(Fragment, { key: '80b133e8baeb5c1d0531153f1f2f521bc8cbed79' }, h("tab-link", { key: 'bcd51261e7d2dd2687964519192b28547f1e7d04', text: this.route.name, type: this.route.children && this.route.children.length > 0 ? 'parent' : 'child', icon: this.route.icon, link: this.route.path, onExpand: this.handleExpanded.bind(this), disabled: this.route.disabled }), this.route.children && this.route.children.length > 0 && (h("ul", { key: '43b9cfdf1e48635d9e867e12d999564b22f10627', class: "sidepanel__submenu-list", ref: el => (this.submenuElement = el) }, this.route.children.map((childRoute, index) => (h("submenu-component", { key: index, route: this.route, childRoute: childRoute, onChildExpanded: expanded => {
                if (expanded) {
                    this.submenuElement.style.maxHeight = 'fit-content';
                }
            } })))))));
    }
}, [0, "tab-component", {
        "route": [16],
        "isExpanded": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["tab-component", "dga-icon-v2", "dga-tag", "submenu-component", "tab-link"];
    components.forEach(tagName => { switch (tagName) {
        case "tab-component":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, TabComponent);
            }
            break;
        case "dga-icon-v2":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "dga-tag":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "submenu-component":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
        case "tab-link":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}

export { TabComponent as T, defineCustomElement as d };
