import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding, } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { ValueView } from '../../value-view';
import * as i0 from "@angular/core";
import * as i1 from "@angular/platform-browser";
import * as i2 from "../../value-view-label.component";
export class RichTextValueViewComponent extends ValueView {
    constructor(_domSanitizer, _changeDetector) {
        super();
        this._domSanitizer = _domSanitizer;
        this._changeDetector = _changeDetector;
        this.snow = true;
    }
    ngOnChanges(changes) {
        if (changes.value) {
            this.safeHtml = this._domSanitizer.bypassSecurityTrustHtml(this.value || '');
            this._changeDetector.markForCheck();
        }
    }
}
RichTextValueViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: RichTextValueViewComponent, deps: [{ token: i1.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
RichTextValueViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: RichTextValueViewComponent, selector: "ax-rich-text-value-view", host: { properties: { "class.ql-snow": "this.snow" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ax-value-view-label [label]=\"label\">\n  <span class=\"ql-editor\" [innerHTML]=\"safeHtml\"></span>\n</ax-value-view-label>\n", styles: [":host ::ng-deep .ql-editor .ax-quill-template-variable{display:inline;background-color:transparent;border:1px solid #bdc3c9;border-radius:5px;padding:1px 6px;cursor:pointer}:host ::ng-deep .ql-editor .ax-quill-template-variable:disabled{cursor:default}:host ::ng-deep .ql-editor .ax-quill-template-variable:hover{background-color:#efefef}:host ::ng-deep .ql-editor .ax-quill-template-variable.invalid{color:var(--warn-color-300);border:1px solid var(--warn-color-300)}.ql-editor{text-align:left;padding:0;-webkit-hyphens:auto;hyphens:auto}@page{margin:1in}\n", ":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%;margin-bottom:.25rem}\n"], dependencies: [{ kind: "component", type: i2.ValueViewLabelComponent, selector: "ax-value-view-label", inputs: ["label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: RichTextValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-rich-text-value-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-value-view-label [label]=\"label\">\n  <span class=\"ql-editor\" [innerHTML]=\"safeHtml\"></span>\n</ax-value-view-label>\n", styles: [":host ::ng-deep .ql-editor .ax-quill-template-variable{display:inline;background-color:transparent;border:1px solid #bdc3c9;border-radius:5px;padding:1px 6px;cursor:pointer}:host ::ng-deep .ql-editor .ax-quill-template-variable:disabled{cursor:default}:host ::ng-deep .ql-editor .ax-quill-template-variable:hover{background-color:#efefef}:host ::ng-deep .ql-editor .ax-quill-template-variable.invalid{color:var(--warn-color-300);border:1px solid var(--warn-color-300)}.ql-editor{text-align:left;padding:0;-webkit-hyphens:auto;hyphens:auto}@page{margin:1in}\n", ":host{display:grid;grid-template-rows:auto auto;align-items:center;font-weight:400;max-width:100%;width:100%;margin-bottom:.25rem}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.DomSanitizer }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { snow: [{
                type: HostBinding,
                args: ['class.ql-snow']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmljaC10ZXh0LXZhbHVlLXZpZXcuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3ZhbHVlLXZpZXcvdmFsdWUtdmlld3MvcmljaC10ZXh0LXZhbHVlLXZpZXcvcmljaC10ZXh0LXZhbHVlLXZpZXcuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3ZhbHVlLXZpZX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