/**
 * @license
 * Copyright ASW (A Software World) All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file
 */
import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import * as i0 from "@angular/core";
import * as i1 from "@angular/material/dialog";
import * as i2 from "@angular/cdk/clipboard";
import * as i3 from "@angular/material/tooltip";
import * as i4 from "@angular/common";
import * as i5 from "@asoftwareworld/form-builder-pro/core";
export class AswJsonPreviewDialog {
    dialogRef;
    data;
    buttonTooltip = 'FormControl.CopyData';
    isCopyData = false;
    constructor(dialogRef, data) {
        this.dialogRef = dialogRef;
        this.data = data;
    }
    onNoClick() {
        this.dialogRef.close();
    }
    copyJsonData() {
        this.isCopyData = true;
        this.buttonTooltip = 'FormControl.Copied';
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AswJsonPreviewDialog, deps: [{ token: i1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: AswJsonPreviewDialog, selector: "asw-json-preview-dialog", ngImport: i0, template: "<mat-dialog-content class=\"mat-typography\">\r\n    <pre id=\"jsonPreviewContent\">{{data | json}}</pre>\r\n</mat-dialog-content>\r\n<mat-dialog-actions align=\"end\">\r\n    <button mat-raised-button\r\n            id=\"closeDialog\"\r\n            type=\"button\"\r\n            class=\"asw-button asw-button-primary asw-mb-1 asw-me-2\"\r\n            (click)=\"onNoClick()\">\r\n        {{'FormControl.Close' | aswTranslate}}\r\n    </button>\r\n    <button mat-raised-button \r\n            id=\"copyData\"\r\n            (click)=\"copyJsonData()\"\r\n            type=\"button\"\r\n            class=\"asw-button asw-button-info asw-mb-1\"\r\n            [cdkCopyToClipboard]=\"data | json\"            \r\n            [disabled]=\"isCopyData\"\r\n            matTooltip=\"{{buttonTooltip | aswTranslate}}\"\r\n            cdkFocusInitial>\r\n        {{buttonTooltip | aswTranslate}}\r\n    </button>\r\n</mat-dialog-actions>", dependencies: [{ kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i2.CdkCopyToClipboard, selector: "[cdkCopyToClipboard]", inputs: ["cdkCopyToClipboard", "cdkCopyToClipboardAttempts"], outputs: ["cdkCopyToClipboardCopied"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i4.JsonPipe, name: "json" }, { kind: "pipe", type: i5.AswTranslatePipe, name: "aswTranslate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: AswJsonPreviewDialog, decorators: [{
            type: Component,
            args: [{ selector: 'asw-json-preview-dialog', template: "<mat-dialog-content class=\"mat-typography\">\r\n    <pre id=\"jsonPreviewContent\">{{data | json}}</pre>\r\n</mat-dialog-content>\r\n<mat-dialog-actions align=\"end\">\r\n    <button mat-raised-button\r\n            id=\"closeDialog\"\r\n            type=\"button\"\r\n            class=\"asw-button asw-button-primary asw-mb-1 asw-me-2\"\r\n            (click)=\"onNoClick()\">\r\n        {{'FormControl.Close' | aswTranslate}}\r\n    </button>\r\n    <button mat-raised-button \r\n            id=\"copyData\"\r\n            (click)=\"copyJsonData()\"\r\n            type=\"button\"\r\n            class=\"asw-button asw-button-info asw-mb-1\"\r\n            [cdkCopyToClipboard]=\"data | json\"            \r\n            [disabled]=\"isCopyData\"\r\n            matTooltip=\"{{buttonTooltip | aswTranslate}}\"\r\n            cdkFocusInitial>\r\n        {{buttonTooltip | aswTranslate}}\r\n    </button>\r\n</mat-dialog-actions>" }]
        }], ctorParameters: function () { return [{ type: i1.MatDialogRef }, { type: undefined, decorators: [{
                    type: Inject,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