import { Component, Input, Output, EventEmitter } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatIconModule } from '@angular/material/icon';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/icon";
export class AlertComponent {
    constructor() {
        this.onClose = new EventEmitter();
    }
    getMatIcon(severity) {
        let variant;
        switch (severity) {
            case 'error':
                variant = 'error_outline';
                break;
            case 'warning':
                variant = 'warning_amber';
                break;
            case 'success':
                variant = 'task_alt';
                break;
            case 'info':
                variant = 'info_outline';
                break;
            default:
                break;
        }
        return variant;
    }
    onCloseClick() {
        alert('Close clicked');
        this.onClose.emit({ Page: 'Page', target: 'target', type: 'type' });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AlertComponent, isStandalone: true, selector: "app-alert", inputs: { message: "message", severity: "severity", hideClose: "hideClose" }, outputs: { onClose: "onClose" }, ngImport: i0, template: "<div\n  class=\"psdk-alert\"\n  [ngClass]=\"{\n    'psdk-alert-error': severity === 'error',\n    'psdk-grid-warning': severity === 'warning',\n    'psdk-grid-success': severity === 'success',\n    'psdk-grid-info': severity === 'info'\n  }\"\n>\n  <div class=\"psdk-alert-icon\">\n    <mat-icon>{{ getMatIcon(severity) }}</mat-icon>\n  </div>\n  <div>{{ message }}</div>\n  <div *ngIf=\"!hideClose\" style=\"margin-left: auto\">\n    <button class=\"close-button\" mat-icon-button (click)=\"onCloseClick()\">\n      <mat-icon>close</mat-icon>\n    </button>\n  </div>\n</div>\n", styles: [".psdk-alert{border:1px solid;display:flex;align-items:center;border-radius:4px;padding:10px;margin:5px 0}.psdk-alert-icon{display:flex;align-items:center;margin-right:10px}.psdk-alert-error{color:var(--app-alert-error-color);border:1px solid var(--app-alert-error-border-color)}.psdk-alert-error .mat-icon{color:var(--app-alert-error-border-color)}.psdk-grid-warning{color:var(--app-alert-warning-color);border:1px solid var(--app-alert-warning-border-color)}.psdk-grid-warning .mat-icon{color:var(--app-alert-warning-border-color)}.psdk-grid-success{color:var(--app-alert-success-color);border:1px solid var(--app-alert-success-border-color)}.psdk-grid-success .mat-icon{color:var(--app-alert-success-border-color)}.psdk-grid-info{color:var(--app-alert-info-color);border:1px solid var(--app-alert-info-border-color)}.psdk-grid-info .mat-icon{color:var(--app-alert-info-border-color)}.close-button{background:none;border:none;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AlertComponent, decorators: [{
            type: Component,
            args: [{ selector: 'app-alert', standalone: true, imports: [CommonModule, MatIconModule], template: "<div\n  class=\"psdk-alert\"\n  [ngClass]=\"{\n    'psdk-alert-error': severity === 'error',\n    'psdk-grid-warning': severity === 'warning',\n    'psdk-grid-success': severity === 'success',\n    'psdk-grid-info': severity === 'info'\n  }\"\n>\n  <div class=\"psdk-alert-icon\">\n    <mat-icon>{{ getMatIcon(severity) }}</mat-icon>\n  </div>\n  <div>{{ message }}</div>\n  <div *ngIf=\"!hideClose\" style=\"margin-left: auto\">\n    <button class=\"close-button\" mat-icon-button (click)=\"onCloseClick()\">\n      <mat-icon>close</mat-icon>\n    </button>\n  </div>\n</div>\n", styles: [".psdk-alert{border:1px solid;display:flex;align-items:center;border-radius:4px;padding:10px;margin:5px 0}.psdk-alert-icon{display:flex;align-items:center;margin-right:10px}.psdk-alert-error{color:var(--app-alert-error-color);border:1px solid var(--app-alert-error-border-color)}.psdk-alert-error .mat-icon{color:var(--app-alert-error-border-color)}.psdk-grid-warning{color:var(--app-alert-warning-color);border:1px solid var(--app-alert-warning-border-color)}.psdk-grid-warning .mat-icon{color:var(--app-alert-warning-border-color)}.psdk-grid-success{color:var(--app-alert-success-color);border:1px solid var(--app-alert-success-border-color)}.psdk-grid-success .mat-icon{color:var(--app-alert-success-border-color)}.psdk-grid-info{color:var(--app-alert-info-color);border:1px solid var(--app-alert-info-border-color)}.psdk-grid-info .mat-icon{color:var(--app-alert-info-border-color)}.close-button{background:none;border:none;cursor:pointer}\n"] }]
        }], propDecorators: { message: [{
                type: Input
            }], severity: [{
                type: Input
            }], hideClose: [{
                type: Input
            }], onClose: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci1zZGstY29tcG9uZW50cy9zcmMvbGliL19jb21wb25lbnRzL2Rlc2lnblN5c3RlbUV4dGVuc2lvbi9hbGVydC9hbGVydC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9hbmd1bGFyLXNkay1jb21wb25lbnRzL3NyYy9saWIvX2NvbXBvbmVudHMvZGVzaWduU3lzdGVtRXh0ZW5zaW9uL2FsZXJ0L2FsZXJ0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDdkUsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBRSxh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