import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "./items/notification-items.component";
export class NewAthenaNotificationsComponent {
    constructor(_eref) {
        this._eref = _eref;
        this.items = [];
        this.isExpanded = false;
        this.isLoaded = false;
    }
    ngOnInit() { }
    get themeClass() {
        return this.isExpanded ? "active-menuitem" : "";
    }
    ngAfterViewInit() {
        setTimeout(() => {
            this.isLoaded = true;
        }, 0);
    }
    collapse() {
        if (this.isLoaded && !this._eref.nativeElement.contains(event.target)) {
            this.isExpanded = false;
        }
    }
    toggle() {
        this.isExpanded = !this.isExpanded;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NewAthenaNotificationsComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: NewAthenaNotificationsComponent, selector: "[smz-ui-new-athena-notifications]", inputs: { items: "items" }, host: { listeners: { "document:click": "collapse($event)" }, properties: { "class": "this.themeClass" } }, ngImport: i0, template: `
      <a class="notification clickable" (click)="toggle()">
          <!-- <span class="username">Notificações</span>
          <i class="profile-submenu-icon pi pi-angle-down"></i> -->
          <i class="pi pi-bell"></i><span class="topbar-badge">{{ items.length }}</span>
      </a>
      <ul *ngIf="isExpanded" class="topbar-menu topbar-notification-menu-top-adjust fadeInDown topbar-menu-visible" smz-ui-new-athena-notification-items [items]="items"></ul>
  `, isInline: true, styles: [".notification{font-weight:700;color:var(--text-color-secondary);margin-left:1rem;position:relative}.notification i{line-height:inherit;font-size:1.5rem}.topbar-notification-menu-top-adjust{margin-top:-17px!important}.topbar-badge{position:absolute;display:block;right:-5px;top:-10px;width:1rem;height:1rem;line-height:1rem;font-size:.714rem;border-radius:50%;font-weight:600;background:var(--text-color-secondary);color:var(--primary-color);text-align:center}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.NewAthenaNotificationItemsComponent, selector: "[smz-ui-new-athena-notification-items]", inputs: ["items"], outputs: ["onClose"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: NewAthenaNotificationsComponent, decorators: [{
            type: Component,
            args: [{ selector: '[smz-ui-new-athena-notifications]', host: { "(document:click)": "collapse($event)" }, changeDetection: ChangeDetectionStrategy.OnPush, template: `
      <a class="notification clickable" (click)="toggle()">
          <!-- <span class="username">Notificações</span>
          <i class="profile-submenu-icon pi pi-angle-down"></i> -->
          <i class="pi pi-bell"></i><span class="topbar-badge">{{ items.length }}</span>
      </a>
      <ul *ngIf="isExpanded" class="topbar-menu topbar-notification-menu-top-adjust fadeInDown topbar-menu-visible" smz-ui-new-athena-notification-items [items]="items"></ul>
  `, styles: [".notification{font-weight:700;color:var(--text-color-secondary);margin-left:1rem;position:relative}.notification i{line-height:inherit;font-size:1.5rem}.topbar-notification-menu-top-adjust{margin-top:-17px!important}.topbar-badge{position:absolute;display:block;right:-5px;top:-10px;width:1rem;height:1rem;line-height:1rem;font-size:.714rem;border-radius:50%;font-weight:600;background:var(--text-color-secondary);color:var(--primary-color);text-align:center}\n"] }]
        }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { items: [{
                type: Input
            }], themeClass: [{
                type: HostBinding,
                args: ["class"]
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90aWZpY2F0aW9ucy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc216LXVpL3NyYy9saWIvbW9kdWxlcy9zbXotbGF5b3V0cy9sYXlvdXRzL25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