import { Overlay } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, Renderer2, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation, } from '@angular/core';
import { combineLatest, ReplaySubject, Subject, map, tap } from 'rxjs';
import { noop, publishRef, sleep } from '../../../../core/public-api';
import animDataMap from '../../lottie-icons/animation-data';
import { NavMenuComponent } from '../nav-menu.component';
import * as i0 from "@angular/core";
import * as i1 from "../nav-menu.component";
import * as i2 from "@angular/cdk/overlay";
const _c0 = ["main"];
function NavItemLiComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function NavItemLiComponent_ng_template_1_a_5_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
const _c1 = function (a0) { return { $implicit: a0 }; };
function NavItemLiComponent_ng_template_1_a_5_Template(rf, ctx) { if (rf & 1) {
    const _r12 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 8);
    i0.ɵɵlistener("click", function NavItemLiComponent_ng_template_1_a_5_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r11.handleContentClicked(false)); });
    i0.ɵɵpipe(1, "async");
    i0.ɵɵpipe(2, "async");
    i0.ɵɵpipe(3, "async");
    i0.ɵɵtemplate(4, NavItemLiComponent_ng_template_1_a_5_ng_container_4_Template, 1, 0, "ng-container", 9);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const fromTooltip_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r6 = i0.ɵɵnextContext();
    const _r3 = i0.ɵɵreference(4);
    i0.ɵɵclassProp("isActive", i0.ɵɵpipeBind1(1, 8, ctx_r6.isActive$))("isLeaf", i0.ɵɵpipeBind1(2, 10, ctx_r6.depth$) === 1);
    i0.ɵɵproperty("routerLink", ctx_r6.item.routerLink);
    i0.ɵɵattribute("data-set-depth", i0.ɵɵpipeBind1(3, 12, ctx_r6.depth$));
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("ngTemplateOutlet", _r3)("ngTemplateOutletContext", i0.ɵɵpureFunction1(14, _c1, fromTooltip_r5));
} }
function NavItemLiComponent_ng_template_1_a_6_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function NavItemLiComponent_ng_template_1_a_6_Template(rf, ctx) { if (rf & 1) {
    const _r16 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "a", 10);
    i0.ɵɵlistener("click", function NavItemLiComponent_ng_template_1_a_6_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.handleContentClicked(false)); });
    i0.ɵɵpipe(1, "async");
    i0.ɵɵpipe(2, "async");
    i0.ɵɵpipe(3, "async");
    i0.ɵɵtemplate(4, NavItemLiComponent_ng_template_1_a_6_ng_container_4_Template, 1, 0, "ng-container", 9);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const fromTooltip_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r7 = i0.ɵɵnextContext();
    const _r3 = i0.ɵɵreference(4);
    i0.ɵɵclassProp("isActive", i0.ɵɵpipeBind1(1, 8, ctx_r7.isActive$))("isLeaf", i0.ɵɵpipeBind1(2, 10, ctx_r7.depth$) === 1);
    i0.ɵɵproperty("href", ctx_r7.item.href, i0.ɵɵsanitizeUrl);
    i0.ɵɵattribute("data-set-depth", i0.ɵɵpipeBind1(3, 12, ctx_r7.depth$));
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("ngTemplateOutlet", _r3)("ngTemplateOutletContext", i0.ɵɵpureFunction1(14, _c1, fromTooltip_r5));
} }
function NavItemLiComponent_ng_template_1_div_7_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function NavItemLiComponent_ng_template_1_div_7_Template(rf, ctx) { if (rf & 1) {
    const _r20 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 11);
    i0.ɵɵlistener("click", function NavItemLiComponent_ng_template_1_div_7_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r20); const ctx_r19 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r19.handleContentClicked(false)); });
    i0.ɵɵpipe(1, "async");
    i0.ɵɵpipe(2, "async");
    i0.ɵɵpipe(3, "async");
    i0.ɵɵpipe(4, "async");
    i0.ɵɵtemplate(5, NavItemLiComponent_ng_template_1_div_7_ng_container_5_Template, 1, 0, "ng-container", 9);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const fromTooltip_r5 = i0.ɵɵnextContext().$implicit;
    const ctx_r8 = i0.ɵɵnextContext();
    const _r3 = i0.ɵɵreference(4);
    i0.ɵɵclassProp("isActive", i0.ɵɵpipeBind1(1, 11, ctx_r8.isActive$))("isExpanded", i0.ɵɵpipeBind1(2, 13, ctx_r8.isExpanded$))("hasSubItem", ctx_r8.hasSubItem)("isLeaf", i0.ɵɵpipeBind1(3, 15, ctx_r8.depth$) === 1);
    i0.ɵɵattribute("data-set-depth", i0.ɵɵpipeBind1(4, 17, ctx_r8.depth$));
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("ngTemplateOutlet", _r3)("ngTemplateOutletContext", i0.ɵɵpureFunction1(19, _c1, fromTooltip_r5));
} }
function NavItemLiComponent_ng_template_1_div_8_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 12);
    i0.ɵɵelement(1, "acl-nav-item-ul", 13);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r9 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("hidden", !i0.ɵɵpipeBind1(2, 2, ctx_r9.isExpanded$))("items", ctx_r9.item.children);
} }
function NavItemLiComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    const _r23 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵlistener("mouseenter", function NavItemLiComponent_ng_template_1_Template_div_mouseenter_0_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r23); const fromTooltip_r5 = restoredCtx.$implicit; const ctx_r22 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r22.handleIconAnim(true, $event, fromTooltip_r5)); })("mouseleave", function NavItemLiComponent_ng_template_1_Template_div_mouseleave_0_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r23); const fromTooltip_r5 = restoredCtx.$implicit; const ctx_r24 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r24.handleIconAnim(false, $event, fromTooltip_r5)); });
    i0.ɵɵpipe(1, "async");
    i0.ɵɵpipe(2, "async");
    i0.ɵɵpipe(3, "async");
    i0.ɵɵpipe(4, "async");
    i0.ɵɵtemplate(5, NavItemLiComponent_ng_template_1_a_5_Template, 5, 16, "a", 4);
    i0.ɵɵtemplate(6, NavItemLiComponent_ng_template_1_a_6_Template, 5, 16, "a", 5);
    i0.ɵɵtemplate(7, NavItemLiComponent_ng_template_1_div_7_Template, 6, 21, "div", 6);
    i0.ɵɵtemplate(8, NavItemLiComponent_ng_template_1_div_8_Template, 3, 4, "div", 7);
    i0.ɵɵpipe(9, "async");
    i0.ɵɵpipe(10, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const fromTooltip_r5 = ctx.$implicit;
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵclassMap("acl-nav-item-li depth-" + i0.ɵɵpipeBind1(1, 16, ctx_r2.depth$));
    i0.ɵɵclassProp("isActive", i0.ɵɵpipeBind1(2, 18, ctx_r2.depth$) === 0 && i0.ɵɵpipeBind1(3, 20, ctx_r2.isActive$))("isExpanded", i0.ɵɵpipeBind1(4, 22, ctx_r2.isExpanded$))("hasDivider", ctx_r2.item.divider)("hasSubItem", ctx_r2.hasSubItem)("isFocused", ctx_r2.snapshot.isFocused);
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("ngIf", ctx_r2.item.routerLink);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.item.href && !ctx_r2.item.routerLink);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r2.item.href);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.hasSubItem && (!i0.ɵɵpipeBind1(9, 24, ctx_r2.navMenu.isCollapse$) || fromTooltip_r5 || i0.ɵɵpipeBind1(10, 26, ctx_r2.depth$) !== 0));
} }
function NavItemLiComponent_ng_template_3_ng_container_1_acl_nav_lottie_icon_1_Template(rf, ctx) { if (rf & 1) {
    const _r32 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "acl-nav-lottie-icon", 19);
    i0.ɵɵlistener("aniInit", function NavItemLiComponent_ng_template_3_ng_container_1_acl_nav_lottie_icon_1_Template_acl_nav_lottie_icon_aniInit_0_listener($event) { i0.ɵɵrestoreView(_r32); const fromTooltip_r25 = i0.ɵɵnextContext(2).$implicit; const ctx_r30 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r30.aniInit($event, fromTooltip_r25)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r28 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("animData", ctx_r28.animDataMap[ctx_r28.item.icon]);
} }
function NavItemLiComponent_ng_template_3_ng_container_1_div_2_aui_icon_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "aui-icon", 22);
} if (rf & 2) {
    const ctx_r33 = i0.ɵɵnextContext(4);
    i0.ɵɵproperty("icon", ctx_r33.item.icon);
} }
function NavItemLiComponent_ng_template_3_ng_container_1_div_2_img_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "img");
    i0.ɵɵpipe(1, "aclSafe");
    i0.ɵɵpipe(2, "aclImageHeader");
} if (rf & 2) {
    const ctx_r34 = i0.ɵɵnextContext(4);
    i0.ɵɵattribute("src", i0.ɵɵpipeBind2(1, 1, i0.ɵɵpipeBind1(2, 4, ctx_r34.item.iconData), "url"), i0.ɵɵsanitizeUrl);
} }
function NavItemLiComponent_ng_template_3_ng_container_1_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 20);
    i0.ɵɵtemplate(1, NavItemLiComponent_ng_template_3_ng_container_1_div_2_aui_icon_1_Template, 1, 1, "aui-icon", 21);
    i0.ɵɵtemplate(2, NavItemLiComponent_ng_template_3_ng_container_1_div_2_img_2_Template, 3, 6, "img", 15);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r29 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r29.item.icon);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r29.item.iconData);
} }
function NavItemLiComponent_ng_template_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, NavItemLiComponent_ng_template_3_ng_container_1_acl_nav_lottie_icon_1_Template, 1, 1, "acl-nav-lottie-icon", 17);
    i0.ɵɵtemplate(2, NavItemLiComponent_ng_template_3_ng_container_1_div_2_Template, 3, 2, "div", 18);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r26 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r26.animDataMap[ctx_r26.item.icon]);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r26.animDataMap[ctx_r26.item.icon]);
} }
function NavItemLiComponent_ng_template_3_ng_container_5_aui_icon_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "aui-icon", 25);
} }
function NavItemLiComponent_ng_template_3_ng_container_5_aui_icon_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "aui-icon", 26);
} }
function NavItemLiComponent_ng_template_3_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, NavItemLiComponent_ng_template_3_ng_container_5_aui_icon_1_Template, 1, 0, "aui-icon", 23);
    i0.ɵɵtemplate(2, NavItemLiComponent_ng_template_3_ng_container_5_aui_icon_2_Template, 1, 0, "aui-icon", 24);
    i0.ɵɵpipe(3, "pure");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r27 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r27.hasSubItem);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind2(3, 2, ctx_r27.item.href, ctx_r27.isExternal));
} }
function NavItemLiComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 14);
    i0.ɵɵtemplate(1, NavItemLiComponent_ng_template_3_ng_container_1_Template, 3, 2, "ng-container", 15);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementStart(3, "div", 16);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
    i0.ɵɵtemplate(5, NavItemLiComponent_ng_template_3_ng_container_5_Template, 4, 5, "ng-container", 15);
    i0.ɵɵpipe(6, "async");
    i0.ɵɵpipe(7, "async");
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 3, ctx_r4.depth$) === 0);
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", ctx_r4.item.label, " ");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !i0.ɵɵpipeBind1(6, 5, ctx_r4.navMenu.isCollapse$) || i0.ɵɵpipeBind1(7, 7, ctx_r4.depth$) !== 0);
} }
let disposeCurrentOverlay = noop;
export class NavItemLiComponent {
    constructor(navMenu, cdr, overlay, viewContainerRef, renderer) {
        this.navMenu = navMenu;
        this.cdr = cdr;
        this.overlay = overlay;
        this.viewContainerRef = viewContainerRef;
        this.renderer = renderer;
        this.item$$ = new ReplaySubject(1);
        this.paths = [];
        this.listeners = [];
        this.destroy$$ = new Subject();
        this.depth$ = this.navMenu.paths$.pipe(map(paths => {
            const path = paths.find(path => [...path].pop() === this.item.key);
            return path?.indexOf(this.item.key);
        }), tap(depth => (this.depth = depth)), publishRef());
        this.isActive$ = combineLatest([this.navMenu.activeKeys$, this.item$$]).pipe(map(([activeKeys, item]) => activeKeys?.includes(item.key)), tap(isActive => {
            this.snapshot.isActive = isActive;
            if (isActive && this.depth === 0) {
                this.navMenu.focusedRootKeyChange(this.item.key);
            }
        }), publishRef());
        this.isExpanded$ = combineLatest([this.navMenu.expandedKeys$, this.item$$]).pipe(map(([expandedKeys, item]) => item.children?.length && expandedKeys?.includes(item.key)), tap(isExpanded => {
            this.snapshot.isExpanded = isExpanded;
        }), publishRef());
        this.isFocusedRoot$ = combineLatest([
            this.item$$,
            this.navMenu.focusedRootKey$,
        ]).pipe(map(([item, activeRootKey]) => item.key === activeRootKey), publishRef());
        this.snapshot = {
            isActive: false,
            isExpanded: false,
            isFocused: false,
        };
        this.animDataMap = animDataMap;
    }
    get item() {
        return this._item;
    }
    set item(val) {
        this._item = val;
        this.item$$.next(val);
    }
    get hasSubItem() {
        return !!this.item.children?.length;
    }
    ngOnInit() {
        this.navMenu.paths$.subscribe(paths => (this.paths = paths));
        combineLatest([this.isActive$, this.isFocusedRoot$]).subscribe(([isActive, isFocused]) => {
            if (!isActive && !isFocused) {
                this.snapshot.isFocused = false;
                this.resetIconAnim();
            }
            else if (this.iconAnim) {
                this.snapshot.isFocused = true;
                this.playIcon();
            }
            this.cdr.markForCheck();
        });
    }
    playIcon() {
        if (this.navMenu.disableAniIcon) {
            this.iconAnim.goToAndStop(this.iconAnim.totalFrames - 1, true);
        }
        else {
            this.iconAnim.play();
        }
    }
    isExternal(url) {
        return /^https?:\/\//.test(url);
    }
    // forceExpand 当折叠侧边栏时悬浮总是展开
    handleContentClicked(forceExpand) {
        if (forceExpand) {
            this.snapshot.isExpanded = false;
        }
        else if (this.navMenu.isCollapse && this.overlayTriggerHovered) {
            return;
        }
        if (this.hasSubItem) {
            this.navMenu.expandedKeyChanged(this.snapshot.isExpanded
                ? this.findParentKey(this.item.key)
                : this.item.key);
        }
        else {
            disposeCurrentOverlay();
        }
    }
    openTooltip(event) {
        if (this.overlayIns) {
            return;
        }
        disposeCurrentOverlay();
        const positionStrategy = this.overlay
            .position()
            .flexibleConnectedTo(event.target)
            .withPositions([
            {
                originX: 'end',
                originY: 'top',
                overlayX: 'start',
                overlayY: 'top',
                offsetX: 0,
                offsetY: -6,
            },
        ])
            .withViewportMargin(4);
        this.overlayIns = this.overlay.create({
            positionStrategy,
            panelClass: 'nav-menu-overlay-pane',
        });
        this.bindOverlayHover();
        this.overlayIns.attach(new TemplatePortal(this.main, this.viewContainerRef, { $implicit: true }));
        disposeCurrentOverlay = () => {
            this.disposeOverlay();
        };
        this.auiTooltipShowHandle();
    }
    bindOverlayHover() {
        const { overlayElement } = this.overlayIns;
        const handle = (hover) => {
            this.overlayHovered = hover;
            if (!hover) {
                this.disposeWithDelayCheck();
            }
        };
        this.clearListeners();
        this.listeners.push(
        // TODO 应该用 fromEvent 数据流的形式，保持风格一致，不过这里很快会被aui的tooltip替换
        this.renderer.listen(overlayElement, 'mouseenter', () => handle(true)), this.renderer.listen(overlayElement, 'mouseleave', () => handle(false)));
    }
    clearListeners() {
        this.listeners.forEach(unListen => {
            unListen();
        });
        this.listeners = [];
    }
    disposeOverlay() {
        if (!this.overlayIns) {
            return;
        }
        this.clearListeners();
        this.navMenu.focusedRootKeyChange(null);
        this.overlayIns?.dispose();
        this.overlayIns = null;
    }
    handleIconAnim(hover, $event, fromTooltip) {
        if (this.depth === 0) {
            if (this.navMenu.isCollapse && !fromTooltip) {
                this.overlayTriggerHovered = hover;
                if (hover) {
                    this.openTooltip($event);
                }
                else {
                    this.disposeWithDelayCheck();
                }
            }
            if (hover) {
                this.navMenu.focusedRootKeyChange(this.item.key);
            }
            else if (!this.navMenu.isCollapse) {
                this.navMenu.focusedRootKeyChange(null);
            }
        }
    }
    async disposeWithDelayCheck() {
        await sleep(150);
        if (!this.overlayHovered && !this.overlayTriggerHovered) {
            this.disposeOverlay();
        }
    }
    findParentKey(key) {
        const path = this.paths.find(path => new Set(path).has(key));
        return path.slice(0, path.indexOf(key)).pop();
    }
    ngOnDestroy() {
        this.destroy$$.next();
        this.destroy$$.complete();
    }
    aniInit(ins, fromTooltip) {
        if (fromTooltip) {
            ins.goToAndStop(ins.totalFrames - 1, true);
            return;
        }
        this.iconAnim = ins;
        if (this.snapshot.isActive || this.snapshot.isFocused) {
            this.playIcon();
        }
    }
    resetIconAnim() {
        if (this.iconAnim) {
            this.iconAnim.goToAndStop(0);
        }
    }
    async auiTooltipShowHandle() {
        const overlayIns = this.overlayIns;
        if (overlayIns) {
            this.hasSubItem && this.handleContentClicked(true);
        }
        await sleep();
        if (overlayIns) {
            const { overlayElement } = overlayIns;
            const hasExactPosition = 
            // @ts-ignore
            // eslint-disable-next-line unicorn/consistent-destructuring, @typescript-eslint/no-unsafe-call
            overlayIns._positionStrategy._hasExactPosition();
            if (hasExactPosition && overlayElement) {
                // 如果弹出菜单因空间原因不能满足准确对齐，则不会设置固定的宽高，那如果再有展开菜单将不能滚动查看
                overlayElement.style.maxHeight =
                    overlayElement.getBoundingClientRect().height + 'px';
            }
        }
    }
}
NavItemLiComponent.ɵfac = function NavItemLiComponent_Factory(t) { return new (t || NavItemLiComponent)(i0.ɵɵdirectiveInject(i1.NavMenuComponent), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i2.Overlay), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.Renderer2)); };
NavItemLiComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NavItemLiComponent, selectors: [["acl-nav-item-li"]], viewQuery: function NavItemLiComponent_Query(rf, ctx) { if (rf & 1) {
        i0.ɵɵviewQuery(_c0, 5);
    } if (rf & 2) {
        let _t;
        i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.main = _t.first);
    } }, inputs: { item: "item" }, decls: 5, vars: 1, consts: [[4, "ngTemplateOutlet"], ["main", ""], ["navItem", ""], [3, "mouseenter", "mouseleave"], ["class", "acl-nav-item-li__content", 3, "isActive", "isLeaf", "routerLink", "click", 4, "ngIf"], ["class", "acl-nav-item-li__content", "target", "_blank", 3, "isActive", "isLeaf", "href", "click", 4, "ngIf"], ["class", "acl-nav-item-li__content no-link", 3, "isActive", "isExpanded", "hasSubItem", "isLeaf", "click", 4, "ngIf"], ["class", "acl-nav-item-li__sub-items", 4, "ngIf"], [1, "acl-nav-item-li__content", 3, "routerLink", "click"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], ["target", "_blank", 1, "acl-nav-item-li__content", 3, "href", "click"], [1, "acl-nav-item-li__content", "no-link", 3, "click"], [1, "acl-nav-item-li__sub-items"], [3, "hidden", "items"], [1, "acl-nav-item"], [4, "ngIf"], [1, "acl-nav-item__content"], ["class", "acl-nav-item__icon", 3, "animData", "aniInit", 4, "ngIf"], ["class", "acl-nav-item__icon", 4, "ngIf"], [1, "acl-nav-item__icon", 3, "animData", "aniInit"], [1, "acl-nav-item__icon"], [3, "icon", 4, "ngIf"], [3, "icon"], ["class", "acl-nav-item-li__expansion-indicator", "icon", "angle_right", 4, "ngIf"], ["class", "acl-nav-item-li__expansion-indicator", "icon", "basic:jump", 4, "ngIf"], ["icon", "angle_right", 1, "acl-nav-item-li__expansion-indicator"], ["icon", "basic:jump", 1, "acl-nav-item-li__expansion-indicator"]], template: function NavItemLiComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, NavItemLiComponent_ng_container_0_Template, 1, 0, "ng-container", 0);
        i0.ɵɵtemplate(1, NavItemLiComponent_ng_template_1_Template, 11, 28, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
        i0.ɵɵtemplate(3, NavItemLiComponent_ng_template_3_Template, 8, 9, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
    } if (rf & 2) {
        const _r1 = i0.ɵɵreference(2);
        i0.ɵɵproperty("ngTemplateOutlet", _r1);
    } }, styles: [".acl-nav-item-li{position:relative}.acl-nav-item-li:hover>.acl-nav-item-li__content,.acl-nav-item-li.isFocused>.acl-nav-item-li__content{color:var(--acl-nav-active-text-color)}.acl-nav-item-li__content{padding:6px var(--aui-spacing-xxl);display:flex;justify-content:space-between;position:relative;cursor:pointer;border-radius:var(--aui-border-radius-m);color:rgb(var(--aui-color-n-3));align-items:center;transition:all .3s ease}.acl-nav-item-li__content:link,.acl-nav-item-li__content:visited{color:rgb(var(--aui-color-n-3))}.acl-nav-item-li__content:hover,.acl-nav-item-li__content:active,.acl-nav-item-li__content:focus{text-decoration:none}.acl-nav-item-li__content:hover,.acl-nav-item-li__content.isActive{color:var(--acl-nav-active-text-color);background-color:var(--acl-nav-active-background-color)}.acl-nav-item-li__content.isActive.hasSubItem{background-color:transparent}.acl-nav-item-li__content[data-set-depth=\"0\"]{padding:10px var(--aui-spacing-xxl);font-weight:500}.acl-nav-item-li__content[data-set-depth=\"1\"]{padding-left:48px}.acl-nav-item-li__content[data-set-depth=\"2\"]{padding-left:64px}.acl-nav-item-li__expansion-indicator,.acl-nav-item-li__more{width:var(--aui-icon-size-m);height:var(--aui-icon-size-m);line-height:var(--aui-icon-size-m);font-size:var(--aui-icon-size-m);display:inline-flex}.acl-nav-item-li__content.isExpanded .acl-nav-item-li__expansion-indicator{transform:rotate(90deg)}.acl-nav-item{display:flex;align-items:center}.acl-nav-item__icon{margin-right:var(--aui-spacing-l);width:var(--aui-icon-size-m);height:var(--aui-icon-size-m);line-height:var(--aui-icon-size-m);font-size:var(--aui-icon-size-m);display:inline-flex;display:block}.acl-nav-item__content{line-height:20px;width:120px;font-size:var(--aui-font-size-m)}.acl-nav-leaf__title{font-size:var(--aui-font-size-l);color:rgb(var(--aui-color-n-2));padding-bottom:var(--aui-spacing-l);border-bottom:1px solid rgb(var(--aui-color-n-9));margin-bottom:6px;font-weight:500}.acl-nav-leaf .acl-nav-item-li__content{padding:6px var(--aui-spacing-xl)}.acl-nav-leaf .acl-nav-item{min-width:116px}\n"], encapsulation: 2, changeDetection: 0 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NavItemLiComponent, [{
        type: Component,
        args: [{ selector: 'acl-nav-item-li', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, template: "<ng-container *ngTemplateOutlet=\"main\"></ng-container>\n\n<ng-template\n  #main\n  let-fromTooltip\n>\n  <div\n    [class]=\"'acl-nav-item-li depth-' + (depth$ | async)\"\n    [class.isActive]=\"(depth$ | async) === 0 && (isActive$ | async)\"\n    [class.isExpanded]=\"isExpanded$ | async\"\n    [class.hasDivider]=\"item.divider\"\n    [class.hasSubItem]=\"hasSubItem\"\n    [class.isFocused]=\"snapshot.isFocused\"\n    (mouseenter)=\"handleIconAnim(true, $event, fromTooltip)\"\n    (mouseleave)=\"handleIconAnim(false, $event, fromTooltip)\"\n  >\n    <!-- routerLink \u548C href \u662F\u51B2\u7A81\u7684\uFF0C\u5E76\u4E14\u4EA7\u54C1\u5E0C\u671B\u53EF\u4EE5\u53F3\u952E\u6253\u5F00\u94FE\u63A5\uFF0C\u6240\u4EE5\u8FD9\u4E24\u4E2Aa\u6807\u7B7E\u662F\u5F88\u6709\u5FC5\u8981\u7684 -->\n    <a\n      *ngIf=\"item.routerLink\"\n      class=\"acl-nav-item-li__content\"\n      [class.isActive]=\"isActive$ | async\"\n      [class.isLeaf]=\"(depth$ | async) === 1\"\n      [attr.data-set-depth]=\"depth$ | async\"\n      (click)=\"handleContentClicked(false)\"\n      [routerLink]=\"item.routerLink\"\n    >\n      <ng-container\n        *ngTemplateOutlet=\"navItem; context: { $implicit: fromTooltip }\"\n      ></ng-container>\n    </a>\n    <a\n      *ngIf=\"item.href && !item.routerLink\"\n      class=\"acl-nav-item-li__content\"\n      [class.isActive]=\"isActive$ | async\"\n      [class.isLeaf]=\"(depth$ | async) === 1\"\n      [attr.data-set-depth]=\"depth$ | async\"\n      (click)=\"handleContentClicked(false)\"\n      [href]=\"item.href\"\n      target=\"_blank\"\n    >\n      <ng-container\n        *ngTemplateOutlet=\"navItem; context: { $implicit: fromTooltip }\"\n      ></ng-container>\n    </a>\n    <div\n      class=\"acl-nav-item-li__content no-link\"\n      [class.isActive]=\"isActive$ | async\"\n      [class.isExpanded]=\"isExpanded$ | async\"\n      [class.hasSubItem]=\"hasSubItem\"\n      [class.isLeaf]=\"(depth$ | async) === 1\"\n      [attr.data-set-depth]=\"depth$ | async\"\n      (click)=\"handleContentClicked(false)\"\n      *ngIf=\"!item.href\"\n    >\n      <ng-container\n        *ngTemplateOutlet=\"navItem; context: { $implicit: fromTooltip }\"\n      ></ng-container>\n    </div>\n\n    <div\n      *ngIf=\"\n        hasSubItem &&\n        (!(navMenu.isCollapse$ | async) ||\n          fromTooltip ||\n          (depth$ | async) !== 0)\n      \"\n      class=\"acl-nav-item-li__sub-items\"\n    >\n      <acl-nav-item-ul\n        [hidden]=\"!(isExpanded$ | async)\"\n        [items]=\"item.children\"\n      ></acl-nav-item-ul>\n    </div>\n  </div>\n</ng-template>\n\n<ng-template\n  #navItem\n  let-fromTooltip\n>\n  <div class=\"acl-nav-item\">\n    <ng-container *ngIf=\"(depth$ | async) === 0\">\n      <acl-nav-lottie-icon\n        *ngIf=\"animDataMap[item.icon]\"\n        class=\"acl-nav-item__icon\"\n        [animData]=\"animDataMap[item.icon]\"\n        (aniInit)=\"aniInit($event, fromTooltip)\"\n      ></acl-nav-lottie-icon>\n      <div\n        class=\"acl-nav-item__icon\"\n        *ngIf=\"!animDataMap[item.icon]\"\n      >\n        <aui-icon\n          *ngIf=\"item.icon\"\n          [icon]=\"item.icon\"\n        ></aui-icon>\n        <img\n          *ngIf=\"item.iconData\"\n          [attr.src]=\"item.iconData | aclImageHeader | aclSafe: 'url'\"\n        />\n      </div>\n    </ng-container>\n\n    <div class=\"acl-nav-item__content\">\n      {{ item.label }}\n    </div>\n  </div>\n  <ng-container\n    *ngIf=\"!(navMenu.isCollapse$ | async) || (depth$ | async) !== 0\"\n  >\n    <aui-icon\n      *ngIf=\"hasSubItem\"\n      class=\"acl-nav-item-li__expansion-indicator\"\n      icon=\"angle_right\"\n    ></aui-icon>\n    <aui-icon\n      *ngIf=\"item.href | pure: isExternal\"\n      class=\"acl-nav-item-li__expansion-indicator\"\n      icon=\"basic:jump\"\n    ></aui-icon>\n  </ng-container>\n</ng-template>\n", styles: [".acl-nav-item-li{position:relative}.acl-nav-item-li:hover>.acl-nav-item-li__content,.acl-nav-item-li.isFocused>.acl-nav-item-li__content{color:var(--acl-nav-active-text-color)}.acl-nav-item-li__content{padding:6px var(--aui-spacing-xxl);display:flex;justify-content:space-between;position:relative;cursor:pointer;border-radius:var(--aui-border-radius-m);color:rgb(var(--aui-color-n-3));align-items:center;transition:all .3s ease}.acl-nav-item-li__content:link,.acl-nav-item-li__content:visited{color:rgb(var(--aui-color-n-3))}.acl-nav-item-li__content:hover,.acl-nav-item-li__content:active,.acl-nav-item-li__content:focus{text-decoration:none}.acl-nav-item-li__content:hover,.acl-nav-item-li__content.isActive{color:var(--acl-nav-active-text-color);background-color:var(--acl-nav-active-background-color)}.acl-nav-item-li__content.isActive.hasSubItem{background-color:transparent}.acl-nav-item-li__content[data-set-depth=\"0\"]{padding:10px var(--aui-spacing-xxl);font-weight:500}.acl-nav-item-li__content[data-set-depth=\"1\"]{padding-left:48px}.acl-nav-item-li__content[data-set-depth=\"2\"]{padding-left:64px}.acl-nav-item-li__expansion-indicator,.acl-nav-item-li__more{width:var(--aui-icon-size-m);height:var(--aui-icon-size-m);line-height:var(--aui-icon-size-m);font-size:var(--aui-icon-size-m);display:inline-flex}.acl-nav-item-li__content.isExpanded .acl-nav-item-li__expansion-indicator{transform:rotate(90deg)}.acl-nav-item{display:flex;align-items:center}.acl-nav-item__icon{margin-right:var(--aui-spacing-l);width:var(--aui-icon-size-m);height:var(--aui-icon-size-m);line-height:var(--aui-icon-size-m);font-size:var(--aui-icon-size-m);display:inline-flex;display:block}.acl-nav-item__content{line-height:20px;width:120px;font-size:var(--aui-font-size-m)}.acl-nav-leaf__title{font-size:var(--aui-font-size-l);color:rgb(var(--aui-color-n-2));padding-bottom:var(--aui-spacing-l);border-bottom:1px solid rgb(var(--aui-color-n-9));margin-bottom:6px;font-weight:500}.acl-nav-leaf .acl-nav-item-li__content{padding:6px var(--aui-spacing-xl)}.acl-nav-leaf .acl-nav-item{min-width:116px}\n"] }]
    }], function () { return [{ type: i1.NavMenuComponent }, { type: i0.ChangeDetectorRef }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: i0.Renderer2 }]; }, { item: [{
            type: Input
        }], main: [{
            type: ViewChild,
            args: ['main']
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 