import { NgModule, Component, HostBinding, EventEmitter, Input, ChangeDetectionStrategy, ViewEncapsulation, Output } from '@angular/core';
import { CommonModule } from '@angular/common';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { EuiIconModule } from '../atoms';
import { BaseDirective } from '../../base.directive';
import { EuiLabelModule } from '../atoms';
import { TranslateModule } from '@ngx-translate/core';
import { EuiButtonModule } from '../eui-button';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../eui-button/eui-button.component";
const _c0 = ["euiAlert", ""];
function EuiAlertComponent_button_2_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function EuiAlertComponent_button_2_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r1 = i0.ɵɵnextContext(); return ctx_r1.onCloseClick($event); });
    i0.ɵɵelementEnd();
} }
const _c1 = ["*"];
export class EuiAlertComponent extends BaseDirective {
    constructor() {
        super();
        this._euiAlertMuted = false;
        this.isCloseable = false;
        this.close = new EventEmitter();
        this.isVisible = true;
    }
    get euiAlertMuted() { return this._euiAlertMuted; }
    set euiAlertMuted(value) { this._euiAlertMuted = coerceBooleanProperty(value); }
    get cssClasses() {
        return [
            this.euiAlertMuted ? `eui-alert--muted` : ``,
            !this.isVisible ? `eui-alert--hidden` : ``,
            super.getCssClasses('eui-alert'),
        ].join(' ').trim();
    }
    ngAfterContentInit() {
        if (!this.e2eAttr) {
            this.e2eAttr = 'eui-alert';
        }
    }
    onCloseClick(event) {
        this.isVisible = false;
        this.close.emit();
    }
}
/** @nocollapse */ EuiAlertComponent.ɵfac = function EuiAlertComponent_Factory(t) { return new (t || EuiAlertComponent)(); };
/** @nocollapse */ EuiAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiAlertComponent, selectors: [["div", "euiAlert", ""], ["eui-alert"]], hostVars: 2, hostBindings: function EuiAlertComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵclassMap(ctx.cssClasses);
    } }, inputs: { euiAlertMuted: "euiAlertMuted", isCloseable: "isCloseable" }, outputs: { close: "close" }, features: [i0.ɵɵInheritDefinitionFeature], attrs: _c0, ngContentSelectors: _c1, decls: 3, vars: 1, consts: [["role", "alert", 1, "eui-alert__content-wrapper"], ["euiButton", "", "euiRounded", "", "euiBasicButton", "", "euiIconButton", "", "euiSizeS", "", "aria-label", "Close Icon Button", "class", "eui-alert__close", 3, "click", 4, "ngIf"], ["euiButton", "", "euiRounded", "", "euiBasicButton", "", "euiIconButton", "", "euiSizeS", "", "aria-label", "Close Icon Button", 1, "eui-alert__close", 3, "click"]], template: function EuiAlertComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef();
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵprojection(1);
        i0.ɵɵtemplate(2, EuiAlertComponent_button_2_Template, 1, 0, "button", 1);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.isCloseable);
    } }, directives: [i1.NgIf, i2.EuiButtonComponent], styles: ["@charset \"UTF-8\";.eui-alert{--eui-alert-padding:var(--eui-spacing);background-color:initial;background-position:var(--eui-spacing-s);background-repeat:no-repeat;border:1px solid;border-color:var(--eui-color-info-lighter);border-left:var(--eui-spacing-3xl) solid var(--eui-color-info-light);color:var(--eui-color);display:flex;padding:var(--eui-alert-padding);position:relative}.eui-alert:before{color:var(--eui-color-white);content:\"\uE90E\";font-family:var(--eui-icons-font-family);font-size:var(--eui-font-size-3xl);left:calc(var(--eui-spacing-xs)*-1);line-height:1;position:absolute;text-align:center;top:50%;transform:translate(-75%,-50%);width:var(--eui-spacing-4xl)}.eui-alert__content-wrapper{align-items:center;display:flex;flex-basis:auto;flex-shrink:1;overflow:auto;width:100%}.eui-alert__content-wrapper::-webkit-scrollbar{background-color:var(--eui-color-grey-lightest);display:inherit;height:8px;width:8px}.eui-alert__content-wrapper::-webkit-scrollbar-thumb{background-color:var(--eui-color-grey-light);border-radius:5rem}.eui-alert__content-wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--eui-color-grey)}.eui-alert__content-wrapper::-webkit-scrollbar-track{background-color:var(--eui-color-grey-lightest);border-radius:0}.eui-alert__close{color:var(--eui-color-grey);font-family:eui-icons,sans-serif;font-size:var(--eui-font-size);font-weight:100;line-height:1;margin-left:auto}.eui-alert__close:before{content:\"\uF3BB\"}.eui-alert__close:hover{color:var(--eui-color)}.eui-alert--hidden{display:none}.eui-alert--success{border-color:var(--eui-color-success-lighter) var(--eui-color-success-lighter) var(--eui-color-success-lighter) var(--eui-color-success-light);border-left-color:var(--eui-color-success-lighter)}.eui-alert--success:before{content:\"\uF00C\"}.eui-alert--danger{border-color:var(--eui-color-danger-lighter) var(--eui-color-danger-lighter) var(--eui-color-danger-lighter) var(--eui-color-danger-light);border-left-color:var(--eui-color-danger-lighter)}.eui-alert--danger:before{content:\"\uF3EA\"}.eui-alert--warning{border-color:var(--eui-color-warning-lighter) var(--eui-color-warning-lighter) var(--eui-color-warning-lighter) var(--eui-color-warning-light);border-left-color:var(--eui-color-warning-lighter)}.eui-alert--warning:before{content:\"\uF071\"}.eui-alert--secondary{border-color:var(--eui-color-grey-lighter) var(--eui-color-grey-lighter) var(--eui-color-grey-lighter) var(--eui-color-grey-light);border-left-color:var(--eui-color-grey-lighter)}.eui-alert--secondary:before{content:\"\uF12B\"}.eui-alert--muted{border-left-width:1px}.eui-alert--muted:before{display:none}.eui-alert--muted.eui-alert--secondary{border-left-color:var(--eui-color-grey-lightester)}.eui-alert--muted.eui-alert--info{border-left-color:var(--eui-color-info-lightester)}.eui-alert--muted.eui-alert--success{border-left-color:var(--eui-color-success-lightester)}.eui-alert--muted.eui-alert--warning{border-left-color:var(--eui-color-warning-lightester)}.eui-alert--muted.eui-alert--danger{border-left-color:var(--eui-color-danger-lightester)}"], encapsulation: 2, changeDetection: 0 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiAlertComponent, [{
        type: Component,
        args: [{
                templateUrl: './eui-alert.component.html',
                selector: 'div[euiAlert], eui-alert',
                styleUrls: ['./styles/_index.scss'],
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return []; }, { euiAlertMuted: [{
            type: Input
        }], isCloseable: [{
            type: Input
        }], close: [{
            type: Output
        }], cssClasses: [{
            type: HostBinding,
            args: ['class']
        }] }); })();
export class EuiAlertModule {
}
/** @nocollapse */ EuiAlertModule.ɵmod = i0.ɵɵdefineNgModule({ type: EuiAlertModule });
/** @nocollapse */ EuiAlertModule.ɵinj = i0.ɵɵdefineInjector({ factory: function EuiAlertModule_Factory(t) { return new (t || EuiAlertModule)(); }, imports: [[
            CommonModule,
            EuiIconModule,
            EuiLabelModule,
            TranslateModule,
            EuiButtonModule
        ]] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(EuiAlertModule, { declarations: [EuiAlertComponent], imports: [CommonModule,
        EuiIconModule,
        EuiLabelModule,
        TranslateModule,
        EuiButtonModule], exports: [EuiAlertComponent] }); })();
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiAlertModule, [{
        type: NgModule,
        args: [{
                imports: [
                    CommonModule,
                    EuiIconModule,
                    EuiLabelModule,
                    TranslateModule,
                    EuiButtonModule
                ],
                declarations: [
                    EuiAlertComponent,
                ],
                exports: [
                    EuiAlertComponent,
                ],
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 