import { __esDecorate, __runInitializers } from 'tslib'; import { Directionality } from '@angular/cdk/bidi'; import * as i0 from '@angular/core'; import { inject, ChangeDetectorRef, DestroyRef, EventEmitter, booleanAttribute, Output, Input, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { slideAlertMotion } from 'ng-zorro-antd/core/animation'; import { WithConfig, onConfigChangeEventForComponent } from 'ng-zorro-antd/core/config'; import * as i2 from 'ng-zorro-antd/core/outlet'; import { NzOutletModule } from 'ng-zorro-antd/core/outlet'; import * as i1 from 'ng-zorro-antd/icon'; import { NzIconModule } from 'ng-zorro-antd/icon'; const NZ_CONFIG_MODULE_NAME = 'alert'; let NzAlertComponent = (() => { let _nzCloseable_decorators; let _nzCloseable_initializers = []; let _nzCloseable_extraInitializers = []; let _nzShowIcon_decorators; let _nzShowIcon_initializers = []; let _nzShowIcon_extraInitializers = []; return class NzAlertComponent { static { const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0; _nzCloseable_decorators = [WithConfig()]; _nzShowIcon_decorators = [WithConfig()]; __esDecorate(null, null, _nzCloseable_decorators, { kind: "field", name: "nzCloseable", static: false, private: false, access: { has: obj => "nzCloseable" in obj, get: obj => obj.nzCloseable, set: (obj, value) => { obj.nzCloseable = value; } }, metadata: _metadata }, _nzCloseable_initializers, _nzCloseable_extraInitializers); __esDecorate(null, null, _nzShowIcon_decorators, { kind: "field", name: "nzShowIcon", static: false, private: false, access: { has: obj => "nzShowIcon" in obj, get: obj => obj.nzShowIcon, set: (obj, value) => { obj.nzShowIcon = value; } }, metadata: _metadata }, _nzShowIcon_initializers, _nzShowIcon_extraInitializers); if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata }); } cdr = inject(ChangeDetectorRef); directionality = inject(Directionality); destroyRef = inject(DestroyRef); _nzModuleName = NZ_CONFIG_MODULE_NAME; nzAction = null; nzCloseText = null; nzIconType = null; nzMessage = null; nzDescription = null; nzType = 'info'; nzCloseable = __runInitializers(this, _nzCloseable_initializers, false); nzShowIcon = (__runInitializers(this, _nzCloseable_extraInitializers), __runInitializers(this, _nzShowIcon_initializers, false)); nzBanner = (__runInitializers(this, _nzShowIcon_extraInitializers), false); nzNoAnimation = false; nzIcon = null; nzOnClose = new EventEmitter(); closed = false; iconTheme = 'fill'; inferredIconType = 'info-circle'; dir = 'ltr'; isTypeSet = false; isShowIconSet = false; constructor() { onConfigChangeEventForComponent(NZ_CONFIG_MODULE_NAME, () => this.cdr.markForCheck()); } ngOnInit() { this.directionality.change?.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((direction) => { this.dir = direction; this.cdr.detectChanges(); }); this.dir = this.directionality.value; } closeAlert() { this.closed = true; } onFadeAnimationDone() { if (this.closed) { this.nzOnClose.emit(true); } } ngOnChanges(changes) { const { nzShowIcon, nzDescription, nzType, nzBanner } = changes; if (nzShowIcon) { this.isShowIconSet = true; } if (nzType) { this.isTypeSet = true; switch (this.nzType) { case 'error': this.inferredIconType = 'close-circle'; break; case 'success': this.inferredIconType = 'check-circle'; break; case 'info': this.inferredIconType = 'info-circle'; break; case 'warning': this.inferredIconType = 'exclamation-circle'; break; } } if (nzDescription) { this.iconTheme = this.nzDescription ? 'outline' : 'fill'; } if (nzBanner) { if (!this.isTypeSet) { this.nzType = 'warning'; } if (!this.isShowIconSet) { this.nzShowIcon = true; } } } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.0", ngImport: i0, type: NzAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.0", type: NzAlertComponent, isStandalone: true, selector: "nz-alert", inputs: { nzAction: "nzAction", nzCloseText: "nzCloseText", nzIconType: "nzIconType", nzMessage: "nzMessage", nzDescription: "nzDescription", nzType: "nzType", nzCloseable: ["nzCloseable", "nzCloseable", booleanAttribute], nzShowIcon: ["nzShowIcon", "nzShowIcon", booleanAttribute], nzBanner: ["nzBanner", "nzBanner", booleanAttribute], nzNoAnimation: ["nzNoAnimation", "nzNoAnimation", booleanAttribute], nzIcon: "nzIcon" }, outputs: { nzOnClose: "nzOnClose" }, exportAs: ["nzAlert"], usesOnChanges: true, ngImport: i0, template: ` @if (!closed) {