import { Component, Input } from '@angular/core';
import { CaseField } from '../../../domain/definition/case-field.model';
import * as i0 from "@angular/core";
function LabelFieldComponent_ccd_markdown_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ccd-markdown", 2);
    i0.ɵɵpipe(1, "rpxTranslate");
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("content", i0.ɵɵpipeBind1(1, 1, ctx_r0.caseField.label));
} }
function LabelFieldComponent_ccd_markdown_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ccd-markdown", 2);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("content", ctx_r0.caseField.label);
} }
function LabelFieldComponent_ccd_markdown_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ccd-markdown", 2);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("content", ctx_r0.caseField.value || ctx_r0.caseField.label);
} }
export class LabelFieldComponent {
    caseField;
    caseFields = [];
    labelCanBeTranslated = false;
    static ɵfac = function LabelFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LabelFieldComponent)(); };
    static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LabelFieldComponent, selectors: [["ccd-label-field"]], inputs: { caseField: "caseField", caseFields: "caseFields", labelCanBeTranslated: "labelCanBeTranslated" }, decls: 6, vars: 7, consts: [["ccdLabelSubstitutor", "", 1, "case-field", 3, "hidden", "caseField", "contextFields", "id"], [3, "content", 4, "ngIf"], [3, "content"]], template: function LabelFieldComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "dl", 0)(1, "dt");
            i0.ɵɵtemplate(2, LabelFieldComponent_ccd_markdown_2_Template, 2, 3, "ccd-markdown", 1)(3, LabelFieldComponent_ccd_markdown_3_Template, 1, 1, "ccd-markdown", 1)(4, LabelFieldComponent_ccd_markdown_4_Template, 1, 1, "ccd-markdown", 1);
            i0.ɵɵelementEnd();
            i0.ɵɵelement(5, "dd");
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵproperty("hidden", ctx.caseField.hidden)("caseField", ctx.caseField)("contextFields", ctx.caseFields)("id", ctx.caseField.id);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.labelCanBeTranslated && !ctx.caseField.isTranslated);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.labelCanBeTranslated && ctx.caseField.isTranslated);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.labelCanBeTranslated);
        } }, encapsulation: 2 });
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LabelFieldComponent, [{
        type: Component,
        args: [{ selector: 'ccd-label-field', template: "<dl [hidden]=\"caseField.hidden\" class=\"case-field\" ccdLabelSubstitutor [caseField]=\"caseField\" [contextFields]=\"caseFields\" [id]=\"caseField.id\">\n  <dt>\n    <ccd-markdown *ngIf=\"labelCanBeTranslated && !caseField.isTranslated\" [content]=\"caseField.label | rpxTranslate\">\n    </ccd-markdown>\n\n    <ccd-markdown *ngIf=\"labelCanBeTranslated && caseField.isTranslated\" [content]=\"caseField.label\">\n    </ccd-markdown>\n\n    <ccd-markdown *ngIf=\"!labelCanBeTranslated\" [content]=\"caseField.value || caseField.label\">\n    </ccd-markdown>\n  </dt>\n  <dd></dd>\n</dl>\n" }]
    }], null, { caseField: [{
            type: Input
        }], caseFields: [{
            type: Input
        }], labelCanBeTranslated: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LabelFieldComponent, { className: "LabelFieldComponent", filePath: "lib/shared/components/palette/label/label-field.component.ts", lineNumber: 8 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFiZWwtZmllbGQuY29tcG9uZW50LmpzIiwic291cmNlUm9vd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