import { __decorate, __param } from "tslib";
import { Component, Inject, ViewEncapsulation } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
var DialogConfirmComponent = /** @class */ (function () {
    function DialogConfirmComponent(dialogRef, data) {
        this.dialogRef = dialogRef;
        this.data = data;
    }
    DialogConfirmComponent.prototype.onNoClick = function () {
        this.dialogRef.close();
    };
    DialogConfirmComponent.ctorParameters = function () { return [
        { type: MatDialogRef },
        { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_DATA,] }] }
    ]; };
    DialogConfirmComponent = __decorate([
        Component({
            selector: 'sd-dialog-confirm',
            template: "<h1 mat-dialog-title class=\"\">\r\n  <mat-icon *ngIf=\"data?.icon\" [ngClass]=\"data?.icon\">\r\n    {{data?.icon}}\r\n  </mat-icon>{{data?.title || 'Confirm'}}\r\n</h1>\r\n<div mat-dialog-content>\r\n  <div [innerHtml]=\"data?.message\">\r\n  </div>\r\n  <div *ngIf=\"data?.input\">\r\n    <mat-form-field class=\"sd-form\" appearance=\"outline\">\r\n      <textarea class=\"sd-input\" matInput placeholder=\"{{data.input?.placeholder}}\" [(ngModel)]=\"value\"\r\n        autocomplete=\"off\" rows=\"5\" [maxlength]=\"data.input?.maxlength\"></textarea>\r\n      <span *ngIf=\"data.input?.maxlength\" matSuffix>{{value?.length || 0}}/{{data.input?.maxlength}}</span>\r\n    </mat-form-field>\r\n  </div>\r\n</div>\r\n<div mat-dialog-actions align=\"end\">\r\n  <button *ngIf=\"data?.noTitle\" mat-button (click)=\"onNoClick()\">{{data?.noTitle}}</button>\r\n  <button *ngIf=\"data?.yesTitle\" mat-raised-button [mat-dialog-close]=\"value || 'ACCEPT'\" color=\"primary\"\r\n    [disabled]=\"data.input?.required && !value\" cdkFocusInitial>{{data?.yesTitle}}</button>\r\n</div>",
            encapsulation: ViewEncapsulation.None,
            styles: [".sd-form{width:100%;font-size:14px}.sd-form.sd-form-with-information{width:calc(100% - 30px)}.sd-information{display:inline-block;text-align:center;margin:auto;width:30px}.cdk-overlay-container .mat-option{font-size:12px}.swal2-popup .swal2-content .swal2-html-container{line-height:1.7;color:#7c7c7e}.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month{opacity:1;cursor:pointer}.daterangepicker{z-index:99999}", "sd-dialog-confirm{padding:12px 16px;display:block}sd-dialog-confirm .mat-dialog-title{display:flex;align-items:center}sd-dialog-confirm .mat-dialog-title .mat-icon{margin-right:5px}sd-dialog-confirm .mat-dialog-content{margin:0 -16px 16px!important}sd-dialog-confirm .mat-button{background-color:#f5f5f5}"]
        }),
        __param(1, Inject(MAT_DIALOG_DATA))
    ], DialogConfirmComponent);
    return DialogConfirmComponent;
}());
export { DialogConfirmComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLWNvbmZpcm0uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vc3VwZXJkZXYtYW5ndWxhci1jb3JlLyIsInNvdXJjZXMiOlsibGliL2NvbXBvbmVudHMvZGlhbG9nLWNvbmZpcm0vZGlhbG9nLWNvbmZpcm0uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNyRSxPQUFPLEVBQUUsWUFBWSxFQUFFLGVBQWUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBeUJ6RTtJQUVFLGdDQUNTLFNBQStDLEVBQ3RCLElBQWdCO1FBRHpDLGNBQVMsR0FBVCxTQUFTLENBQXNDO1FBQ3RCLFNBQUksR0FBSixJQUFJLENBQVk7SUFBSSxDQUFDO0lBRXZELDBDQUFTLEdBQVQ7UUFDRSxJQUFJLENBQUMsU0FBUyxDQUFDLEtBQUssRUFBRSxDQUFDO0lBQ3pCLENBQUM7O2dCQUxtQixZQUFZO2dEQUM3Qix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