import * as i0 from '@angular/core';
import { Component, Input, ViewChild, PLATFORM_ID, Renderer2, ElementRef, ViewEncapsulation, Inject, EventEmitter, forwardRef, Optional, Host, Self, Output, ContentChild, Directive, NgModule } from '@angular/core';
import * as i1 from '@angular/platform-browser';
import * as i3 from '@angular/common';
import { isPlatformServer, CommonModule } from '@angular/common';
import * as i4 from '@eui/externals/quill';
import { getFormat, defaultModules, QuillModule } from '@eui/externals/quill';
import QuillType from 'quill';
import * as i1$1 from '@angular/forms';
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { distinctUntilChanged, takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
import * as i2 from '@eui/components';
import { UxFormGroupComponent } from '@eui/components';

const _c0$1 = ["editor"];
class UxEditorViewHTMLComponent {
    constructor(sanitizer, renderer) {
        this.sanitizer = sanitizer;
        this.renderer = renderer;
        this.content = '';
        this.theme = 'snow';
        this.styles = null;
        this.innerHTML = '';
        this.themeClass = 'ql-snow';
    }
    ngOnChanges(changes) {
        if (changes && changes.theme) {
            const theme = changes.theme.currentValue || this.theme;
            this.themeClass = `ql-${theme}`;
        }
        else if (!this.theme) {
            this.themeClass = 'ql-snow';
        }
        if (changes && changes.styles) {
            this.styles = changes.styles.currentValue;
            if (this.styles) {
                this._setStyles(this.editorElementRef, this.styles);
            }
        }
        if (changes && changes.content) {
            // this.innerHTML = this.sanitizer.sanitize(SecurityContext.HTML, changes.content.currentValue);
            this.innerHTML = this.sanitizer.bypassSecurityTrustHtml(changes.content.currentValue);
        }
    }
    _setStyles(element, styles) {
        if (styles) {
            Object.keys(styles).forEach((key) => {
                this.renderer.setStyle(element.nativeElement, key, styles[key]);
            });
        }
    }
}
/** @nocollapse */ UxEditorViewHTMLComponent.ɵfac = function UxEditorViewHTMLComponent_Factory(t) { return new (t || UxEditorViewHTMLComponent)(i0.ɵɵdirectiveInject(i1.DomSanitizer), i0.ɵɵdirectiveInject(i0.Renderer2)); };
/** @nocollapse */ UxEditorViewHTMLComponent.ɵcmp = i0.ɵɵdefineComponent({ type: UxEditorViewHTMLComponent, selectors: [["ux-editor-view-html"]], viewQuery: function UxEditorViewHTMLComponent_Query(rf, ctx) { if (rf & 1) {
        i0.ɵɵstaticViewQuery(_c0$1, true);
    } if (rf & 2) {
        var _t;
        i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.editorElementRef = _t.first);
    } }, inputs: { content: "content", theme: "theme", styles: "styles" }, features: [i0.ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [[1, "ql-container", 3, "ngClass"], ["editor", ""], [1, "ql-editor", 3, "innerHTML"]], template: function UxEditorViewHTMLComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0, 1);
        i0.ɵɵelement(2, "div", 2);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵproperty("ngClass", ctx.themeClass);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("innerHTML", ctx.innerHTML, i0.ɵɵsanitizeHtml);
    } }, directives: [i3.NgClass], encapsulation: 2 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(UxEditorViewHTMLComponent, [{
        type: Component,
        args: [{
                selector: 'ux-editor-view-html',
                template: `
    <div #editor class="ql-container" [ngClass]="themeClass">
        <div class="ql-editor" [innerHTML]="innerHTML"></div>
    </div>
    `
            }]
    }], function () { return [{ type: i1.DomSanitizer }, { type: i0.Renderer2 }]; }, { content: [{
            type: Input
        }], theme: [{
            type: Input
        }], styles: [{
            type: Input
        }], editorElementRef: [{
            type: ViewChild,
            args: ['editor', { static: true }]
        }] }); })();

class UxEditorViewComponent {
    constructor(platformId, renderer, elementRef) {
        this.platformId = platformId;
        this.renderer = renderer;
        this.elementRef = elementRef;
        this.theme = 'snow';
        this.debug = false;
        this.strict = true;
        this.customOptions = [];
        this.preserveWhitespace = false;
        this.styles = null;
        this.valueSetter = (quillEditor, value) => {
            const format = getFormat(this.format);
            let content = value;
            if (format === 'html' || format === 'text') {
                content = quillEditor.clipboard.convert(value);
            }
            else if (format === 'json') {
                try {
                    content = JSON.parse(value);
                }
                catch (e) {
                    console.warn('JSON parse error!');
                    content = [{ insert: value }];
                }
            }
            quillEditor.setContents(content);
        };
    }
    ngOnChanges(changes) {
        if (!this.quillEditor) {
            return;
        }
        if (changes.content) {
            this.valueSetter(this.quillEditor, changes.content.currentValue);
        }
    }
    ngAfterViewInit() {
        if (isPlatformServer(this.platformId)) {
            return;
        }
        const modules = Object.assign({}, this.modules || (this.modules || defaultModules));
        modules.toolbar = false;
        this.customOptions.forEach((customOption) => {
            const newCustomOption = QuillType.import(customOption.import);
            newCustomOption.whitelist = customOption.whitelist;
            QuillType.register(newCustomOption, true);
        });
        let debug = this.debug;
        if (!debug && debug !== false && this.debug) {
            debug = this.debug;
        }
        let formats = this.formats;
        if (!formats && formats === undefined) {
            formats = this.formats ? Object.assign({}, this.formats) : (this.formats === null ? null : undefined);
        }
        const theme = this.theme || (this.theme ? this.theme : 'snow');
        this.elementRef.nativeElement.insertAdjacentHTML('afterbegin', this.preserveWhitespace ? '<pre quill-view-element></pre>' : '<div quill-view-element></div>');
        this.editorElem = this.elementRef.nativeElement.querySelector('[quill-view-element]');
        this.quillEditor = new QuillType(this.editorElem, {
            debug,
            formats,
            modules,
            readOnly: true,
            strict: this.strict,
            theme
        });
        this.renderer.addClass(this.editorElem, 'ngx-quill-view');
        if (this.content) {
            this.valueSetter(this.quillEditor, this.content);
        }
    }
}
/** @nocollapse */ UxEditorViewComponent.ɵfac = function UxEditorViewComponent_Factory(t) { return new (t || UxEditorViewComponent)(i0.ɵɵdirectiveInject(PLATFORM_ID), i0.ɵɵdirectiveInject(Renderer2), i0.ɵɵdirectiveInject(ElementRef)); };
/** @nocollapse */ UxEditorViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: UxEditorViewComponent, selectors: [["ux-editor-view"]], inputs: { format: "format", theme: "theme", modules: "modules", debug: "debug", formats: "formats", strict: "strict", content: "content", customOptions: "customOptions", preserveWhitespace: "preserveWhitespace", styles: "styles" }, features: [i0.ɵɵNgOnChangesFeature], decls: 0, vars: 0, template: function UxEditorViewComponent_Template(rf, ctx) { }, styles: ["\n        .ql-container.ngx-quill-view {\n            border: 0;\n        }\n    "], encapsulation: 2 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(UxEditorViewComponent, [{
        type: Component,
        args: [{
                selector: 'ux-editor-view',
                styles: [`
        .ql-container.ngx-quill-view {
            border: 0;
        }
    `],
                template: ``,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return [{ type: undefined, decorators: [{
                type: Inject,
                args: [PLATFORM_ID]
            }] }, { type: i0.Renderer2, decorators: [{
                type: Inject,
                args: [Renderer2]
            }] }, { type: i0.ElementRef, decorators: [{
                type: Inject,
                args: [ElementRef]
            }] }]; }, { format: [{
            type: Input
        }], theme: [{
            type: Input
        }], modules: [{
            type: Input
        }], debug: [{
            type: Input
        }], formats: [{
            type: Input
        }], strict: [{
            type: Input
        }], content: [{
            type: Input
        }], customOptions: [{
            type: Input
        }], preserveWhitespace: [{
            type: Input
        }], styles: [{
            type: Input
        }] }); })();

class UxEditorCountersComponent {
    constructor() {
        this.isMaxLengthValid = true;
    }
}
/** @nocollapse */ UxEditorCountersComponent.ɵfac = function UxEditorCountersComponent_Factory(t) { return new (t || UxEditorCountersComponent)(); };
/** @nocollapse */ UxEditorCountersComponent.ɵcmp = i0.ɵɵdefineComponent({ type: UxEditorCountersComponent, selectors: [["ux-editor-counters"]], inputs: { charactersCounter: "charactersCounter", charactersLabel: "charactersLabel", wordsCounter: "wordsCounter", wordsLabel: "wordsLabel", isMaxLengthValid: "isMaxLengthValid" }, decls: 11, vars: 6, consts: [[1, "editor-counters"], [1, "flex-container", "flex-column", "mr-2"], [1, "chars-counter"], [1, "chars-label"], [1, "flex-container", "flex-column"], [1, "words-counter"], [1, "words-label"]], template: function UxEditorCountersComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "button", 0);
        i0.ɵɵelementStart(1, "div", 1);
        i0.ɵɵelementStart(2, "span", 2);
        i0.ɵɵtext(3);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(4, "span", 3);
        i0.ɵɵtext(5);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(6, "div", 4);
        i0.ɵɵelementStart(7, "span", 5);
        i0.ɵɵtext(8);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(9, "span", 6);
        i0.ɵɵtext(10);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(2);
        i0.ɵɵclassProp("chars-counter--error", !ctx.isMaxLengthValid);
        i0.ɵɵadvance(1);
        i0.ɵɵtextInterpolate(ctx.charactersCounter);
        i0.ɵɵadvance(2);
        i0.ɵɵtextInterpolate(ctx.charactersLabel);
        i0.ɵɵadvance(3);
        i0.ɵɵtextInterpolate(ctx.wordsCounter);
        i0.ɵɵadvance(2);
        i0.ɵɵtextInterpolate(ctx.wordsLabel);
    } }, styles: ["\n    "], encapsulation: 2 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(UxEditorCountersComponent, [{
        type: Component,
        args: [{
                selector: 'ux-editor-counters',
                styles: [`
    `],
                template: `
    <button class="editor-counters">
        <div class="flex-container flex-column mr-2">
            <span class="chars-counter" [class.chars-counter--error]="!isMaxLengthValid">{{charactersCounter}}</span>
            <span class="chars-label">{{charactersLabel}}</span>
        </div>
        <div class="flex-container flex-column">
            <span class="words-counter">{{wordsCounter}}</span>
            <span class="words-label">{{wordsLabel}}</span>
        </div>
    </button>
    `,
                encapsulation: ViewEncapsulation.None,
            }]
    }], function () { return []; }, { charactersCounter: [{
            type: Input
        }], charactersLabel: [{
            type: Input
        }], wordsCounter: [{
            type: Input
        }], wordsLabel: [{
            type: Input
        }], isMaxLengthValid: [{
            type: Input
        }] }); })();

// tslint:disable:max-line-length
function UxEditorComponent_quill_editor_1_div_1_span_17_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 8);
    i0.ɵɵelementStart(1, "select", 41);
    i0.ɵɵelementStart(2, "option", 16);
    i0.ɵɵtext(3, "Sans Serif");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "option", 42);
    i0.ɵɵtext(5, "Serif");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "option", 43);
    i0.ɵɵtext(7, "Monospace");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r6 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Font", ctx_r6.crlf, "Change the font face");
} }
function UxEditorComponent_quill_editor_1_div_1_span_26_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 8);
    i0.ɵɵelement(1, "button", 44);
    i0.ɵɵelement(2, "button", 45);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Subscript", ctx_r7.crlf, "Create ssmall letters below the text baseline");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Superscript", ctx_r7.crlf, "Create small letters above the line of the text");
} }
function UxEditorComponent_quill_editor_1_div_1_span_33_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 8);
    i0.ɵɵelement(1, "button", 46);
    i0.ɵɵelement(2, "button", 47);
    i0.ɵɵelement(3, "button", 48);
    i0.ɵɵelement(4, "button", 49);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r8 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Numbering", ctx_r8.crlf, "Start an ordered list");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Bullets", ctx_r8.crlf, "Start a bulleted list");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Decrease Indent", ctx_r8.crlf, "Decrease the indent level of the paragraph");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Increase Indent", ctx_r8.crlf, "Increase the indent level of the paragraph");
} }
function UxEditorComponent_quill_editor_1_div_1_button_35_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "button", 50);
} if (rf & 2) {
    const ctx_r9 = i0.ɵɵnextContext(3);
    i0.ɵɵpropertyInterpolate1("title", "Blockquote", ctx_r9.crlf, "Create a quoted block of the selected text");
} }
function UxEditorComponent_quill_editor_1_div_1_button_36_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "button", 51);
} if (rf & 2) {
    const ctx_r10 = i0.ɵɵnextContext(3);
    i0.ɵɵpropertyInterpolate1("title", "Insert Code Block", ctx_r10.crlf, "Insert a code block at the cursor row position");
} }
function UxEditorComponent_quill_editor_1_div_1_button_38_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "button", 52);
} if (rf & 2) {
    const ctx_r11 = i0.ɵɵnextContext(3);
    i0.ɵɵpropertyInterpolate1("title", "Insert Picture", ctx_r11.crlf, "Insert a picture from a file");
} }
function UxEditorComponent_quill_editor_1_div_1_button_39_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "button", 53);
    i0.ɵɵelement(1, "span", 54);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r12 = i0.ɵɵnextContext(3);
    i0.ɵɵpropertyInterpolate1("title", "Insert Picture from URL", ctx_r12.crlf, "Insert a picture from a remote URL");
} }
function UxEditorComponent_quill_editor_1_div_1_button_40_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "button", 55);
} if (rf & 2) {
    const ctx_r13 = i0.ɵɵnextContext(3);
    i0.ɵɵpropertyInterpolate1("title", "Insert Video", ctx_r13.crlf, "Insert a video from a file");
} }
function UxEditorComponent_quill_editor_1_div_1_span_50_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 8);
    i0.ɵɵelement(1, "ux-editor-counters", 56);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r14 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Counters", ctx_r14.crlf, "Characters and words counters (stripped Html)");
    i0.ɵɵproperty("charactersCounter", ctx_r14.charactersCounter)("charactersLabel", ctx_r14.charactersLabel)("wordsCounter", ctx_r14.wordsCounter)("wordsLabel", ctx_r14.wordsLabel)("isMaxLengthValid", ctx_r14.isMaxLengthValid);
} }
function UxEditorComponent_quill_editor_1_div_1_Template(rf, ctx) { if (rf & 1) {
    const _r16 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵlistener("focusin", function UxEditorComponent_quill_editor_1_div_1_Template_div_focusin_0_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return ctx_r15.onToolbarFocusIn($event); })("focusout", function UxEditorComponent_quill_editor_1_div_1_Template_div_focusout_0_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r17 = i0.ɵɵnextContext(2); return ctx_r17.onToolbarFocusOut($event); });
    i0.ɵɵelementStart(1, "span", 8);
    i0.ɵɵelementStart(2, "select", 9);
    i0.ɵɵelementStart(3, "option", 10);
    i0.ɵɵtext(4, "Heading 1");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "option", 11);
    i0.ɵɵtext(6, "Heading 2");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "option", 12);
    i0.ɵɵtext(8, "Heading 3");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "option", 13);
    i0.ɵɵtext(10, "Heading 4");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "option", 14);
    i0.ɵɵtext(12, "Heading 5");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(13, "option", 15);
    i0.ɵɵtext(14, "Heading 6");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(15, "option", 16);
    i0.ɵɵtext(16, "Normal");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(17, UxEditorComponent_quill_editor_1_div_1_span_17_Template, 8, 1, "span", 17);
    i0.ɵɵelementStart(18, "span", 8);
    i0.ɵɵelement(19, "button", 18);
    i0.ɵɵelement(20, "button", 19);
    i0.ɵɵelement(21, "button", 20);
    i0.ɵɵelement(22, "button", 21);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(23, "span", 8);
    i0.ɵɵelement(24, "select", 22);
    i0.ɵɵelement(25, "select", 23);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(26, UxEditorComponent_quill_editor_1_div_1_span_26_Template, 3, 2, "span", 17);
    i0.ɵɵelementStart(27, "span", 8);
    i0.ɵɵelementStart(28, "select", 24);
    i0.ɵɵelement(29, "option", 16);
    i0.ɵɵelement(30, "option", 25);
    i0.ɵɵelement(31, "option", 26);
    i0.ɵɵelement(32, "option", 27);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(33, UxEditorComponent_quill_editor_1_div_1_span_33_Template, 5, 4, "span", 17);
    i0.ɵɵelementStart(34, "span", 8);
    i0.ɵɵtemplate(35, UxEditorComponent_quill_editor_1_div_1_button_35_Template, 1, 1, "button", 28);
    i0.ɵɵtemplate(36, UxEditorComponent_quill_editor_1_div_1_button_36_Template, 1, 1, "button", 29);
    i0.ɵɵelement(37, "button", 30);
    i0.ɵɵtemplate(38, UxEditorComponent_quill_editor_1_div_1_button_38_Template, 1, 1, "button", 31);
    i0.ɵɵtemplate(39, UxEditorComponent_quill_editor_1_div_1_button_39_Template, 2, 1, "button", 32);
    i0.ɵɵtemplate(40, UxEditorComponent_quill_editor_1_div_1_button_40_Template, 1, 1, "button", 33);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(41, "span", 8);
    i0.ɵɵelement(42, "button", 34);
    i0.ɵɵelementStart(43, "button", 35);
    i0.ɵɵlistener("click", function UxEditorComponent_quill_editor_1_div_1_Template_button_click_43_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r18 = i0.ɵɵnextContext(2); return ctx_r18.editorDeleteContent($event); });
    i0.ɵɵelement(44, "span", 36);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(45, "span", 8);
    i0.ɵɵelementStart(46, "button", 37);
    i0.ɵɵlistener("click", function UxEditorComponent_quill_editor_1_div_1_Template_button_click_46_listener() { i0.ɵɵrestoreView(_r16); const ctx_r19 = i0.ɵɵnextContext(2); return ctx_r19.editorUndo(); });
    i0.ɵɵelement(47, "span", 38);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(48, "button", 39);
    i0.ɵɵlistener("click", function UxEditorComponent_quill_editor_1_div_1_Template_button_click_48_listener() { i0.ɵɵrestoreView(_r16); const ctx_r20 = i0.ɵɵnextContext(2); return ctx_r20.editorRedo(); });
    i0.ɵɵelement(49, "span", 40);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(50, UxEditorComponent_quill_editor_1_div_1_span_50_Template, 2, 6, "span", 17);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("title", "Style", ctx_r4.crlf, "Apply an HTML tag or CSS class to the selected text");
    i0.ɵɵadvance(15);
    i0.ɵɵproperty("ngIf", !ctx_r4.isMinimalToolbar);
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("title", "Bold (Ctrl + B)", ctx_r4.crlf, "Make the selected text bold");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Italic (Ctrl + I)", ctx_r4.crlf, "Italicize the selected text");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Underline (Ctrl + U)", ctx_r4.crlf, "Underline the selected text");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Strikethrough", ctx_r4.crlf, "Draw a line to the middle of the selected text");
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("title", "Font Color", ctx_r4.crlf, "Change the text color");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Text Highlight Color", ctx_r4.crlf, "Change the background color of the text");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r4.isMinimalToolbar);
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("title", "Text Align", ctx_r4.crlf, "Align the text to the selected position: left (default), center, right or justify");
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("ngIf", !ctx_r4.isMinimalToolbar);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", !ctx_r4.isMinimalToolbar);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r4.isMinimalToolbar);
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Insert Hyperlink (Ctrl + K)", ctx_r4.crlf, "Create a link to a Web page, a picture, an e-mail address or a program");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r4.isImageUrl);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r4.isImageUrl);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r4.isMinimalToolbar);
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("title", "Remove Styles", ctx_r4.crlf, "Remove the styles of the selected text");
    i0.ɵɵadvance(1);
    i0.ɵɵpropertyInterpolate1("title", "Delete content", ctx_r4.crlf, "Permanently deletes editor's contents");
    i0.ɵɵadvance(3);
    i0.ɵɵpropertyInterpolate1("title", "Undo (Ctrl + Z)", ctx_r4.crlf, "Cancels the previous action");
    i0.ɵɵadvance(2);
    i0.ɵɵpropertyInterpolate1("title", "Redo (Ctrl + Y)", ctx_r4.crlf, "Do the next history action again");
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r4.showCounters && (ctx_r4.format === "html" || ctx_r4.format === "text"));
} }
function UxEditorComponent_quill_editor_1_div_2_Template(rf, ctx) { if (rf & 1) {
    const _r22 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵlistener("focusin", function UxEditorComponent_quill_editor_1_div_2_Template_div_focusin_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r21 = i0.ɵɵnextContext(2); return ctx_r21.onToolbarFocusIn($event); })("focusout", function UxEditorComponent_quill_editor_1_div_2_Template_div_focusout_0_listener($event) { i0.ɵɵrestoreView(_r22); const ctx_r23 = i0.ɵɵnextContext(2); return ctx_r23.onToolbarFocusOut($event); });
    i0.ɵɵprojection(1);
    i0.ɵɵelementEnd();
} }
function UxEditorComponent_quill_editor_1_Template(rf, ctx) { if (rf & 1) {
    const _r25 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "quill-editor", 5);
    i0.ɵɵlistener("onEditorCreated", function UxEditorComponent_quill_editor_1_Template_quill_editor_onEditorCreated_0_listener($event) { i0.ɵɵrestoreView(_r25); const ctx_r24 = i0.ɵɵnextContext(); return ctx_r24.onEditorCreatedEmit($event); })("onEditorChanged", function UxEditorComponent_quill_editor_1_Template_quill_editor_onEditorChanged_0_listener($event) { i0.ɵɵrestoreView(_r25); const ctx_r26 = i0.ɵɵnextContext(); return ctx_r26.onEditorChangedEmit($event); })("onContentChanged", function UxEditorComponent_quill_editor_1_Template_quill_editor_onContentChanged_0_listener($event) { i0.ɵɵrestoreView(_r25); const ctx_r27 = i0.ɵɵnextContext(); return ctx_r27.onContentChangedEmit($event); })("onSelectionChanged", function UxEditorComponent_quill_editor_1_Template_quill_editor_onSelectionChanged_0_listener($event) { i0.ɵɵrestoreView(_r25); const ctx_r28 = i0.ɵɵnextContext(); return ctx_r28.onSelectionChangedEmit($event); })("onFocus", function UxEditorComponent_quill_editor_1_Template_quill_editor_onFocus_0_listener($event) { i0.ɵɵrestoreView(_r25); const ctx_r29 = i0.ɵɵnextContext(); return ctx_r29.onFocusEmit($event); })("onBlur", function UxEditorComponent_quill_editor_1_Template_quill_editor_onBlur_0_listener($event) { i0.ɵɵrestoreView(_r25); const ctx_r30 = i0.ɵɵnextContext(); return ctx_r30.onBlurEmit($event); });
    i0.ɵɵtemplate(1, UxEditorComponent_quill_editor_1_div_1_Template, 51, 22, "div", 6);
    i0.ɵɵtemplate(2, UxEditorComponent_quill_editor_1_div_2_Template, 2, 0, "div", 6);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("ux-editor ", ctx_r0.styleClass, "");
    i0.ɵɵclassProp("ux-editor--readonly", ctx_r0.isReadOnly)("ux-editor--focused", ctx_r0.isFocused)("ux-editor--editable", !ctx_r0.isReadOnly);
    i0.ɵɵproperty("id", ctx_r0.generatedId)("format", ctx_r0.format)("formats", ctx_r0.formats)("maxLength", ctx_r0.maxLength)("minLength", ctx_r0.minLength)("readOnly", ctx_r0.isReadOnly)("required", ctx_r0.isRequired)("sanitize", ctx_r0.isUsedSanitizationForHtml)("modules", ctx_r0.modules)("theme", ctx_r0.theme)("placeholder", ctx_r0.placeholder)("styles", ctx_r0.style)("customToolbarPosition", ctx_r0.customToolbarPosition)("preserveWhitespace", ctx_r0.preserveWhitespace)("spellcheck", ctx_r0.spellcheck)("formControl", ctx_r0.formControl)("debug", false)("tabindex", ctx_r0.tabindex);
    i0.ɵɵattribute("aria-invalid", ctx_r0.ariaInvalid)("aria-required", ctx_r0.isRequired);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r0.customToolbarOptions && !ctx_r0.customEditorToolbar);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.customEditorToolbar);
} }
function UxEditorComponent_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 57);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("maxlength-wrapper--error", !ctx_r1.isMaxLengthValid);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r1.charactersLeft);
} }
function UxEditorComponent_div_3_ux_editor_view_html_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ux-editor-view-html", 61);
} if (rf & 2) {
    const ctx_r31 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("content", ctx_r31.value)("theme", ctx_r31.theme)("styles", ctx_r31.hasReadOnlyStyles ? ctx_r31.style : null);
} }
function UxEditorComponent_div_3_ux_editor_view_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ux-editor-view", 62);
} if (rf & 2) {
    const ctx_r32 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("content", ctx_r32.value)("format", ctx_r32.format)("theme", ctx_r32.theme)("styles", ctx_r32.hasReadOnlyStyles ? ctx_r32.style : null);
} }
function UxEditorComponent_div_3_Template(rf, ctx) { if (rf & 1) {
    const _r34 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 58);
    i0.ɵɵlistener("click", function UxEditorComponent_div_3_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r34); const ctx_r33 = i0.ɵɵnextContext(); return ctx_r33.enableEditorOnClickFocus($event); })("focusin", function UxEditorComponent_div_3_Template_div_focusin_0_listener($event) { i0.ɵɵrestoreView(_r34); const ctx_r35 = i0.ɵɵnextContext(); return ctx_r35.enableEditorOnClickFocus($event); });
    i0.ɵɵtemplate(1, UxEditorComponent_div_3_ux_editor_view_html_1_Template, 1, 3, "ux-editor-view-html", 59);
    i0.ɵɵtemplate(2, UxEditorComponent_div_3_ux_editor_view_2_Template, 1, 4, "ux-editor-view", 60);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("ux-editor ux-editor--readonly ", ctx_r2.styleClass, "");
    i0.ɵɵclassProp("ux-editor--empty", !ctx_r2.value);
    i0.ɵɵpropertyInterpolate("tabindex", ctx_r2.tabindex);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.format === "html" || ctx_r2.format === "text");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.format === "object" || ctx_r2.format === "json");
} }
function UxEditorComponent_div_4_code_74_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "code");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r36 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r36.formControl.value);
} }
function UxEditorComponent_div_4_code_75_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "code");
    i0.ɵɵelementStart(1, "pre", 73);
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "json");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r37 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, ctx_r37.formControl.value));
} }
function UxEditorComponent_div_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 63);
    i0.ɵɵelementStart(1, "div", 64);
    i0.ɵɵtext(2, "UX-EDITOR debug");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 65);
    i0.ɵɵelementStart(4, "strong");
    i0.ɵɵtext(5, "OPTIONS:");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "span", 66);
    i0.ɵɵtext(7, "id: ");
    i0.ɵɵelementStart(8, "span", 67);
    i0.ɵɵtext(9);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(10, "span", 66);
    i0.ɵɵtext(11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(12, "span", 68);
    i0.ɵɵtext(13, "isReadOnly");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(14, "span", 68);
    i0.ɵɵtext(15, "isEnabledOnFocus");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(16, "span", 68);
    i0.ɵɵtext(17, "preserveWhitespace");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(18, "span", 68);
    i0.ɵɵtext(19, "spellcheck");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(20, "span", 66);
    i0.ɵɵtext(21, "maxLength: ");
    i0.ɵɵelementStart(22, "span", 67);
    i0.ɵɵtext(23);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(24, "div", 65);
    i0.ɵɵelementStart(25, "strong");
    i0.ɵɵtext(26, "EVENTS:");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(27, "span", 68);
    i0.ɵɵtext(28, "onFocus");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(29, "span", 68);
    i0.ɵɵtext(30, "onBlur");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(31, "span", 68);
    i0.ɵɵtext(32, "onEditorCreated");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(33, "span", 68);
    i0.ɵɵtext(34, "onEditorChanged");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(35, "span", 68);
    i0.ɵɵtext(36, "onContentChanged");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(37, "span", 68);
    i0.ɵɵtext(38, "onSelectionChanged");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(39, "div", 65);
    i0.ɵɵelementStart(40, "strong");
    i0.ɵɵtext(41, "FORM:");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(42, "span", 66);
    i0.ɵɵtext(43, "controlName: ");
    i0.ɵɵelementStart(44, "span", 67);
    i0.ɵɵtext(45);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(46, "span", 68);
    i0.ɵɵtext(47, "isRequired");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(48, "span", 68);
    i0.ɵɵtext(49, "isFormControlValid");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(50, "span", 66);
    i0.ɵɵtext(51, "validationErrorMessage: ");
    i0.ɵɵelementStart(52, "span");
    i0.ɵɵtext(53);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(54, "span", 69);
    i0.ɵɵtext(55, "isMaxLengthValid");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(56, "div", 65);
    i0.ɵɵelementStart(57, "strong");
    i0.ɵɵtext(58, "STYLE:");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(59, "span", 66);
    i0.ɵɵtext(60);
    i0.ɵɵpipe(61, "json");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(62, "div", 65);
    i0.ɵɵelementStart(63, "strong");
    i0.ɵɵtext(64, "SOURCE:");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(65, "span", 66);
    i0.ɵɵtext(66, "format: ");
    i0.ɵɵelementStart(67, "span", 67);
    i0.ɵɵtext(68);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(69, "span", 66);
    i0.ɵɵtext(70, "charactersLeft: ");
    i0.ɵɵelementStart(71, "span", 70);
    i0.ɵɵtext(72);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(73, "div", 71);
    i0.ɵɵtemplate(74, UxEditorComponent_div_4_code_74_Template, 2, 1, "code", 72);
    i0.ɵɵtemplate(75, UxEditorComponent_div_4_code_75_Template, 4, 3, "code", 72);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵadvance(9);
    i0.ɵɵtextInterpolate(ctx_r3.generatedId);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("toolbarPosition: ", ctx_r3.customToolbarPosition, "");
    i0.ɵɵadvance(1);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.isReadOnly)("ux-editor__debug-badge--off", !ctx_r3.isReadOnly);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.isEnabledOnFocus)("ux-editor__debug-badge--off", !ctx_r3.isEnabledOnFocus);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.preserveWhitespace)("ux-editor__debug-badge--off", !ctx_r3.preserveWhitespace);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.spellcheck)("ux-editor__debug-badge--off", !ctx_r3.spellcheck);
    i0.ɵɵadvance(5);
    i0.ɵɵtextInterpolate(ctx_r3.maxLength);
    i0.ɵɵadvance(4);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.isFocused)("ux-editor__debug-badge--off", !ctx_r3.isFocused);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.isBlured)("ux-editor__debug-badge--off", !ctx_r3.isBlured);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.isEditorCreated)("ux-editor__debug-badge--off", !ctx_r3.isEditorCreated);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.hasEditorChanged)("ux-editor__debug-badge--off", !ctx_r3.hasEditorChanged);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.hasContentChanged)("ux-editor__debug-badge--off", !ctx_r3.hasContentChanged);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.hasSelectionChanged)("ux-editor__debug-badge--off", !ctx_r3.hasSelectionChanged);
    i0.ɵɵadvance(8);
    i0.ɵɵtextInterpolate(ctx_r3.formControlName);
    i0.ɵɵadvance(1);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.isRequired)("ux-editor__debug-badge--off", !ctx_r3.isRequired);
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("ux-editor__debug-badge--on", ctx_r3.isFormControlValid)("ux-editor__debug-badge--alert", !ctx_r3.isFormControlValid);
    i0.ɵɵadvance(4);
    i0.ɵɵclassMapInterpolate1("eui-u-color-", ctx_r3.feedbackTypeClass, "");
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.formValidationErrorMessage);
    i0.ɵɵadvance(1);
    i0.ɵɵclassProp("ux-editor__debug-badge--alert", !ctx_r3.isMaxLengthValid);
    i0.ɵɵadvance(6);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(61, 64, ctx_r3.style));
    i0.ɵɵadvance(8);
    i0.ɵɵtextInterpolate(ctx_r3.format);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngClass", ctx_r3.isMaxLengthValid ? "eui-u-color-black" : "eui-u-color-danger");
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.charactersLeft);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r3.format === "text" || ctx_r3.format === "html");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r3.format === "json" || ctx_r3.format === "object");
} }
const _c0 = [[["uxEditorCustomToolbar"]]];
const _c1 = ["uxEditorCustomToolbar"];
// Default editor options (to be passed through modules)
const defaultEditorOptions = {
    toolbar: true,
    clipboard: true,
    history: {
        delay: 1000,
        maxStack: 100,
        userOnly: true
    }
};
const customEditorOptions = {
    import: 'formats/font',
    whitelist: ['roboto'],
};
class UxEditorComponent {
    constructor(uxFormGroupComponent, ngControl) {
        this.ngControl = ngControl;
        this.e2eAttr = 'ux-editor';
        // COMMON OPTIONS (OLD BASE)
        this.style = null; // mapped to NEW styles
        this.placeholder = '';
        this.format = 'html'; // single format content
        this.isEnabledOnFocus = false;
        this.isReadOnly = false; // mapped to NEW readOnly
        this.isUsedNativeEditorInReadMode = false; // used to allow native editor Quill to render the Html and apply its styles.
        this.theme = 'snow';
        this.debug = false; // true = log
        this.isEditable = false; // DEPRECATED - No more needed! isReadOnly is enough
        this.feedbackTypeClass = 'danger';
        // NEW INPUT OPTIONS
        this.tabindex = '0';
        this.hasReadOnlyStyles = false; // Allows the viewer to use styles when isReadOnly=true
        this.isMinimalToolbar = false; // Allows to display minimal features from default toolbar
        this.modules = defaultEditorOptions;
        this.isRequired = false; // form validator required!
        this.customToolbarPosition = 'top';
        // @Input() sanitize?: true | false = true;     // Security: removed as input option! Always true!
        this.isUsedSanitizationForHtml = true;
        this.strict = true;
        this.customOptions = [customEditorOptions] || [];
        this.preserveWhitespace = false;
        this.spellcheck = false;
        this.showCounters = true;
        this.isImageUrl = false;
        /*  DEPRECATED (OLD)                NEW
            -------------------------------------------------------
            (onInit)                =>      (onEditorCreated)
            (onTextChange)          =>      (onContentChanged)
            (onSelectionChange)     =>      (onSelectionChanged)
                                            (onEditorCreated)
                                            (onEditorChanged)
                                            (onContentChanged)
                                            (onFocus)
                                            (onBlur)             */
        // OLD EMITTERS (Keep for backward compatibility) - TO BE DEPRECATED
        this.onInit = new EventEmitter();
        this.onTextChange = new EventEmitter();
        this.onSelectionChange = new EventEmitter();
        // NEW EMITTERS
        this.onEditorCreated = new EventEmitter();
        this.onEditorChanged = new EventEmitter();
        this.onContentChanged = new EventEmitter();
        this.onSelectionChanged = new EventEmitter();
        this.onFocus = new EventEmitter();
        this.onBlur = new EventEmitter();
        this.getCharactersCounter = new EventEmitter();
        this.getWordsCounter = new EventEmitter();
        this.crlf = String.fromCharCode(10, 13); // for tooltip CR+LF
        this.editorConfig = [];
        this.value = '';
        this.sanitize = true; // Security: always set sanitizing to true!
        this.isEnabledOnFocusBackup = false; // backup & restore of the isEnabledOnFocus original option
        this.displayAbout = false;
        this.charactersLabel = 'characters';
        this.wordsLabel = 'words';
        this.isMaxLengthValid = true;
        // Debugger events & misc
        this.isBlured = false;
        this.isFocused = false;
        this.isEditorCreated = false;
        this.hasEditorChanged = false;
        this.hasContentChanged = false;
        this.hasSelectionChanged = false;
        this.isToolbarTouched = false;
        this.formValidationErrorMessage = '';
        this.ariaInvalid = false;
        this.formControl = new FormControl();
        this.destroy$ = new Subject();
        this.imageHandler = (image, callback) => {
            const range = this.quillEditor.getSelection();
            const value = prompt('Enter image link URL');
            if (value) {
                this.quillEditor.insertEmbed(range.index, 'image', value, QuillType.sources.USER);
            }
        };
        this.propagateChange = (_) => { };
        this.propagateTouched = () => { };
        this.onValidatorChanged = () => { };
        // Inject NgControl value accessor to self
        // This replaces injector.get(NgControl) which is throwing a deprecation warning
        // Also removed NG_VALUE_ACCESSOR from the providers to avoid circular dependency
        if (this.ngControl) {
            this.ngControl.valueAccessor = this;
        }
        this.uxFormGroupComponent = uxFormGroupComponent;
    }
    ngOnInit() {
        // Replace default Toolbar with custom
        if (this.customToolbarOptions) {
            this.modules = Object.assign(Object.assign({}, this.modules), { toolbar: this.customToolbarOptions });
        }
        // Backup original value of isEnabledOnFocus option
        this.isEnabledOnFocusBackup = this.isEnabledOnFocus;
        // Generate unique id for ux-editor instance
        this.generatedId = this.id ? this.id : 'ux-editor-' + (Math.floor(Math.random() * 1000000) + 1).toString();
        if (this.uxFormGroupComponent) {
            this.uxFormGroupComponent.id = this.generatedId;
            if (this.validationErrorMessage) {
                this.uxFormGroupComponent.validationErrorMessage = this.validationErrorMessage;
                this.uxFormGroupComponent.validationErrorFeedbackClass = this.feedbackTypeClass;
                this.formValidationErrorMessage = this.uxFormGroupComponent.validationErrorMessage;
            }
            if (!this.uxFormGroupComponent.isRequired) {
                this.uxFormGroupComponent.isRequired = this.isRequired;
            }
            else {
                this.isRequired = this.uxFormGroupComponent.isRequired;
            }
        }
        this._formControlStatusChanges();
    }
    ngOnChanges(changes) {
        // console.log('ngOnChanges() changes:', changes);
        if (changes) {
            if (changes.isEnabledOnFocus && changes.isEnabledOnFocus.currentValue === true) {
                this.isEnabledOnFocus = true;
                this.isReadOnly = true;
            }
            // Overrides the isEnabledOnFocus=true option
            if (changes.isReadOnly) {
                if (changes.isReadOnly.currentValue === true) {
                    this.isEnabledOnFocus = false;
                    this.isReadOnly = true;
                }
                // Edition mode
                if (changes.isReadOnly.currentValue === false) {
                    this._formControlStatusChanges();
                }
            }
        }
    }
    ngOnDestroy() {
        this.destroy$.next(true);
        this.destroy$.unsubscribe();
    }
    // Overrides default image handler (embedded B64 content from file) with URL images instead
    setImageUrlHandler(editorInstance) {
        if (editorInstance) {
            this.quillEditor = editorInstance;
            const toolbar = editorInstance.getModule('toolbar');
            toolbar.addHandler('image', this.imageHandler);
        }
    }
    // TOOLBAR EXTRAS (eUI Customs)
    editorUndo() {
        this.quillEditor.history.undo();
    }
    editorRedo() {
        this.quillEditor.history.redo();
    }
    editorDeleteContent(event) {
        if (confirm('Are you sure you want to delete all editor\'s content?')) {
            setTimeout(() => {
                this.quillEditor.setContents([]);
                this.quillEditor.setText('');
                this.propagateChange('');
            });
        }
    }
    editorAbout() {
        this.displayAbout = !this.displayAbout;
    }
    // TOGGLES
    toggleReadOnly() {
        this.isReadOnly = !this.isReadOnly;
    }
    toggleRequired() {
        this.isRequired = !this.isRequired;
    }
    // READONLY MODE Functions
    enableEditorOnClickFocus(event) {
        if (this.isEnabledOnFocus) {
            this.isReadOnly = false; // show toolbar
            // this.isEnabledOnFocus = false;  // Disable the isEnabledOnFocus when focused to avoid lost focus when using toolbar actions
        }
    }
    // TOOLBAR EVENTS / FUNCTIONS
    // Force remaining on Editor when touching the toolbar actions
    onToolbarFocusIn(event) {
        // console.log('onToolbarFocusIn() triggered');
        this.isToolbarTouched = true;
    }
    // Reset toolbar touched state on exit
    onToolbarFocusOut(event) {
        // console.log('onToolbarFocusOut() triggered');
        this.isToolbarTouched = false;
    }
    // EVENT HANDLERS EMITTERS
    onEditorCreatedEmit(event) {
        if (this.debug === 'log') {
            console.log('editor-created', event);
        }
        // Starting point event returns the Quill instance
        if (event) {
            this.quillEditor = event;
            if (this.format === 'html') {
                const delta = this.quillEditor.clipboard.convert({ html: this.value });
                this.formControl.patchValue(delta);
                this.quillEditor.setContents(delta);
            }
            this.onInit.emit(event); // OLD KEEP! TO BE DEPRECATED
            this.onEditorCreated.emit(event);
            this.isEditorCreated = true; // For debugger
            // Set focus when navigating with tab key
            if (this.isEnabledOnFocusBackup) {
                this._editorSetFocus();
            }
            // Import & register new module for custom Link insert with encoded URI (EUI-1575)
            this._getEncodedURILink();
            // Use URL images instead of embedded B64 content (overrides default image handler)
            if (this.isImageUrl) {
                this.setImageUrlHandler(this.quillEditor);
            }
        }
    }
    onEditorChangedEmit(event) {
        if (this.debug === 'log') {
            console.log('editor-changed', event);
        }
        this.onEditorChanged.emit(event);
        this.hasEditorChanged = true; // For debugger
    }
    onContentChangedEmit(event) {
        if (this.debug === 'log') {
            console.log('content-changed', event);
        }
        this.onTextChange.emit(event); // OLD KEEP! TO BE DEPRECATED
        this.onContentChanged.emit(event);
        this.hasContentChanged = true; // For debugger
        // Update editor's value
        switch (this.format) {
            case 'text':
                this.value = event.text;
                this._calculateCounters(this.value); // Update counters
                break;
            case 'json':
                this.value = JSON.stringify(event.content);
                break;
            case 'object':
                this.value = event.content;
                break;
            default:
                this.value = event.html;
                this._calculateCounters(this.value); // Update counters
        }
        this.propagateChange(this.value);
    }
    onSelectionChangedEmit(event) {
        if (this.debug === 'log') {
            console.log('selection-changed', event);
        }
        this.hasSelectionChanged = true; // For debugger
        this.onSelectionChange.emit(event); // OLD KEEP! TO BE DEPRECATED
        this.onSelectionChanged.emit(event);
    }
    onFocusEmit(event) {
        if (this.debug === 'log') {
            console.log('onFocus', event);
        }
        this.isFocused = true;
        this.isBlured = false;
        this.onFocus.emit(true);
    }
    onBlurEmit(event) {
        if (this.debug === 'log') {
            console.log('onBlur', event);
        }
        this.isFocused = false;
        this.isBlured = true;
        this.onBlur.emit(true);
    }
    // CONTROL VALUE ACCESSORS
    registerOnChange(fn) {
        this.propagateChange = fn;
    }
    registerOnTouched(fn) {
        this.propagateTouched = fn;
    }
    registerOnValidatorChange(fn) {
        this.onValidatorChanged = fn;
    }
    writeValue(value) {
        // EUI-3568
        setTimeout(() => {
            if (this.debug === 'log') {
                console.log('ControlValueAccessors: writeValue():', value);
            }
            this.value = value || null;
            this._calculateCounters(this.value); // Set initial counters
            if (this.formControl) {
                this.formControl.patchValue(value);
            }
            // Save the last correct input value when formControl is valid
            if (this.value && this.formControlStatus === 'VALID') {
                this.lastValidValue = this.value;
            }
        });
    }
    // PRIVATE FUNCTIONS
    _editorSetFocus() {
        // Set focus to ql-editor div container
        if (this.quillEditor) {
            setTimeout(() => {
                this.quillEditor.focus();
                // Do NOT use patchValue here since it resets editor's cursor position !!
            });
        }
    }
    // Custom Link insert with encoded URI override
    _getEncodedURILink() {
        let Link = QuillType.import('formats/link');
        class MyLink extends Link {
            static create(value) {
                let node = super.create(value);
                value = encodeURI(this.sanitize(value));
                node.setAttribute('href', value);
                // How to remove target
                // if (value.startsWith('https://quilljs.com')) {
                //     node.removeAttribute('target');
                // }
                return node;
            }
        }
        QuillType.register('silent', MyLink);
    }
    _formControlStatusChanges() {
        this.formControl = new FormControl(this.value);
        if (this.ngControl && this.ngControl.statusChanges) {
            this.ngControl.statusChanges.pipe(distinctUntilChanged(), takeUntil(this.destroy$)).subscribe((value) => {
                if (value === 'VALID') {
                    this.formControlStatus = 'VALID';
                    this.isFormControlValid = true;
                    this.ariaInvalid = false;
                }
                else {
                    this.formControlStatus = 'INVALID';
                    this.isFormControlValid = false;
                    this.ariaInvalid = true;
                }
                if (this.uxFormGroupComponent) {
                    this.uxFormGroupComponent.isValid = this.isFormControlValid;
                    if (this.formControl.touched) {
                        this.uxFormGroupComponent.validationErrorMessage = this.validationErrorMessage || this.uxFormGroupComponent.validationErrorMessage;
                    }
                }
            });
        }
    }
    _calculateCounters(content) {
        if (this.format === 'html' || this.format === 'text') {
            if (content && content.length && content !== null) {
                let text = '';
                if (this.format === 'html') {
                    text = this._stripHtml(content);
                }
                else {
                    text = content;
                }
                this.charactersCounter = text.length;
                this.wordsCounter = !text ? 0 : text.trim().split(/\s+/).length;
            }
            else {
                // Empty content
                this.charactersCounter = 0;
                this.wordsCounter = 0;
            }
            // Output counters (for custom toolbar usage)
            this.getCharactersCounter.emit(this.charactersCounter);
            this.getWordsCounter.emit(this.wordsCounter);
            // Update maxLength & validity
            this._refreshMaxLength();
        }
        return;
    }
    _refreshMaxLength() {
        if (this.maxLength && this.maxLength > 0) {
            this.charactersLeft = this.maxLength - this.charactersCounter;
            if (this.charactersLeft < 0) {
                this.charactersLeft = 0;
                this.isMaxLengthValid = false;
                this.isFormControlValid = false;
            }
            else {
                this.isMaxLengthValid = true;
            }
        }
        return;
    }
    _stripHtml(content) {
        const regex = /(<([^>]+)>)/gm;
        return content.replace(regex, '');
    }
}
/** @nocollapse */ UxEditorComponent.ɵfac = function UxEditorComponent_Factory(t) { return new (t || UxEditorComponent)(i0.ɵɵdirectiveInject(forwardRef(() => UxFormGroupComponent), 9), i0.ɵɵdirectiveInject(i1$1.NgControl, 10)); };
/** @nocollapse */ UxEditorComponent.ɵcmp = i0.ɵɵdefineComponent({ type: UxEditorComponent, selectors: [["ux-editor"]], contentQueries: function UxEditorComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
        i0.ɵɵstaticContentQuery(dirIndex, UxEditorCustomToolbarTagDirective, true);
    } if (rf & 2) {
        var _t;
        i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.customEditorToolbar = _t.first);
    } }, inputs: { e2eAttr: "e2eAttr", id: "id", style: "style", styleClass: "styleClass", placeholder: "placeholder", formats: "formats", format: "format", isEnabledOnFocus: "isEnabledOnFocus", isReadOnly: "isReadOnly", isUsedNativeEditorInReadMode: "isUsedNativeEditorInReadMode", customToolbarOptions: "customToolbarOptions", theme: "theme", debug: "debug", isEditable: "isEditable", formControlName: "formControlName", feedbackTypeClass: "feedbackTypeClass", validationErrorMessage: "validationErrorMessage", tabindex: "tabindex", hasReadOnlyStyles: "hasReadOnlyStyles", isMinimalToolbar: "isMinimalToolbar", modules: "modules", maxLength: "maxLength", minLength: "minLength", isRequired: "isRequired", customToolbarPosition: "customToolbarPosition", isUsedSanitizationForHtml: "isUsedSanitizationForHtml", strict: "strict", scrollingContainer: "scrollingContainer", bounds: "bounds", customOptions: "customOptions", trackChanges: "trackChanges", preserveWhitespace: "preserveWhitespace", spellcheck: "spellcheck", showCounters: "showCounters", isImageUrl: "isImageUrl" }, outputs: { onInit: "onInit", onTextChange: "onTextChange", onSelectionChange: "onSelectionChange", onEditorCreated: "onEditorCreated", onEditorChanged: "onEditorChanged", onContentChanged: "onContentChanged", onSelectionChanged: "onSelectionChanged", onFocus: "onFocus", onBlur: "onBlur", getCharactersCounter: "getCharactersCounter", getWordsCounter: "getWordsCounter" }, features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c1, decls: 5, vars: 4, consts: [[1, "ux-editor-wrapper"], [3, "id", "class", "ux-editor--readonly", "ux-editor--focused", "ux-editor--editable", "format", "formats", "maxLength", "minLength", "readOnly", "required", "sanitize", "modules", "theme", "placeholder", "styles", "customToolbarPosition", "preserveWhitespace", "spellcheck", "formControl", "debug", "tabindex", "onEditorCreated", "onEditorChanged", "onContentChanged", "onSelectionChanged", "onFocus", "onBlur", 4, "ngIf"], ["class", "maxlength-wrapper", 3, "maxlength-wrapper--error", 4, "ngIf"], [3, "class", "ux-editor--empty", "tabindex", "click", "focusin", 4, "ngIf"], ["class", "ux-editor__debug", 4, "ngIf"], [3, "id", "format", "formats", "maxLength", "minLength", "readOnly", "required", "sanitize", "modules", "theme", "placeholder", "styles", "customToolbarPosition", "preserveWhitespace", "spellcheck", "formControl", "debug", "tabindex", "onEditorCreated", "onEditorChanged", "onContentChanged", "onSelectionChanged", "onFocus", "onBlur"], ["quill-editor-toolbar", "", 3, "focusin", "focusout", 4, "ngIf"], ["quill-editor-toolbar", "", 3, "focusin", "focusout"], [1, "ql-formats"], [1, "ql-header", 3, "title"], ["value", "1"], ["value", "2"], ["value", "3"], ["value", "4"], ["value", "5"], ["value", "6"], ["selected", ""], ["class", "ql-formats", 4, "ngIf"], ["aria-label", "Bold (Ctrl + B)", 1, "ql-bold", 3, "title"], ["aria-label", "Italic (Ctrl + I)", 1, "ql-italic", 3, "title"], ["aria-label", "Underline (Ctrl + U)", 1, "ql-underline", 3, "title"], ["aria-label", "Strikethrough", 1, "ql-strike", 3, "title"], ["aria-label", "Font Color", 1, "ql-color", 3, "title"], ["aria-label", "Text Highlight Color", 1, "ql-background", 3, "title"], ["aria-label", "Text Align", 1, "ql-align", 3, "title"], ["value", "center"], ["value", "right"], ["value", "justify"], ["class", "ql-blockquote", "aria-label", "Blockquote", 3, "title", 4, "ngIf"], ["class", "ql-code-block", "aria-label", "Insert Code Block", 3, "title", 4, "ngIf"], ["aria-label", "Insert Link", 1, "ql-link", 3, "title"], ["class", "ql-image", "aria-label", "Insert Image", 3, "title", 4, "ngIf"], ["class", "ql-image", "aria-label", "Insert Image from URL", 3, "title", 4, "ngIf"], ["class", "ql-video", "aria-label", "Insert Video", 3, "title", 4, "ngIf"], ["aria-label", "Remove Styles", 1, "ql-clean", 3, "title"], ["aria-label", "Delete", 3, "title", "click"], [1, "eui-icon", "eui-icon-delete-forever"], ["aria-label", "Undo (Ctrl + Z)", 3, "title", "click"], [1, "eui-icon", "eui-icon-undo"], ["aria-label", "Redo (Ctrl + Y)", 3, "title", "click"], [1, "eui-icon", "eui-icon-redo"], [1, "ql-font", 3, "title"], ["value", "serif"], ["value", "monospace"], ["value", "sub", "aria-label", "Subscript", 1, "ql-script", 3, "title"], ["value", "super", "aria-label", "Superscript", 1, "ql-script", 3, "title"], ["value", "ordered", "aria-label", "Ordered List", 1, "ql-list", 3, "title"], ["value", "bullet", "aria-label", "Unordered List", 1, "ql-list", 3, "title"], ["value", "-1", "type", "button", "aria-label", "Decrease Indent", 1, "ql-indent", 3, "title"], ["value", "+1", "type", "button", "aria-label", "Increase Indent", 1, "ql-indent", 3, "title"], ["aria-label", "Blockquote", 1, "ql-blockquote", 3, "title"], ["aria-label", "Insert Code Block", 1, "ql-code-block", 3, "title"], ["aria-label", "Insert Image", 1, "ql-image", 3, "title"], ["aria-label", "Insert Image from URL", 1, "ql-image", 3, "title"], [1, "eui-icon", "eui-icon-image-add"], ["aria-label", "Insert Video", 1, "ql-video", 3, "title"], ["aria-label", "Counters", 3, "charactersCounter", "charactersLabel", "wordsCounter", "wordsLabel", "isMaxLengthValid", "title"], [1, "maxlength-wrapper"], [3, "tabindex", "click", "focusin"], [3, "content", "theme", "styles", 4, "ngIf"], [3, "content", "format", "theme", "styles", 4, "ngIf"], [3, "content", "theme", "styles"], [3, "content", "format", "theme", "styles"], [1, "ux-editor__debug"], [1, "ux-editor__debug-title"], [1, "ux-editor__debug-section"], [1, "ux-editor__debug-badge", "ux-editor__debug-badge--off"], [1, "eui-u-color-black"], [1, "ux-editor__debug-badge"], [1, "ux-editor__debug-badge", "ux-editor__debug-badge--on"], [3, "ngClass"], [1, "ux-editor__debug-source"], [4, "ngIf"], [1, "ux-editor__debug-source-code"]], template: function UxEditorComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef(_c0);
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵtemplate(1, UxEditorComponent_quill_editor_1_Template, 3, 31, "quill-editor", 1);
        i0.ɵɵtemplate(2, UxEditorComponent_div_2_Template, 2, 3, "div", 2);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(3, UxEditorComponent_div_3_Template, 3, 8, "div", 3);
        i0.ɵɵtemplate(4, UxEditorComponent_div_4_Template, 76, 66, "div", 4);
    } if (rf & 2) {
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", !ctx.isReadOnly || ctx.isUsedNativeEditorInReadMode);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", !ctx.isReadOnly && ctx.charactersLeft > -1);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.isReadOnly && !ctx.isUsedNativeEditorInReadMode);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.debug);
    } }, directives: function () { return [i3.NgIf, i4.QuillEditorComponent, i1$1.RequiredValidator, i1$1.NgControlStatus, i1$1.FormControlDirective, i1$1.NgSelectOption, i1$1.ɵangular_packages_forms_forms_x, UxEditorCountersComponent,
        UxEditorViewHTMLComponent,
        UxEditorViewComponent, i3.NgClass]; }, pipes: function () { return [i3.JsonPipe]; }, encapsulation: 2 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(UxEditorComponent, [{
        type: Component,
        args: [{
                selector: 'ux-editor',
                templateUrl: './ux-editor.component.html',
            }]
    }], function () { return [{ type: i2.UxFormGroupComponent, decorators: [{
                type: Optional
            }, {
                type: Host
            }, {
                type: Inject,
                args: [forwardRef(() => UxFormGroupComponent)]
            }] }, { type: i1$1.NgControl, decorators: [{
                type: Optional
            }, {
                type: Self
            }] }]; }, { e2eAttr: [{
            type: Input
        }], id: [{
            type: Input
        }], style: [{
            type: Input
        }], styleClass: [{
            type: Input
        }], placeholder: [{
            type: Input
        }], formats: [{
            type: Input
        }], format: [{
            type: Input
        }], isEnabledOnFocus: [{
            type: Input
        }], isReadOnly: [{
            type: Input
        }], isUsedNativeEditorInReadMode: [{
            type: Input
        }], customToolbarOptions: [{
            type: Input
        }], theme: [{
            type: Input
        }], debug: [{
            type: Input
        }], isEditable: [{
            type: Input
        }], formControlName: [{
            type: Input
        }], feedbackTypeClass: [{
            type: Input
        }], validationErrorMessage: [{
            type: Input
        }], tabindex: [{
            type: Input
        }], hasReadOnlyStyles: [{
            type: Input
        }], isMinimalToolbar: [{
            type: Input
        }], modules: [{
            type: Input
        }], maxLength: [{
            type: Input
        }], minLength: [{
            type: Input
        }], isRequired: [{
            type: Input
        }], customToolbarPosition: [{
            type: Input
        }], isUsedSanitizationForHtml: [{
            type: Input
        }], strict: [{
            type: Input
        }], scrollingContainer: [{
            type: Input
        }], bounds: [{
            type: Input
        }], customOptions: [{
            type: Input
        }], trackChanges: [{
            type: Input
        }], preserveWhitespace: [{
            type: Input
        }], spellcheck: [{
            type: Input
        }], showCounters: [{
            type: Input
        }], isImageUrl: [{
            type: Input
        }], onInit: [{
            type: Output
        }], onTextChange: [{
            type: Output
        }], onSelectionChange: [{
            type: Output
        }], onEditorCreated: [{
            type: Output
        }], onEditorChanged: [{
            type: Output
        }], onContentChanged: [{
            type: Output
        }], onSelectionChanged: [{
            type: Output
        }], onFocus: [{
            type: Output
        }], onBlur: [{
            type: Output
        }], getCharactersCounter: [{
            type: Output
        }], getWordsCounter: [{
            type: Output
        }], customEditorToolbar: [{
            type: ContentChild,
            args: [forwardRef(() => UxEditorCustomToolbarTagDirective), { static: true }]
        }] }); })();
// tslint:disable-next-line
class UxEditorCustomToolbarTagDirective {
}
/** @nocollapse */ UxEditorCustomToolbarTagDirective.ɵfac = function UxEditorCustomToolbarTagDirective_Factory(t) { return new (t || UxEditorCustomToolbarTagDirective)(); };
/** @nocollapse */ UxEditorCustomToolbarTagDirective.ɵdir = i0.ɵɵdefineDirective({ type: UxEditorCustomToolbarTagDirective, selectors: [["uxEditorCustomToolbar"]] });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(UxEditorCustomToolbarTagDirective, [{
        type: Directive,
        args: [{ selector: 'uxEditorCustomToolbar' }]
    }], null, null); })();
class UxEditorComponentModule {
}
/** @nocollapse */ UxEditorComponentModule.ɵmod = i0.ɵɵdefineNgModule({ type: UxEditorComponentModule });
/** @nocollapse */ UxEditorComponentModule.ɵinj = i0.ɵɵdefineInjector({ factory: function UxEditorComponentModule_Factory(t) { return new (t || UxEditorComponentModule)(); }, imports: [[
            CommonModule,
            FormsModule,
            ReactiveFormsModule,
            QuillModule.forRoot(),
        ]] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(UxEditorComponentModule, { declarations: [UxEditorComponent, UxEditorViewComponent,
        UxEditorViewHTMLComponent,
        UxEditorCountersComponent, UxEditorCustomToolbarTagDirective], imports: [CommonModule,
        FormsModule,
        ReactiveFormsModule, i4.QuillModule], exports: [UxEditorComponent, UxEditorViewComponent,
        UxEditorViewHTMLComponent,
        UxEditorCountersComponent, UxEditorCustomToolbarTagDirective] }); })();
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(UxEditorComponentModule, [{
        type: NgModule,
        args: [{
                imports: [
                    CommonModule,
                    FormsModule,
                    ReactiveFormsModule,
                    QuillModule.forRoot(),
                ],
                exports: [
                    UxEditorComponent,
                    UxEditorViewComponent,
                    UxEditorViewHTMLComponent,
                    UxEditorCountersComponent,
                    UxEditorCustomToolbarTagDirective,
                ],
                declarations: [
                    UxEditorComponent,
                    UxEditorViewComponent,
                    UxEditorViewHTMLComponent,
                    UxEditorCountersComponent,
                    UxEditorCustomToolbarTagDirective,
                ],
            }]
    }], null, null); })();

/**
 * Generated bundle index. Do not edit.
 */

export { UxEditorComponent, UxEditorComponentModule, UxEditorCountersComponent, UxEditorCustomToolbarTagDirective, UxEditorViewComponent, UxEditorViewHTMLComponent };
//# sourceMappingURL=eui-externals-ux-editor.js.map
