import { Component, Inject } from "@angular/core";
import { MAT_DIALOG_DATA } from "@angular/material/dialog";
import { Subject } from "rxjs";
import { takeUntil } from "rxjs/operators";
import { Color } from "../../common/color.enum";
import * as i0 from "@angular/core";
import * as i1 from "../../../../services/translation-registry.service";
import * as i2 from "@angular/material/dialog";
import * as i3 from "@angular/common";
import * as i4 from "@angular/material/icon";
import * as i5 from "../../../button/button";
import * as i6 from "../../../../directives/tooltip/tooltip-renderer.directive";
import * as i7 from "../../model/risk-result.model";
export class RiskResultComponent {
    constructor(translate, dialogRef, data) {
        this.translate = translate;
        this.dialogRef = dialogRef;
        this.data = data;
        this.results = [];
        this.color = Color;
        this.isSimple = 0;
        this.ngUnsubscribe = new Subject();
        this.title = data.title;
        this.results = data.results;
        this.isSimple = data.isSimple || 0;
    }
    ngOnInit() {
        this.translate.getLanguageSubject$.pipe(takeUntil(this.ngUnsubscribe)).subscribe((res) => {
            if (res) {
                this.LANG = this.translate.getObjectLang(res);
            }
        });
    }
    ngOnDestroy() {
        this.ngUnsubscribe.next();
        this.ngUnsubscribe.complete();
    }
    onCloseClick() {
        this.dialogRef.close();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RiskResultComponent, deps: [{ token: i1.TranslateLibraryService }, { token: i2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: RiskResultComponent, selector: "qms-risk-result", ngImport: i0, template: "<div class=\"dialog-container\">\n  <div mat-dialog-title class=\"dialog-title\">\n    <h3 class=\"title\">{{ title }}</h3>\n    <button\n      qms-btn-icon\n      color=\"light\"\n      qms-tool-tip=\"Caption\"\n      mode=\"dark\"\n      (click)=\"onCloseClick()\"\n    >\n      <mat-icon>close</mat-icon>\n    </button>\n  </div>\n\n  <mat-dialog-content>\n    <div class=\"flex-container-header\">\n      <div class=\"first\">{{ isSimple ? LANG.EVENT : LANG.CAUSE }}</div>\n      <div class=\"second\">{{ LANG.AREA_OF_IMPACT }}</div>\n      <div class=\"third\">{{ LANG.RESULT }}</div>\n    </div>\n    <div class=\"flex-container\" *ngFor=\"let item of results\">\n      <!-- g y r 1 2 3   done -->\n      <div class=\"first\" [ngSwitch]=\"item.color\">\n        <label *ngSwitchCase=\"3\" class=\"label-red\"></label>\n        <label *ngSwitchCase=\"1\" class=\"label-green\"></label>\n        <label *ngSwitchCase=\"2\" class=\"label-yellow\"></label>\n        {{ item.cause }}\n      </div>\n      <div class=\"second\">{{ item.consequenceArea }}</div>\n      <ng-container [ngSwitch]=\"item.color\">\n        <div class=\"third text-red\" *ngSwitchCase=\"3\">\n          <span class=\"material-icons-outlined\">report_problem</span>\n          {{ LANG.NOT_ACCEPTED }}\n        </div>\n        <div class=\"third text-yellow\" *ngSwitchCase=\"2\">\n          <mat-icon>error_outline</mat-icon>\n          {{ LANG.MUST_BE_EVALUATED }}\n        </div>\n        <div class=\"third text-green\" *ngSwitchCase=\"1\">\n          <mat-icon>done</mat-icon>\n          {{ LANG.ACCEPTED }}\n        </div>\n      </ng-container>\n    </div>\n  </mat-dialog-content>\n</div>\n", styles: [".dialog-title{display:flex;justify-content:space-between}.dialog-title h3.title{font-family:Raleway;font-style:normal;font-weight:500;font-size:22px;line-height:26px}.flex-container-header{display:flex;align-items:center;font-size:.75rem;border-radius:4px;line-height:16px}.flex-container-header>div{font-family:Open Sans;font-style:normal;font-weight:600;text-align:left;padding:10px 25px;color:#0009}.flex-container-header .first{flex:0 1 40%}.flex-container-header .second,.flex-container-header .third{flex:0 1 30%}.flex-container{display:flex;align-items:center;font-size:.875rem;line-height:22px;border-radius:4px;border:1px solid #ddd;min-height:48px;margin-bottom:10px}.flex-container>div{font-family:Open Sans;font-style:normal;text-align:left;padding:10px 25px;color:var(--default-color)}.flex-container .first{display:flex;flex:0 1 40%;align-items:center;font-weight:600}.flex-container .second{flex:0 1 30%;font-weight:400}.flex-container .third{display:flex;flex:0 1 30%;align-items:center;font-weight:600;font-size:.75rem}.flex-container .third.text-red,.flex-container .third.text-green,.flex-container .third.text-yellow{font-size:.75rem}.flex-container .third.text-red .mat-icon,.flex-container .third.text-red .material-icons-outlined,.flex-container .third.text-green .mat-icon,.flex-container .third.text-green .material-icons-outlined,.flex-container .third.text-yellow .mat-icon,.flex-container .third.text-yellow .material-icons-outlined{margin-right:1rem}.flex-container .third.text-red{color:var(--error)}.flex-container .third.text-yellow{color:var(--risk-yellow-dark)}.flex-container .third.text-green{color:var(--risk-green-dark)}.label-red,.label-yellow,.label-green{font-family:Open Sans;font-style:normal;font-weight:600;display:flex;text-align:center;margin-right:1rem;width:24px;height:24px;flex:0 0 24px;border-radius:1px}.label-red{background-color:var(--secondary);color:#fff}.label-yellow{background-color:var(--risk-yellow);color:#000000de}.label-green{background-color:var(--risk-green);color:#fff}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i5.QMSButtonIcon, selector: "button[qms-btn-icon]", inputs: ["disabled", "color", "active"], exportAs: ["qmsButtonIcon"] }, { kind: "directive", type: i6.QMSToolTipRendererDirective, selector: "[qms-tool-tip]", inputs: ["showToolTip", "mode", "qms-tool-tip", "contentTemplate", "position"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: RiskResultComponent, decorators: [{
            type: Component,
            args: [{ selector: 'qms-risk-result', template: "<div class=\"dialog-container\">\n  <div mat-dialog-title class=\"dialog-title\">\n    <h3 class=\"title\">{{ title }}</h3>\n    <button\n      qms-btn-icon\n      color=\"light\"\n      qms-tool-tip=\"Caption\"\n      mode=\"dark\"\n      (click)=\"onCloseClick()\"\n    >\n      <mat-icon>close</mat-icon>\n    </button>\n  </div>\n\n  <mat-dialog-content>\n    <div class=\"flex-container-header\">\n      <div class=\"first\">{{ isSimple ? LANG.EVENT : LANG.CAUSE }}</div>\n      <div class=\"second\">{{ LANG.AREA_OF_IMPACT }}</div>\n      <div class=\"third\">{{ LANG.RESULT }}</div>\n    </div>\n    <div class=\"flex-container\" *ngFor=\"let item of results\">\n      <!-- g y r 1 2 3   done -->\n      <div class=\"first\" [ngSwitch]=\"item.color\">\n        <label *ngSwitchCase=\"3\" class=\"label-red\"></label>\n        <label *ngSwitchCase=\"1\" class=\"label-green\"></label>\n        <label *ngSwitchCase=\"2\" class=\"label-yellow\"></label>\n        {{ item.cause }}\n      </div>\n      <div class=\"second\">{{ item.consequenceArea }}</div>\n      <ng-container [ngSwitch]=\"item.color\">\n        <div class=\"third text-red\" *ngSwitchCase=\"3\">\n          <span class=\"material-icons-outlined\">report_problem</span>\n          {{ LANG.NOT_ACCEPTED }}\n        </div>\n        <div class=\"third text-yellow\" *ngSwitchCase=\"2\">\n          <mat-icon>error_outline</mat-icon>\n          {{ LANG.MUST_BE_EVALUATED }}\n        </div>\n        <div class=\"third text-green\" *ngSwitchCase=\"1\">\n          <mat-icon>done</mat-icon>\n          {{ LANG.ACCEPTED }}\n        </div>\n      </ng-container>\n    </div>\n  </mat-dialog-content>\n</div>\n", styles: [".dialog-title{display:flex;justify-content:space-between}.dialog-title h3.title{font-family:Raleway;font-style:normal;font-weight:500;font-size:22px;line-height:26px}.flex-container-header{display:flex;align-items:center;font-size:.75rem;border-radius:4px;line-height:16px}.flex-container-header>div{font-family:Open Sans;font-style:normal;font-weight:600;text-align:left;padding:10px 25px;color:#0009}.flex-container-header .first{flex:0 1 40%}.flex-container-header .second,.flex-container-header .third{flex:0 1 30%}.flex-container{display:flex;align-items:center;font-size:.875rem;line-height:22px;border-radius:4px;border:1px solid #ddd;min-height:48px;margin-bottom:10px}.flex-container>div{font-family:Open Sans;font-style:normal;text-align:left;padding:10px 25px;color:var(--default-color)}.flex-container .first{display:flex;flex:0 1 40%;align-items:center;font-weight:600}.flex-container .second{flex:0 1 30%;font-weight:400}.flex-container .third{display:flex;flex:0 1 30%;align-items:center;font-weight:600;font-size:.75rem}.flex-container .third.text-red,.flex-container .third.text-green,.flex-container .third.text-yellow{font-size:.75rem}.flex-container .third.text-red .mat-icon,.flex-container .third.text-red .material-icons-outlined,.flex-container .third.text-green .mat-icon,.flex-container .third.text-green .material-icons-outlined,.flex-container .third.text-yellow .mat-icon,.flex-container .third.text-yellow .material-icons-outlined{margin-right:1rem}.flex-container .third.text-red{color:var(--error)}.flex-container .third.text-yellow{color:var(--risk-yellow-dark)}.flex-container .third.text-green{color:var(--risk-green-dark)}.label-red,.label-yellow,.label-green{font-family:Open Sans;font-style:normal;font-weight:600;display:flex;text-align:center;margin-right:1rem;width:24px;height:24px;flex:0 0 24px;border-radius:1px}.label-red{background-color:var(--secondary);color:#fff}.label-yellow{background-color:var(--risk-yellow);color:#000000de}.label-green{background-color:var(--risk-green);color:#fff}\n"] }]
        }], ctorParameters: () => [{ type: i1.TranslateLibraryService }, { type: i2.MatDialogRef }, { type: i7.RiskResult, decorators: [{
                    type: Inject,
                    args: [MAT_DIALOG_DATA]
                }] }] });
//# sourceMappingURL=data:application/json;base64, 