import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/components/button/v1";
function ModalFooterComponent_button_4_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 5);
    i0.ɵɵlistener("click", function ModalFooterComponent_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeButtonClicked.emit()); });
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵclassMap(ctx_r0.cancelButtonClass);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", ctx_r0.cancelButtonText, " ");
} }
export class ModalFooterComponent {
    constructor() {
        this.loading = false;
        this.error = '';
        this.saveButtonText = 'Save';
        this.saveButtonClass = 'primary';
        this.saveButtonDisabled = false;
        this.saveButtonLoading = false;
        this.cancelButtonText = 'Cancel';
        this.cancelButtonClass = 'secondary';
        // eslint-disable-next-line
        this.onSave = new EventEmitter();
        // eslint-disable-next-line
        this.closeButtonClicked = new EventEmitter();
    }
    static { this.ɵfac = function ModalFooterComponent_Factory(t) { return new (t || ModalFooterComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ModalFooterComponent, selectors: [["fusion-modal-footer"]], inputs: { loading: "loading", error: "error", saveButtonText: "saveButtonText", saveButtonClass: "saveButtonClass", saveButtonDisabled: "saveButtonDisabled", saveButtonLoading: "saveButtonLoading", cancelButtonText: "cancelButtonText", cancelButtonClass: "cancelButtonClass", cancelButtonHidden: "cancelButtonHidden", notificationFooter: "notificationFooter" }, outputs: { onSave: "onSave", closeButtonClicked: "closeButtonClicked" }, decls: 7, vars: 7, consts: [[1, "modal-footer"], [1, "footer"], [1, "fu-error-message"], ["fusion-button", "", 3, "class", "click", 4, "ngIf"], ["fusion-button", "", 3, "loading", "disabled", "click"], ["fusion-button", "", 3, "click"]], template: function ModalFooterComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "span", 2);
            i0.ɵɵtext(3);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(4, ModalFooterComponent_button_4_Template, 2, 3, "button", 3);
            i0.ɵɵelementStart(5, "button", 4);
            i0.ɵɵlistener("click", function ModalFooterComponent_Template_button_click_5_listener() { return ctx.onSave.emit(); });
            i0.ɵɵtext(6);
            i0.ɵɵelementEnd()()();
        } if (rf & 2) {
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(ctx.error);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.cancelButtonHidden);
            i0.ɵɵadvance();
            i0.ɵɵclassMap(ctx.saveButtonClass);
            i0.ɵɵproperty("loading", ctx.saveButtonLoading)("disabled", ctx.saveButtonDisabled || ctx.loading || !!ctx.error);
            i0.ɵɵadvance();
            i0.ɵɵtextInterpolate1(" ", ctx.saveButtonText, " ");
        } }, dependencies: [i1.NgIf, i2.ButtonComponent], styles: ["[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-radius:var(--border-radius, 3px)}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top:1px solid var(--light-color, #E1E6EB)}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top-right-radius:0!important}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top-left-radius:0!important}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{height:62px;background-color:var(--light-color-100, #F9FAFB);padding:15px 30px 15px 15px;box-sizing:border-box}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{vertical-align:middle}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   button[_ngcontent-%COMP%] + button[_ngcontent-%COMP%]{margin-left:10px}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   .fu-error-message[_ngcontent-%COMP%]{color:var(--negative-color, #e1174c);margin-right:15px}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ModalFooterComponent, [{
        type: Component,
        args: [{ selector: 'fusion-modal-footer', template: "<div class=\"modal-footer\">\n    <div class=\"footer\">\n        <span class=\"fu-error-message\">{{ error }}</span>\n        <button\n            fusion-button\n            [class]=\"cancelButtonClass\"\n            (click)=\"closeButtonClicked.emit()\"\n            *ngIf=\"!cancelButtonHidden\"\n        >\n            {{ cancelButtonText }}\n        </button>\n        <button\n            fusion-button\n            [class]=\"saveButtonClass\"\n            [loading]=\"saveButtonLoading\"\n            [disabled]=\"saveButtonDisabled || loading || !!error\"\n            (click)=\"onSave.emit()\"\n        >\n            {{ saveButtonText }}\n        </button>\n    </div>\n</div>\n", styles: [":host .modal-footer{border-radius:var(--border-radius, 3px)}:host .modal-footer{border-top:1px solid var(--light-color, #E1E6EB)}:host .modal-footer{border-top-right-radius:0!important}:host .modal-footer{border-top-left-radius:0!important}:host .modal-footer{height:62px;background-color:var(--light-color-100, #F9FAFB);padding:15px 30px 15px 15px;box-sizing:border-box}:host .modal-footer div{text-align:right}:host .modal-footer div button{vertical-align:middle}:host .modal-footer div button+button{margin-left:10px}:host .modal-footer div .fu-error-message{color:var(--negative-color, #e1174c);margin-right:15px}\n"] }]
    }], null, { loading: [{
            type: Input
        }], error: [{
            type: Input
        }], saveButtonText: [{
            type: Input
        }], saveButtonClass: [{
            type: Input
        }], saveButtonDisabled: [{
            type: Input
        }], saveButtonLoading: [{
            type: Input
        }], cancelButtonText: [{
            type: Input
        }], cancelButtonClass: [{
            type: Input
        }], cancelButtonHidden: [{
            type: Input
        }], notificationFooter: [{
            type: Input
        }], onSave: [{
            type: Output
        }], closeButtonClicked: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ModalFooterComponent, { className: "ModalFooterComponent", filePath: "components/modal-footer/modal-footer.component.ts", lineNumber: 8 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kYWwtZm9vdGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL21vZGFsL3YxL2NvbXBvbmVudHMvbW9kYWwtZm9vdGVyL21vZGFsLWZvb3Rlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9mdXNpb24tdWkvY29tcG9uZW50cy9tb2RhbC92MS9jb21wb25lbnRzL21vZGFsLWZvb3Rlci9tb2RhbC1mb290ZXIuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBQyxNQUFNLGVBQWUsQ0FBQzs7Ozs7O0lDRzdELGlDQUtDO0lBRkcsb0tBQVMsZUFBQSxnQ0FBeUIsQ0FBQSxJQUFDO0lBR25DLFlBQ0o7SUFBQSxpQkFBUzs7O0lBTEwsdUNBQTJCO0lBSTNCLGNBQ0o7SUFESSx3REFDSjs7QURIUixNQUFNLE9BQU8sb0JBQW9CO0lBTGpDO1FBTWEsWUFBTyxHQUFHLEtBQUssQ0FBQztRQUNoQixVQUFLLEdBQUcsRUFBRSxDQUFDO1FBQ1gsbUJBQWMsR0FBRyxNQUFNLENBQUM7UUFDeEIsb0JBQWUsR0FBRyxTQUFTLEN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