import * as i0 from '@angular/core';
import { EventEmitter, inject, ElementRef, booleanAttribute, HostListener, Input, Output, HostBinding, ViewEncapsulation, Component, ChangeDetectorRef, ViewChild, ViewChildren, NgModule } from '@angular/core';
import { consumeEvent } from '@eui/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { NgTemplateOutlet } from '@angular/common';
import * as i2 from '@eui/components/eui-icon';
import { EUI_ICON } from '@eui/components/eui-icon';
import * as i3 from '@eui/components/eui-badge';
import { EUI_BADGE } from '@eui/components/eui-badge';
import * as i4 from '@eui/components/eui-icon-button';
import { EUI_ICON_BUTTON } from '@eui/components/eui-icon-button';
import * as i5 from '@eui/components/eui-button';
import { EUI_BUTTON } from '@eui/components/eui-button';
import { EuiTooltipDirective } from '@eui/components/directives';
import { RouterLink, RouterLinkActive, Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import * as i1 from '@ngx-translate/core';
import { TranslateModule } from '@ngx-translate/core';
import { FocusKeyManager } from '@angular/cdk/a11y';
import * as i2$1 from '@eui/components/eui-icon-input';
import { EUI_ICON_INPUT } from '@eui/components/eui-icon-input';
import * as i3$1 from '@eui/components/eui-input-text';
import { EUI_INPUT_TEXT } from '@eui/components/eui-input-text';

class EuiMenuItemComponent {
    constructor() {
        this.role = 'menuitem';
        this.ariaLabel = '';
        this.tabindex = '-1';
        this.hasExpandIcon = true;
        this.expandToggle = new EventEmitter();
        this.itemClick = new EventEmitter();
        this.expandMenuLabel = 'Expand';
        this.collapseMenuLabel = 'Collapse';
        this.isUrlItem = false;
        this.isLinkItem = false;
        this.isLabelItem = false;
        this.isActionIconFocused = false;
        this.elementRef = inject(ElementRef);
    }
    get cssClasses() {
        return this.getCssClasses();
    }
    get ariaHasPopup() {
        return this.item?.children?.length > 0 ? true : undefined;
    }
    get ariaExpanded() {
        return this.item.children ? coerceBooleanProperty(this.item.expanded) : undefined;
    }
    get ariaDisabled() {
        return this.item.disabled;
    }
    ngOnInit() {
        this.isUrlItem = (this.item.url || this.item.urlExternal || this.item.children || this.item.command) && !this.item.link;
        this.isLabelItem = !this.item.url && !this.item.urlExternal && !this.item.command && !this.item.children && !this.item.link;
        this.isLinkItem = !this.isUrlItem && !this.isLabelItem;
        this.ariaLabel = this.getAriaLabel();
    }
    ngOnChanges(changes) {
        if (changes.item && changes.item.isFirstChange()) {
            this.item = changes.item.currentValue;
            if (!this.item.urlExternalTarget) {
                this.item.urlExternalTarget = '_blank';
            }
            this.item.filtered = typeof this.item.filtered == 'boolean' ? this.item.filtered : true;
            this.item.visible = typeof this.item.visible == 'boolean' ? this.item.visible : true;
        }
    }
    stopPropagation(event) {
        this.itemClick.emit(this.item);
        consumeEvent(event);
    }
    get menuItemTooltip() {
        if ((this.hasTooltip && this.isCollapsed) || (this.hasTooltipOnExpanded && !this.isCollapsed)) {
            return this.item.tooltip || this.getTooltipFromItem(this.item);
        }
        return null;
    }
    onClick(event) {
        this.itemClick.emit(this.item);
        this.focus();
        consumeEvent(event);
    }
    onExpandToggle(event) {
        this.expandToggle.emit(this.item);
        consumeEvent(event);
    }
    onActionIconClick(event) {
        this.item.actionIcon?.action(event);
        consumeEvent(event);
    }
    onActionIconKeyDown(event) {
        if (event.key === 'Enter') {
            this.item.actionIcon?.action(event);
            consumeEvent(event);
        }
    }
    focusActionIcon() {
        this.elementRef.nativeElement.querySelector('.eui-menu-item__link-action-icon').focus();
        this.isActionIconFocused = true;
    }
    onActionIconFocusOut() {
        this.isActionIconFocused = false;
    }
    focus() {
        this.elementRef.nativeElement.focus();
    }
    /**
     * Check if an element is visible in the viewport
     * @param partiallyVisible
     */
    elementIsVisibleInViewport(partiallyVisible = false) {
        const { top, left, bottom, right } = this.elementRef.nativeElement.getBoundingClientRect();
        const { innerHeight, innerWidth } = window;
        return partiallyVisible
            ? ((top > 0 && top < innerHeight) ||
                (bottom > 0 && bottom < innerHeight)) &&
                ((left > 0 && left < innerWidth) || (right > 0 && right < innerWidth))
            : top >= 0 && left >= 0 && bottom <= innerHeight && right <= innerWidth;
    }
    /**
     * Scroll the element into view
     * @param properties
     */
    scrollIntoView(properties) {
        this.elementRef.nativeElement.scrollIntoView(properties);
    }
    getTooltipFromItem(item) {
        return item.label && item.tagLabel ? `${item.label} (${item.tagLabel})` : item.label ||
            item.tagLabel ||
            null;
    }
    getAriaLabel() {
        return this.item.label ||
            this.item.tagLabel ||
            (this.item.actionIcon && this.item.actionIcon.label) ||
            this.item.iconLabel ||
            'Eui menu item';
    }
    /**
     * Returns the default eui-menu-item class on the HostBinding function
     * @private
     */
    getCssClasses() {
        return [
            'eui-menu-item',
            this.isCollapsed && this.hasIconLabel ? 'eui-menu-item--icon-label' : '',
            !this.parent && this.hasBoldRootLevel ? 'eui-menu-item--bold' : '',
        ].join(' ').trim();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EuiMenuItemComponent, isStandalone: true, selector: "eui-menu-item", inputs: { item: "item", parent: "parent", hasExpandIcon: "hasExpandIcon", hasIcon: ["hasIcon", "hasIcon", booleanAttribute], hasIconLabel: ["hasIconLabel", "hasIconLabel", booleanAttribute], hasTooltip: ["hasTooltip", "hasTooltip", booleanAttribute], hasTooltipOnExpanded: ["hasTooltipOnExpanded", "hasTooltipOnExpanded", booleanAttribute], isCollapsed: ["isCollapsed", "isCollapsed", booleanAttribute], hasCollapsedInitials: ["hasCollapsedInitials", "hasCollapsedInitials", booleanAttribute], hasBoldRootLevel: ["hasBoldRootLevel", "hasBoldRootLevel", booleanAttribute] }, outputs: { expandToggle: "expandToggle", itemClick: "itemClick" }, host: { listeners: { "click": "stopPropagation($event)" }, properties: { "attr.role": "this.role", "attr.aria-label": "this.ariaLabel", "class": "this.cssClasses", "attr.tabindex": "this.tabindex", "attr.aria-haspopup": "this.ariaHasPopup", "attr.aria-expanded": "this.ariaExpanded", "attr.aria-disabled": "this.ariaDisabled" } }, usesOnChanges: true, ngImport: i0, template: "@if (item.visible && item.filtered) {\n    @if (isLabelItem) {\n        <li\n            role=\"none\"\n            id=\"{{item.id}}\"\n            class=\"eui-menu-item__content\"\n            [attr.data-e2e]=\"item.e2eAttr\"\n            [class.eui-menu-item--disabled]=\"item.disabled\"\n            [attr.aria-disabled]=\"item.disabled\"\n            [euiTooltip]=\"(menuItemTooltip | translate)\"\n            tabindex=\"-1\"\n            position=\"after\">\n\n            <a\n                (click)=\"onClick($event)\"\n                tabindex=\"-1\"\n                class=\"eui-menu-item__link eui-menu-item__link-category\"\n                [class.eui-menu-item__link--disabled]=\"item.disabled\"\n                [class.eui-menu-item__link--active]=\"item.active\"\n                [class.eui-menu-item__link--has-sub]=\"item.children?.length > 0\"\n                href=\"javascript:void(0)\"\n                [euiTooltip]=\"(menuItemTooltip | translate)\"\n                position=\"after\"\n                [attr.aria-label]=\"isCollapsed ? (item.label | translate) : null\">\n\n                <div class=\"eui-menu-item__link-start-block\">\n                    <ng-template *ngTemplateOutlet=\"itemIconContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n                </div>\n\n                <div class=\"eui-menu-item__link-content-block\">\n                    <div class=\"eui-menu-item__link-label-container\">\n                        <span class=\"eui-menu-item__link-label-category\">{{ item.label | translate }}</span>\n                    </div>\n                </div>\n\n                <div class=\"eui-menu-item__link-end-block\">\n                    <ng-template *ngTemplateOutlet=\"itemEndContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n                </div>\n            </a>\n        </li>\n    }\n\n    @if (isUrlItem) {\n        <li\n            role=\"none\"\n            id=\"{{item.id}}\"\n            [attr.data-e2e]=\"item.e2eAttr\"\n            class=\"eui-menu-item__content\"\n            [class.eui-menu-item--disabled]=\"item.disabled\"\n            [class.eui-menu-item--expanded]=\"item.expanded || item.filtered\"\n            [attr.aria-disabled]=\"item.disabled\">\n            <a\n                (click)=\"onClick($event)\"\n                class=\"eui-menu-item__link\"\n                [class.eui-menu-item__link--disabled]=\"item.disabled\"\n                [class.eui-menu-item__link--active]=\"item.active\"\n                [class.eui-menu-item__link--has-sub]=\"item.children?.length > 0\"\n                [routerLink]=\"item.url ? item.url : null\"\n                [queryParams]=\"item.queryParams\"\n                [routerLinkActive]=\"item.url ? 'eui-menu-item__link--active' : ''\"\n                [euiTooltip]=\"(menuItemTooltip | translate)\"\n                position=\"after\"\n                [attr.aria-label]=\"isCollapsed ? (item.label | translate) : null\"\n                tabindex=\"-1\">\n                <ng-template *ngTemplateOutlet=\"linkContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n            </a>\n\n            <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n        </li>\n    }\n\n    @if (isLinkItem) {\n        <li\n            role=\"none\"\n            id=\"{{item.id}}\"\n            [attr.data-e2e]=\"item.e2eAttr\"\n            class=\"eui-menu-item__content\"\n            [class.eui-menu-item--disabled]=\"item.disabled\"\n            [class.eui-menu-item--expanded]=\"item.expanded || item.filtered\"\n            [attr.aria-disabled]=\"item.disabled\">\n            <a\n                (click)=\"onClick($event)\"\n                tabindex=\"-1\"\n                class=\"eui-menu-item__link\"\n                [class.eui-menu-item__link--disabled]=\"item.disabled\"\n                [class.eui-menu-item__link--active]=\"item.active\"\n                [class.eui-menu-item__link--has-sub]=\"item.children?.length > 0\"\n                href=\"javascript:void(0)\"\n                [euiTooltip]=\"(menuItemTooltip | translate)\"\n                [attr.aria-label]=\"isCollapsed ? (item.label | translate) : null\"\n                position=\"after\">\n                <ng-template *ngTemplateOutlet=\"linkContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n            </a>\n\n            <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n        </li>\n    }\n}\n\n<ng-template #linkContent>\n    @if (hasIconLabel) {\n        @if (isCollapsed) {\n            <div class=\"eui-menu-item__link-content-icon-block\">\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon\"\n                    icon=\"{{ item.iconSvgName }}\"\n                    fillColor=\"{{ item.iconTypeClass }}\" />                \n                <div class=\"eui-menu-item__link-label-container\">\n                    <span class=\"eui-menu-item__link-label\">{{ item.label | translate }}</span>\n                </div>\n            </div>            \n        } @else {\n            <ng-template *ngTemplateOutlet=\"defaultContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n        }\n    } @else {\n        <ng-template *ngTemplateOutlet=\"defaultContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n    } \n\n    <div class=\"eui-menu-item__link-end-block\">\n        <ng-template *ngTemplateOutlet=\"itemEndContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n    </div>\n</ng-template>\n\n<ng-template #defaultContent>\n    <div class=\"eui-menu-item__link-start-block\">\n        <ng-template *ngTemplateOutlet=\"itemIconContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n    </div>\n\n    <div class=\"eui-menu-item__link-content-block\">\n        <div class=\"eui-menu-item__link-label-container\">\n            <span class=\"eui-menu-item__link-label\">{{ item.label | translate }}</span>\n            @if (item.urlExternal && item.urlExternalTarget === '_blank') {\n            <eui-icon-svg\n                class=\"eui-menu-item__label-external\"\n                icon=\"eui-ecl-external\"\n                size=\"2xs\"\n                aria-label=\"external link icon\"\n                euiEnd>\n            </eui-icon-svg>\n            }\n        </div>\n    </div>\n</ng-template>\n\n\n<!-- PROJECTED CONTENT BLOCK -->\n<ng-template #content>\n    <ng-content />\n</ng-template>\n\n<!-- PROJECTED START BLOCK -->\n<ng-template #itemIconContent>\n    @if (!isCollapsed) {\n        @if (hasIcon) {\n            @if (item.iconSvgName) {\n                <!-- SVG -->\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon\"\n                    icon=\"{{ item.iconSvgName }}\"\n                    fillColor=\"{{ item.iconTypeClass }}\" />\n            } @else if (item.iconSvgUrl) {\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon\"\n                    iconUrl=\"{{ item.iconSvgUrl }}\"\n                    fillColor=\"{{ item.iconTypeClass }}\" />\n            } @else if (item.hasMarker) {\n                <!-- MARKER -->\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-marker\"\n                    fillColor=\"{{ item?.markerTypeClass }}\"\n                    icon=\"ellipse:sharp\"\n                    size=\"2xs\"\n                    [aria-label]=\"item.markerTypeClass + ' ' + 'marker'\" />\n            }\n            @else if (!isLabelItem) {\n                <!-- DEFAULT for non category items -->\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon\"\n                    icon=\"ellipse:sharp\"\n                    fillColor=\"neutral-light\"\n                    size=\"2xs\" />\n            }\n        } @else if (item.hasMarker) {\n            <eui-icon-svg\n                class=\"eui-menu-item__link-marker\"\n                fillColor=\"{{ item?.markerTypeClass }}\"\n                icon=\"ellipse:sharp\"\n                size=\"2xs\"\n                [aria-label]=\"item.markerTypeClass + ' ' + 'marker'\" />\n        }\n\n    } @else {\n        @if (hasCollapsedInitials) {\n            <span class=\"eui-menu-item__link-initials eui-u-c-bg-{{item.iconTypeClass}}\">\n                {{ item.initials }}\n            </span>\n        } @else {\n            @if (hasIcon) {\n                @if (item.iconSvgName) {\n                    <!-- SVG -->\n                    <eui-icon-svg\n                        class=\"eui-menu-item__link-icon\"\n                        icon=\"{{ item.iconSvgName }}\"\n                        fillColor=\"{{ item.iconTypeClass }}\" />\n\n                } @else if (item.iconSvgUrl) {\n                    <eui-icon-svg\n                        class=\"eui-menu-item__link-icon\"\n                        iconUrl=\"{{ item.iconSvgUrl }}\"\n                        fillColor=\"{{ item.iconTypeClass }}\" />\n\n                } @else if (item.hasMarker) {\n                    <!-- MARKER -->\n                    <eui-icon-svg\n                        class=\"eui-menu-item__link-marker\"\n                        fillColor=\"{{ item?.markerTypeClass }}\"\n                        icon=\"ellipse:sharp\"\n                        size=\"2xs\"\n                        [aria-label]=\"item.markerTypeClass + ' ' + 'marker'\" />\n                } @else {\n                    <!-- DEFAULT -->\n                    <eui-icon-svg\n                        class=\"eui-menu-item__link-icon\"\n                        icon=\"ellipse:sharp\"\n                        fillColor=\"neutral-light\"\n                        size=\"2xs\"\n                        [aria-label]=\"item.iconLabel\" />\n                }\n            } @else {\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon eui-u-ml-2xs\"\n                    icon=\"square:sharp\"\n                    fillColor=\"neutral-light\"\n                    size=\"2xs\" />\n            }\n        }\n    }\n</ng-template>\n\n<!-- PROJECTED END BLOCK -->\n<ng-template #itemEndContent>\n    @if (item.tagLabel) {\n        @if (isCollapsed) {\n            <eui-badge [euiVariant]=\"item.tagTypeClass\" class=\"eui-menu-item__link-dotted-badge\" />\n        } @else {\n            <eui-badge [euiVariant]=\"item.tagTypeClass\">\n                {{ item.tagLabel }}\n            </eui-badge>\n        }\n    }\n\n    @if (item.actionIcon) {\n    <button\n        euiButton\n        euiRounded\n        euiIconButton\n        euiSizeS\n        euiBasicButton\n        type=\"button\"\n        tabindex=\"-1\"\n        (keydown)=\"onActionIconKeyDown($event)\"\n        (focusout)=\"onActionIconFocusOut()\"\n        (focus)=\"focusActionIcon()\"\n        class=\"eui-menu-item__link-action-icon\"\n        [euiDisabled]=\"item.disabled\"\n        [attr.aria-label]=\"item.actionIcon?.label\"\n        (click)=\"onActionIconClick($event)\">\n        <eui-icon-svg [icon]=\"item.actionIcon?.icon\" [fillColor]=\"item.actionIcon?.color\"></eui-icon-svg>\n    </button>\n    }\n\n    @if (hasExpandIcon) {\n        @if (item.children?.length > 0) {\n        <eui-icon-button\n                         class=\"eui-menu-item__link-toggle\"\n                         [icon]=\"item.expanded ? 'chevron-up:sharp': 'chevron-down:sharp'\"\n                         (buttonClick)=\"onExpandToggle($event)\"\n                         [ariaLabel]=\"item.expanded ? collapseMenuLabel : expandMenuLabel\"\n                         euiRounded\n                         size=\"s\"\n                         [tabindex]=\"-1\"\n                         [euiDisabled]=\"item.disabled\"/>\n        }\n    }\n</ng-template>\n", styles: [".eui-19 .eui-menu{display:flex;flex-direction:column;gap:0;list-style:none;margin-block-start:0;margin-block-end:0;margin:0;padding:0;width:100%}.eui-19 .eui-menu:focus:not([readonly]){outline:2px solid var(--eui-c-focus)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu--collapsed .eui-menu-filter{transition:none;visibility:hidden}.eui-19 .eui-menu--collapsed .eui-menu-item__link{padding-left:var(--eui-s-m)}.eui-19 .eui-menu--collapsed .eui-menu-item__link-start-block{gap:0}.eui-19 .eui-menu--collapsed .eui-menu-item__link-content-block,.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block{visibility:hidden}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-action-icon{display:none}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-dotted-badge{position:absolute;top:var(--eui-s-2xs);right:var(--eui-s-2xs);visibility:visible}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-toggle{display:inherit;position:absolute;right:calc(-1.75 * var(--eui-s-xs));transform:scale(.75);visibility:visible}.eui-19 .eui-menu--collapsed .eui-menu-item__link-initials{display:flex;background-color:var(--eui-c-s-secondary-surface-light);border:var(--eui-bw-xs) solid var(--eui-c-divider);border-radius:var(--eui-s-xs);font:var(--eui-f-s-bold);justify-content:center;margin-left:calc(-1 * var(--eui-s-2xs));min-width:var(--eui-s-2xl)}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded:first-child{border-bottom:none;padding-bottom:0}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-l)}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-s)}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link{padding-left:0;min-height:var(--eui-s-2xl)}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link-icon{display:none}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link-content-icon-block{padding-top:0;padding-bottom:0}.eui-19 .eui-menu--no-items{color:var(--eui-c-text-lighter);text-align:center}.eui-19 .eui-menu-filter{display:flex;padding:var(--eui-s-m);position:relative;width:100%}.eui-19 .eui-menu-filter--collapsed{padding:0;height:0}.eui-19 .eui-menu-filter--collapsed .eui-icon-svg{display:none}.eui-19 .eui-menu-item{display:flex;position:relative;width:100%}.eui-19 .eui-menu-item:focus-visible>.eui-menu-item__content{outline:1px solid var(--eui-c-focus-visible);outline-offset:-1px}.eui-19 .eui-menu-item .eui-menu-item__content{align-items:center;display:flex;position:relative;width:100%;border:var(--eui-bw-xs) solid transparent}.eui-19 .eui-menu-item__link{align-items:center;color:var(--eui-c-text);cursor:pointer;display:flex;font:var(--eui-f-m);gap:var(--eui-s-xs);min-height:var(--eui-s-4xl);padding:0 var(--eui-s-xs) 0 var(--eui-s-m);margin-bottom:calc(-1 * var(--eui-s-2xs));border-top:1px solid var(--eui-c-divider-light);text-decoration:none;width:100%}.eui-19 .eui-menu-item__link-start-block{align-items:center;display:flex;gap:var(--eui-s-xs)}.eui-19 .eui-menu-item__link-start-block:empty{display:none}.eui-19 .eui-menu-item__link-content-block,.eui-19 .eui-menu-item__link-content-icon-block{display:flex;flex-direction:column;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container{align-items:center;display:flex;position:relative;width:100%}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container .eui-menu-item__link-label,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label{color:var(--eui-c-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container .eui-menu-item__link-label-category,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label-category{cursor:default;font:var(--eui-f-bold);opacity:var(--eui-o-75);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-icon-block{gap:var(--eui-s-2xs);padding:var(--eui-s-2xs);align-items:center}.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container{justify-content:center}.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label{font:var(--eui-f-2xs)!important}.eui-19 .eui-menu-item__link-end-block{align-items:center;display:flex;gap:var(--eui-s-xs)}.eui-19 .eui-menu-item__link:hover:not(.eui-menu-item--disabled):not(.eui-menu-item__link-category){background-color:var(--eui-c-active-bg);text-decoration:none}.eui-19 .eui-menu-item__link--disabled{opacity:var(--eui-o-50);pointer-events:none}.eui-19 .eui-menu-item__link--active:not(.eui-menu-item--disabled){background-color:var(--eui-c-active-bg);font:var(--eui-f-m-bold)}.eui-19 .eui-menu-item__link--active:not(.eui-menu-item--disabled) .eui-menu-item__link-label{color:var(--eui-c-link)}.eui-19 .eui-menu-item--expanded{display:flex;flex-direction:column}.eui-19 .eui-menu-item--expanded .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-3xl)}.eui-19 .eui-menu-item .eui-menu-sub .eui-menu-item__link{min-height:var(--eui-s-3xl);padding-left:var(--eui-s-xl);border-top:0}.eui-19 .eui-menu-item--bold>.eui-menu-item__content>.eui-menu-item__link{font:var(--eui-f-m-bold)}.eui-19 .eui-menu-item--icon-label .eui-menu-item__link{padding:0;gap:0}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "component", type: i2.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }, { kind: "component", type: i3.EuiBadgeComponent, selector: "div[euiBadge], span[euiBadge], eui-badge", inputs: ["e2eAttr", "aria-label", "maxCharCount", "charReplacement", "euiIconBadge", "euiDottedBadge"] }, { kind: "component", type: i4.EuiIconButtonComponent, selector: "eui-icon-button", inputs: ["icon", "iconUrl", "fillColor", "size", "ariaLabel", "tabindex", "hasNoPadding", "hasOverflowHover", "hasFocusHoverColor", "hasFocusHoverBg", "euiRounded", "euiDisabled"], outputs: ["buttonClick"] }, { kind: "component", type: i5.EuiButtonComponent, selector: "button[euiButton], a[euiButton]", inputs: ["e2eAttr", "id", "euiBasicButton", "euiButtonCall", "euiCTAButton", "euiBlockButton", "euiIconButton", "euiAvatarButton", "euiLineWrap", "isCompact", "hasNoFocusRing", "isChecked", "euiDisabled"], outputs: ["buttonClick"] }, { kind: "directive", type: EuiTooltipDirective, selector: "[euiTooltip]", inputs: ["e2eAttr", "showDelay", "hideDelay", "contentAlignment", "position", "isDisabled", "euiTooltip", "euiTooltipPrimary", "euiTooltipSecondary", "euiTooltipInfo", "euiTooltipSuccess", "euiTooltipWarning", "euiTooltipDanger", "euiTooltipAccent"], exportAs: ["euiTooltip"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiMenuItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-menu-item', encapsulation: ViewEncapsulation.None, imports: [
                        RouterLink,
                        RouterLinkActive,
                        NgTemplateOutlet,
                        TranslateModule,
                        ...EUI_ICON,
                        ...EUI_BADGE,
                        ...EUI_ICON_BUTTON,
                        ...EUI_BUTTON,
                        EuiTooltipDirective,
                    ], template: "@if (item.visible && item.filtered) {\n    @if (isLabelItem) {\n        <li\n            role=\"none\"\n            id=\"{{item.id}}\"\n            class=\"eui-menu-item__content\"\n            [attr.data-e2e]=\"item.e2eAttr\"\n            [class.eui-menu-item--disabled]=\"item.disabled\"\n            [attr.aria-disabled]=\"item.disabled\"\n            [euiTooltip]=\"(menuItemTooltip | translate)\"\n            tabindex=\"-1\"\n            position=\"after\">\n\n            <a\n                (click)=\"onClick($event)\"\n                tabindex=\"-1\"\n                class=\"eui-menu-item__link eui-menu-item__link-category\"\n                [class.eui-menu-item__link--disabled]=\"item.disabled\"\n                [class.eui-menu-item__link--active]=\"item.active\"\n                [class.eui-menu-item__link--has-sub]=\"item.children?.length > 0\"\n                href=\"javascript:void(0)\"\n                [euiTooltip]=\"(menuItemTooltip | translate)\"\n                position=\"after\"\n                [attr.aria-label]=\"isCollapsed ? (item.label | translate) : null\">\n\n                <div class=\"eui-menu-item__link-start-block\">\n                    <ng-template *ngTemplateOutlet=\"itemIconContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n                </div>\n\n                <div class=\"eui-menu-item__link-content-block\">\n                    <div class=\"eui-menu-item__link-label-container\">\n                        <span class=\"eui-menu-item__link-label-category\">{{ item.label | translate }}</span>\n                    </div>\n                </div>\n\n                <div class=\"eui-menu-item__link-end-block\">\n                    <ng-template *ngTemplateOutlet=\"itemEndContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n                </div>\n            </a>\n        </li>\n    }\n\n    @if (isUrlItem) {\n        <li\n            role=\"none\"\n            id=\"{{item.id}}\"\n            [attr.data-e2e]=\"item.e2eAttr\"\n            class=\"eui-menu-item__content\"\n            [class.eui-menu-item--disabled]=\"item.disabled\"\n            [class.eui-menu-item--expanded]=\"item.expanded || item.filtered\"\n            [attr.aria-disabled]=\"item.disabled\">\n            <a\n                (click)=\"onClick($event)\"\n                class=\"eui-menu-item__link\"\n                [class.eui-menu-item__link--disabled]=\"item.disabled\"\n                [class.eui-menu-item__link--active]=\"item.active\"\n                [class.eui-menu-item__link--has-sub]=\"item.children?.length > 0\"\n                [routerLink]=\"item.url ? item.url : null\"\n                [queryParams]=\"item.queryParams\"\n                [routerLinkActive]=\"item.url ? 'eui-menu-item__link--active' : ''\"\n                [euiTooltip]=\"(menuItemTooltip | translate)\"\n                position=\"after\"\n                [attr.aria-label]=\"isCollapsed ? (item.label | translate) : null\"\n                tabindex=\"-1\">\n                <ng-template *ngTemplateOutlet=\"linkContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n            </a>\n\n            <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n        </li>\n    }\n\n    @if (isLinkItem) {\n        <li\n            role=\"none\"\n            id=\"{{item.id}}\"\n            [attr.data-e2e]=\"item.e2eAttr\"\n            class=\"eui-menu-item__content\"\n            [class.eui-menu-item--disabled]=\"item.disabled\"\n            [class.eui-menu-item--expanded]=\"item.expanded || item.filtered\"\n            [attr.aria-disabled]=\"item.disabled\">\n            <a\n                (click)=\"onClick($event)\"\n                tabindex=\"-1\"\n                class=\"eui-menu-item__link\"\n                [class.eui-menu-item__link--disabled]=\"item.disabled\"\n                [class.eui-menu-item__link--active]=\"item.active\"\n                [class.eui-menu-item__link--has-sub]=\"item.children?.length > 0\"\n                href=\"javascript:void(0)\"\n                [euiTooltip]=\"(menuItemTooltip | translate)\"\n                [attr.aria-label]=\"isCollapsed ? (item.label | translate) : null\"\n                position=\"after\">\n                <ng-template *ngTemplateOutlet=\"linkContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n            </a>\n\n            <ng-template *ngTemplateOutlet=\"content\"></ng-template>\n        </li>\n    }\n}\n\n<ng-template #linkContent>\n    @if (hasIconLabel) {\n        @if (isCollapsed) {\n            <div class=\"eui-menu-item__link-content-icon-block\">\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon\"\n                    icon=\"{{ item.iconSvgName }}\"\n                    fillColor=\"{{ item.iconTypeClass }}\" />                \n                <div class=\"eui-menu-item__link-label-container\">\n                    <span class=\"eui-menu-item__link-label\">{{ item.label | translate }}</span>\n                </div>\n            </div>            \n        } @else {\n            <ng-template *ngTemplateOutlet=\"defaultContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n        }\n    } @else {\n        <ng-template *ngTemplateOutlet=\"defaultContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n    } \n\n    <div class=\"eui-menu-item__link-end-block\">\n        <ng-template *ngTemplateOutlet=\"itemEndContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n    </div>\n</ng-template>\n\n<ng-template #defaultContent>\n    <div class=\"eui-menu-item__link-start-block\">\n        <ng-template *ngTemplateOutlet=\"itemIconContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\"></ng-template>\n    </div>\n\n    <div class=\"eui-menu-item__link-content-block\">\n        <div class=\"eui-menu-item__link-label-container\">\n            <span class=\"eui-menu-item__link-label\">{{ item.label | translate }}</span>\n            @if (item.urlExternal && item.urlExternalTarget === '_blank') {\n            <eui-icon-svg\n                class=\"eui-menu-item__label-external\"\n                icon=\"eui-ecl-external\"\n                size=\"2xs\"\n                aria-label=\"external link icon\"\n                euiEnd>\n            </eui-icon-svg>\n            }\n        </div>\n    </div>\n</ng-template>\n\n\n<!-- PROJECTED CONTENT BLOCK -->\n<ng-template #content>\n    <ng-content />\n</ng-template>\n\n<!-- PROJECTED START BLOCK -->\n<ng-template #itemIconContent>\n    @if (!isCollapsed) {\n        @if (hasIcon) {\n            @if (item.iconSvgName) {\n                <!-- SVG -->\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon\"\n                    icon=\"{{ item.iconSvgName }}\"\n                    fillColor=\"{{ item.iconTypeClass }}\" />\n            } @else if (item.iconSvgUrl) {\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon\"\n                    iconUrl=\"{{ item.iconSvgUrl }}\"\n                    fillColor=\"{{ item.iconTypeClass }}\" />\n            } @else if (item.hasMarker) {\n                <!-- MARKER -->\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-marker\"\n                    fillColor=\"{{ item?.markerTypeClass }}\"\n                    icon=\"ellipse:sharp\"\n                    size=\"2xs\"\n                    [aria-label]=\"item.markerTypeClass + ' ' + 'marker'\" />\n            }\n            @else if (!isLabelItem) {\n                <!-- DEFAULT for non category items -->\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon\"\n                    icon=\"ellipse:sharp\"\n                    fillColor=\"neutral-light\"\n                    size=\"2xs\" />\n            }\n        } @else if (item.hasMarker) {\n            <eui-icon-svg\n                class=\"eui-menu-item__link-marker\"\n                fillColor=\"{{ item?.markerTypeClass }}\"\n                icon=\"ellipse:sharp\"\n                size=\"2xs\"\n                [aria-label]=\"item.markerTypeClass + ' ' + 'marker'\" />\n        }\n\n    } @else {\n        @if (hasCollapsedInitials) {\n            <span class=\"eui-menu-item__link-initials eui-u-c-bg-{{item.iconTypeClass}}\">\n                {{ item.initials }}\n            </span>\n        } @else {\n            @if (hasIcon) {\n                @if (item.iconSvgName) {\n                    <!-- SVG -->\n                    <eui-icon-svg\n                        class=\"eui-menu-item__link-icon\"\n                        icon=\"{{ item.iconSvgName }}\"\n                        fillColor=\"{{ item.iconTypeClass }}\" />\n\n                } @else if (item.iconSvgUrl) {\n                    <eui-icon-svg\n                        class=\"eui-menu-item__link-icon\"\n                        iconUrl=\"{{ item.iconSvgUrl }}\"\n                        fillColor=\"{{ item.iconTypeClass }}\" />\n\n                } @else if (item.hasMarker) {\n                    <!-- MARKER -->\n                    <eui-icon-svg\n                        class=\"eui-menu-item__link-marker\"\n                        fillColor=\"{{ item?.markerTypeClass }}\"\n                        icon=\"ellipse:sharp\"\n                        size=\"2xs\"\n                        [aria-label]=\"item.markerTypeClass + ' ' + 'marker'\" />\n                } @else {\n                    <!-- DEFAULT -->\n                    <eui-icon-svg\n                        class=\"eui-menu-item__link-icon\"\n                        icon=\"ellipse:sharp\"\n                        fillColor=\"neutral-light\"\n                        size=\"2xs\"\n                        [aria-label]=\"item.iconLabel\" />\n                }\n            } @else {\n                <eui-icon-svg\n                    class=\"eui-menu-item__link-icon eui-u-ml-2xs\"\n                    icon=\"square:sharp\"\n                    fillColor=\"neutral-light\"\n                    size=\"2xs\" />\n            }\n        }\n    }\n</ng-template>\n\n<!-- PROJECTED END BLOCK -->\n<ng-template #itemEndContent>\n    @if (item.tagLabel) {\n        @if (isCollapsed) {\n            <eui-badge [euiVariant]=\"item.tagTypeClass\" class=\"eui-menu-item__link-dotted-badge\" />\n        } @else {\n            <eui-badge [euiVariant]=\"item.tagTypeClass\">\n                {{ item.tagLabel }}\n            </eui-badge>\n        }\n    }\n\n    @if (item.actionIcon) {\n    <button\n        euiButton\n        euiRounded\n        euiIconButton\n        euiSizeS\n        euiBasicButton\n        type=\"button\"\n        tabindex=\"-1\"\n        (keydown)=\"onActionIconKeyDown($event)\"\n        (focusout)=\"onActionIconFocusOut()\"\n        (focus)=\"focusActionIcon()\"\n        class=\"eui-menu-item__link-action-icon\"\n        [euiDisabled]=\"item.disabled\"\n        [attr.aria-label]=\"item.actionIcon?.label\"\n        (click)=\"onActionIconClick($event)\">\n        <eui-icon-svg [icon]=\"item.actionIcon?.icon\" [fillColor]=\"item.actionIcon?.color\"></eui-icon-svg>\n    </button>\n    }\n\n    @if (hasExpandIcon) {\n        @if (item.children?.length > 0) {\n        <eui-icon-button\n                         class=\"eui-menu-item__link-toggle\"\n                         [icon]=\"item.expanded ? 'chevron-up:sharp': 'chevron-down:sharp'\"\n                         (buttonClick)=\"onExpandToggle($event)\"\n                         [ariaLabel]=\"item.expanded ? collapseMenuLabel : expandMenuLabel\"\n                         euiRounded\n                         size=\"s\"\n                         [tabindex]=\"-1\"\n                         [euiDisabled]=\"item.disabled\"/>\n        }\n    }\n</ng-template>\n", styles: [".eui-19 .eui-menu{display:flex;flex-direction:column;gap:0;list-style:none;margin-block-start:0;margin-block-end:0;margin:0;padding:0;width:100%}.eui-19 .eui-menu:focus:not([readonly]){outline:2px solid var(--eui-c-focus)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu--collapsed .eui-menu-filter{transition:none;visibility:hidden}.eui-19 .eui-menu--collapsed .eui-menu-item__link{padding-left:var(--eui-s-m)}.eui-19 .eui-menu--collapsed .eui-menu-item__link-start-block{gap:0}.eui-19 .eui-menu--collapsed .eui-menu-item__link-content-block,.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block{visibility:hidden}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-action-icon{display:none}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-dotted-badge{position:absolute;top:var(--eui-s-2xs);right:var(--eui-s-2xs);visibility:visible}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-toggle{display:inherit;position:absolute;right:calc(-1.75 * var(--eui-s-xs));transform:scale(.75);visibility:visible}.eui-19 .eui-menu--collapsed .eui-menu-item__link-initials{display:flex;background-color:var(--eui-c-s-secondary-surface-light);border:var(--eui-bw-xs) solid var(--eui-c-divider);border-radius:var(--eui-s-xs);font:var(--eui-f-s-bold);justify-content:center;margin-left:calc(-1 * var(--eui-s-2xs));min-width:var(--eui-s-2xl)}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded:first-child{border-bottom:none;padding-bottom:0}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-l)}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-s)}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link{padding-left:0;min-height:var(--eui-s-2xl)}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link-icon{display:none}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link-content-icon-block{padding-top:0;padding-bottom:0}.eui-19 .eui-menu--no-items{color:var(--eui-c-text-lighter);text-align:center}.eui-19 .eui-menu-filter{display:flex;padding:var(--eui-s-m);position:relative;width:100%}.eui-19 .eui-menu-filter--collapsed{padding:0;height:0}.eui-19 .eui-menu-filter--collapsed .eui-icon-svg{display:none}.eui-19 .eui-menu-item{display:flex;position:relative;width:100%}.eui-19 .eui-menu-item:focus-visible>.eui-menu-item__content{outline:1px solid var(--eui-c-focus-visible);outline-offset:-1px}.eui-19 .eui-menu-item .eui-menu-item__content{align-items:center;display:flex;position:relative;width:100%;border:var(--eui-bw-xs) solid transparent}.eui-19 .eui-menu-item__link{align-items:center;color:var(--eui-c-text);cursor:pointer;display:flex;font:var(--eui-f-m);gap:var(--eui-s-xs);min-height:var(--eui-s-4xl);padding:0 var(--eui-s-xs) 0 var(--eui-s-m);margin-bottom:calc(-1 * var(--eui-s-2xs));border-top:1px solid var(--eui-c-divider-light);text-decoration:none;width:100%}.eui-19 .eui-menu-item__link-start-block{align-items:center;display:flex;gap:var(--eui-s-xs)}.eui-19 .eui-menu-item__link-start-block:empty{display:none}.eui-19 .eui-menu-item__link-content-block,.eui-19 .eui-menu-item__link-content-icon-block{display:flex;flex-direction:column;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container{align-items:center;display:flex;position:relative;width:100%}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container .eui-menu-item__link-label,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label{color:var(--eui-c-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container .eui-menu-item__link-label-category,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label-category{cursor:default;font:var(--eui-f-bold);opacity:var(--eui-o-75);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-icon-block{gap:var(--eui-s-2xs);padding:var(--eui-s-2xs);align-items:center}.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container{justify-content:center}.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label{font:var(--eui-f-2xs)!important}.eui-19 .eui-menu-item__link-end-block{align-items:center;display:flex;gap:var(--eui-s-xs)}.eui-19 .eui-menu-item__link:hover:not(.eui-menu-item--disabled):not(.eui-menu-item__link-category){background-color:var(--eui-c-active-bg);text-decoration:none}.eui-19 .eui-menu-item__link--disabled{opacity:var(--eui-o-50);pointer-events:none}.eui-19 .eui-menu-item__link--active:not(.eui-menu-item--disabled){background-color:var(--eui-c-active-bg);font:var(--eui-f-m-bold)}.eui-19 .eui-menu-item__link--active:not(.eui-menu-item--disabled) .eui-menu-item__link-label{color:var(--eui-c-link)}.eui-19 .eui-menu-item--expanded{display:flex;flex-direction:column}.eui-19 .eui-menu-item--expanded .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-3xl)}.eui-19 .eui-menu-item .eui-menu-sub .eui-menu-item__link{min-height:var(--eui-s-3xl);padding-left:var(--eui-s-xl);border-top:0}.eui-19 .eui-menu-item--bold>.eui-menu-item__content>.eui-menu-item__link{font:var(--eui-f-m-bold)}.eui-19 .eui-menu-item--icon-label .eui-menu-item__link{padding:0;gap:0}\n"] }]
        }], propDecorators: { role: [{
                type: HostBinding,
                args: ['attr.role']
            }], ariaLabel: [{
                type: HostBinding,
                args: ['attr.aria-label']
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], tabindex: [{
                type: HostBinding,
                args: ['attr.tabindex']
            }], ariaHasPopup: [{
                type: HostBinding,
                args: ['attr.aria-haspopup']
            }], ariaExpanded: [{
                type: HostBinding,
                args: ['attr.aria-expanded']
            }], ariaDisabled: [{
                type: HostBinding,
                args: ['attr.aria-disabled']
            }], item: [{
                type: Input
            }], parent: [{
                type: Input
            }], hasExpandIcon: [{
                type: Input
            }], expandToggle: [{
                type: Output
            }], itemClick: [{
                type: Output
            }], hasIcon: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasIconLabel: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasTooltip: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasTooltipOnExpanded: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isCollapsed: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasCollapsedInitials: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasBoldRootLevel: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], stopPropagation: [{
                type: HostListener,
                args: ['click', ['$event']]
            }] } });

class EuiMenuComponent {
    constructor() {
        this.filterValue = '';
        this.isCollapsed = false;
        this.hasCollapsedInitials = false;
        this.hasFilter = false;
        this.hasIcons = false;
        this.hasIconsLabels = false;
        this.hasTooltip = true;
        this.hasTooltipOnExpanded = false;
        /**
         * Expand all items in the menu. Affects only items that have no expanded property set.
         * e.g. items = [{label: test, expanded: true}, {label: test2, expanded: false}, {label: test3}] will expand only test3.
         */
        this.expandAllItems = false;
        this.isFlat = false;
        this.hasScrollToItem = false;
        this.hasBoldRootLevel = false;
        this.isClick = new EventEmitter();
        this.itemClick = new EventEmitter();
        this.expandToggle = new EventEmitter();
        this.hasExpandIcon = true;
        this.router = inject(Router);
        this.route = inject(ActivatedRoute);
        this.cd = inject(ChangeDetectorRef);
    }
    get cssClasses() {
        return [
            'eui-menu',
            this.isCollapsed ? 'eui-menu--collapsed' : '',
            !this.hasIcons ? 'eui-menu--no-icons' : '',
            this.isFlat ? 'eui-menu--flat' : '',
        ].join(' ').trim();
    }
    stopPropagation(event) {
        event.stopPropagation();
    }
    onKeydown(event) {
        // finds first child when ArrowDown
        const firstChild = this.focusKeyManager.activeItem?.item.children ? this.findFirstFilteredItem(this.focusKeyManager.activeItem?.item.children) : undefined;
        const firstFocusableItem = this.findFocusableItem(firstChild);
        // finds the parent element
        const parent = this.focusKeyManager.activeItem?.item.parent;
        const parentFocusableItem = this.findFocusableItem(parent);
        switch (event.key) {
            case 'Enter': {
                if ((this.focusKeyManager.activeItem.isLinkItem || this.focusKeyManager.activeItem.isUrlItem) &&
                    !this.focusKeyManager.activeItem.disabled) {
                    this.focusKeyManager.activeItem.onClick(event);
                    event.preventDefault();
                }
                break;
            }
            case 'ArrowRight': {
                if (this.isFilterEnabled()) {
                    break;
                }
                if (this.focusKeyManager.activeItem?.item.actionIcon) {
                    this.checkActionIconFocusState();
                    break;
                }
                else {
                    if (!this.focusKeyManager.activeItem?.item.expanded) {
                        this.focusKeyManager.activeItem?.onExpandToggle(event);
                        this.cd.detectChanges();
                    }
                    break;
                }
            }
            case 'ArrowLeft': {
                if (this.isFilterEnabled()) {
                    break;
                }
                if (this.focusKeyManager.activeItem?.item.actionIcon) {
                    this.checkActionIconFocusState();
                    break;
                }
                else {
                    if (this.focusKeyManager.activeItem?.item.expanded) {
                        this.focusKeyManager.activeItem.onExpandToggle(event);
                        this.cd.detectChanges();
                        event.preventDefault();
                    }
                    break;
                }
            }
            case 'ArrowDown': {
                event.preventDefault();
                if (this.shouldRenderChild(this.focusKeyManager.activeItem?.item)) {
                    //focuses first child
                    firstFocusableItem?.focus();
                    this.focusKeyManager.updateActiveItem(firstFocusableItem);
                }
                else if (parent) {
                    // finds last filtered child when ArrowDown and navigating within submenu
                    const filteredChildren = this.findFilteredItems(parent.children);
                    const lastChildIndex = (filteredChildren?.length) - 1;
                    const lastChild = filteredChildren[lastChildIndex];
                    const lastFocusableItem = this.findFocusableItem(lastChild);
                    // if the active item is the last child, puts the focus on the next parent
                    if (this.focusKeyManager.activeItem === lastFocusableItem) {
                        this.focusKeyManager.updateActiveItem(parentFocusableItem);
                        this.focusKeyManager.setNextItemActive();
                    }
                    else {
                        this.focusKeyManager.setActiveItem(this.focusKeyManager.activeItemIndex + 1);
                    }
                }
                else {
                    // skips remaining children in the query list when there is expanded node
                    this.focusKeyManager.skipPredicate(menuItem => menuItem.parent != undefined || menuItem.item.visible === false);
                    this.focusKeyManager.onKeydown(event);
                }
                break;
            }
            case 'ArrowUp': {
                event.preventDefault();
                if (parent) {
                    // finds first filtered child when ArrowUp
                    const filteredChildren = this.findFilteredItems(parent.children);
                    const firstChildUp = filteredChildren['0'];
                    const firstFocusableItemUp = this.findFocusableItem(firstChildUp);
                    // when navigating up on a submenu focuses the parent if the active item is the first child
                    if (this.focusKeyManager.activeItem === firstFocusableItemUp) {
                        this.focusKeyManager.setActiveItem(parentFocusableItem);
                    }
                    else {
                        this.focusKeyManager.setActiveItem(this.focusKeyManager.activeItemIndex - 1);
                    }
                }
                else {
                    this.focusKeyManager.onKeydown(event);
                    // when navigating up from a parent element to an expanded submenu, finds the last child and focuses it
                    if (this.shouldRenderChild(this.focusKeyManager.activeItem?.item)) {
                        const filteredChildren = this.findFilteredItems(this.focusKeyManager.activeItem?.item.children);
                        const lastChildIndexUp = (filteredChildren.length) - 1;
                        const lastFocusableItemUp = this.findFocusableItem(filteredChildren[lastChildIndexUp]);
                        this.focusKeyManager.setActiveItem(lastFocusableItemUp);
                    }
                }
                break;
            }
            default: {
                this.focusKeyManager.onKeydown(event);
                break;
            }
        }
    }
    ngOnChanges(changes) {
        if (changes.items) {
            this.items = this.configureItems(this.items);
            // get current url
            const currentUrl = this.router.url;
            // find an item that matches the current url or the most relevant one
            const item = this.findMostRelevantItem(currentUrl, this.items);
            // expand to that item
            if (item) {
                this.expandToGivenItem(item);
            }
        }
        // Expand / Collapse All items
        if (changes.expandAllItems) {
            this.items = this.setExpandedToAllItems(coerceBooleanProperty(changes.expandAllItems.currentValue), this.items);
        }
        if (changes.filterValue && this.hasFilter) {
            this.onFilter(changes.filterValue.currentValue ?? '');
        }
        // Refresh when interactive collapsed to initials
        if (changes.hasCollapsedInitials) {
            this.hasCollapsedInitials = changes.hasCollapsedInitials.currentValue;
            this.items = this.configureItems(this.items);
        }
        if (changes.hasScrollToItem) {
            this.hasScrollToItem = changes.hasScrollToItem.currentValue;
            if (this.hasScrollToItem) {
                this.scrollToItem(this.router.url);
            }
        }
        if (changes.hasFilter) {
            this.hasFilter = changes.hasFilter.currentValue;
            if (!this.hasFilter) {
                // iterate through all items and reset the filtered property
                this.items = this.filterMenuItems(this.items, '');
            }
        }
    }
    ngOnInit() {
        // Labels default values - TODO : translations
        if (!this.searchFilterLabel) {
            this.searchFilterLabel = 'Search filter';
        }
        // subscription to routes url changes for activating the scrollIntoView
        this.router.events.subscribe((event) => {
            // Handle route change event
            if (event instanceof NavigationEnd) {
                if (this.hasScrollToItem) {
                    this.scrollToItem(event.url);
                }
            }
        });
    }
    ngAfterViewInit() {
        // instantiates FocusKeyManager with the query list of items enabling wrapping
        this.focusKeyManager = new FocusKeyManager(this.menuItemsComponents).withWrap();
        // scrolls to the item that matches the current url
        if (this.hasScrollToItem) {
            this.scrollToItem(this.router.url);
        }
    }
    ngOnDestroy() {
        if (this.subscription) {
            this.subscription.unsubscribe();
        }
    }
    onClick(item) {
        if (!item.disabled) {
            if (item.urlExternal) {
                window.open(item.urlExternal, item.urlExternalTarget || '_blank');
            }
            else if (item.url) {
                this.router.navigate([item.url], { relativeTo: this.route, fragment: this.fragmentId, queryParams: item.queryParams });
            }
            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.isClick.emit(true);
        this.itemClick.emit(item);
        const focusedItem = this.findFocusableItem(item);
        this.focusKeyManager.updateActiveItem(focusedItem);
    }
    onExpandToggle(item) {
        if (item.children) {
            this.expandToggle.emit(item);
            this.onExpandToggled(item, this.items);
            // TODO: investigate why the above is needed. Can it be simply "item.expanded = !item.expanded;" ?
        }
    }
    onMenuFilterClick(event) {
        consumeEvent(event);
    }
    onFilter(eventOrValue) {
        const value = eventOrValue instanceof Event
            ? eventOrValue.target.value
            : eventOrValue;
        this.items = this.filterMenuItems(this.items, value);
        this.hasExpandIcon = !(this.isFilterEnabled());
    }
    /**
     * Check if the children of an item should be rendered. The children should be rendered if the item is expanded
     * or if the item is filtered and the filter input has a value. There are two cases when the filter input has a value:
     * 1. The user has typed something in the filter input
     * 2. The user has typed something in the filter input and the item is filtered
     * In general there are two states to be taken into account, the expanded state and the filtered state.
     *
     * @param item
     * @protected
     */
    shouldRenderChild(item) {
        return item?.children &&
            (item?.expanded || (this.hasFilter &&
                item?.filtered &&
                this.isFilterEnabled()));
    }
    /**
     * finds the EuiMenuItemComponent in the queried focusableItems[] that  matches the passed EuiMenuItem object
     *
     * @param menuItem an EuiMenuItem
     * @private
     */
    findFocusableItem(menuItem) {
        return this.menuItemsComponents.find((focusableItem) => focusableItem.item.label === menuItem?.label && focusableItem.item.id === menuItem.id);
    }
    /**
     * finds the first item that is filtered
     *
     * @param menuItems an array of EuiMenuItem
     * @private
     */
    findFirstFilteredItem(menuItems) {
        return menuItems.find((item) => item.filtered);
    }
    /**
     * finds all filtered menu items
     *
     * @param menuItems an array of EuiMenuItem
     * @private
     */
    findFilteredItems(menuItems) {
        return menuItems.filter((items) => items.filtered);
    }
    /**
     * checks the focus state of the action icon
     *
     * @private
     */
    checkActionIconFocusState() {
        // check if the action icon is focused and if not focus it, otherwise focus the active item
        // eslint-disable-next-line
        !this.focusKeyManager.activeItem.isActionIconFocused ? this.focusKeyManager.activeItem.focusActionIcon() : this.focusKeyManager.activeItem.focus();
    }
    /**
     * filter all menu items given a value
     *
     * @param menuItems an array of menu items
     * @param filterValue the value to filter menu items
     * @private
     */
    filterMenuItems(menuItems, filterValue) {
        return menuItems?.map((item) => {
            const found = item.label?.toLowerCase().indexOf(filterValue.toLowerCase()) !== -1;
            if (item.children) {
                item.children = this.filterMenuItems(item.children, filterValue);
                item.filtered = item.children.filter((l) => l['filtered'] === true).length > 0;
            }
            else if (found) {
                item.filtered = found;
            }
            else {
                item.filtered = false;
            }
            return item;
        }) || [];
    }
    /**
     * expand / collapse all items
     *
     * @param isExpanded
     * @param items
     * @private
     */
    setExpandedToAllItems(isExpanded, items) {
        return items?.map((item) => {
            if (item.children) {
                item.expanded = item.expanded ?? isExpanded;
                item.children = this.setExpandedToAllItems(isExpanded, item.children);
            }
            return Object.assign(item, { visible: item.visible === undefined ? true : item.visible });
        });
    }
    /**
     * expand / collapse a menu item
     *
     * @param item The item where the "expand" had been toggled
     * @param items The items list (used for recursion)
     * @private
     */
    onExpandToggled(item, items) {
        const itemIdx = items?.indexOf(item);
        if (itemIdx > -1) {
            items[itemIdx].expanded = !items[itemIdx].expanded;
        }
        else {
            items.forEach((i) => {
                if (i.children) {
                    this.onExpandToggled(item, i.children);
                }
            });
        }
    }
    /**
     * configure an array of items with visible, filtered and expand (in case of expandAllItems flag enabled) properties
     *
     * @param items An array of EuiMenuItem
     * @param parent the parent item of items if exists
     * @private
     */
    configureItems(items, parent) {
        return items?.map((item) => {
            // recursion in case there are children
            if (item.children) {
                item.children = this.configureItems(item.children, item);
                // expand all parents with children
                if (this.expandAllItems) {
                    item.expanded = true;
                }
            }
            // point to the parent
            if (parent) {
                item.parent = parent;
            }
            // make sure the items are configured with a unique id
            this.items = this.items?.map((item) => this.setRandomId(item));
            if (item.label && this.hasCollapsedInitials) {
                const words = item.label.split(' ');
                if (words.length === 1) {
                    item.initials = `${item.label.substring(0, 1)}${item.label.substring(1, 1)}`;
                }
                else {
                    item.initials = `${words[0].substring(0, 1)}${words[1].substring(0, 1)}`;
                }
            }
            return Object.assign(item, { visible: item.visible === undefined ? true : item.visible, filtered: true });
        });
    }
    /**
     * Given a URL and a list of items, it will expand the item that matches the URL. If not item matches exactly the url, then it will
     * match the item that is most relevant to that url.
     *
     * @param url
     * @param items
     * @param relevantItem
     * @private
     */
    findMostRelevantItem(url, items, relevantItem) {
        if (!items) {
            return null;
        }
        items.forEach((item) => {
            if (item.url && url.indexOf(item.url.substring(1)) > -1) {
                relevantItem = this.getMostRelevantItem(url, relevantItem, item);
            }
            if (item.children) {
                relevantItem = this.findMostRelevantItem(url, item.children, relevantItem);
            }
        });
        return relevantItem;
    }
    /**
     * Given two items with url return the one with the most relevant url that matches given url
     *
     * @param url A URL to be matched with the one of given items
     * @param item1
     * @param item2
     * @private
     */
    getMostRelevantItem(url, item1, item2) {
        const remainder1 = url.replace(item1?.url || '', '');
        const remainder2 = url.replace(item2?.url || '', '');
        return remainder1.length < remainder2.length ? item1 : item2;
    }
    /**
     * Given an item, if there's a parent expand it until you reach the root item
     *
     * @param item Given menu item
     * @private
     */
    expandToGivenItem(item) {
        if (item.parent) {
            setTimeout(() => (item.parent.expanded = true));
            this.expandToGivenItem(item.parent);
        }
    }
    /**
     * Set a random id to an item and its child if they don't have one
     * @param item
     * @private
     */
    setRandomId(item) {
        item.id = item.id || crypto.randomUUID();
        if (item.children) {
            item.children = item.children.map((child) => {
                return this.setRandomId(child);
            });
        }
        return item;
    }
    /**
     * Scroll to an item if it's not visible in the viewport
     * @param url
     * @private
     */
    scrollToItem(url) {
        const item = this.findMostRelevantItem(url, this.items);
        if (item) {
            // change the state of that item to expanded if it's not
            this.expandToGivenItem(item);
            setTimeout(_ => {
                const menuItem = this.menuItemsComponents?.find((menuItem) => menuItem.item.id === item.id);
                if (menuItem && !menuItem.elementIsVisibleInViewport()) {
                    menuItem.scrollIntoView({ behavior: 'smooth' });
                }
            }, 300);
        }
    }
    /**
     * Check if the filter input has a value
     * @private
     */
    isFilterEnabled() {
        return this.filterInput?.nativeElement?.value.length > 0;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EuiMenuComponent, isStandalone: true, selector: "eui-menu", inputs: { items: "items", searchFilterLabel: "searchFilterLabel", externalLinkLabel: "externalLinkLabel", fragmentId: "fragmentId", filterValue: "filterValue", isCollapsed: ["isCollapsed", "isCollapsed", booleanAttribute], hasCollapsedInitials: ["hasCollapsedInitials", "hasCollapsedInitials", booleanAttribute], hasFilter: ["hasFilter", "hasFilter", booleanAttribute], hasIcons: ["hasIcons", "hasIcons", booleanAttribute], hasIconsLabels: ["hasIconsLabels", "hasIconsLabels", booleanAttribute], hasTooltip: ["hasTooltip", "hasTooltip", booleanAttribute], hasTooltipOnExpanded: ["hasTooltipOnExpanded", "hasTooltipOnExpanded", booleanAttribute], expandAllItems: ["expandAllItems", "expandAllItems", booleanAttribute], isFlat: ["isFlat", "isFlat", booleanAttribute], hasScrollToItem: ["hasScrollToItem", "hasScrollToItem", booleanAttribute], hasBoldRootLevel: ["hasBoldRootLevel", "hasBoldRootLevel", booleanAttribute] }, outputs: { isClick: "isClick", itemClick: "itemClick", expandToggle: "expandToggle" }, host: { listeners: { "click": "stopPropagation($event)" }, properties: { "class": "this.cssClasses" } }, viewQueries: [{ propertyName: "filterInput", first: true, predicate: ["filterInput"], descendants: true, read: ElementRef }, { propertyName: "menubar", first: true, predicate: ["menubar"], descendants: true, read: ElementRef }, { propertyName: "menuItemsComponents", predicate: EuiMenuItemComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (hasFilter) {\n    <div class=\"eui-menu-filter\" [class.eui-menu-filter--collapsed]=\"isCollapsed\" (click)=\"onMenuFilterClick($event)\">\n        <eui-icon-input>\n            <eui-icon-svg icon=\"search:outline\" fillColor=\"neutral-lighter\" aria-label=\"Search Icon\"></eui-icon-svg>\n            <input\n                #filterInput\n                euiInputText\n                [euiClearable]=\"true\"\n                (input)=\"onFilter($event)\"\n                [placeholder]=\"searchFilterLabel\"\n                [attr.aria-label]=\"searchFilterLabel\"\n                [value]=\"filterValue\" />\n        </eui-icon-input>\n    </div>\n}\n\n<ul #menubar euiList class=\"eui-menu\" role=\"menubar\" aria-orientation=\"vertical\" tabindex=\"0\" (keydown)=\"onKeydown($event)\">\n    @if (items) {\n        @for (item of items; track item.id; let index = $index) {\n            <ng-template [ngTemplateOutlet]=\"menuItemTemplateRef\" [ngTemplateOutletContext]=\"{ menuItem: item, index: index }\"></ng-template>\n        }\n    } @else {\n        <span class=\"eui-menu--no-items\">No menu items defined</span>\n    }\n</ul>\n\n<!-- describe the recursive template of the menu item -->\n<ng-template #menuItemTemplateRef let-item=\"menuItem\" let-parent=\"parent\" let-i=\"index\">\n    <!-- render the menu item-->\n    @if (item.filtered) {\n    <eui-menu-item\n        [item]=\"item\"\n        [parent]=\"parent\"\n        [hasIcon]=\"hasIcons\"\n        [hasIconLabel]=\"hasIconsLabels\"\n        [hasTooltip]=\"hasTooltip\"\n        [hasTooltipOnExpanded]=\"hasTooltipOnExpanded\"\n        [isCollapsed]=\"isCollapsed\"\n        [hasBoldRootLevel]=\"hasBoldRootLevel\"\n        [hasCollapsedInitials]=\"hasCollapsedInitials\"\n        (expandToggle)=\"onExpandToggle($event)\"\n        (itemClick)=\"onClick($event)\"\n        [hasExpandIcon]=\"hasExpandIcon\">\n        <!-- if the menu item has children, render the children -->\n        @if (shouldRenderChild(item)) {\n            <ul euiList class=\"eui-menu eui-menu-sub\" role=\"menu\" [attr.aria-label]=\"item.label\" tabindex=\"-1\">\n                @for (child of item.children; track child.id; let childIndex = $index) {\n                    <ng-template [ngTemplateOutlet]=\"menuItemTemplateRef\" [ngTemplateOutletContext]=\"{ menuItem: child, index: childIndex, parent: item }\">\n                    </ng-template>\n                }\n            </ul>\n        }\n    </eui-menu-item>\n    }\n</ng-template>\n", styles: [".eui-19 .eui-menu{display:flex;flex-direction:column;gap:0;list-style:none;margin-block-start:0;margin-block-end:0;margin:0;padding:0;width:100%}.eui-19 .eui-menu:focus:not([readonly]){outline:2px solid var(--eui-c-focus)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu--collapsed .eui-menu-filter{transition:none;visibility:hidden}.eui-19 .eui-menu--collapsed .eui-menu-item__link{padding-left:var(--eui-s-m)}.eui-19 .eui-menu--collapsed .eui-menu-item__link-start-block{gap:0}.eui-19 .eui-menu--collapsed .eui-menu-item__link-content-block,.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block{visibility:hidden}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-action-icon{display:none}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-dotted-badge{position:absolute;top:var(--eui-s-2xs);right:var(--eui-s-2xs);visibility:visible}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-toggle{display:inherit;position:absolute;right:calc(-1.75 * var(--eui-s-xs));transform:scale(.75);visibility:visible}.eui-19 .eui-menu--collapsed .eui-menu-item__link-initials{display:flex;background-color:var(--eui-c-s-secondary-surface-light);border:var(--eui-bw-xs) solid var(--eui-c-divider);border-radius:var(--eui-s-xs);font:var(--eui-f-s-bold);justify-content:center;margin-left:calc(-1 * var(--eui-s-2xs));min-width:var(--eui-s-2xl)}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded:first-child{border-bottom:none;padding-bottom:0}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-l)}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-s)}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link{padding-left:0;min-height:var(--eui-s-2xl)}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link-icon{display:none}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link-content-icon-block{padding-top:0;padding-bottom:0}.eui-19 .eui-menu--no-items{color:var(--eui-c-text-lighter);text-align:center}.eui-19 .eui-menu-filter{display:flex;padding:var(--eui-s-m);position:relative;width:100%}.eui-19 .eui-menu-filter--collapsed{padding:0;height:0}.eui-19 .eui-menu-filter--collapsed .eui-icon-svg{display:none}.eui-19 .eui-menu-item{display:flex;position:relative;width:100%}.eui-19 .eui-menu-item:focus-visible>.eui-menu-item__content{outline:1px solid var(--eui-c-focus-visible);outline-offset:-1px}.eui-19 .eui-menu-item .eui-menu-item__content{align-items:center;display:flex;position:relative;width:100%;border:var(--eui-bw-xs) solid transparent}.eui-19 .eui-menu-item__link{align-items:center;color:var(--eui-c-text);cursor:pointer;display:flex;font:var(--eui-f-m);gap:var(--eui-s-xs);min-height:var(--eui-s-4xl);padding:0 var(--eui-s-xs) 0 var(--eui-s-m);margin-bottom:calc(-1 * var(--eui-s-2xs));border-top:1px solid var(--eui-c-divider-light);text-decoration:none;width:100%}.eui-19 .eui-menu-item__link-start-block{align-items:center;display:flex;gap:var(--eui-s-xs)}.eui-19 .eui-menu-item__link-start-block:empty{display:none}.eui-19 .eui-menu-item__link-content-block,.eui-19 .eui-menu-item__link-content-icon-block{display:flex;flex-direction:column;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container{align-items:center;display:flex;position:relative;width:100%}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container .eui-menu-item__link-label,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label{color:var(--eui-c-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container .eui-menu-item__link-label-category,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label-category{cursor:default;font:var(--eui-f-bold);opacity:var(--eui-o-75);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-icon-block{gap:var(--eui-s-2xs);padding:var(--eui-s-2xs);align-items:center}.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container{justify-content:center}.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label{font:var(--eui-f-2xs)!important}.eui-19 .eui-menu-item__link-end-block{align-items:center;display:flex;gap:var(--eui-s-xs)}.eui-19 .eui-menu-item__link:hover:not(.eui-menu-item--disabled):not(.eui-menu-item__link-category){background-color:var(--eui-c-active-bg);text-decoration:none}.eui-19 .eui-menu-item__link--disabled{opacity:var(--eui-o-50);pointer-events:none}.eui-19 .eui-menu-item__link--active:not(.eui-menu-item--disabled){background-color:var(--eui-c-active-bg);font:var(--eui-f-m-bold)}.eui-19 .eui-menu-item__link--active:not(.eui-menu-item--disabled) .eui-menu-item__link-label{color:var(--eui-c-link)}.eui-19 .eui-menu-item--expanded{display:flex;flex-direction:column}.eui-19 .eui-menu-item--expanded .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-3xl)}.eui-19 .eui-menu-item .eui-menu-sub .eui-menu-item__link{min-height:var(--eui-s-3xl);padding-left:var(--eui-s-xl);border-top:0}.eui-19 .eui-menu-item--bold>.eui-menu-item__content>.eui-menu-item__link{font:var(--eui-f-m-bold)}.eui-19 .eui-menu-item--icon-label .eui-menu-item__link{padding:0;gap:0}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: EuiMenuItemComponent, selector: "eui-menu-item", inputs: ["item", "parent", "hasExpandIcon", "hasIcon", "hasIconLabel", "hasTooltip", "hasTooltipOnExpanded", "isCollapsed", "hasCollapsedInitials", "hasBoldRootLevel"], outputs: ["expandToggle", "itemClick"] }, { kind: "component", type: i2.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }, { kind: "component", type: i2$1.EuiIconInputComponent, selector: "eui-icon-input", inputs: ["euiIconPositionStart", "euiIconPositionEnd"] }, { kind: "component", type: i3$1.EuiInputTextComponent, selector: "input[euiInputText]", inputs: ["isInvalid"] }], encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiMenuComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-menu', encapsulation: ViewEncapsulation.None, imports: [
                        NgTemplateOutlet,
                        EuiMenuItemComponent,
                        ...EUI_ICON,
                        ...EUI_ICON_INPUT,
                        ...EUI_INPUT_TEXT,
                    ], template: "@if (hasFilter) {\n    <div class=\"eui-menu-filter\" [class.eui-menu-filter--collapsed]=\"isCollapsed\" (click)=\"onMenuFilterClick($event)\">\n        <eui-icon-input>\n            <eui-icon-svg icon=\"search:outline\" fillColor=\"neutral-lighter\" aria-label=\"Search Icon\"></eui-icon-svg>\n            <input\n                #filterInput\n                euiInputText\n                [euiClearable]=\"true\"\n                (input)=\"onFilter($event)\"\n                [placeholder]=\"searchFilterLabel\"\n                [attr.aria-label]=\"searchFilterLabel\"\n                [value]=\"filterValue\" />\n        </eui-icon-input>\n    </div>\n}\n\n<ul #menubar euiList class=\"eui-menu\" role=\"menubar\" aria-orientation=\"vertical\" tabindex=\"0\" (keydown)=\"onKeydown($event)\">\n    @if (items) {\n        @for (item of items; track item.id; let index = $index) {\n            <ng-template [ngTemplateOutlet]=\"menuItemTemplateRef\" [ngTemplateOutletContext]=\"{ menuItem: item, index: index }\"></ng-template>\n        }\n    } @else {\n        <span class=\"eui-menu--no-items\">No menu items defined</span>\n    }\n</ul>\n\n<!-- describe the recursive template of the menu item -->\n<ng-template #menuItemTemplateRef let-item=\"menuItem\" let-parent=\"parent\" let-i=\"index\">\n    <!-- render the menu item-->\n    @if (item.filtered) {\n    <eui-menu-item\n        [item]=\"item\"\n        [parent]=\"parent\"\n        [hasIcon]=\"hasIcons\"\n        [hasIconLabel]=\"hasIconsLabels\"\n        [hasTooltip]=\"hasTooltip\"\n        [hasTooltipOnExpanded]=\"hasTooltipOnExpanded\"\n        [isCollapsed]=\"isCollapsed\"\n        [hasBoldRootLevel]=\"hasBoldRootLevel\"\n        [hasCollapsedInitials]=\"hasCollapsedInitials\"\n        (expandToggle)=\"onExpandToggle($event)\"\n        (itemClick)=\"onClick($event)\"\n        [hasExpandIcon]=\"hasExpandIcon\">\n        <!-- if the menu item has children, render the children -->\n        @if (shouldRenderChild(item)) {\n            <ul euiList class=\"eui-menu eui-menu-sub\" role=\"menu\" [attr.aria-label]=\"item.label\" tabindex=\"-1\">\n                @for (child of item.children; track child.id; let childIndex = $index) {\n                    <ng-template [ngTemplateOutlet]=\"menuItemTemplateRef\" [ngTemplateOutletContext]=\"{ menuItem: child, index: childIndex, parent: item }\">\n                    </ng-template>\n                }\n            </ul>\n        }\n    </eui-menu-item>\n    }\n</ng-template>\n", styles: [".eui-19 .eui-menu{display:flex;flex-direction:column;gap:0;list-style:none;margin-block-start:0;margin-block-end:0;margin:0;padding:0;width:100%}.eui-19 .eui-menu:focus:not([readonly]){outline:2px solid var(--eui-c-focus)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu:focus-visible:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu [tabindex=\"0\"]:focus:not([readonly]){outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important;transition:none}.eui-19 .eui-menu--collapsed .eui-menu-filter{transition:none;visibility:hidden}.eui-19 .eui-menu--collapsed .eui-menu-item__link{padding-left:var(--eui-s-m)}.eui-19 .eui-menu--collapsed .eui-menu-item__link-start-block{gap:0}.eui-19 .eui-menu--collapsed .eui-menu-item__link-content-block,.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block{visibility:hidden}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-action-icon{display:none}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-dotted-badge{position:absolute;top:var(--eui-s-2xs);right:var(--eui-s-2xs);visibility:visible}.eui-19 .eui-menu--collapsed .eui-menu-item__link-end-block .eui-menu-item__link-toggle{display:inherit;position:absolute;right:calc(-1.75 * var(--eui-s-xs));transform:scale(.75);visibility:visible}.eui-19 .eui-menu--collapsed .eui-menu-item__link-initials{display:flex;background-color:var(--eui-c-s-secondary-surface-light);border:var(--eui-bw-xs) solid var(--eui-c-divider);border-radius:var(--eui-s-xs);font:var(--eui-f-s-bold);justify-content:center;margin-left:calc(-1 * var(--eui-s-2xs));min-width:var(--eui-s-2xl)}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded:first-child{border-bottom:none;padding-bottom:0}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-l)}.eui-19 .eui-menu--collapsed .eui-menu-item--expanded .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-s)}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link{padding-left:0;min-height:var(--eui-s-2xl)}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link-icon{display:none}.eui-19 .eui-menu--collapsed .eui-menu-item--icon-label .eui-menu-sub .eui-menu-item__link-content-icon-block{padding-top:0;padding-bottom:0}.eui-19 .eui-menu--no-items{color:var(--eui-c-text-lighter);text-align:center}.eui-19 .eui-menu-filter{display:flex;padding:var(--eui-s-m);position:relative;width:100%}.eui-19 .eui-menu-filter--collapsed{padding:0;height:0}.eui-19 .eui-menu-filter--collapsed .eui-icon-svg{display:none}.eui-19 .eui-menu-item{display:flex;position:relative;width:100%}.eui-19 .eui-menu-item:focus-visible>.eui-menu-item__content{outline:1px solid var(--eui-c-focus-visible);outline-offset:-1px}.eui-19 .eui-menu-item .eui-menu-item__content{align-items:center;display:flex;position:relative;width:100%;border:var(--eui-bw-xs) solid transparent}.eui-19 .eui-menu-item__link{align-items:center;color:var(--eui-c-text);cursor:pointer;display:flex;font:var(--eui-f-m);gap:var(--eui-s-xs);min-height:var(--eui-s-4xl);padding:0 var(--eui-s-xs) 0 var(--eui-s-m);margin-bottom:calc(-1 * var(--eui-s-2xs));border-top:1px solid var(--eui-c-divider-light);text-decoration:none;width:100%}.eui-19 .eui-menu-item__link-start-block{align-items:center;display:flex;gap:var(--eui-s-xs)}.eui-19 .eui-menu-item__link-start-block:empty{display:none}.eui-19 .eui-menu-item__link-content-block,.eui-19 .eui-menu-item__link-content-icon-block{display:flex;flex-direction:column;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container{align-items:center;display:flex;position:relative;width:100%}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container .eui-menu-item__link-label,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label{color:var(--eui-c-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-block .eui-menu-item__link-label-container .eui-menu-item__link-label-category,.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label-category{cursor:default;font:var(--eui-f-bold);opacity:var(--eui-o-75);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.eui-19 .eui-menu-item__link-content-icon-block{gap:var(--eui-s-2xs);padding:var(--eui-s-2xs);align-items:center}.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container{justify-content:center}.eui-19 .eui-menu-item__link-content-icon-block .eui-menu-item__link-label-container .eui-menu-item__link-label{font:var(--eui-f-2xs)!important}.eui-19 .eui-menu-item__link-end-block{align-items:center;display:flex;gap:var(--eui-s-xs)}.eui-19 .eui-menu-item__link:hover:not(.eui-menu-item--disabled):not(.eui-menu-item__link-category){background-color:var(--eui-c-active-bg);text-decoration:none}.eui-19 .eui-menu-item__link--disabled{opacity:var(--eui-o-50);pointer-events:none}.eui-19 .eui-menu-item__link--active:not(.eui-menu-item--disabled){background-color:var(--eui-c-active-bg);font:var(--eui-f-m-bold)}.eui-19 .eui-menu-item__link--active:not(.eui-menu-item--disabled) .eui-menu-item__link-label{color:var(--eui-c-link)}.eui-19 .eui-menu-item--expanded{display:flex;flex-direction:column}.eui-19 .eui-menu-item--expanded .eui-menu-item--expanded .eui-menu-sub .eui-menu-item__link{padding-left:var(--eui-s-3xl)}.eui-19 .eui-menu-item .eui-menu-sub .eui-menu-item__link{min-height:var(--eui-s-3xl);padding-left:var(--eui-s-xl);border-top:0}.eui-19 .eui-menu-item--bold>.eui-menu-item__content>.eui-menu-item__link{font:var(--eui-f-m-bold)}.eui-19 .eui-menu-item--icon-label .eui-menu-item__link{padding:0;gap:0}\n"] }]
        }], propDecorators: { menuItemsComponents: [{
                type: ViewChildren,
                args: [EuiMenuItemComponent]
            }], filterInput: [{
                type: ViewChild,
                args: ['filterInput', { read: ElementRef }]
            }], menubar: [{
                type: ViewChild,
                args: ['menubar', { read: ElementRef }]
            }], cssClasses: [{
                type: HostBinding,
                args: ['class']
            }], items: [{
                type: Input
            }], searchFilterLabel: [{
                type: Input
            }], externalLinkLabel: [{
                type: Input
            }], fragmentId: [{
                type: Input
            }], filterValue: [{
                type: Input
            }], isCollapsed: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasCollapsedInitials: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasFilter: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasIcons: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasIconsLabels: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasTooltip: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasTooltipOnExpanded: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], expandAllItems: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isFlat: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasScrollToItem: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasBoldRootLevel: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isClick: [{
                type: Output
            }], itemClick: [{
                type: Output
            }], expandToggle: [{
                type: Output
            }], stopPropagation: [{
                type: HostListener,
                args: ['click', ['$event']]
            }] } });

/**
 * Angular module that provides list components for eui-menu
 *
 * @deprecated Use {@link EUI_MENU} instead
 */
class EuiMenuModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiMenuModule, imports: [EuiMenuComponent, EuiMenuItemComponent], exports: [EuiMenuComponent, EuiMenuItemComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiMenuModule, imports: [EuiMenuComponent, EuiMenuItemComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiMenuModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [EuiMenuComponent, EuiMenuItemComponent],
                    exports: [EuiMenuComponent, EuiMenuItemComponent],
                }]
        }] });

const EUI_MENU = [
    EuiMenuComponent,
    EuiMenuItemComponent,
];

/**
 * Generated bundle index. Do not edit.
 */

export { EUI_MENU, EuiMenuComponent, EuiMenuItemComponent, EuiMenuModule };
//# sourceMappingURL=eui-components-eui-menu.mjs.map
