import { Component, ChangeDetectionStrategy, HostBinding, ViewEncapsulation, Input, Output, EventEmitter, ViewChild, ElementRef, HostListener } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { consumeEvent } from '@eui/core';
import { BaseDirective } from '../../base.directive';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "@angular/common";
import * as i3 from "./eui-menu-item.component";
const _c0 = ["input"];
function EuiMenuComponent_div_0_span_5_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "span", 10);
    i0.ɵɵlistener("click", function EuiMenuComponent_div_0_span_5_Template_span_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(2); return ctx_r5.onClearInput(); });
    i0.ɵɵelementEnd();
} }
function EuiMenuComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 4);
    i0.ɵɵlistener("click", function EuiMenuComponent_div_0_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.onMenuFilterClick($event); });
    i0.ɵɵelementStart(1, "div", 5);
    i0.ɵɵelementStart(2, "input", 6, 7);
    i0.ɵɵlistener("keyup", function EuiMenuComponent_div_0_Template_input_keyup_2_listener() { i0.ɵɵrestoreView(_r8); const _r3 = i0.ɵɵreference(3); const ctx_r9 = i0.ɵɵnextContext(); return ctx_r9.onFilter(_r3.value); });
    i0.ɵɵelementEnd();
    i0.ɵɵelement(4, "span", 8);
    i0.ɵɵtemplate(5, EuiMenuComponent_div_0_span_5_Template, 1, 0, "span", 9);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const _r3 = i0.ɵɵreference(3);
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate("placeholder", ctx_r0.searchFilterLabel);
    i0.ɵɵattribute("aria-label", ctx_r0.searchFilterLabel);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", _r3.value);
} }
function EuiMenuComponent_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 11);
    i0.ɵɵtext(1, "No menu items defined");
    i0.ɵɵelementEnd();
} }
function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_ul_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r26 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "eui-menu-item", 16);
    i0.ɵɵlistener("expandToggled", function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_ul_2_ng_container_1_Template_eui_menu_item_expandToggled_1_listener($event) { i0.ɵɵrestoreView(_r26); const ctx_r25 = i0.ɵɵnextContext(8); return ctx_r25.onExpandToggle($event); })("clicked", function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_ul_2_ng_container_1_Template_eui_menu_item_clicked_1_listener($event) { i0.ɵɵrestoreView(_r26); const ctx_r27 = i0.ɵɵnextContext(8); return ctx_r27.onClick($event); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const itemSubSubSub_r23 = ctx.$implicit;
    const ctx_r22 = i0.ɵɵnextContext(8);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("item", itemSubSubSub_r23)("hasIcon", ctx_r22.hasIcons)("hasTooltip", ctx_r22.hasTooltip)("isCollapsed", ctx_r22.isCollapsed);
} }
function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_ul_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ul", 15);
    i0.ɵɵtemplate(1, EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_ul_2_ng_container_1_Template, 2, 4, "ng-container", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const itemSubSub_r19 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", itemSubSub_r19.children);
} }
function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r30 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "eui-menu-item", 13);
    i0.ɵɵlistener("expandToggled", function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_Template_eui_menu_item_expandToggled_1_listener($event) { i0.ɵɵrestoreView(_r30); const ctx_r29 = i0.ɵɵnextContext(6); return ctx_r29.onExpandToggle($event); })("clicked", function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_Template_eui_menu_item_clicked_1_listener($event) { i0.ɵɵrestoreView(_r30); const ctx_r31 = i0.ɵɵnextContext(6); return ctx_r31.onClick($event); })("actionIconClicked", function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_Template_eui_menu_item_actionIconClicked_1_listener($event) { i0.ɵɵrestoreView(_r30); const ctx_r32 = i0.ɵɵnextContext(6); return ctx_r32.onActionIconClick($event); });
    i0.ɵɵtemplate(2, EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_ul_2_Template, 2, 1, "ul", 14);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const itemSubSub_r19 = ctx.$implicit;
    const ctx_r18 = i0.ɵɵnextContext(6);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("item", itemSubSub_r19)("hasIcon", ctx_r18.hasIcons)("hasTooltip", ctx_r18.hasTooltip)("isCollapsed", ctx_r18.isCollapsed);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", itemSubSub_r19.children && itemSubSub_r19.expanded);
} }
function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ul", 15);
    i0.ɵɵtemplate(1, EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_ng_container_1_Template, 3, 5, "ng-container", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const itemSub_r15 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", itemSub_r15.children);
} }
function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r35 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "eui-menu-item", 13);
    i0.ɵɵlistener("expandToggled", function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_Template_eui_menu_item_expandToggled_1_listener($event) { i0.ɵɵrestoreView(_r35); const ctx_r34 = i0.ɵɵnextContext(4); return ctx_r34.onExpandToggle($event); })("clicked", function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_Template_eui_menu_item_clicked_1_listener($event) { i0.ɵɵrestoreView(_r35); const ctx_r36 = i0.ɵɵnextContext(4); return ctx_r36.onClick($event); })("actionIconClicked", function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_Template_eui_menu_item_actionIconClicked_1_listener($event) { i0.ɵɵrestoreView(_r35); const ctx_r37 = i0.ɵɵnextContext(4); return ctx_r37.onActionIconClick($event); });
    i0.ɵɵtemplate(2, EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_ul_2_Template, 2, 1, "ul", 14);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const itemSub_r15 = ctx.$implicit;
    const ctx_r14 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("item", itemSub_r15)("hasIcon", ctx_r14.hasIcons)("hasTooltip", ctx_r14.hasTooltip)("isCollapsed", ctx_r14.isCollapsed);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", itemSub_r15.children && itemSub_r15.expanded);
} }
function EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ul", 15);
    i0.ɵɵtemplate(1, EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_ng_container_1_Template, 3, 5, "ng-container", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r10 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", item_r10.children);
} }
function EuiMenuComponent_ng_container_3_eui_menu_item_1_Template(rf, ctx) { if (rf & 1) {
    const _r40 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "eui-menu-item", 13);
    i0.ɵɵlistener("expandToggled", function EuiMenuComponent_ng_container_3_eui_menu_item_1_Template_eui_menu_item_expandToggled_0_listener($event) { i0.ɵɵrestoreView(_r40); const ctx_r39 = i0.ɵɵnextContext(2); return ctx_r39.onExpandToggle($event); })("clicked", function EuiMenuComponent_ng_container_3_eui_menu_item_1_Template_eui_menu_item_clicked_0_listener($event) { i0.ɵɵrestoreView(_r40); const ctx_r41 = i0.ɵɵnextContext(2); return ctx_r41.onClick($event); })("actionIconClicked", function EuiMenuComponent_ng_container_3_eui_menu_item_1_Template_eui_menu_item_actionIconClicked_0_listener($event) { i0.ɵɵrestoreView(_r40); const ctx_r42 = i0.ɵɵnextContext(2); return ctx_r42.onActionIconClick($event); });
    i0.ɵɵtemplate(1, EuiMenuComponent_ng_container_3_eui_menu_item_1_ul_1_Template, 2, 1, "ul", 14);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r10 = i0.ɵɵnextContext().$implicit;
    const ctx_r12 = i0.ɵɵnextContext();
    i0.ɵɵproperty("item", item_r10)("hasIcon", ctx_r12.hasIcons)("hasTooltip", ctx_r12.hasTooltip)("isCollapsed", ctx_r12.isCollapsed);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", item_r10.children && item_r10.expanded);
} }
function EuiMenuComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, EuiMenuComponent_ng_container_3_eui_menu_item_1_Template, 2, 5, "eui-menu-item", 12);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const item_r10 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", item_r10.filtered);
} }
export class EuiMenuComponent extends BaseDirective {
    constructor(router, route) {
        super();
        this.router = router;
        this.route = route;
        this.isCollapsed = false;
        this.hasFilter = false;
        this.hasIcons = false;
        this.hasTooltip = false;
        this.expandAllItems = false;
        this.onClicked = new EventEmitter();
        this.onItemClicked = new EventEmitter();
    }
    get cssClasses() {
        return [
            super.getCssClasses('eui-menu-wrapper'),
            this.isCollapsed ? 'eui-menu--collapsed' : '',
            !this.hasIcons ? 'eui-menu--no-icons' : '',
        ].join(' ').trim();
    }
    stopPropagation(event) {
        event.stopPropagation();
    }
    ngOnChanges(changes) {
        if (changes.items) {
            this.items = this.items.map((item) => {
                // remapping to EuiMenuItem class
                const mappedItem = Object.assign(item, { visible: item.visible === undefined ? true : item.visible, filtered: true });
                if (mappedItem.children) {
                    mappedItem.children.map((itemSub) => {
                        if (itemSub.children) {
                            itemSub.children.map((itemSubSub) => {
                                if (itemSubSub.children) {
                                    itemSubSub.children.map((itemSubSubSub) => Object.assign(itemSubSubSub, {
                                        visible: itemSubSubSub.visible === undefined ? true : itemSubSubSub.visible, filtered: true
                                    }));
                                }
                                return Object.assign(itemSubSub, {
                                    visible: itemSubSub.visible === undefined ? true : itemSubSub.visible, filtered: true
                                });
                            });
                        }
                        return Object.assign(itemSub, { visible: itemSub.visible === undefined ? true : itemSub.visible, filtered: true });
                    });
                }
                // expand all parents with children
                if (this.expandAllItems && mappedItem.children) {
                    mappedItem.expanded = true;
                }
                return mappedItem;
            });
            if (!this.expandAllItems) {
                const currentUrl = window.location.href + '/';
                this.items.forEach((item) => {
                    if (item.children) {
                        item.children.forEach((itemSub) => {
                            if (itemSub.url && currentUrl.indexOf(itemSub.url.substr(1)) > -1) {
                                setTimeout(() => this.onExpandToggle(item));
                                return;
                            }
                            else {
                                if (itemSub.children) {
                                    itemSub.children.forEach((itemSubSub) => {
                                        if (itemSubSub.url && currentUrl.indexOf(itemSubSub.url.substr(1)) > -1) {
                                            setTimeout(() => this.onExpandToggle(itemSub));
                                            setTimeout(() => this.onExpandToggle(item));
                                            return;
                                        }
                                    });
                                }
                            }
                        });
                    }
                });
            }
        }
        // Expand / Collapse All items
        if (changes.expandAllItems) {
            this.expandAllItems = changes.expandAllItems.currentValue;
            if (this.expandAllItems) {
                this._onToggleExpandAllItems(true);
            }
            else {
                this._onToggleExpandAllItems(false);
            }
        }
    }
    ngOnInit() {
        // Labels default values - TODO : translations
        if (!this.searchFilterLabel) {
            this.searchFilterLabel = 'Search filter';
        }
    }
    onClick(item) {
        if (item.urlExternal) {
            window.open(item.urlExternal, '_blank');
        }
        else if (item.url) {
            this.router.navigate([item.url], { relativeTo: this.route, fragment: this.fragmentId });
        }
        else {
            if (typeof (item.command) === 'function') {
                item.command();
            }
            else {
                this.onExpandToggle(item);
            }
        }
        if (item.link) {
            this.items = this.items.map((it) => {
                it.active = false;
                if (it.id === item.id) {
                    it.active = true;
                }
                return it;
            });
        }
        this.onClicked.emit(true);
        this.onItemClicked.emit(item);
    }
    onExpandToggle(item) {
        const itemIdx = this.items.indexOf(item);
        if (itemIdx > -1) {
            this.items[itemIdx].expanded = !this.items[itemIdx].expanded;
        }
        else {
            this.items.forEach((i) => {
                if (i.children) {
                    const itemIdx2 = i.children.indexOf(item);
                    if (itemIdx2 > -1) {
                        i.children[itemIdx2].expanded = !i.children[itemIdx2].expanded;
                    }
                    else {
                        i.children.forEach((ii) => {
                            var _a;
                            if (i.children) {
                                const itemIdx3 = (_a = ii.children) === null || _a === void 0 ? void 0 : _a.indexOf(item);
                                if (itemIdx3 > -1) {
                                    ii.children[itemIdx3].expanded = !ii.children[itemIdx3].expanded;
                                }
                            }
                        });
                    }
                }
            });
        }
    }
    onActionIconClick(event) {
        if (typeof (event.item.actionIconCommand) === 'function') {
            event.item.actionIconCommand(event);
        }
        consumeEvent(event.event);
    }
    onMenuFilterClick(event) {
        consumeEvent(event);
    }
    onFilter(event) {
        this.items = this.items.map((item) => {
            if (item.children || item.label.toLowerCase().indexOf(event.toLowerCase()) !== -1) {
                if (item.children) {
                    const children = item.children.map((subItem) => {
                        if (subItem.children || subItem.label.toLowerCase().indexOf(event.toLowerCase()) !== -1) {
                            if (subItem.children) {
                                const children2 = subItem.children.map((subItem2) => {
                                    if (subItem2.children || subItem2.label.toLowerCase().indexOf(event.toLowerCase()) !== -1) {
                                        return Object.assign(subItem2, { filtered: true });
                                    }
                                    else {
                                        return Object.assign(subItem2, { filtered: false });
                                    }
                                });
                                Object.assign(subItem, { children: children2 });
                                return Object.assign(subItem, {
                                    filtered: subItem.children.filter((l) => l['filtered'] === true).length > 0,
                                });
                            }
                            return Object.assign(subItem, { filtered: true });
                        }
                        else {
                            return Object.assign(subItem, { filtered: false });
                        }
                    });
                    Object.assign(item, { children });
                    return Object.assign(item, { filtered: item.children.filter((l) => l['filtered'] === true).length > 0 });
                }
                else {
                    return Object.assign(item, { filtered: true });
                }
            }
            else {
                return Object.assign(item, { filtered: false });
            }
        });
    }
    onClearInput() {
        this.inputFilterElement.nativeElement.value = '';
        this.onFilter('');
        this.inputFilterElement.nativeElement.focus();
    }
    _onToggleExpandAllItems(state) {
        if (this.items) {
            this.items = this.items.map((item) => {
                if (item.children) {
                    item.expanded = state;
                }
                return Object.assign(item, { visible: item.visible === undefined ? true : item.visible });
            });
        }
    }
}
/** @nocollapse */ EuiMenuComponent.ɵfac = function EuiMenuComponent_Factory(t) { return new (t || EuiMenuComponent)(i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i1.ActivatedRoute)); };
/** @nocollapse */ EuiMenuComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiMenuComponent, selectors: [["eui-menu"]], viewQuery: function EuiMenuComponent_Query(rf, ctx) { if (rf & 1) {
        i0.ɵɵviewQuery(_c0, true);
    } if (rf & 2) {
        var _t;
        i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputFilterElement = _t.first);
    } }, hostVars: 2, hostBindings: function EuiMenuComponent_HostBindings(rf, ctx) { if (rf & 1) {
        i0.ɵɵlistener("click", function EuiMenuComponent_click_HostBindingHandler($event) { return ctx.stopPropagation($event); });
    } if (rf & 2) {
        i0.ɵɵclassMap(ctx.cssClasses);
    } }, inputs: { items: "items", isCollapsed: "isCollapsed", hasFilter: "hasFilter", hasIcons: "hasIcons", hasTooltip: "hasTooltip", expandAllItems: "expandAllItems", fragmentId: "fragmentId", searchFilterLabel: "searchFilterLabel", expandMenuLabel: "expandMenuLabel", collapseMenuLabel: "collapseMenuLabel", externalLinkLabel: "externalLinkLabel" }, outputs: { onClicked: "onClicked", onItemClicked: "onItemClicked" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 4, vars: 3, consts: [["class", "eui-menu-filter", 3, "click", 4, "ngIf"], ["role", "menubar", 1, "eui-menu"], ["class", "eui-menu--no-items", 4, "ngIf"], [4, "ngFor", "ngForOf"], [1, "eui-menu-filter", 3, "click"], [1, "eui-clearable-input-wrapper"], ["type", "text", 1, "eui-menu-filter__input", 3, "placeholder", "keyup"], ["input", ""], ["aria-label", "Search Icon", 1, "eui-menu-filter__search-icon", "eui-icon", "eui-icon-search-m"], ["class", "eui-clearable-input-wrapper__clear", "aria-label", "Clear", 3, "click", 4, "ngIf"], ["aria-label", "Clear", 1, "eui-clearable-input-wrapper__clear", 3, "click"], [1, "eui-menu--no-items"], [3, "item", "hasIcon", "hasTooltip", "isCollapsed", "expandToggled", "clicked", "actionIconClicked", 4, "ngIf"], [3, "item", "hasIcon", "hasTooltip", "isCollapsed", "expandToggled", "clicked", "actionIconClicked"], ["class", "eui-menu eui-menu-sub", "role", "menu", "aria-haspopup", "true", "aria-expanded", "true", 4, "ngIf"], ["role", "menu", "aria-haspopup", "true", "aria-expanded", "true", 1, "eui-menu", "eui-menu-sub"], [3, "item", "hasIcon", "hasTooltip", "isCollapsed", "expandToggled", "clicked"]], template: function EuiMenuComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, EuiMenuComponent_div_0_Template, 6, 3, "div", 0);
        i0.ɵɵelementStart(1, "ul", 1);
        i0.ɵɵtemplate(2, EuiMenuComponent_span_2_Template, 2, 0, "span", 2);
        i0.ɵɵtemplate(3, EuiMenuComponent_ng_container_3_Template, 2, 1, "ng-container", 3);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵproperty("ngIf", ctx.hasFilter);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", !ctx.items);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngForOf", ctx.items);
    } }, directives: [i2.NgIf, i2.NgForOf, i3.EuiMenuItemComponent], styles: [".eui-menu,.eui-menu-wrapper{display:flex;flex-direction:column;flex-shrink:0;width:100%}.eui-menu--no-items,.eui-menu-wrapper--no-items{color:var(--eui-color-grey);display:block;text-align:center}.eui-menu--collapsed .eui-menu-filter{transition:none;visibility:hidden}.eui-menu-filter{margin:var(--eui-spacing) 0;padding:0 var(--eui-spacing);position:relative}.eui-menu-filter__search-icon{color:var(--eui-color-grey);font-size:var(--eui-font-size-3xl);left:var(--eui-spacing-xs);position:absolute;top:var(--eui-spacing-xs)}.eui-menu-filter.eui-clearable-input-wrapper__clear{background-color:var(--eui-color-white);opacity:1}.eui-menu-filter__input{border:1px solid var(--eui-color-grey-lighter);padding-left:var(--eui-spacing-2xl);padding-right:var(--eui-spacing-xl);width:100%}.eui-menu-item{display:flex;flex-direction:column;position:relative;width:100%}.eui-menu--collapsed .eui-menu-item{align-items:center;display:flex;flex-direction:column}.eui-menu-item__category{align-items:center;color:var(--eui-color-grey-darker);display:flex;flex-direction:row;font-size:var(--eui-font-size-s);font-weight:700;height:calc(var(--eui-spacing)*2.75);justify-content:center;padding:var(--eui-spacing-xs) var(--eui-spacing);text-decoration:none;text-transform:uppercase;transition:all .3s ease-in-out}.eui-page-column__body .eui-menu-item__category{font-weight:500;text-transform:inherit}.eui-menu-item__category:hover:not(.eui-menu-item--disabled){background-color:var(--eui-color-grey-lightest);cursor:default;text-decoration:none}.eui-menu-item__category-icon{color:var(--eui-color-grey-darker);font-size:var(--eui-font-size-2xl)}.eui-menu-item__category-icon:not(.eui-menu-item__category-icon--default)+.eui-menu-item__category-label,.eui-menu-item__category-icon:not(.eui-menu-item__category-icon--none)+.eui-menu-item__category-label{padding-left:var(--eui-spacing-xs)}.eui-menu-item__category-icon--none{padding:0}.eui-menu-item__category-icon--default{align-items:center;display:flex;justify-content:center;width:100%}.eui-menu-item__category-icon--default:before{background:#9b9b9b;border-radius:50%;content:\"\";height:5px;width:5px}.ff.eui-menu--collapsed .eui-menu-item__category-icon--default{margin-left:var(--eui-spacing-2xs)}.eui-menu-item__category-label{overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:100%}.eui-menu--collapsed .eui-menu-item__category-label{display:none}.eui-page-column__body .eui-menu-item__category-label{font-size:var(--eui-font-size)}.eui-menu-item__link{align-items:center;border-top:.1rem solid #efefef;color:var(--eui-color-font);display:flex;height:calc(var(--eui-spacing)*2.75);justify-content:center;padding-left:var(--eui-spacing);padding-right:var(--eui-spacing);text-decoration:none;text-transform:uppercase;transition:all .3s ease-in-out;white-space:nowrap;width:100%}.eui-page-column__body .eui-menu-item__link{text-transform:inherit}.eui-menu-item__link:focus{text-decoration:none}.eui-menu-item__link:hover:not(.eui-menu-item--disabled){background-color:var(--eui-color-primary-lightester-2);text-decoration:none}.eui-menu-item__link:hover:not(.eui-menu-item--disabled) .eui-menu-item__link-label{color:var(--eui-color-primary)}.eui-menu-item__link--active:not(.eui-menu-item--disabled),.eui-menu-item__link:active:not(.eui-menu-item--disabled){background-color:var(--eui-color-primary-lightester-2);font-weight:700;text-decoration:none}.eui-menu-item__link--active:not(.eui-menu-item--disabled) .eui-menu-item__link-label,.eui-menu-item__link:active:not(.eui-menu-item--disabled) .eui-menu-item__link-label{color:var(--eui-color-primary)}.eui-menu-item__link-icon{color:var(--eui-color-grey-darker);font-size:var(--eui-font-size-2xl)}.eui-menu-item__link-icon+.eui-menu-item__link-label{padding-left:var(--eui-spacing-xs)}.eui-menu-item__link-icon--with-badge .eui-chip{display:flex;height:var(--eui-spacing);left:-12px;position:absolute;top:-4px}.eui-menu-item__link-icon--none{padding:0}.eui-menu-item__link-icon--none+.eui-menu-item__category-label{margin-left:calc(var(--eui-spacing-s)*-1)}.eui-menu-item__link-icon--default{align-items:center;display:flex;flex-direction:column;font-size:var(--eui-font-size-xs);justify-content:inherit;width:100%}.ff.eui-menu--collapsed .eui-menu-item__link-icon--default{margin-left:var(--eui-spacing-2xs)}.eui-menu-item__link-label{font-size:calc(var(--eui-font-size) - 1px);overflow:hidden;padding-top:var(--eui-spacing-3xs);position:relative;text-overflow:ellipsis;white-space:nowrap;width:100%}.eui-menu--collapsed .eui-menu-item__link-label{display:none}.eui-page-column__body .eui-menu-item__link-label{font-size:var(--eui-font-size)}.eui-menu-item__link-right-content{align-items:center;display:flex;height:calc(var(--eui-spacing)*2.5);margin-left:auto}.eui-menu--collapsed .eui-menu-item__link-right-content{margin:0}.eui-menu--collapsed .eui-menu-item__link-right-content .eui-chip .eui-chip__content-container>span{display:inline-block;max-width:var(--eui-spacing-xl);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-menu-item__link-tag-label{display:flex;margin-left:var(--eui-spacing-xs);transform:scale(1)}.eui-menu--collapsed .eui-menu-item__link-tag-label{position:absolute;right:1px;top:0;transform:scale(.875)}.eui-menu-item__link-toggle{font-size:var(--eui-font-size);margin-left:var(--eui-spacing-2xs)!important;margin-right:calc(var(--eui-spacing-xs)*-1)!important;transition:all .3s linear!important}.eui-menu--collapsed .eui-menu-item__link-toggle{display:none;transition:none}.eui-menu-item__link-toggle .eui-button__container .eui-icon{font-size:var(--eui-font-size-l)!important}.eui-menu-item__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.eui-menu-item__label-external{color:var(--eui-color-grey);font-size:var(--eui-font-size-xs);margin-left:var(--eui-spacing-xs)}.eui-menu-item .eui-button.eui-menu-item__link-toggle:active,.eui-menu-item .eui-button.eui-menu-item__link-toggle:focus{border:2px solid var(--eui-color-accessible-focus);outline:none;transition:border .15s ease-in-out}.eui-app.ff.sidebar--close .eui-menu-item__link-tag-label{right:0}.eui-menu-item--expanded .eui-menu-item__category{display:flex}.eui-menu-item--disabled{background-image:none;box-shadow:none;cursor:default;opacity:.65;pointer-events:none}.eui-menu--no-icons:not(.eui-menu--collapsed) .eui-menu-item__category-icon,.eui-menu--no-icons:not(.eui-menu--collapsed) .eui-menu-item__category-icon--default,.eui-menu--no-icons:not(.eui-menu--collapsed) .eui-menu-item__link-icon,.eui-menu--no-icons:not(.eui-menu--collapsed) .eui-menu-item__link-icon--default{display:none}.eui-menu-sub{text-decoration:none}.eui-menu-sub .eui-menu-item__category{align-items:center;color:var(--eui-color-grey-darker);display:flex;flex-direction:row;font-size:var(--eui-font-size-s);font-weight:700;height:calc(var(--eui-spacing)*2.25);justify-content:center;overflow:hidden;padding:var(--eui-spacing-xs) var(--eui-spacing);text-decoration:none;text-overflow:ellipsis;text-transform:uppercase;transition:all .3s ease-in-out;white-space:nowrap}.eui-page-column__body .eui-menu-sub .eui-menu-item__category{font-weight:500;text-transform:inherit}.eui-menu-sub .eui-menu-item__category:hover:not(.eui-menu-item--disabled){background-color:var(--eui-color-grey-lightest);cursor:default;text-decoration:none}.eui-menu-sub .eui-menu-item__category-icon--default{color:var(--eui-color-primary-light);font-size:var(--eui-font-size)}.ff.eui-menu--collapsed .eui-menu-sub .eui-menu-item__category-icon--default{margin-left:var(--eui-spacing-2xs)}.eui-menu-sub .eui-menu-item__link{border:none;height:calc(var(--eui-spacing)*2.25);padding-left:calc(var(--eui-spacing)*2);text-transform:none}.eui-menu--collapsed .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-spacing)}.eui-menu-sub .eui-menu-item__link-icon{font-size:var(--eui-font-size-2xl)}.eui-menu-sub .eui-menu-item__link-icon+.eui-menu-item__link-label{padding-left:var(--eui-spacing-xs)}.eui-menu-sub .eui-menu-item__link-icon--default{font-size:var(--eui-font-size-xs);margin:0}.ff.eui-menu--collapsed .eui-menu-sub .eui-menu-item__link-icon--default{margin-left:var(--eui-spacing-2xs)}.eui-menu-sub .eui-menu-item__link-icon--none{display:none}.eui-menu-sub .eui-menu-item__link-marker{display:flex;font-size:var(--eui-font-size-xs);justify-content:center;position:relative;top:calc(var(--eui-spacing-2xs) - 2px)}.eui-menu-sub .eui-menu-item__link-marker.eui-menu-item__link-marker--default+.eui-menu-item__link-label,.eui-menu-sub .eui-menu-item__link-marker.eui-menu-item__link-marker--none+.eui-menu-item__link-label{padding-left:var(--eui-spacing-xs)}.ff.eui-menu--collapsed .eui-menu-sub .eui-menu-item__link-marker{margin-left:calc(var(--eui-spacing-2xs)*-1)}.eui-menu-sub .eui-menu-item__link-label{font-size:calc(var(--eui-font-size) - 1px);height:auto;overflow:hidden;padding-top:var(--eui-spacing-3xs);text-overflow:ellipsis;white-space:nowrap;width:100%}.eui-menu-sub .eui-menu-item__link-right-content{align-items:center;display:flex;height:calc(var(--eui-spacing)*2.5);margin-left:auto}.eui-menu--collapsed .eui-menu-sub .eui-menu-item__link-right-content{margin-left:var(--eui-spacing-2xs)}.eui-menu--collapsed .eui-menu-sub .eui-menu-item__link-right-content .eui-chip .eui-chip__content-container>span{display:inline-block;max-width:var(--eui-spacing-xl);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-menu-sub .eui-menu-sub .eui-menu-item{padding-left:calc(var(--eui-spacing)*1)}.eui-menu--collapsed .eui-menu--no-icons .eui-menu-sub .eui-menu-item__link{margin-left:calc(var(--eui-spacing)*-1)}.eui-t-compact .eui-menu-item__category-icon,.eui-t-compact .eui-menu-item__link-icon{font-size:var(--eui-font-size-3xl)}.eui-t-compact .eui-menu-item__category-icon--default,.eui-t-compact .eui-menu-item__link-icon--default{font-size:var(--eui-font-size-xs)}.eui-t-compact .eui-menu-item__link-tag-label{transform:scale(1.1)}.eui-t-compact .eui-menu-item__category-label{font-size:calc(var(--eui-font-size) - 1px)}"], encapsulation: 2 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiMenuComponent, [{
        type: Component,
        args: [{
                selector: 'eui-menu',
                templateUrl: './eui-menu.component.html',
                styleUrls: ['./styles/_index.scss'],
                changeDetection: ChangeDetectionStrategy.Default,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }]; }, { items: [{
            type: Input
        }], isCollapsed: [{
            type: Input
        }], hasFilter: [{
            type: Input
        }], hasIcons: [{
            type: Input
        }], hasTooltip: [{
            type: Input
        }], expandAllItems: [{
            type: Input
        }], fragmentId: [{
            type: Input
        }], searchFilterLabel: [{
            type: Input
        }], expandMenuLabel: [{
            type: Input
        }], collapseMenuLabel: [{
            type: Input
        }], externalLinkLabel: [{
            type: Input
        }], onClicked: [{
            type: Output
        }], onItemClicked: [{
            type: Output
        }], inputFilterElement: [{
            type: ViewChild,
            args: ['input', { static: false }]
        }], cssClasses: [{
            type: HostBinding,
            args: ['class']
        }], stopPropagation: [{
            type: HostListener,
            args: ['click', ['$event']]
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 