/**
 * @packageDocumentation
 * @module code
 */
import { DIALOG_DATA } from '@alauda/ui';
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core';
import { readonlyOptions, viewActions, } from '../code-editor-configs';
import * as i0 from "@angular/core";
function CodeDisplayDialogComponent_span_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 3);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r0.data.extra);
} }
export class CodeDisplayDialogComponent {
    constructor(data) {
        this.data = data;
        this.editorActions = viewActions;
        this.codeEditorOptions = {
            ...readonlyOptions,
            language: data.language || 'yaml',
        };
    }
}
CodeDisplayDialogComponent.ɵfac = function CodeDisplayDialogComponent_Factory(t) { return new (t || CodeDisplayDialogComponent)(i0.ɵɵdirectiveInject(DIALOG_DATA)); };
CodeDisplayDialogComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CodeDisplayDialogComponent, selectors: [["ng-component"]], decls: 8, vars: 12, consts: [[3, "divider"], ["class", "extra", 4, "ngIf"], [3, "ngModel", "options", "actionsConfig"], [1, "extra"]], template: function CodeDisplayDialogComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "aui-dialog-header", 0)(1, "div")(2, "span");
        i0.ɵɵtext(3);
        i0.ɵɵpipe(4, "translate");
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(5, CodeDisplayDialogComponent_span_5_Template, 2, 1, "span", 1);
        i0.ɵɵelementEnd()();
        i0.ɵɵelementStart(6, "aui-dialog-content");
        i0.ɵɵelement(7, "aui-code-editor", 2);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵproperty("divider", false);
        i0.ɵɵadvance(1);
        i0.ɵɵclassProp("ellipsis-dialog-header", ctx.data.ellipsis);
        i0.ɵɵadvance(1);
        i0.ɵɵclassProp("text-ellipsis", ctx.data.ellipsis);
        i0.ɵɵadvance(1);
        i0.ɵɵtextInterpolate1(" ", ctx.data.title || i0.ɵɵpipeBind1(4, 10, "view_yaml"), " ");
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.data.extra);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngModel", ctx.data.code || "")("options", ctx.codeEditorOptions)("actionsConfig", ctx.editorActions);
    } }, encapsulation: 2, changeDetection: 0 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CodeDisplayDialogComponent, [{
        type: Component,
        args: [{ preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, template: "<aui-dialog-header [divider]=\"false\">\n  <div [class.ellipsis-dialog-header]=\"data.ellipsis\">\n    <span [class.text-ellipsis]=\"data.ellipsis\">\n      {{ data.title || ('view_yaml' | translate) }}\n    </span>\n    <span\n      *ngIf=\"data.extra\"\n      class=\"extra\"\n      >{{ data.extra }}</span\n    >\n  </div>\n</aui-dialog-header>\n<aui-dialog-content>\n  <aui-code-editor\n    [ngModel]=\"data.code || ''\"\n    [options]=\"codeEditorOptions\"\n    [actionsConfig]=\"editorActions\"\n  ></aui-code-editor>\n</aui-dialog-content>\n" }]
    }], function () { return [{ type: undefined, decorators: [{
                type: Inject,
                args: [DIALOG_DATA]
            }] }]; }, null); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL2NvZGUvY29kZS1kaXNwbGF5LWRpYWxvZy9jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbW1vbi9zcmMvY29kZS9jb2RlLWRpc3BsYXktZGlhbG9nL3RlbXBsYXRlLmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE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