import { Component } from '@angular/core';
import { MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/legacy-dialog";
import * as i2 from "rpx-xui-translation";
export class SaveOrDiscardDialogComponent {
    matDialogRef;
    result;
    constructor(matDialogRef) {
        this.matDialogRef = matDialogRef;
    }
    cancel() {
        this.result = 'Cancel';
        this.matDialogRef.close(this.result);
    }
    save() {
        this.result = 'Save';
        this.matDialogRef.close(this.result);
    }
    discard() {
        this.result = 'Discard';
        this.matDialogRef.close(this.result);
    }
    static ɵfac = function SaveOrDiscardDialogComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SaveOrDiscardDialogComponent)(i0.ɵɵdirectiveInject(i1.MatLegacyDialogRef)); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SaveOrDiscardDialogComponent, selectors: [["ccd-save-or-discard-dialog"]], decls: 19, vars: 12, consts: [[1, "dialog-header"], [1, "heading-h2", "x", 3, "click"], [1, "heading-h2", "dialog-title"], [1, "dialog-info"], [1, "text-info"], ["type", "button", "title", "Save", 1, "button", "action-button", 3, "click"], ["type", "button", "title", "Discard", 1, "button", "button-secondary", 3, "click"]], template: function SaveOrDiscardDialogComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2", 1);
            i0.ɵɵlistener("click", function SaveOrDiscardDialogComponent_Template_h2_click_2_listener() { return ctx.cancel(); });
            i0.ɵɵtext(3, "X");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(4, "div")(5, "h2", 2);
            i0.ɵɵtext(6);
            i0.ɵɵpipe(7, "rpxTranslate");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(8, "div", 3)(9, "span", 4);
            i0.ɵɵtext(10);
            i0.ɵɵpipe(11, "rpxTranslate");
            i0.ɵɵelementEnd()();
            i0.ɵɵelementStart(12, "div")(13, "button", 5);
            i0.ɵɵlistener("click", function SaveOrDiscardDialogComponent_Template_button_click_13_listener() { return ctx.save(); });
            i0.ɵɵtext(14);
            i0.ɵɵpipe(15, "rpxTranslate");
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(16, "button", 6);
            i0.ɵɵlistener("click", function SaveOrDiscardDialogComponent_Template_button_click_16_listener() { return ctx.discard(); });
            i0.ɵɵtext(17);
            i0.ɵɵpipe(18, "rpxTranslate");
            i0.ɵɵelementEnd()()();
        } if (rf & 2) {
            i0.ɵɵadvance(6);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(7, 4, "Would you like to save changes to this page?"));
            i0.ɵɵadvance(4);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(11, 6, "You will be taken back to your case list."));
            i0.ɵɵadvance(4);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(15, 8, "Save"));
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(18, 10, "Discard"));
        } }, dependencies: [i2.RpxTranslatePipe], styles: [".x[_ngcontent-%COMP%]{margin:0;padding:9px 9px 0 0;font-size:24px;font-weight:700;font-style:normal;font-stretch:normal;cursor:pointer;color:#6e7071}@media (prefers-color-scheme: dark){.dialog-title[_ngcontent-%COMP%], .dialog-info[_ngcontent-%COMP%]{color:#000}}.dialog-header[_ngcontent-%COMP%]{text-align:right}.dialog-title[_ngcontent-%COMP%], .dialog-info[_ngcontent-%COMP%]{margin:0 0 21px 25px}.action-button[_ngcontent-%COMP%]{margin:0 15px 0 25px}"] });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SaveOrDiscardDialogComponent, [{
        type: Component,
        args: [{ selector: 'ccd-save-or-discard-dialog', template: "<div>\n  <div class=\"dialog-header\">\n    <h2 (click)=\"cancel()\" class=\"heading-h2 x\">X</h2>\n  </div>\n  <div>\n    <h2 class=\"heading-h2 dialog-title\">{{'Would you like to save changes to this page?' | rpxTranslate}}</h2>\n  </div>\n  <div class=\"dialog-info\">\n    <span class=\"text-info\">{{'You will be taken back to your case list.' | rpxTranslate}}</span>\n  </div>\n  <div>\n    <button type=\"button\" title=\"Save\" class=\"button action-button\" (click)=\"save()\">{{'Save' | rpxTranslate}}</button>\n    <button type=\"button\" title=\"Discard\" class=\"button button-secondary\" (click)=\"discard()\">{{'Discard' | rpxTranslate}}</button>\n  </div>\n</div>\n", styles: [".x{margin:0;padding:9px 9px 0 0;font-size:24px;font-weight:700;font-style:normal;font-stretch:normal;cursor:pointer;color:#6e7071}@media (prefers-color-scheme: dark){.dialog-title,.dialog-info{color:#000}}.dialog-header{text-align:right}.dialog-title,.dialog-info{margin:0 0 21px 25px}.action-button{margin:0 15px 0 25px}\n"] }]
    }], () => [{ type: i1.MatLegacyDialogRef }], null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SaveOrDiscardDialogComponent, { className: "SaveOrDiscardDialogComponent", filePath: "lib/shared/components/dialogs/save-or-discard-dialog/save-or-discard-dialog.component.ts", lineNumber: 9 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2F2ZS1vci1kaXNjYXJkLWRpYWxvZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jY2QtY2FzZS11aS10b29sa2l0L3NyYy9saWIvc2hhcmVkL2NvbXBvbmVudHMvZGlhbG9ncy9zYXZlLW9yLWRpc2NhcmQtZGlhbG9nL3NhdmUtb3ItZGlzY2FyZC1kaWFsb2cuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NkLWNhc2UtdWktdG9vbGtpdC9zcmMvbGliL3NoYXJlZC9jb21wb25lbnRzL2RpYWxvZ3Mvc2F2ZS1vci1kaXNjYXJkLWRpYWxvZy9zYXZlLW9yLWRpc2NhcmQtZGl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