import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from "@angular/core";
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../../../../../../common/menu-item-actions/menu-item-actions.directive";
import * as i3 from "../../../../../../common/is-visible-pipe/is-visible.pipe";
export class HephaestusProfileMenuItemsComponent {
    constructor(_eref) {
        this._eref = _eref;
        this.onClose = new EventEmitter();
        this.isLoaded = false;
    }
    ngOnInit() {
    }
    ngAfterViewInit() {
        setTimeout(() => {
            this.isLoaded = true;
        }, 0);
    }
    collapse(event) {
        if (this.isLoaded && !this._eref.nativeElement.contains(event.target)) {
            this.onClose.emit();
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: HephaestusProfileMenuItemsComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: HephaestusProfileMenuItemsComponent, selector: "[smz-ui-hephaestus-profile-menu-items]", inputs: { items: "items" }, outputs: { onClose: "onClose" }, host: { listeners: { "document:click": "collapse($event)" } }, ngImport: i0, template: `
    <li *ngFor="let item of items | isVisible; index as index">
      <a menuItemAction [item]="item" [parent]="null" [breadcrumbs]="false" [tabindex]="index">
      <i *ngIf="item.icon != null" class="pi" [ngClass]="item.icon"></i>
        <span>{{ item.label }}</span>
      </a>
    </li>
  `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.MenuItemActionsDirective, selector: "[menuItemAction]", inputs: ["item", "parent", "breadcrumbs"], outputs: ["collapse"] }, { kind: "pipe", type: i3.IsVisiblePipe, name: "isVisible" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: HephaestusProfileMenuItemsComponent, decorators: [{
            type: Component,
            args: [{
                    selector: "[smz-ui-hephaestus-profile-menu-items]",
                    host: { "(document:click)": "collapse($event)" },
                    changeDetection: ChangeDetectionStrategy.OnPush,
                    template: `
    <li *ngFor="let item of items | isVisible; index as index">
      <a menuItemAction [item]="item" [parent]="null" [breadcrumbs]="false" [tabindex]="index">
      <i *ngIf="item.icon != null" class="pi" [ngClass]="item.icon"></i>
        <span>{{ item.label }}</span>
      </a>
    </li>
  `,
                }]
        }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { items: [{
                type: Input
            }], onClose: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZS1tZW51LWl0ZW1zLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1zbXotdWkvc3JjL2xpYi9tb2R1bGVzL3Ntei1sYXlvdXRzL2xheW91dHMvaGVwaGFlc3R1cy9jb21wb25lbnRzL3Byb2ZpbGUtbWVudS9wcm9maWxlLW1lbnUtaXRlbXMuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBaUIsdUJBQXVCLEVBQUUsU0FBUyxFQUFjLFlBQVksRUFBRSxLQUFLLEVBQVUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7OztBQWdCbkksTUFBTSxPQUFPLG1DQUFtQztJQUs5QyxZQUFvQixLQUFpQjtRQUFqQixVQUFLLEdBQUwsS0FBSyxDQUFZO1FBRnBCLFlBQU8sR0FBdUIsSUFBSSxZQUFZLEVBQ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