import { NXClickEvent, NXComponent, AXComponent, NXEvent } from '@acorex/cdk/common';
import { AXDecoratorGenericComponent, AXDecoratorIconComponent } from '@acorex/components/decorators';
import { isBrowser } from '@acorex/core/platform';
import { AXTranslatorPipe } from '@acorex/core/translation';
import { AXHtmlUtil, AXUnsubscriber } from '@acorex/core/utils';
import { AXZIndexService } from '@acorex/core/z-index';
import { isPlatformBrowser, NgTemplateOutlet, AsyncPipe } from '@angular/common';
import * as i0 from '@angular/core';
import { inject, DestroyRef, DOCUMENT, PLATFORM_ID, Injectable, signal, computed, contentChildren, viewChild, input, Renderer2, Injector, output, afterNextRender, HostBinding, HostListener, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { Router, NavigationStart } from '@angular/router';
import { filter } from 'rxjs/operators';
import { cloneDeep } from 'lodash-es';
import { Subject } from 'rxjs';

class AXMenuService {
    constructor() {
        this.closeAll$ = new Subject();
        this.open$ = new Subject();
        this.close$ = new Subject();
        this.openContextMenu$ = new Subject();
        this.closeAllContextMenu$ = new Subject();
        this.destroyRef = inject(DestroyRef);
        this.document = inject(DOCUMENT);
        this.platformId = inject(PLATFORM_ID);
        this.openItems = new Set();
        this.globalListenersBound = false;
        this.scrollableParents = [];
        this.onDocumentClick = (event) => {
            if (this.rootElement && !this.rootElement.contains(event.target)) {
                this.closeAll$.next();
            }
        };
        this.onWindowOrScrollEvent = () => {
            this.closeAll$.next();
        };
        this.closeAll$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
            this.openItems.clear();
        });
    }
    /**
     * Registers a single set of document/window/scroll listeners for the whole menu tree.
     */
    initGlobalListeners(rootElement) {
        if (!isPlatformBrowser(this.platformId) || this.globalListenersBound) {
            return;
        }
        this.globalListenersBound = true;
        this.rootElement = rootElement;
        this.document.addEventListener('click', this.onDocumentClick);
        window.addEventListener('scroll', this.onWindowOrScrollEvent, { capture: true });
        window.addEventListener('resize', this.onWindowOrScrollEvent);
        this.scrollableParents = AXHtmlUtil.getScrollableParents(rootElement);
        this.scrollableParents.forEach((parent) => {
            parent.addEventListener('scroll', this.onWindowOrScrollEvent);
        });
        this.destroyRef.onDestroy(() => {
            this.document.removeEventListener('click', this.onDocumentClick);
            window.removeEventListener('scroll', this.onWindowOrScrollEvent, { capture: true });
            window.removeEventListener('resize', this.onWindowOrScrollEvent);
            this.scrollableParents.forEach((parent) => {
                parent.removeEventListener('scroll', this.onWindowOrScrollEvent);
            });
        });
    }
    /**
     * Closes open submenus that are not on the ancestor path of the item being opened.
     */
    closeExcept(opener) {
        const keepOpen = new Set();
        let current = opener;
        while (current) {
            keepOpen.add(current);
            current = current.getParentMenuItem?.() ?? current.parent ?? null;
        }
        for (const openItem of [...this.openItems]) {
            if (!keepOpen.has(openItem)) {
                this.markClosed(openItem);
            }
        }
    }
    markOpen(item) {
        this.openItems.add(item);
        this.open$.next(item);
    }
    markClosed(item) {
        this.openItems.delete(item);
        this.close$.next(item);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuService }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuService, decorators: [{
            type: Injectable
        }], ctorParameters: () => [] });

class AXRootMenu {
}
class AXMenuItemComponentBase {
}
class AXMenuItemClickBaseEvent extends NXClickEvent {
    constructor() {
        super(...arguments);
        this.canceled = false;
    }
}

/**
 * Represents a menu item component used within an `ax-menu`.
 * @category Components
 */
class AXMenuItemComponent extends NXComponent {
    constructor() {
        super();
        this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
        this.parent = inject(AXMenuItemComponent, { optional: true, skipSelf: true });
        this.isFirstLevel = computed(() => this.getParentMenuItem() == null, ...(ngDevMode ? [{ debugName: "isFirstLevel" }] : []));
        this.childMenuItems = contentChildren(AXMenuItemComponent, ...(ngDevMode ? [{ debugName: "childMenuItems", descendants: false }] : [{ descendants: false }]));
        this.discoveredSubmenuNodeCount = signal(0, ...(ngDevMode ? [{ debugName: "discoveredSubmenuNodeCount" }] : []));
        this.submenuSlot = viewChild('submenuSlot', ...(ngDevMode ? [{ debugName: "submenuSlot" }] : []));
        this.platformId = inject(PLATFORM_ID);
        this.destroyRef = inject(DestroyRef);
        this.childObserver = null;
        this.childRefreshScheduled = false;
        /**
         * Nested items from the data model. Required for recursive `ngTemplateOutlet` templates
         * because `contentChildren` does not traverse those embedded views.
         */
        this.subItems = input([], ...(ngDevMode ? [{ debugName: "subItems" }] : []));
        this.hasSubItems = computed(() => (this.subItems()?.length ?? 0) > 0 ||
            this.childMenuItems().length > 0 ||
            this.discoveredSubmenuNodeCount() > 0, ...(ngDevMode ? [{ debugName: "hasSubItems" }] : []));
        this.root = inject(AXRootMenu);
        this.service = inject(AXMenuService);
        this.unsuscriber = inject(AXUnsubscriber);
        this.renderer = inject(Renderer2);
        this.injector = inject(Injector);
        this.zIndexService = inject(AXZIndexService);
        this.zToken = null;
        this.arrowIcon = computed(() => {
            const isRtl = AXHtmlUtil.isRtl(this.nativeElement);
            return this.root.orientation() == 'horizontal' && this.isFirstLevel()
                ? 'ax-icon-chevron-down'
                : isRtl
                    ? 'ax-icon-chevron-left'
                    : 'ax-icon-chevron-right';
        }, ...(ngDevMode ? [{ debugName: "arrowIcon" }] : []));
        this.onClick = output();
        this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
        this.data = input(...(ngDevMode ? [undefined, { debugName: "data" }] : []));
        this.disabled = input(...(ngDevMode ? [undefined, { debugName: "disabled" }] : []));
        this.color = input(...(ngDevMode ? [undefined, { debugName: "color" }] : []));
        this.mouseLeaveTimeout = null;
        afterNextRender(() => {
            if (!isPlatformBrowser(this.platformId)) {
                return;
            }
            this.reparentOrphanedChildren();
            this.updateDiscoveredSubmenuNodeCount();
            this.childObserver = new MutationObserver((records) => {
                if (!this.hasRelevantChildMutation(records)) {
                    return;
                }
                this.scheduleChildRefresh();
            });
            this.childObserver.observe(this.nativeElement, { childList: true, subtree: true });
            this.destroyRef.onDestroy(() => this.childObserver?.disconnect());
        });
        this.service.closeAll$.pipe(this.unsuscriber.takeUntilDestroy).subscribe(() => this.close());
        this.service.open$.pipe(this.unsuscriber.takeUntilDestroy).subscribe((item) => {
            if (this === item) {
                this.isOpen.set(true);
                this.schedulePositionCalculation();
            }
        });
        this.service.close$.pipe(this.unsuscriber.takeUntilDestroy).subscribe((item) => {
            if (this == item) {
                this.isOpen.set(false);
            }
        });
    }
    getText() {
        return this.nativeElement.querySelector('ax-text')?.innerText;
    }
    /**
     * Resolves the parent menu item. Items rendered via recursive `ngTemplateOutlet` do not
     * receive a DI parent, so we fall back to the DOM tree after reparenting.
     */
    getParentMenuItem() {
        if (this.parent) {
            return this.parent;
        }
        const parentHost = this.nativeElement.parentElement?.closest('ax-menu-item');
        if (!parentHost || parentHost === this.nativeElement) {
            return null;
        }
        const ctx = parentHost.__axContext__;
        return ctx instanceof AXMenuItemComponent ? ctx : null;
    }
    /**
     * Opens the submenu of this menu item if it has sub-items and is not disabled.
     */
    open() {
        if (this.disabled() || !this.hasSubItems()) {
            return;
        }
        this.reparentOrphanedChildren();
        this.service.closeExcept(this);
        if (!this.zToken) {
            this.zToken = this.zIndexService.acquire();
        }
        this.service.markOpen(this);
    }
    /**
     * Closes the submenu of this menu item if open.
     */
    close() {
        this.service.markClosed(this);
        this.zIndexService.release(this.zToken);
        this.zToken = null;
    }
    /**
     * Positions the submenu after layout so nested levels measure their full height.
     */
    schedulePositionCalculation() {
        afterNextRender(() => {
            if (this.isOpen()) {
                this.calculatePosition();
                afterNextRender(() => {
                    if (this.isOpen()) {
                        this.calculatePosition();
                    }
                }, { injector: this.injector });
            }
        }, { injector: this.injector });
    }
    /**
     * Calculate the position of the submenu to avoid it going out of the viewport.
     */
    calculatePosition() {
        const submenu = this.submenuSlot()?.nativeElement;
        if (!submenu)
            return;
        const submenuRect = this.measureSubmenuRect(submenu);
        const itemRect = this.nativeElement.getBoundingClientRect();
        const windowWidth = window.innerWidth;
        const windowHeight = window.innerHeight;
        const isRtl = AXHtmlUtil.isRtl(this.nativeElement);
        let finalTop;
        let finalLeft;
        const preferredTop = this.isFirstLevel() && this.root.orientation() === 'horizontal'
            ? itemRect.bottom
            : itemRect.top;
        const alternateTop = itemRect.top - submenuRect.height;
        if (preferredTop + submenuRect.height <= windowHeight) {
            finalTop = preferredTop;
        }
        else if (alternateTop >= 0) {
            finalTop = alternateTop;
        }
        else {
            finalTop = windowHeight - submenuRect.height;
        }
        finalTop = this.clampVerticalPosition(finalTop, submenuRect.height, windowHeight);
        if (this.isFirstLevel() && this.root.orientation() === 'horizontal') {
            const preferredLeft = isRtl ? itemRect.right - submenuRect.width : itemRect.left;
            const alternateLeft = isRtl ? itemRect.left : itemRect.right - submenuRect.width;
            if (preferredLeft >= 0 && preferredLeft + submenuRect.width <= windowWidth) {
                finalLeft = preferredLeft;
            }
            else {
                finalLeft = Math.max(0, Math.min(alternateLeft, windowWidth - submenuRect.width));
            }
        }
        else {
            const preferredLeftRtl = itemRect.left - submenuRect.width;
            const alternateLeftRtl = itemRect.right;
            const preferredLeftLtr = itemRect.right;
            const alternateLeftLtr = itemRect.left - submenuRect.width;
            if (isRtl) {
                if (preferredLeftRtl >= 0) {
                    finalLeft = preferredLeftRtl;
                }
                else if (alternateLeftRtl + submenuRect.width <= windowWidth) {
                    finalLeft = alternateLeftRtl;
                }
                else {
                    finalLeft = 0;
                }
            }
            else {
                if (preferredLeftLtr + submenuRect.width <= windowWidth) {
                    finalLeft = preferredLeftLtr;
                }
                else if (alternateLeftLtr >= 0) {
                    finalLeft = alternateLeftLtr;
                }
                else {
                    finalLeft = windowWidth - submenuRect.width;
                }
            }
        }
        const isNestedMenu = !(this.isFirstLevel() && this.root.orientation() === 'horizontal');
        if (isNestedMenu) {
            const overlapsParent = finalLeft < itemRect.right && itemRect.left < finalLeft + submenuRect.width;
            if (overlapsParent) {
                const shiftedTop = itemRect.bottom;
                if (shiftedTop + submenuRect.height <= windowHeight) {
                    finalTop = shiftedTop;
                }
            }
        }
        finalTop = this.clampVerticalPosition(finalTop, submenuRect.height, windowHeight);
        this.renderer.setStyle(submenu, 'position', 'fixed');
        this.renderer.setStyle(submenu, 'top', `${finalTop}px`);
        this.renderer.setStyle(submenu, 'left', `${finalLeft}px`);
        if (this.zToken) {
            this.renderer.setStyle(submenu, 'z-index', String(this.zToken.zIndex));
        }
    }
    /** Measures submenu size using the same flex layout as the rendered menu. */
    measureSubmenuRect(submenu) {
        this.renderer.setStyle(submenu, 'visibility', 'hidden');
        this.renderer.setStyle(submenu, 'display', 'flex');
        const rect = submenu.getBoundingClientRect();
        this.renderer.removeStyle(submenu, 'visibility');
        this.renderer.removeStyle(submenu, 'display');
        return rect;
    }
    /**
     * Moves nested `ax-menu-item` nodes rendered by recursive `ngTemplateOutlet` templates
     * into the submenu slot. Angular content queries do not traverse those embedded views.
     */
    reparentOrphanedChildren() {
        const container = this.submenuSlot()?.nativeElement;
        if (!container) {
            return;
        }
        for (const el of this.getDirectSubmenuNodes()) {
            if (!container.contains(el)) {
                try {
                    container.appendChild(el);
                }
                catch {
                    // HierarchyRequestError when the node is already being moved.
                }
            }
        }
    }
    /**
     * Nested submenu nodes rendered by custom recursive templates (direct children of this item only).
     */
    getDirectSubmenuNodes() {
        return Array.from(this.nativeElement.querySelectorAll('ax-menu-item, ax-title, ax-divider')).filter((el) => {
            if (el === this.nativeElement) {
                return false;
            }
            if (el.tagName === 'AX-MENU-ITEM') {
                return el.parentElement?.closest('ax-menu-item') === this.nativeElement;
            }
            return el.closest('ax-menu-item') === this.nativeElement;
        });
    }
    updateDiscoveredSubmenuNodeCount() {
        this.discoveredSubmenuNodeCount.set(this.getDirectSubmenuNodes().length);
    }
    scheduleChildRefresh() {
        if (this.childRefreshScheduled) {
            return;
        }
        this.childRefreshScheduled = true;
        requestAnimationFrame(() => {
            this.childRefreshScheduled = false;
            this.reparentOrphanedChildren();
            this.updateDiscoveredSubmenuNodeCount();
        });
    }
    hasRelevantChildMutation(records) {
        for (const record of records) {
            if (this.nodeListContainsMenuStructuralNode(record.addedNodes) ||
                this.nodeListContainsMenuStructuralNode(record.removedNodes)) {
                return true;
            }
        }
        return false;
    }
    nodeListContainsMenuStructuralNode(nodes) {
        for (const node of Array.from(nodes)) {
            if (!(node instanceof Element)) {
                continue;
            }
            const tagName = node.tagName;
            if (tagName === 'AX-MENU-ITEM' || tagName === 'AX-TITLE' || tagName === 'AX-DIVIDER') {
                return true;
            }
            if (node.querySelector?.('ax-menu-item,ax-title,ax-divider')) {
                return true;
            }
        }
        return false;
    }
    /** Keeps the submenu fully inside the viewport vertically. */
    clampVerticalPosition(top, height, windowHeight) {
        if (top + height > windowHeight) {
            top = windowHeight - height;
        }
        if (top < 0) {
            top = 0;
        }
        return top;
    }
    handleClick(e) {
        e.stopPropagation();
        if (this.disabled())
            return;
        const event = {
            sender: this,
            nativeEvent: e,
            canceled: false,
            item: {
                name: this.name(),
                text: this.getText(),
                data: this.data(),
            },
        };
        this.onClick.emit(event);
        this.root.onItemClick.emit({ ...event, ...{ sender: this.root } });
        if (this.hasSubItems() && !event.canceled) {
            this.open();
        }
        else if (!event.canceled) {
            this.service.closeAll$.next();
            this.service.closeAllContextMenu$.next({ sender: this.root });
        }
    }
    handleMouseEnter(event) {
        event.stopPropagation();
        if (this.mouseLeaveTimeout) {
            clearTimeout(this.mouseLeaveTimeout);
            this.mouseLeaveTimeout = null;
        }
        if (!this.isFirstLevel() || this.root.openOn() == 'hover') {
            this.open();
        }
    }
    handleMouseLeave(event) {
        event.stopPropagation();
        if (!this.hasSubItems() || this.root.closeOn() !== 'leave') {
            return;
        }
        const relatedTarget = event.relatedTarget;
        if (relatedTarget instanceof Node && this.containsSubmenuPointer(relatedTarget)) {
            return;
        }
        if (this.mouseLeaveTimeout) {
            clearTimeout(this.mouseLeaveTimeout);
        }
        this.mouseLeaveTimeout = setTimeout(() => {
            this.close();
        }, 500);
    }
    /** True when the pointer moved into this item's submenu panel or a nested open submenu. */
    containsSubmenuPointer(node) {
        const submenu = this.submenuSlot()?.nativeElement;
        if (submenu?.contains(node)) {
            return true;
        }
        if (this.nativeElement.contains(node)) {
            return true;
        }
        return this.getDirectSubmenuNodes().some((child) => child.contains(node));
    }
    ngOnDestroy() {
        if (this.isOpen()) {
            this.close();
        }
    }
    /** @ignore */
    get __hostClass() {
        const list = ['ax-action-item'];
        if (this.disabled()) {
            list.push('ax-state-disabled');
        }
        list.push(`ax-${this.color() ?? 'default'}`);
        return list;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXMenuItemComponent, isStandalone: true, selector: "ax-menu-item", inputs: { subItems: { classPropertyName: "subItems", publicName: "subItems", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick" }, host: { listeners: { "click": "handleClick($event)", "mouseenter": "handleMouseEnter($event)", "mouseleave": "handleMouseLeave($event)" }, properties: { "class": "this.__hostClass" } }, providers: [
            {
                provide: AXMenuItemComponentBase,
                useExisting: AXMenuItemComponent,
            },
            AXUnsubscriber,
            {
                provide: AXComponent,
                useExisting: AXMenuItemComponent,
            },
        ], queries: [{ propertyName: "childMenuItems", predicate: AXMenuItemComponent, isSignal: true }], viewQueries: [{ propertyName: "submenuSlot", first: true, predicate: ["submenuSlot"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-action-item-prefix\">\n  <ng-content select=\"ax-prefix\"></ng-content>\n  <ng-content select=\"ax-text\"></ng-content>\n</div>\n<div class=\"ax-action-item-suffix\">\n  <ng-content select=\"ax-suffix\"></ng-content>\n  @if (hasSubItems() && (!isFirstLevel() || root.hasArrow())) {\n    <i class=\"ax-icon ax-icon-solid {{ arrowIcon() }} \"></i>\n  }\n</div>\n<div\n  #submenuSlot\n  class=\"ax-menu-items ax-action-list ax-action-list-vertical\"\n  [class.ax-state-open]=\"isOpen()\"\n>\n  <ng-content select=\"ax-menu-item,ax-title,ax-divider,ng-container,[ngTemplateOutlet]\"></ng-content>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-menu-item', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                        {
                            provide: AXMenuItemComponentBase,
                            useExisting: AXMenuItemComponent,
                        },
                        AXUnsubscriber,
                        {
                            provide: AXComponent,
                            useExisting: AXMenuItemComponent,
                        },
                    ], template: "<div class=\"ax-action-item-prefix\">\n  <ng-content select=\"ax-prefix\"></ng-content>\n  <ng-content select=\"ax-text\"></ng-content>\n</div>\n<div class=\"ax-action-item-suffix\">\n  <ng-content select=\"ax-suffix\"></ng-content>\n  @if (hasSubItems() && (!isFirstLevel() || root.hasArrow())) {\n    <i class=\"ax-icon ax-icon-solid {{ arrowIcon() }} \"></i>\n  }\n</div>\n<div\n  #submenuSlot\n  class=\"ax-menu-items ax-action-list ax-action-list-vertical\"\n  [class.ax-state-open]=\"isOpen()\"\n>\n  <ng-content select=\"ax-menu-item,ax-title,ax-divider,ng-container,[ngTemplateOutlet]\"></ng-content>\n</div>\n" }]
        }], ctorParameters: () => [], propDecorators: { handleClick: [{
                type: HostListener,
                args: ['click', ['$event']]
            }], handleMouseEnter: [{
                type: HostListener,
                args: ['mouseenter', ['$event']]
            }], handleMouseLeave: [{
                type: HostListener,
                args: ['mouseleave', ['$event']]
            }], __hostClass: [{
                type: HostBinding,
                args: ['class']
            }] } });

class AXContextMenuOpeningEvent extends NXEvent {
    constructor() {
        super(...arguments);
        this.canceled = false;
    }
}
/**
 * Represents a menu component that displays context menu.
 * @category Components
 */
class AXContextMenuComponent extends NXComponent {
    // Constructor (Dependency Injection)
    /** @ignore */
    constructor() {
        super();
        // Inputs and Outputs
        this.orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
        this.openOn = input('hover', ...(ngDevMode ? [{ debugName: "openOn" }] : []));
        this.closeOn = input('click', ...(ngDevMode ? [{ debugName: "closeOn" }] : []));
        /** When true, closes the menu on router navigation (e.g. side-menu route changes). */
        this.closeOnRouteChange = input(false, ...(ngDevMode ? [{ debugName: "closeOnRouteChange" }] : []));
        this.originalItems = input([], ...(ngDevMode ? [{ debugName: "originalItems", alias: 'items' }] : [{ alias: 'items' }]));
        this.target = input(...(ngDevMode ? [undefined, { debugName: "target" }] : []));
        this.onItemClick = output();
        this.onOpening = output();
        /** Emitted when the menu closes (backdrop, item click, scroll, another menu opening, etc.). */
        this.onClose = output();
        this.hasArrow = signal(true, ...(ngDevMode ? [{ debugName: "hasArrow" }] : []));
        // Injected Services
        this.service = inject(AXMenuService);
        this.renderer = inject(Renderer2);
        this.document = inject(DOCUMENT);
        this.platformID = inject(PLATFORM_ID);
        this.zIndexService = inject(AXZIndexService);
        this.injector = inject(Injector);
        this.zToken = null;
        this.lastOpenPoint = null;
        this.router = inject(Router, { optional: true });
        this.destroyRef = inject(DestroyRef);
        this.originalNextSibling = null;
        this.originalParent = null;
        this.items = signal([], ...(ngDevMode ? [{ debugName: "items" }] : []));
        //
        afterNextRender(() => {
            this.bindContextEvent();
            this.service.initGlobalListeners(this.nativeElement);
        });
        this.setupCloseOnRouteChange();
        this.service.closeAllContextMenu$.subscribe(() => {
            this.service.closeAll$.next();
            this.close();
        });
        this.service.openContextMenu$.subscribe((e) => {
            if (e.sender == this) {
                this.internalShowAt(e.point);
            }
        });
    }
    // Lifecycle Hooks
    ngOnDestroy() {
        if (isBrowser()) {
            this.removeContextEvent();
        }
    }
    /**
     * Refreshes the context menu by rebinding event listeners to target elements.
     */
    refresh() {
        this.bindContextEvent();
    }
    /**
     * Shows the context menu at a specific point.
     * @param point - The coordinates where the menu should appear
     * @param targetElement - Optional target element for the context menu
     * @param event - Optional opening event with menu items
     */
    showAt(point, targetElement, event) {
        const sender = this;
        this.service.closeAllContextMenu$.next({ sender });
        if (isPlatformBrowser(this.platformID)) {
            if (!targetElement) {
                targetElement = this.document.elementFromPoint(point.x, point.y);
            }
            if (!event) {
                event = {
                    sender: this,
                    canceled: false,
                    targetElement: targetElement,
                    items: cloneDeep(this.originalItems()),
                };
                if (event.canceled)
                    return;
            }
            this.onOpening.emit(event);
            this.items.set(event.items);
        }
        this.service.openContextMenu$.next({ sender, point });
    }
    /**
     * Closes the context menu and removes the backdrop.
     */
    close() {
        const wasOpen = this.nativeElement.classList.contains('ax-state-open');
        this.nativeElement.classList.remove('ax-state-open');
        this.lastOpenPoint = null;
        // Drop rendered items before moving DOM nodes back to the original parent.
        // This prevents a large menu tree from being re-parented/removed as a single heavy DOM operation.
        if (wasOpen) {
            this.items.set([]);
        }
        this.removeBackdrop();
        // Release z-index token
        this.zIndexService.release(this.zToken);
        this.zToken = null;
        if (wasOpen) {
            this.onClose.emit();
        }
    }
    // Private Methods (Internal Logic)
    /** @ignore */
    setupCloseOnRouteChange() {
        if (!this.router || !isPlatformBrowser(this.platformID)) {
            return;
        }
        this.router.events
            .pipe(filter((event) => event instanceof NavigationStart), takeUntilDestroyed(this.destroyRef))
            .subscribe(() => {
            if (this.closeOnRouteChange()) {
                this.close();
            }
        });
    }
    /** @ignore */
    getTargetElements() {
        if (isPlatformBrowser(this.platformID)) {
            const elements = typeof this.target() == 'string'
                ? Array.from(this.document.querySelectorAll(this.target()))
                : Array.isArray(this.target())
                    ? this.target()
                    : [this.target()];
            return elements;
        }
        return null;
    }
    /** @ignore */
    bindContextEvent() {
        this.getTargetElements().forEach((e) => {
            e?.addEventListener('contextmenu', this.handleContextMenu.bind(this));
        });
    }
    /** @ignore */
    removeContextEvent() {
        this.getTargetElements().forEach((e) => {
            e?.removeEventListener('contextmenu', this.handleContextMenu.bind(this));
        });
    }
    /** @ignore */
    handleContextMenu(e) {
        e.preventDefault();
        e.stopPropagation();
        //
        if (isPlatformBrowser(this.platformID)) {
            const elementsUnderMouse = this.document.elementsFromPoint(e.x, e.y);
            const targetElements = this.getTargetElements();
            const targetElement = elementsUnderMouse.find((target) => targetElements.includes(target));
            //
            const event = {
                sender: this,
                canceled: false,
                targetElement: targetElement,
                items: cloneDeep(this.originalItems()),
            };
            //
            if (!event.canceled) {
                this.showAt({ x: e.clientX, y: e.clientY }, targetElement, event);
            }
        }
    }
    /** @ignore */
    internalShowAt(point) {
        this.lastOpenPoint = point;
        const elementRef = this.nativeElement;
        elementRef.classList.add('ax-state-open');
        this.positionAtPoint(point);
        this.createBackdrop();
        // Items may render after the signal update (e.g. compact side-menu); reposition once laid out.
        afterNextRender(() => {
            if (this.lastOpenPoint && elementRef.classList.contains('ax-state-open')) {
                this.positionAtPoint(this.lastOpenPoint);
            }
        }, { injector: this.injector });
    }
    /**
     * Positions the menu at `point`, flipping when it would overflow the viewport.
     * Uses a temporary visible layout pass so parents that hide the host (e.g. side-menu `display: none`) do not yield a zero-sized rect.
     */
    positionAtPoint(point) {
        const elementRef = this.nativeElement;
        const itemRect = this.measureMenuRect(elementRef);
        const windowWidth = window.innerWidth;
        const windowHeight = window.innerHeight;
        const isRtl = AXHtmlUtil.isRtl(elementRef);
        let left;
        if (isRtl) {
            left = point.x - itemRect.width;
            if (left < 0) {
                left = point.x;
            }
        }
        else {
            left = point.x;
            if (left + itemRect.width > windowWidth) {
                left = point.x - itemRect.width;
            }
        }
        const bottom = point.y + itemRect.height;
        let top;
        if (bottom > windowHeight) {
            top = point.y - itemRect.height;
            if (top < 0) {
                top = 0;
            }
        }
        else {
            top = point.y;
        }
        this.renderer.setStyle(elementRef, 'left', `${left}px`);
        this.renderer.setStyle(elementRef, 'top', `${top}px`);
        this.renderer.setStyle(elementRef, 'position', 'fixed');
    }
    /** Measures menu size even when an ancestor hides the host with `display: none`. */
    measureMenuRect(elementRef) {
        this.renderer.setStyle(elementRef, 'visibility', 'hidden');
        this.renderer.setStyle(elementRef, 'display', 'flex');
        const rect = elementRef.getBoundingClientRect();
        this.renderer.removeStyle(elementRef, 'visibility');
        this.renderer.removeStyle(elementRef, 'display');
        return rect;
    }
    /** @ignore */
    createBackdrop() {
        if (!this.originalParent) {
            this.originalParent = this.nativeElement.parentElement;
            this.originalNextSibling = this.nativeElement.nextSibling;
        }
        // Acquire z-index token
        this.zToken = this.zIndexService.acquire();
        this.backdropElement = this.renderer.createElement('div');
        this.renderer.setStyle(this.backdropElement, 'position', 'fixed');
        this.renderer.setStyle(this.backdropElement, 'top', '0');
        this.renderer.setStyle(this.backdropElement, 'left', '0');
        this.renderer.setStyle(this.backdropElement, 'width', '100%');
        this.renderer.setStyle(this.backdropElement, 'height', '100%');
        this.renderer.setStyle(this.backdropElement, 'z-index', String(this.zToken.zIndex));
        this.renderer.setStyle(this.backdropElement, 'background', 'transparent');
        this.createEventListeners(this.backdropElement);
        this.document.body.appendChild(this.backdropElement);
        this.backdropElement.appendChild(this.nativeElement);
    }
    /** @ignore */
    removeBackdrop() {
        if (this.backdropElement) {
            if (this.originalParent) {
                this.renderer.insertBefore(this.originalParent, this.nativeElement, this.originalNextSibling);
            }
            if (this.backdropElement.parentNode) {
                this.renderer.removeChild(this.backdropElement.parentNode, this.backdropElement);
            }
            this.backdropElement = null;
        }
    }
    createEventListeners(el) {
        const l1 = this.renderer.listen(el, 'click', () => {
            this.close();
            l1();
        });
        const l2 = this.renderer.listen(el, 'wheel', () => {
            this.close();
            l2();
        });
        const l3 = this.renderer.listen(el, 'contextmenu', (e) => {
            e.preventDefault();
            e.stopPropagation();
            const x = e.clientX;
            const y = e.clientY;
            // Close first so the full-screen backdrop is gone; otherwise the next target never
            // receives contextmenu (conversation list / message list / etc.).
            this.close();
            if (isPlatformBrowser(this.platformID)) {
                requestAnimationFrame(() => {
                    const under = this.document.elementFromPoint(x, y);
                    if (!under || under === this.document.body || under === this.document.documentElement) {
                        return;
                    }
                    const forward = new MouseEvent('contextmenu', {
                        bubbles: true,
                        cancelable: true,
                        view: this.document.defaultView ?? undefined,
                        clientX: x,
                        clientY: y,
                        screenX: e.screenX,
                        screenY: e.screenY,
                        button: 2,
                        buttons: 2,
                    });
                    under.dispatchEvent(forward);
                });
            }
            l3();
        });
    }
    // Host Listeners (UI Interaction Handling)
    /** @ignore */
    onWindowEvent() {
        const sender = this;
        this.service.closeAllContextMenu$.next({ sender: sender }); // Close all menus on scroll or resize
    }
    /** @ignore */
    get __hostClass() {
        return ['ax-menu-container', `ax-orientation-${this.orientation()}`, 'ax-action-list', 'ax-action-list-vertical'];
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXContextMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXContextMenuComponent, isStandalone: true, selector: "ax-context-menu", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, openOn: { classPropertyName: "openOn", publicName: "openOn", isSignal: true, isRequired: false, transformFunction: null }, closeOn: { classPropertyName: "closeOn", publicName: "closeOn", isSignal: true, isRequired: false, transformFunction: null }, closeOnRouteChange: { classPropertyName: "closeOnRouteChange", publicName: "closeOnRouteChange", isSignal: true, isRequired: false, transformFunction: null }, originalItems: { classPropertyName: "originalItems", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onItemClick: "onItemClick", onOpening: "onOpening", onClose: "onClose" }, host: { listeners: { "window:scroll": "onWindowEvent($event)", "window:resize": "onWindowEvent($event)" }, properties: { "class": "this.__hostClass" } }, providers: [
            AXMenuService,
            {
                provide: AXRootMenu,
                useExisting: AXContextMenuComponent,
            },
            {
                provide: AXComponent,
                useExisting: AXContextMenuComponent,
            },
        ], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n  <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n  @if (item.group?.title) {\n    <ax-title>{{ item.group?.title }}</ax-title>\n  }\n  <ax-menu-item\n    [name]=\"item.name\"\n    [data]=\"item.data\"\n    [disabled]=\"item.disabled\"\n    [color]=\"item.color\"\n    [subItems]=\"item.items ?? []\"\n  >\n    @if (item.icon) {\n      <ax-prefix>\n        <ax-icon [icon]=\"item.icon\"> </ax-icon>\n      </ax-prefix>\n    }\n    @if (item.text) {\n      <ax-text>{{ item.text | translate | async }}</ax-text>\n    }\n    @if (item.suffix) {\n      <ax-suffix>\n        <ax-text>{{ item.suffix.text | translate | async }}</ax-text>\n      </ax-suffix>\n    }\n    @for (child of item.items; track child) {\n      <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n    }\n  </ax-menu-item>\n  @if (item.break) {\n    <ax-divider></ax-divider>\n  }\n</ng-template>\n", styles: ["ax-context-menu,ax-menu{--ax-comp-menu-items-min-width: 12rem;--ax-comp-menu-action-list-hover-decorator-opacity: .7;--ax-comp-menu-action-list-horizontal-min-width: 12rem;--ax-comp-menu-action-list-horizontal-gap: 1.25rem;--ax-comp-menu-action-list-vertical-min-width: 12rem}ax-context-menu ax-menu-item.ax-primary,ax-menu ax-menu-item.ax-primary{--ax-comp-menu-item-text-color: var(--ax-sys-color-primary-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-primary-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-primary-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-primary-surface)}ax-context-menu ax-menu-item.ax-secondary,ax-menu ax-menu-item.ax-secondary{--ax-comp-menu-item-text-color: var(--ax-sys-color-secondary-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-secondary-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-secondary-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-secondary-surface)}ax-context-menu ax-menu-item.ax-success,ax-menu ax-menu-item.ax-success{--ax-comp-menu-item-text-color: var(--ax-sys-color-success-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-success-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-success-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-success-surface)}ax-context-menu ax-menu-item.ax-warning,ax-menu ax-menu-item.ax-warning{--ax-comp-menu-item-text-color: var(--ax-sys-color-warning-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-warning-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-warning-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-warning-surface)}ax-context-menu ax-menu-item.ax-danger,ax-menu ax-menu-item.ax-danger{--ax-comp-menu-item-text-color: var(--ax-sys-color-danger-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-danger-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-danger-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-danger-surface)}ax-context-menu ax-menu-item.ax-accent1,ax-menu ax-menu-item.ax-accent1{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent1-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent1-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent1-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent1-surface)}ax-context-menu ax-menu-item.ax-accent2,ax-menu ax-menu-item.ax-accent2{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent2-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent2-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent2-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent2-surface)}ax-context-menu ax-menu-item.ax-accent3,ax-menu ax-menu-item.ax-accent3{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent3-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent3-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent3-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent3-surface)}ax-context-menu ax-menu-item.ax-accent4,ax-menu ax-menu-item.ax-accent4{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent4-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent4-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent4-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent4-surface)}ax-context-menu ax-menu-item.ax-accent5,ax-menu ax-menu-item.ax-accent5{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent5-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent5-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent5-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent5-surface)}ax-context-menu ax-menu-item.ax-accent6,ax-menu ax-menu-item.ax-accent6{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent6-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent6-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent6-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent6-surface)}ax-context-menu ax-menu-item.ax-accent7,ax-menu ax-menu-item.ax-accent7{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent7-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent7-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent7-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent7-surface)}ax-context-menu,ax-menu{width:100%;color:inherit;display:flex;width:max-content}ax-context-menu.ax-menu-container,ax-context-menu .ax-menu-items,ax-menu.ax-menu-container,ax-menu .ax-menu-items{--ax-comp-action-item-padding-inline: .875rem;opacity:0;display:flex;position:fixed;visibility:hidden;width:max-content;height:max-content;flex-direction:column;min-width:var(--ax-comp-menu-items-min-width);color:rgba(var(--ax-comp-menu-items-text-color, var(--ax-sys-color-on-lightest-surface)));background-color:rgba(var(--ax-comp-menu-sub-item-bg-color, var(--ax-sys-color-lightest-surface)));padding-block:var(--ax-comp-menu-items-padding-block, .5rem);border-width:var(--ax-comp-menu-items-border-width, 1px);border-radius:var(--ax-comp-menu-items-border-radius, var(--ax-sys-border-radius));border-color:rgba(var(--ax-comp-menu-items-border-color, var(--ax-sys-color-border-lightest-surface)));--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);transition-property:opacity,color;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-context-menu.ax-menu-container.ax-state-open,ax-context-menu .ax-menu-items.ax-state-open,ax-menu.ax-menu-container.ax-state-open,ax-menu .ax-menu-items.ax-state-open{opacity:1;visibility:visible}ax-context-menu.ax-menu-container ax-menu-item,ax-context-menu .ax-menu-items ax-menu-item,ax-menu.ax-menu-container ax-menu-item,ax-menu .ax-menu-items ax-menu-item{color:rgba(var(--ax-comp-menu-item-text-color, var(--ax-sys-color-on-surface)))}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{color:rgba(var(--ax-comp-menu-item-suffix-text-color))}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled),ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled){color:rgba(var(--ax-comp-menu-item-hover-text-color, var(--ax-sys-color-on-surface)));background-color:rgba(var(--ax-comp-menu-item-hover-bg-color, var(--ax-sys-color-surface)))!important}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text{color:rgba(var(--ax-comp-menu-item-hover-suffix-text-color))}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{font-weight:400!important}ax-context-menu.ax-action-list-horizontal{padding-inline:var(--ax-comp-menu-action-list-horizontal-padding-inline, 1rem)}ax-menu>ax-menu-item{--ax-comp-action-item-padding-inline: 0}ax-menu>ax-menu-item:has(>.ax-action-item-suffix:not(:empty)){gap:.5rem}ax-menu.ax-action-list-horizontal{min-width:var(--ax-comp-menu-action-list-horizontal-min-width);gap:var(--ax-comp-menu-action-list-horizontal-gap)}ax-menu.ax-action-list-horizontal>ax-title{display:none}ax-menu.ax-action-list-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-prefix{padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:not(ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:empty){padding-inline-end:0!important;margin-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-suffix{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}ax-menu.ax-action-list-vertical{width:max-content;min-width:var(--ax-comp-menu-action-list-vertical-min-width)}ax-menu.ax-action-list-vertical>ax-menu-item{font-weight:500}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-suffix{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}ax-menu>ax-menu-item{padding-block:var(--ax-comp-menu-items-padding-block, .5rem)}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled){border-radius:var(--ax-comp-menu-items-border-radius, var(--ax-sys-border-radius))}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-text{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXMenuItemComponent, selector: "ax-menu-item", inputs: ["subItems", "name", "data", "disabled", "color"], outputs: ["onClick"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXContextMenuComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-context-menu', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
                        AXMenuService,
                        {
                            provide: AXRootMenu,
                            useExisting: AXContextMenuComponent,
                        },
                        {
                            provide: AXComponent,
                            useExisting: AXContextMenuComponent,
                        },
                    ], imports: [
                        NgTemplateOutlet,
                        AXDecoratorGenericComponent,
                        AXMenuItemComponent,
                        AXDecoratorIconComponent,
                        AsyncPipe,
                        AXTranslatorPipe,
                    ], template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n  <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n  @if (item.group?.title) {\n    <ax-title>{{ item.group?.title }}</ax-title>\n  }\n  <ax-menu-item\n    [name]=\"item.name\"\n    [data]=\"item.data\"\n    [disabled]=\"item.disabled\"\n    [color]=\"item.color\"\n    [subItems]=\"item.items ?? []\"\n  >\n    @if (item.icon) {\n      <ax-prefix>\n        <ax-icon [icon]=\"item.icon\"> </ax-icon>\n      </ax-prefix>\n    }\n    @if (item.text) {\n      <ax-text>{{ item.text | translate | async }}</ax-text>\n    }\n    @if (item.suffix) {\n      <ax-suffix>\n        <ax-text>{{ item.suffix.text | translate | async }}</ax-text>\n      </ax-suffix>\n    }\n    @for (child of item.items; track child) {\n      <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n    }\n  </ax-menu-item>\n  @if (item.break) {\n    <ax-divider></ax-divider>\n  }\n</ng-template>\n", styles: ["ax-context-menu,ax-menu{--ax-comp-menu-items-min-width: 12rem;--ax-comp-menu-action-list-hover-decorator-opacity: .7;--ax-comp-menu-action-list-horizontal-min-width: 12rem;--ax-comp-menu-action-list-horizontal-gap: 1.25rem;--ax-comp-menu-action-list-vertical-min-width: 12rem}ax-context-menu ax-menu-item.ax-primary,ax-menu ax-menu-item.ax-primary{--ax-comp-menu-item-text-color: var(--ax-sys-color-primary-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-primary-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-primary-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-primary-surface)}ax-context-menu ax-menu-item.ax-secondary,ax-menu ax-menu-item.ax-secondary{--ax-comp-menu-item-text-color: var(--ax-sys-color-secondary-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-secondary-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-secondary-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-secondary-surface)}ax-context-menu ax-menu-item.ax-success,ax-menu ax-menu-item.ax-success{--ax-comp-menu-item-text-color: var(--ax-sys-color-success-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-success-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-success-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-success-surface)}ax-context-menu ax-menu-item.ax-warning,ax-menu ax-menu-item.ax-warning{--ax-comp-menu-item-text-color: var(--ax-sys-color-warning-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-warning-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-warning-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-warning-surface)}ax-context-menu ax-menu-item.ax-danger,ax-menu ax-menu-item.ax-danger{--ax-comp-menu-item-text-color: var(--ax-sys-color-danger-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-danger-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-danger-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-danger-surface)}ax-context-menu ax-menu-item.ax-accent1,ax-menu ax-menu-item.ax-accent1{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent1-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent1-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent1-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent1-surface)}ax-context-menu ax-menu-item.ax-accent2,ax-menu ax-menu-item.ax-accent2{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent2-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent2-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent2-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent2-surface)}ax-context-menu ax-menu-item.ax-accent3,ax-menu ax-menu-item.ax-accent3{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent3-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent3-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent3-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent3-surface)}ax-context-menu ax-menu-item.ax-accent4,ax-menu ax-menu-item.ax-accent4{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent4-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent4-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent4-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent4-surface)}ax-context-menu ax-menu-item.ax-accent5,ax-menu ax-menu-item.ax-accent5{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent5-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent5-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent5-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent5-surface)}ax-context-menu ax-menu-item.ax-accent6,ax-menu ax-menu-item.ax-accent6{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent6-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent6-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent6-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent6-surface)}ax-context-menu ax-menu-item.ax-accent7,ax-menu ax-menu-item.ax-accent7{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent7-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent7-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent7-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent7-surface)}ax-context-menu,ax-menu{width:100%;color:inherit;display:flex;width:max-content}ax-context-menu.ax-menu-container,ax-context-menu .ax-menu-items,ax-menu.ax-menu-container,ax-menu .ax-menu-items{--ax-comp-action-item-padding-inline: .875rem;opacity:0;display:flex;position:fixed;visibility:hidden;width:max-content;height:max-content;flex-direction:column;min-width:var(--ax-comp-menu-items-min-width);color:rgba(var(--ax-comp-menu-items-text-color, var(--ax-sys-color-on-lightest-surface)));background-color:rgba(var(--ax-comp-menu-sub-item-bg-color, var(--ax-sys-color-lightest-surface)));padding-block:var(--ax-comp-menu-items-padding-block, .5rem);border-width:var(--ax-comp-menu-items-border-width, 1px);border-radius:var(--ax-comp-menu-items-border-radius, var(--ax-sys-border-radius));border-color:rgba(var(--ax-comp-menu-items-border-color, var(--ax-sys-color-border-lightest-surface)));--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);transition-property:opacity,color;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-context-menu.ax-menu-container.ax-state-open,ax-context-menu .ax-menu-items.ax-state-open,ax-menu.ax-menu-container.ax-state-open,ax-menu .ax-menu-items.ax-state-open{opacity:1;visibility:visible}ax-context-menu.ax-menu-container ax-menu-item,ax-context-menu .ax-menu-items ax-menu-item,ax-menu.ax-menu-container ax-menu-item,ax-menu .ax-menu-items ax-menu-item{color:rgba(var(--ax-comp-menu-item-text-color, var(--ax-sys-color-on-surface)))}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{color:rgba(var(--ax-comp-menu-item-suffix-text-color))}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled),ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled){color:rgba(var(--ax-comp-menu-item-hover-text-color, var(--ax-sys-color-on-surface)));background-color:rgba(var(--ax-comp-menu-item-hover-bg-color, var(--ax-sys-color-surface)))!important}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text{color:rgba(var(--ax-comp-menu-item-hover-suffix-text-color))}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{font-weight:400!important}ax-context-menu.ax-action-list-horizontal{padding-inline:var(--ax-comp-menu-action-list-horizontal-padding-inline, 1rem)}ax-menu>ax-menu-item{--ax-comp-action-item-padding-inline: 0}ax-menu>ax-menu-item:has(>.ax-action-item-suffix:not(:empty)){gap:.5rem}ax-menu.ax-action-list-horizontal{min-width:var(--ax-comp-menu-action-list-horizontal-min-width);gap:var(--ax-comp-menu-action-list-horizontal-gap)}ax-menu.ax-action-list-horizontal>ax-title{display:none}ax-menu.ax-action-list-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-prefix{padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:not(ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:empty){padding-inline-end:0!important;margin-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-suffix{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}ax-menu.ax-action-list-vertical{width:max-content;min-width:var(--ax-comp-menu-action-list-vertical-min-width)}ax-menu.ax-action-list-vertical>ax-menu-item{font-weight:500}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-suffix{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}ax-menu>ax-menu-item{padding-block:var(--ax-comp-menu-items-padding-block, .5rem)}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled){border-radius:var(--ax-comp-menu-items-border-radius, var(--ax-sys-border-radius))}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-text{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}\n"] }]
        }], ctorParameters: () => [], propDecorators: { onWindowEvent: [{
                type: HostListener,
                args: ['window:scroll', ['$event']]
            }, {
                type: HostListener,
                args: ['window:resize', ['$event']]
            }], __hostClass: [{
                type: HostBinding,
                args: ['class']
            }] } });

/**
 * Represents a menu component that displays menu items.
 * @category Components
 */
class AXMenuComponent extends NXComponent {
    constructor() {
        super();
        this.orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
        this.openOn = input('hover', ...(ngDevMode ? [{ debugName: "openOn" }] : []));
        this.closeOn = input('leave', ...(ngDevMode ? [{ debugName: "closeOn" }] : []));
        this.service = inject(AXMenuService);
        this.onItemClick = output();
        this.items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
        this.hasArrow = input(true, ...(ngDevMode ? [{ debugName: "hasArrow" }] : []));
        afterNextRender(() => {
            this.service.initGlobalListeners(this.nativeElement);
        });
    }
    /** @ignore */
    get __hostClass() {
        return [
            'ax-root-menu',
            'ax-action-list',
            `ax-action-list-${this.orientation()}`,
            `${!this.hasArrow() ? 'ax-hide-arrow' : ''}`,
        ];
    }
    /**
     * Closes all open menus and submenus for this root menu.
     *
     * @returns void - No return value. All open menu overlays are closed and hidden.
     */
    close() {
        this.service.closeAll$.next();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.3", type: AXMenuComponent, isStandalone: true, selector: "ax-menu", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, openOn: { classPropertyName: "openOn", publicName: "openOn", isSignal: true, isRequired: false, transformFunction: null }, closeOn: { classPropertyName: "closeOn", publicName: "closeOn", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, hasArrow: { classPropertyName: "hasArrow", publicName: "hasArrow", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onItemClick: "onItemClick" }, host: { properties: { "class": "this.__hostClass" } }, providers: [
            AXMenuService,
            {
                provide: AXRootMenu,
                useExisting: AXMenuComponent,
            },
            {
                provide: AXComponent,
                useExisting: AXMenuComponent,
            },
        ], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n  <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n  @if (item.group?.title) {\n    <ax-title>{{ item.group?.title }}</ax-title>\n  }\n  <ax-menu-item\n    [name]=\"item.name\"\n    [data]=\"item.data\"\n    [disabled]=\"item.disabled\"\n    [color]=\"item.color\"\n    [subItems]=\"item.items ?? []\"\n  >\n    @if (item.icon) {\n      <ax-prefix>\n        <ax-icon [icon]=\"item.icon\"> </ax-icon>\n      </ax-prefix>\n    }\n    @if (item.text) {\n      <ax-text>{{ item.text | translate | async }}</ax-text>\n    }\n    @if (item.suffix) {\n      <ax-suffix>\n        <ax-text>{{ item.suffix.text | translate | async }}</ax-text>\n      </ax-suffix>\n    }\n    @for (child of item.items; track child) {\n      <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n    }\n  </ax-menu-item>\n  @if (item.break) {\n    <ax-divider></ax-divider>\n  }\n</ng-template>\n", styles: ["ax-context-menu,ax-menu{--ax-comp-menu-items-min-width: 12rem;--ax-comp-menu-action-list-hover-decorator-opacity: .7;--ax-comp-menu-action-list-horizontal-min-width: 12rem;--ax-comp-menu-action-list-horizontal-gap: 1.25rem;--ax-comp-menu-action-list-vertical-min-width: 12rem}ax-context-menu ax-menu-item.ax-primary,ax-menu ax-menu-item.ax-primary{--ax-comp-menu-item-text-color: var(--ax-sys-color-primary-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-primary-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-primary-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-primary-surface)}ax-context-menu ax-menu-item.ax-secondary,ax-menu ax-menu-item.ax-secondary{--ax-comp-menu-item-text-color: var(--ax-sys-color-secondary-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-secondary-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-secondary-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-secondary-surface)}ax-context-menu ax-menu-item.ax-success,ax-menu ax-menu-item.ax-success{--ax-comp-menu-item-text-color: var(--ax-sys-color-success-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-success-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-success-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-success-surface)}ax-context-menu ax-menu-item.ax-warning,ax-menu ax-menu-item.ax-warning{--ax-comp-menu-item-text-color: var(--ax-sys-color-warning-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-warning-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-warning-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-warning-surface)}ax-context-menu ax-menu-item.ax-danger,ax-menu ax-menu-item.ax-danger{--ax-comp-menu-item-text-color: var(--ax-sys-color-danger-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-danger-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-danger-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-danger-surface)}ax-context-menu ax-menu-item.ax-accent1,ax-menu ax-menu-item.ax-accent1{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent1-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent1-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent1-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent1-surface)}ax-context-menu ax-menu-item.ax-accent2,ax-menu ax-menu-item.ax-accent2{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent2-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent2-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent2-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent2-surface)}ax-context-menu ax-menu-item.ax-accent3,ax-menu ax-menu-item.ax-accent3{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent3-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent3-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent3-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent3-surface)}ax-context-menu ax-menu-item.ax-accent4,ax-menu ax-menu-item.ax-accent4{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent4-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent4-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent4-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent4-surface)}ax-context-menu ax-menu-item.ax-accent5,ax-menu ax-menu-item.ax-accent5{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent5-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent5-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent5-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent5-surface)}ax-context-menu ax-menu-item.ax-accent6,ax-menu ax-menu-item.ax-accent6{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent6-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent6-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent6-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent6-surface)}ax-context-menu ax-menu-item.ax-accent7,ax-menu ax-menu-item.ax-accent7{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent7-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent7-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent7-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent7-surface)}ax-context-menu,ax-menu{width:100%;color:inherit;display:flex;width:max-content}ax-context-menu.ax-menu-container,ax-context-menu .ax-menu-items,ax-menu.ax-menu-container,ax-menu .ax-menu-items{--ax-comp-action-item-padding-inline: .875rem;opacity:0;display:flex;position:fixed;visibility:hidden;width:max-content;height:max-content;flex-direction:column;min-width:var(--ax-comp-menu-items-min-width);color:rgba(var(--ax-comp-menu-items-text-color, var(--ax-sys-color-on-lightest-surface)));background-color:rgba(var(--ax-comp-menu-sub-item-bg-color, var(--ax-sys-color-lightest-surface)));padding-block:var(--ax-comp-menu-items-padding-block, .5rem);border-width:var(--ax-comp-menu-items-border-width, 1px);border-radius:var(--ax-comp-menu-items-border-radius, var(--ax-sys-border-radius));border-color:rgba(var(--ax-comp-menu-items-border-color, var(--ax-sys-color-border-lightest-surface)));--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);transition-property:opacity,color;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-context-menu.ax-menu-container.ax-state-open,ax-context-menu .ax-menu-items.ax-state-open,ax-menu.ax-menu-container.ax-state-open,ax-menu .ax-menu-items.ax-state-open{opacity:1;visibility:visible}ax-context-menu.ax-menu-container ax-menu-item,ax-context-menu .ax-menu-items ax-menu-item,ax-menu.ax-menu-container ax-menu-item,ax-menu .ax-menu-items ax-menu-item{color:rgba(var(--ax-comp-menu-item-text-color, var(--ax-sys-color-on-surface)))}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{color:rgba(var(--ax-comp-menu-item-suffix-text-color))}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled),ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled){color:rgba(var(--ax-comp-menu-item-hover-text-color, var(--ax-sys-color-on-surface)));background-color:rgba(var(--ax-comp-menu-item-hover-bg-color, var(--ax-sys-color-surface)))!important}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text{color:rgba(var(--ax-comp-menu-item-hover-suffix-text-color))}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{font-weight:400!important}ax-context-menu.ax-action-list-horizontal{padding-inline:var(--ax-comp-menu-action-list-horizontal-padding-inline, 1rem)}ax-menu>ax-menu-item{--ax-comp-action-item-padding-inline: 0}ax-menu>ax-menu-item:has(>.ax-action-item-suffix:not(:empty)){gap:.5rem}ax-menu.ax-action-list-horizontal{min-width:var(--ax-comp-menu-action-list-horizontal-min-width);gap:var(--ax-comp-menu-action-list-horizontal-gap)}ax-menu.ax-action-list-horizontal>ax-title{display:none}ax-menu.ax-action-list-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-prefix{padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:not(ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:empty){padding-inline-end:0!important;margin-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-suffix{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}ax-menu.ax-action-list-vertical{width:max-content;min-width:var(--ax-comp-menu-action-list-vertical-min-width)}ax-menu.ax-action-list-vertical>ax-menu-item{font-weight:500}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-suffix{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}ax-menu>ax-menu-item{padding-block:var(--ax-comp-menu-items-padding-block, .5rem)}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled){border-radius:var(--ax-comp-menu-items-border-radius, var(--ax-sys-border-radius))}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-text{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXMenuItemComponent, selector: "ax-menu-item", inputs: ["subItems", "name", "data", "disabled", "color"], outputs: ["onClick"] }, { kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-menu', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                        AXMenuService,
                        {
                            provide: AXRootMenu,
                            useExisting: AXMenuComponent,
                        },
                        {
                            provide: AXComponent,
                            useExisting: AXMenuComponent,
                        },
                    ], imports: [
                        NgTemplateOutlet,
                        AXDecoratorGenericComponent,
                        AXMenuItemComponent,
                        AXDecoratorIconComponent,
                        AsyncPipe,
                        AXTranslatorPipe,
                    ], template: "<ng-content select=\"ax-menu-item,ax-divider,ax-title,ng-container\"></ng-content>\n\n@for (node of items(); track node) {\n  <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: node }\"> </ng-container>\n}\n\n<ng-template #Recursion let-item>\n  @if (item.group?.title) {\n    <ax-title>{{ item.group?.title }}</ax-title>\n  }\n  <ax-menu-item\n    [name]=\"item.name\"\n    [data]=\"item.data\"\n    [disabled]=\"item.disabled\"\n    [color]=\"item.color\"\n    [subItems]=\"item.items ?? []\"\n  >\n    @if (item.icon) {\n      <ax-prefix>\n        <ax-icon [icon]=\"item.icon\"> </ax-icon>\n      </ax-prefix>\n    }\n    @if (item.text) {\n      <ax-text>{{ item.text | translate | async }}</ax-text>\n    }\n    @if (item.suffix) {\n      <ax-suffix>\n        <ax-text>{{ item.suffix.text | translate | async }}</ax-text>\n      </ax-suffix>\n    }\n    @for (child of item.items; track child) {\n      <ng-container [ngTemplateOutlet]=\"Recursion\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\n    }\n  </ax-menu-item>\n  @if (item.break) {\n    <ax-divider></ax-divider>\n  }\n</ng-template>\n", styles: ["ax-context-menu,ax-menu{--ax-comp-menu-items-min-width: 12rem;--ax-comp-menu-action-list-hover-decorator-opacity: .7;--ax-comp-menu-action-list-horizontal-min-width: 12rem;--ax-comp-menu-action-list-horizontal-gap: 1.25rem;--ax-comp-menu-action-list-vertical-min-width: 12rem}ax-context-menu ax-menu-item.ax-primary,ax-menu ax-menu-item.ax-primary{--ax-comp-menu-item-text-color: var(--ax-sys-color-primary-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-primary-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-primary-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-primary-surface)}ax-context-menu ax-menu-item.ax-secondary,ax-menu ax-menu-item.ax-secondary{--ax-comp-menu-item-text-color: var(--ax-sys-color-secondary-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-secondary-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-secondary-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-secondary-surface)}ax-context-menu ax-menu-item.ax-success,ax-menu ax-menu-item.ax-success{--ax-comp-menu-item-text-color: var(--ax-sys-color-success-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-success-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-success-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-success-surface)}ax-context-menu ax-menu-item.ax-warning,ax-menu ax-menu-item.ax-warning{--ax-comp-menu-item-text-color: var(--ax-sys-color-warning-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-warning-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-warning-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-warning-surface)}ax-context-menu ax-menu-item.ax-danger,ax-menu ax-menu-item.ax-danger{--ax-comp-menu-item-text-color: var(--ax-sys-color-danger-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-danger-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-danger-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-danger-surface)}ax-context-menu ax-menu-item.ax-accent1,ax-menu ax-menu-item.ax-accent1{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent1-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent1-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent1-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent1-surface)}ax-context-menu ax-menu-item.ax-accent2,ax-menu ax-menu-item.ax-accent2{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent2-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent2-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent2-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent2-surface)}ax-context-menu ax-menu-item.ax-accent3,ax-menu ax-menu-item.ax-accent3{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent3-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent3-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent3-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent3-surface)}ax-context-menu ax-menu-item.ax-accent4,ax-menu ax-menu-item.ax-accent4{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent4-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent4-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent4-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent4-surface)}ax-context-menu ax-menu-item.ax-accent5,ax-menu ax-menu-item.ax-accent5{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent5-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent5-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent5-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent5-surface)}ax-context-menu ax-menu-item.ax-accent6,ax-menu ax-menu-item.ax-accent6{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent6-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent6-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent6-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent6-surface)}ax-context-menu ax-menu-item.ax-accent7,ax-menu ax-menu-item.ax-accent7{--ax-comp-menu-item-text-color: var(--ax-sys-color-accent7-surface);--ax-comp-menu-item-hover-text-color: var(--ax-sys-color-accent7-surface);--ax-comp-menu-item-hover-bg-color: var(--ax-sys-color-accent7-surface), .1;--ax-comp-menu-item-hover-suffix-text-color: var(--ax-sys-color-accent7-surface)}ax-context-menu,ax-menu{width:100%;color:inherit;display:flex;width:max-content}ax-context-menu.ax-menu-container,ax-context-menu .ax-menu-items,ax-menu.ax-menu-container,ax-menu .ax-menu-items{--ax-comp-action-item-padding-inline: .875rem;opacity:0;display:flex;position:fixed;visibility:hidden;width:max-content;height:max-content;flex-direction:column;min-width:var(--ax-comp-menu-items-min-width);color:rgba(var(--ax-comp-menu-items-text-color, var(--ax-sys-color-on-lightest-surface)));background-color:rgba(var(--ax-comp-menu-sub-item-bg-color, var(--ax-sys-color-lightest-surface)));padding-block:var(--ax-comp-menu-items-padding-block, .5rem);border-width:var(--ax-comp-menu-items-border-width, 1px);border-radius:var(--ax-comp-menu-items-border-radius, var(--ax-sys-border-radius));border-color:rgba(var(--ax-comp-menu-items-border-color, var(--ax-sys-color-border-lightest-surface)));--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);transition-property:opacity,color;transition-duration:var(--ax-sys-transition-duration);transition-timing-function:var(--ax-sys-transition-timing-function)}ax-context-menu.ax-menu-container.ax-state-open,ax-context-menu .ax-menu-items.ax-state-open,ax-menu.ax-menu-container.ax-state-open,ax-menu .ax-menu-items.ax-state-open{opacity:1;visibility:visible}ax-context-menu.ax-menu-container ax-menu-item,ax-context-menu .ax-menu-items ax-menu-item,ax-menu.ax-menu-container ax-menu-item,ax-menu .ax-menu-items ax-menu-item{color:rgba(var(--ax-comp-menu-item-text-color, var(--ax-sys-color-on-surface)))}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{color:rgba(var(--ax-comp-menu-item-suffix-text-color))}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled),ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled),ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled){color:rgba(var(--ax-comp-menu-item-hover-text-color, var(--ax-sys-color-on-surface)));background-color:rgba(var(--ax-comp-menu-item-hover-bg-color, var(--ax-sys-color-surface)))!important}ax-context-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item:hover:not(.ax-state-disabled) ax-suffix ax-text{color:rgba(var(--ax-comp-menu-item-hover-suffix-text-color))}ax-context-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-context-menu .ax-menu-items ax-menu-item ax-suffix ax-text,ax-menu.ax-menu-container ax-menu-item ax-suffix ax-text,ax-menu .ax-menu-items ax-menu-item ax-suffix ax-text{font-weight:400!important}ax-context-menu.ax-action-list-horizontal{padding-inline:var(--ax-comp-menu-action-list-horizontal-padding-inline, 1rem)}ax-menu>ax-menu-item{--ax-comp-action-item-padding-inline: 0}ax-menu>ax-menu-item:has(>.ax-action-item-suffix:not(:empty)){gap:.5rem}ax-menu.ax-action-list-horizontal{min-width:var(--ax-comp-menu-action-list-horizontal-min-width);gap:var(--ax-comp-menu-action-list-horizontal-gap)}ax-menu.ax-action-list-horizontal>ax-title{display:none}ax-menu.ax-action-list-horizontal>ax-menu-item{font-weight:500}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-prefix{padding-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:not(ax-menu.ax-action-list-horizontal>ax-menu-item>.ax-action-item-suffix:empty){padding-inline-end:0!important;margin-inline-start:0!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-horizontal>ax-menu-item:hover:not(ax-menu.ax-action-list-horizontal>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-suffix{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}ax-menu.ax-action-list-vertical{width:max-content;min-width:var(--ax-comp-menu-action-list-vertical-min-width)}ax-menu.ax-action-list-vertical>ax-menu-item{font-weight:500}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled){background-color:transparent!important}ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-prefix,ax-menu.ax-action-list-vertical>ax-menu-item:hover:not(ax-menu.ax-action-list-vertical>ax-menu-item:hover.ax-state-disabled)>.ax-action-item-suffix{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}ax-menu>ax-menu-item{padding-block:var(--ax-comp-menu-items-padding-block, .5rem)}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled){border-radius:var(--ax-comp-menu-items-border-radius, var(--ax-sys-border-radius))}ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-icon,ax-menu>ax-menu-item:hover:not(ax-menu>ax-menu-item:hover.ax-state-disabled)>ax-text{opacity:var(--ax-comp-menu-action-list-hover-decorator-opacity)}\n"] }]
        }], ctorParameters: () => [], propDecorators: { __hostClass: [{
                type: HostBinding,
                args: ['class']
            }] } });

class AXMenuModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: AXMenuModule, imports: [AXMenuItemComponent, AXMenuComponent, AXContextMenuComponent], exports: [AXMenuItemComponent, AXMenuComponent, AXContextMenuComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuModule, imports: [AXMenuComponent, AXContextMenuComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXMenuModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [AXMenuItemComponent, AXMenuComponent, AXContextMenuComponent],
                    exports: [AXMenuItemComponent, AXMenuComponent, AXContextMenuComponent],
                }]
        }] });

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

export { AXContextMenuComponent, AXContextMenuOpeningEvent, AXMenuComponent, AXMenuItemClickBaseEvent, AXMenuItemComponent, AXMenuItemComponentBase, AXMenuModule, AXMenuService, AXRootMenu };
//# sourceMappingURL=acorex-components-menu.mjs.map
