import * as i3 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i0 from '@angular/core';
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Output, Input, HostListener, ViewEncapsulation, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
import { Observable, take, shareReplay, Subject, tap, debounceTime, takeUntil } from 'rxjs';
import { Destroy, ResizeListenerModule } from '@deja-js/component/core';

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
/**
 * Monaco Editor Service
 *
 * Service used by Monaco Editor Component to load only once instance of the Monaco Editor Library
 */
class MonacoEditorService {
    /**
     * Constructor
     */
    constructor(zone) {
        this.monacoApi$ = new Observable(subscriber => {
            const wnd = window;
            const monacoWindow = wnd;
            const baseElement = document.getElementsByTagName('base')[0] || {};
            const baseHref = baseElement.href;
            const basePath = monacoWindow.MONACOEDITOR_BASEPATH || `${baseHref}assets/monaco/vs`;
            const onGotAmdLoader = () => {
                // Load monaco
                monacoWindow.require.config({ paths: { vs: basePath } });
                monacoWindow.require(['vs/editor/editor.main'], () => {
                    zone.run(() => {
                        subscriber.next(monacoWindow.monaco);
                    });
                });
            };
            // Load AMD loader if necessary
            if (!monacoWindow.require && !monacoWindow.monaco) {
                const loaderScript = document.createElement('script');
                loaderScript.type = 'text/javascript';
                loaderScript.src = `${basePath}/loader.js`;
                loaderScript.addEventListener('load', onGotAmdLoader);
                document.body.appendChild(loaderScript);
            }
            else {
                onGotAmdLoader();
            }
        }).pipe(take(1), shareReplay({ bufferSize: 1, refCount: false }));
    }
}
MonacoEditorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
MonacoEditorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorService, providedIn: 'root' });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root'
                }]
        }], ctorParameters: function () { return [{ type: i0.NgZone }]; } });

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
/**
 * Monaco Editor Component for Angular
 *
 * The Monaco Editor is the code editor that powers [VS Code](https://github.com/Microsoft/vscode), a good page describing the code editor's features is [here](https://code.visualstudio.com/docs/editor/editingevolved).
 */
class MonacoEditorControlComponent extends Destroy {
    constructor(elementRef) {
        super();
        this.elementRef = elementRef;
        this.valueChange = new EventEmitter();
        this.createEditor$ = new Subject();
        console.log('MonacoEditorControlComponent constructor');
        this.createEditor$.pipe(tap(() => {
            this.editor = null;
        }), debounceTime(100), takeUntil(this.destroyed$)).subscribe(() => {
            const element = this.elementRef.nativeElement;
            const setElementSize = () => {
                element.setAttribute('style', `height: ${element.parentElement.offsetHeight}px; width:100%;`);
            };
            this.clearElement();
            this.editor = this.isDiffEditor ? this.monacoEditorApi.editor.createDiffEditor(element, this.options) : this.monacoEditorApi.editor.create(element, this.options);
            setElementSize();
            const editableModel = this.monacoEditorApi.editor.createModel(this.editableValue, this.options.language);
            if (this.isDiffEditor) {
                const readOnlyModel = this.monacoEditorApi.editor.createModel(this.readOnlyValue, this.options.language);
                this.editor.setModel({
                    modified: editableModel,
                    original: readOnlyModel
                });
            }
            else {
                this.editor.setModel(editableModel);
            }
            if (this.editableModelSub) {
                this.editableModelSub.dispose();
                delete this.editableModelSub;
            }
            this.editableModelSub = editableModel.onDidChangeContent(() => {
                const v = this.editableModel.getValue();
                this._editableValue = v;
                this.valueChange.emit(v);
            });
        });
        this.destroyed$.pipe(
        // eslint-disable-next-line rxjs-angular/prefer-takeuntil
        ).subscribe(() => {
            if (this.editor) {
                this.editor.dispose();
            }
            this.clearElement();
            if (this.editableModelSub) {
                this.editableModelSub.dispose();
            }
        });
    }
    set options(value) {
        if (JSON.stringify(this._options) !== JSON.stringify(value)) {
            this._options = value;
            if (this.editor) {
                this.editor.updateOptions(this.options);
            }
        }
    }
    get options() {
        return this._options;
    }
    set isDiffEditor(value) {
        if (this._isDiffEditor !== value) {
            this._isDiffEditor = coerceBooleanProperty(value);
            this.createEditor$.next();
        }
    }
    get isDiffEditor() {
        return this._isDiffEditor;
    }
    set editableValue(value) {
        if (this._editableValue !== value) {
            this._editableValue = value;
            const editableModel = this.editableModel;
            if (editableModel) {
                editableModel.setValue(this.editableValue);
            }
        }
    }
    get editableValue() {
        return this._editableValue || '';
    }
    set readOnlyValue(value) {
        if (this._readOnlyValue !== value) {
            this._readOnlyValue = value;
            const readOnlyModel = this.readOnlyModel;
            if (readOnlyModel) {
                readOnlyModel.setValue(this.readOnlyValue);
            }
        }
    }
    get readOnlyValue() {
        return this._readOnlyValue || '';
    }
    set monacoEditorApi(value) {
        if (this._monacoEditorApi !== value) {
            this._monacoEditorApi = value;
            this.createEditor$.next();
        }
    }
    get monacoEditorApi() {
        return this._monacoEditorApi;
    }
    get editableModel() {
        const model = this.editor?.getModel();
        return model?.id ? model : model?.modified;
    }
    get readOnlyModel() {
        const model = this.editor?.getModel();
        return model?.id ? undefined : model?.original;
    }
    onResize() {
        // Manually set monaco size because MonacoEditor doesn't work with Flexbox css
        const myDiv = this.elementRef.nativeElement.firstChild;
        myDiv.setAttribute('style', 'height: 100%; width: 100%;');
        if (this.editor) {
            this.editor.layout();
        }
    }
    ngOnInit() {
        this.createEditor$.next();
    }
    clearElement() {
        const element = this.elementRef.nativeElement;
        // eslint-disable-next-line no-loops/no-loops
        while (element.hasChildNodes()) {
            element.removeChild(element.firstChild);
        }
    }
}
MonacoEditorControlComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorControlComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
MonacoEditorControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: MonacoEditorControlComponent, selector: "monaco-editor-control", inputs: { options: "options", isDiffEditor: "isDiffEditor", editableValue: "editableValue", readOnlyValue: "readOnlyValue", monacoEditorApi: "monacoEditorApi" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "window:resize": "onResize()" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorControlComponent, decorators: [{
            type: Component,
            args: [{ selector: 'monaco-editor-control', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{width:100%;height:100%}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { valueChange: [{
                type: Output
            }], options: [{
                type: Input
            }], isDiffEditor: [{
                type: Input
            }], editableValue: [{
                type: Input
            }], readOnlyValue: [{
                type: Input
            }], monacoEditorApi: [{
                type: Input
            }], onResize: [{
                type: HostListener,
                args: ['window:resize', []]
            }] } });

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
/**
 * Monaco Editor Component for Angular
 *
 * The Monaco Editor is the code editor that powers [VS Code](https://github.com/Microsoft/vscode), a good page describing the code editor's features is [here](https://code.visualstudio.com/docs/editor/editingevolved).
 */
class MonacoEditorComponent {
    constructor(monacoEditorService) {
        this.monacoEditorService = monacoEditorService;
        this.valueChange = new EventEmitter();
        this.options = {
            automaticLayout: true
        };
    }
    set isDiffEditor(value) {
        this._isDiffEditor = coerceBooleanProperty(value);
    }
    get isDiffEditor() {
        return this._isDiffEditor;
    }
    /**
     * Enable experimental screen reader support.
     * Defaults to `true`.
     */
    set experimentalScreenReader(value) {
        this.updateOptions({ experimentalScreenReader: coerceBooleanProperty(value) });
    }
    get experimentalScreenReader() {
        return this.options.experimentalScreenReader;
    }
    /**
     * The aria label for the editor's textarea (when it is focused).
     */
    set ariaLabel(value) {
        this.updateOptions({ ariaLabel: value });
    }
    get ariaLabel() {
        return this.options.ariaLabel;
    }
    /**
     * Render vertical lines at the specified columns.
     * Defaults to empty array.
     */
    set rulers(value) {
        this.updateOptions({ rulers: value });
    }
    get rulers() {
        return this.options.rulers;
    }
    /**
     * A string containing the word separators used when doing word navigation.
     * Defaults to `~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?
     */
    set wordSeparators(value) {
        this.updateOptions({ wordSeparators: value });
    }
    get wordSeparators() {
        return this.options.wordSeparators;
    }
    /**
     * Enable Linux primary clipboard.
     * Defaults to true.
     */
    set selectionClipboard(value) {
        this.updateOptions({ selectionClipboard: coerceBooleanProperty(value) });
    }
    get selectionClipboard() {
        return this.options.selectionClipboard;
    }
    /**
     * Control the rendering of line numbers.
     * If it is a function, it will be invoked when rendering a line number and the return value will be rendered.
     * Otherwise, if it is a truey, line numbers will be rendered normally (equivalent of using an identity function).
     * Otherwise, line numbers will not be rendered.
     * Defaults to true.
     */
    set lineNumbers(value) {
        this.updateOptions({ lineNumbers: value });
    }
    get lineNumbers() {
        return this.options.lineNumbers;
    }
    /**
     * Should the corresponding line be selected when clicking on the line number?
     * Defaults to true.
     */
    set selectOnLineNumbers(value) {
        this.updateOptions({ selectOnLineNumbers: coerceBooleanProperty(value) });
    }
    get selectOnLineNumbers() {
        return this.options.selectOnLineNumbers;
    }
    /**
     * Control the width of line numbers, by reserving horizontal space for rendering at least an amount of digits.
     * Defaults to 5.
     */
    set lineNumbersMinChars(value) {
        this.updateOptions({ lineNumbersMinChars: coerceNumberProperty(value) });
    }
    get lineNumbersMinChars() {
        return this.options.lineNumbersMinChars;
    }
    /**
     * Enable the rendering of the glyph margin.
     * Defaults to true in vscode and to false in monaco-editor.
     */
    set glyphMargin(value) {
        this.updateOptions({ glyphMargin: coerceBooleanProperty(value) });
    }
    get glyphMargin() {
        return this.options.glyphMargin;
    }
    /**
     * The width reserved for line decorations (in px).
     * Line decorations are placed between line numbers and the editor content.
     * You can pass in a string in the format floating point followed by "ch". e.g. 1.3ch.
     * Defaults to 10.
     */
    set lineDecorationsWidth(value) {
        this.updateOptions({ lineDecorationsWidth: coerceNumberProperty(value) });
    }
    get lineDecorationsWidth() {
        return this.options.lineDecorationsWidth;
    }
    /**
     * When revealing the cursor, a virtual padding (px) is added to the cursor, turning it into a rectangle.
     * This virtual padding ensures that the cursor gets revealed before hitting the edge of the viewport.
     * Defaults to 30 (px).
     */
    set revealHorizontalRightPadding(value) {
        this.updateOptions({ revealHorizontalRightPadding: coerceNumberProperty(value) });
    }
    get revealHorizontalRightPadding() {
        return this.options.revealHorizontalRightPadding;
    }
    /**
     * Render the editor selection with rounded borders.
     * Defaults to true.
     */
    set roundedSelection(value) {
        this.updateOptions({ roundedSelection: coerceBooleanProperty(value) });
    }
    get roundedSelection() {
        return this.options.roundedSelection;
    }
    /**
     * Theme to be used for rendering.
     * The current out-of-the-box available themes are: 'vs' (default), 'vs-dark', 'hc-black'.
     * You can create custom themes via `monaco.editor.defineTheme`.
     */
    set theme(value) {
        this.updateOptions({ theme: value });
    }
    get theme() {
        return this.options.theme;
    }
    /**
     * Should the editor be read only.
     * Defaults to false.
     */
    set readOnly(value) {
        this.updateOptions({ readOnly: coerceBooleanProperty(value) });
    }
    get readOnly() {
        return this.options.readOnly;
    }
    /**
     * Control the behavior and rendering of the scrollbars.
     */
    set scrollbar(value) {
        this.updateOptions({ scrollbar: value });
    }
    get scrollbar() {
        return this.options.scrollbar;
    }
    /**
     * Display overflow widgets as `fixed`.
     * Defaults to `false`.
     */
    set fixedOverflowWidgets(value) {
        this.updateOptions({ fixedOverflowWidgets: coerceBooleanProperty(value) });
    }
    get fixedOverflowWidgets() {
        return this.options.fixedOverflowWidgets;
    }
    /**
     * The number of vertical lanes the overview ruler should render.
     * Defaults to 2.
     */
    set overviewRulerLanes(value) {
        this.updateOptions({ overviewRulerLanes: coerceNumberProperty(value) });
    }
    get overviewRulerLanes() {
        return this.options.overviewRulerLanes;
    }
    /**
     * Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'.
     * Defaults to 'blink'.
     */
    set cursorBlinking(value) {
        this.updateOptions({ cursorBlinking: value });
    }
    get cursorBlinking() {
        return this.options.cursorBlinking;
    }
    /**
     * Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl.
     * Defaults to false.
     */
    set mouseWheelZoom(value) {
        this.updateOptions({ mouseWheelZoom: coerceBooleanProperty(value) });
    }
    get mouseWheelZoom() {
        return this.options.mouseWheelZoom;
    }
    /**
     * Control the cursor style, either 'block' or 'line'.
     * Defaults to 'line'.
     */
    set cursorStyle(value) {
        this.updateOptions({ cursorStyle: value });
    }
    get cursorStyle() {
        return this.options.cursorStyle;
    }
    /**
     * Enable font ligatures.
     * Defaults to false.
     */
    set fontLigatures(value) {
        this.updateOptions({ fontLigatures: coerceBooleanProperty(value) });
    }
    get fontLigatures() {
        return this.options.fontLigatures;
    }
    /**
     * Disable the use of `translate3d`.
     * Defaults to false.
     */
    set disableTranslate3d(value) {
        this.updateOptions({ disableTranslate3d: coerceBooleanProperty(value) });
    }
    get disableTranslate3d() {
        return this.options.disableTranslate3d;
    }
    /**
     * Disable the optimizations for monospace fonts.
     * Defaults to false.
     */
    set disableMonospaceOptimizations(value) {
        this.updateOptions({ disableMonospaceOptimizations: coerceBooleanProperty(value) });
    }
    get disableMonospaceOptimizations() {
        return this.options.disableMonospaceOptimizations;
    }
    /**
     * Should the cursor be hidden in the overview ruler.
     * Defaults to false.
     */
    set hideCursorInOverviewRuler(value) {
        this.updateOptions({ hideCursorInOverviewRuler: coerceBooleanProperty(value) });
    }
    get hideCursorInOverviewRuler() {
        return this.options.hideCursorInOverviewRuler;
    }
    /**
     * Enable that scrolling can go one screen size after the last line.
     * Defaults to true.
     */
    set scrollBeyondLastLine(value) {
        this.updateOptions({ scrollBeyondLastLine: coerceBooleanProperty(value) });
    }
    get scrollBeyondLastLine() {
        return this.options.scrollBeyondLastLine;
    }
    /**
     * Enable that the editor will install an interval to check if its container dom node size has changed.
     * Enabling this might have a severe performance impact.
     * Defaults to false.
     */
    set automaticLayout(value) {
        this.updateOptions({ automaticLayout: coerceBooleanProperty(value) });
    }
    get automaticLayout() {
        return this.options.automaticLayout;
    }
    /**
     * Control the wrapping strategy of the editor.
     * Using -1 means no wrapping whatsoever.
     * Using 0 means viewport width wrapping (ajusts with the resizing of the editor).
     * Using a positive number means wrapping after a fixed number of characters.
     * Defaults to 300.
     */
    set wrappingColumn(value) {
        this.updateOptions({ wrappingColumn: coerceNumberProperty(value) });
    }
    get wrappingColumn() {
        return this.options.wrappingColumn;
    }
    /**
     * Control the alternate style of viewport wrapping.
     * When set to true viewport wrapping is used only when the window width is less than the number of columns specified in the wrappingColumn property. Has no effect if wrappingColumn is not a positive number.
     * Defaults to false.
     */
    set wordWrap(value) {
        this.updateOptions({ wordWrap: coerceBooleanProperty(value) });
    }
    get wordWrap() {
        return this.options.wordWrap;
    }
    /**
     * Control indentation of wrapped lines. Can be: 'none', 'same' or 'indent'.
     * Defaults to 'same' in vscode and to 'none' in monaco-editor.
     */
    set wrappingIndent(value) {
        this.updateOptions({ wrappingIndent: value });
    }
    get wrappingIndent() {
        return this.options.wrappingIndent;
    }
    /**
     * Configure word wrapping characters. A break will be introduced before these characters.
     * Defaults to '{([+'.
     */
    set wordWrapBreakBeforeCharacters(value) {
        this.updateOptions({ wordWrapBreakBeforeCharacters: value });
    }
    get wordWrapBreakBeforeCharacters() {
        return this.options.wordWrapBreakBeforeCharacters;
    }
    /**
     * Configure word wrapping characters. A break will be introduced after these characters.
     * Defaults to ' \t})]?|&,;'.
     */
    set wordWrapBreakAfterCharacters(value) {
        this.updateOptions({ wordWrapBreakAfterCharacters: value });
    }
    get wordWrapBreakAfterCharacters() {
        return this.options.wordWrapBreakAfterCharacters;
    }
    /**
     * Configure word wrapping characters. A break will be introduced after these characters only if no `wordWrapBreakBeforeCharacters` or `wordWrapBreakAfterCharacters` were found.
     * Defaults to '.'.
     */
    set wordWrapBreakObtrusiveCharacters(value) {
        this.updateOptions({ wordWrapBreakObtrusiveCharacters: value });
    }
    get wordWrapBreakObtrusiveCharacters() {
        return this.options.wordWrapBreakObtrusiveCharacters;
    }
    /**
     * Performance guard: Stop rendering a line after x characters.
     * Defaults to 10000 if wrappingColumn is -1. Defaults to -1 if wrappingColumn is >= 0.
     * Use -1 to never stop rendering
     */
    set stopRenderingLineAfter(value) {
        this.updateOptions({ stopRenderingLineAfter: coerceNumberProperty(value) });
    }
    get stopRenderingLineAfter() {
        return this.options.stopRenderingLineAfter;
    }
    /**
     * Enable hover.
     * Defaults to true.
     */
    set hover(value) {
        this.updateOptions({ hover: coerceBooleanProperty(value) });
    }
    get hover() {
        return this.options.hover;
    }
    /**
     * Enable custom contextmenu.
     * Defaults to true.
     */
    set contextmenu(value) {
        this.updateOptions({ contextmenu: coerceBooleanProperty(value) });
    }
    get contextmenu() {
        return this.options.contextmenu;
    }
    /**
     * A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.
     * Defaults to 1.
     */
    set mouseWheelScrollSensitivity(value) {
        this.updateOptions({ mouseWheelScrollSensitivity: coerceNumberProperty(value) });
    }
    get mouseWheelScrollSensitivity() {
        return this.options.mouseWheelScrollSensitivity;
    }
    /**
     * Enable quick suggestions (shadow suggestions)
     * Defaults to true.
     */
    set quickSuggestions(value) {
        this.updateOptions({ quickSuggestions: coerceBooleanProperty(value) });
    }
    get quickSuggestions() {
        return this.options.quickSuggestions;
    }
    /**
     * Quick suggestions show delay (in ms)
     * Defaults to 500 (ms)
     */
    set quickSuggestionsDelay(value) {
        this.updateOptions({ quickSuggestionsDelay: coerceNumberProperty(value) });
    }
    get quickSuggestionsDelay() {
        return this.options.quickSuggestionsDelay;
    }
    /**
     * Enables parameter hints
     */
    set parameterHints(value) {
        this.updateOptions({ parameterHints: coerceBooleanProperty(value) });
    }
    get parameterHints() {
        return this.options.parameterHints;
    }
    /**
     * Render icons in suggestions box.
     * Defaults to true.
     */
    set iconsInSuggestions(value) {
        this.updateOptions({ iconsInSuggestions: coerceBooleanProperty(value) });
    }
    get iconsInSuggestions() {
        return this.options.iconsInSuggestions;
    }
    /**
     * Enable auto closing brackets.
     * Defaults to true.
     */
    set autoClosingBrackets(value) {
        this.updateOptions({ autoClosingBrackets: coerceBooleanProperty(value) });
    }
    get autoClosingBrackets() {
        return this.options.autoClosingBrackets;
    }
    /**
     * Enable format on type.
     * Defaults to false.
     */
    set formatOnType(value) {
        this.updateOptions({ formatOnType: coerceBooleanProperty(value) });
    }
    get formatOnType() {
        return this.options.formatOnType;
    }
    /**
     * Enable format on paste.
     * Defaults to false.
     */
    set formatOnPaste(value) {
        this.updateOptions({ formatOnPaste: coerceBooleanProperty(value) });
    }
    get formatOnPaste() {
        return this.options.formatOnPaste;
    }
    /**
     * Enable the suggestion box to pop-up on trigger characters.
     * Defaults to true.
     */
    set suggestOnTriggerCharacters(value) {
        this.updateOptions({ suggestOnTriggerCharacters: coerceBooleanProperty(value) });
    }
    get suggestOnTriggerCharacters() {
        return this.options.suggestOnTriggerCharacters;
    }
    /**
     * Accept suggestions on ENTER.
     * Defaults to true.
     */
    set acceptSuggestionOnEnter(value) {
        this.updateOptions({ acceptSuggestionOnEnter: coerceBooleanProperty(value) });
    }
    get acceptSuggestionOnEnter() {
        return this.options.acceptSuggestionOnEnter;
    }
    /**
     * Accept suggestions on provider defined characters.
     * Defaults to true.
     */
    set acceptSuggestionOnCommitCharacter(value) {
        this.updateOptions({ acceptSuggestionOnCommitCharacter: coerceBooleanProperty(value) });
    }
    get acceptSuggestionOnCommitCharacter() {
        return this.options.acceptSuggestionOnCommitCharacter;
    }
    /**
     * Enable snippet suggestions. Default to 'true'.
     */
    set snippetSuggestions(value) {
        this.updateOptions({ snippetSuggestions: value });
    }
    get snippetSuggestions() {
        return this.options.snippetSuggestions;
    }
    /**
     * Copying without a selection copies the current line.
     */
    set emptySelectionClipboard(value) {
        this.updateOptions({ emptySelectionClipboard: coerceBooleanProperty(value) });
    }
    get emptySelectionClipboard() {
        return this.options.emptySelectionClipboard;
    }
    /**
     * Enable tab completion. Defaults to 'false'
     */
    set tabCompletion(value) {
        this.updateOptions({ tabCompletion: coerceBooleanProperty(value) });
    }
    get tabCompletion() {
        return this.options.tabCompletion;
    }
    /**
     * Enable word based suggestions. Defaults to 'true'
     */
    set wordBasedSuggestions(value) {
        this.updateOptions({ wordBasedSuggestions: coerceBooleanProperty(value) });
    }
    get wordBasedSuggestions() {
        return this.options.wordBasedSuggestions;
    }
    /**
     * The font size for the suggest widget.
     * Defaults to the editor font size.
     */
    set suggestFontSize(value) {
        this.updateOptions({ suggestFontSize: coerceNumberProperty(value) });
    }
    get suggestFontSize() {
        return this.options.suggestFontSize;
    }
    /**
     * The line height for the suggest widget.
     * Defaults to the editor line height.
     */
    set suggestLineHeight(value) {
        this.updateOptions({ suggestLineHeight: coerceNumberProperty(value) });
    }
    get suggestLineHeight() {
        return this.options.suggestLineHeight;
    }
    /**
     * Enable selection highlight.
     * Defaults to true.
     */
    set selectionHighlight(value) {
        this.updateOptions({ selectionHighlight: coerceBooleanProperty(value) });
    }
    get selectionHighlight() {
        return this.options.selectionHighlight;
    }
    /**
     * Show code lens
     * Defaults to true.
     */
    set codeLens(value) {
        this.updateOptions({ codeLens: coerceBooleanProperty(value) });
    }
    get codeLens() {
        return this.options.codeLens;
    }
    /**
     * Enable code folding
     * Defaults to true in vscode and to false in monaco-editor.
     */
    set folding(value) {
        this.updateOptions({ folding: coerceBooleanProperty(value) });
    }
    get folding() {
        return this.options.folding;
    }
    /**
     * Enable rendering of whitespace.
     * Defaults to none.
     */
    set renderWhitespace(value) {
        this.updateOptions({ renderWhitespace: value });
    }
    get renderWhitespace() {
        return this.options.renderWhitespace;
    }
    /**
     * Enable rendering of control characters.
     * Defaults to false.
     */
    set renderControlCharacters(value) {
        this.updateOptions({ renderControlCharacters: coerceBooleanProperty(value) });
    }
    get renderControlCharacters() {
        return this.options.renderControlCharacters;
    }
    /**
     * Enable rendering of indent guides.
     * Defaults to false.
     */
    set renderIndentGuides(value) {
        this.updateOptions({ renderIndentGuides: coerceBooleanProperty(value) });
    }
    get renderIndentGuides() {
        return this.options.renderIndentGuides;
    }
    /**
     * Enable rendering of current line highlight.
     * Defaults to all.
     */
    set renderLineHighlight(value) {
        this.updateOptions({ renderLineHighlight: value });
    }
    get renderLineHighlight() {
        return this.options.renderLineHighlight;
    }
    /**
     * Inserting and deleting whitespace follows tab stops.
     */
    set useTabStops(value) {
        this.updateOptions({ useTabStops: coerceBooleanProperty(value) });
    }
    get useTabStops() {
        return this.options.useTabStops;
    }
    /**
     * The font family
     */
    set fontFamily(value) {
        this.updateOptions({ fontFamily: value });
    }
    get fontFamily() {
        return this.options.fontFamily;
    }
    /**
     * The font weight
     */
    set fontWeight(value) {
        this.updateOptions({ fontWeight: value });
    }
    get fontWeight() {
        return this.options.fontWeight;
    }
    /**
     * The font size
     */
    set fontSize(value) {
        this.updateOptions({ fontSize: coerceNumberProperty(value) });
    }
    get fontSize() {
        return this.options.fontSize;
    }
    /**
     * The line height
     */
    set lineHeight(value) {
        this.updateOptions({ lineHeight: coerceNumberProperty(value) });
    }
    get lineHeight() {
        return this.options.lineHeight;
    }
    /**
    * Language of content to show
    */
    set language(value) {
        this.updateOptions({ language: value });
    }
    get language() {
        return this.options.language;
    }
    set value(value) {
        this._value = value;
    }
    get value() {
        return this._value;
    }
    set valueToCompare(value) {
        this._valueToCompare = value;
    }
    get valueToCompare() {
        return this._valueToCompare;
    }
    updateOptions(options) {
        this.options = { ...this.options, ...options };
    }
    onValueChange(value) {
        this.value = value;
        this.valueChange.next(value);
    }
}
MonacoEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorComponent, deps: [{ token: MonacoEditorService }], target: i0.ɵɵFactoryTarget.Component });
MonacoEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: MonacoEditorComponent, selector: "monaco-editor", inputs: { isDiffEditor: "isDiffEditor", experimentalScreenReader: "experimentalScreenReader", ariaLabel: "ariaLabel", rulers: "rulers", wordSeparators: "wordSeparators", selectionClipboard: "selectionClipboard", lineNumbers: "lineNumbers", selectOnLineNumbers: "selectOnLineNumbers", lineNumbersMinChars: "lineNumbersMinChars", glyphMargin: "glyphMargin", lineDecorationsWidth: "lineDecorationsWidth", revealHorizontalRightPadding: "revealHorizontalRightPadding", roundedSelection: "roundedSelection", theme: "theme", readOnly: "readOnly", scrollbar: "scrollbar", fixedOverflowWidgets: "fixedOverflowWidgets", overviewRulerLanes: "overviewRulerLanes", cursorBlinking: "cursorBlinking", mouseWheelZoom: "mouseWheelZoom", cursorStyle: "cursorStyle", fontLigatures: "fontLigatures", disableTranslate3d: "disableTranslate3d", disableMonospaceOptimizations: "disableMonospaceOptimizations", hideCursorInOverviewRuler: "hideCursorInOverviewRuler", scrollBeyondLastLine: "scrollBeyondLastLine", automaticLayout: "automaticLayout", wrappingColumn: "wrappingColumn", wordWrap: "wordWrap", wrappingIndent: "wrappingIndent", wordWrapBreakBeforeCharacters: "wordWrapBreakBeforeCharacters", wordWrapBreakAfterCharacters: "wordWrapBreakAfterCharacters", wordWrapBreakObtrusiveCharacters: "wordWrapBreakObtrusiveCharacters", stopRenderingLineAfter: "stopRenderingLineAfter", hover: "hover", contextmenu: "contextmenu", mouseWheelScrollSensitivity: "mouseWheelScrollSensitivity", quickSuggestions: "quickSuggestions", quickSuggestionsDelay: "quickSuggestionsDelay", parameterHints: "parameterHints", iconsInSuggestions: "iconsInSuggestions", autoClosingBrackets: "autoClosingBrackets", formatOnType: "formatOnType", formatOnPaste: "formatOnPaste", suggestOnTriggerCharacters: "suggestOnTriggerCharacters", acceptSuggestionOnEnter: "acceptSuggestionOnEnter", acceptSuggestionOnCommitCharacter: "acceptSuggestionOnCommitCharacter", snippetSuggestions: "snippetSuggestions", emptySelectionClipboard: "emptySelectionClipboard", tabCompletion: "tabCompletion", wordBasedSuggestions: "wordBasedSuggestions", suggestFontSize: "suggestFontSize", suggestLineHeight: "suggestLineHeight", selectionHighlight: "selectionHighlight", codeLens: "codeLens", folding: "folding", renderWhitespace: "renderWhitespace", renderControlCharacters: "renderControlCharacters", renderIndentGuides: "renderIndentGuides", renderLineHighlight: "renderLineHighlight", useTabStops: "useTabStops", fontFamily: "fontFamily", fontWeight: "fontWeight", fontSize: "fontSize", lineHeight: "lineHeight", language: "language", value: "value", valueToCompare: "valueToCompare" }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<ng-container *ngIf=\"monacoEditorService.monacoApi$ | async as monacoApi\">\n    <monaco-editor-control [options]=\"options\" [monacoEditorApi]=\"monacoApi\" [isDiffEditor]=\"isDiffEditor\" [editableValue]=\"value\" [readOnlyValue]=\"valueToCompare\" (valueChange)=\"onValueChange($event)\"></monaco-editor-control>\n</ng-container>", styles: ["monaco-editor{width:100%;display:flex;flex:1 1 auto}monaco-editor monaco-editor-control{flex:1 1 auto}\n"], components: [{ type: MonacoEditorControlComponent, selector: "monaco-editor-control", inputs: ["options", "isDiffEditor", "editableValue", "readOnlyValue", "monacoEditorApi"], outputs: ["valueChange"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorComponent, decorators: [{
            type: Component,
            args: [{ encapsulation: ViewEncapsulation.None, selector: 'monaco-editor', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"monacoEditorService.monacoApi$ | async as monacoApi\">\n    <monaco-editor-control [options]=\"options\" [monacoEditorApi]=\"monacoApi\" [isDiffEditor]=\"isDiffEditor\" [editableValue]=\"value\" [readOnlyValue]=\"valueToCompare\" (valueChange)=\"onValueChange($event)\"></monaco-editor-control>\n</ng-container>", styles: ["monaco-editor{width:100%;display:flex;flex:1 1 auto}monaco-editor monaco-editor-control{flex:1 1 auto}\n"] }]
        }], ctorParameters: function () { return [{ type: MonacoEditorService }]; }, propDecorators: { valueChange: [{
                type: Output
            }], isDiffEditor: [{
                type: Input
            }], experimentalScreenReader: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }], rulers: [{
                type: Input
            }], wordSeparators: [{
                type: Input
            }], selectionClipboard: [{
                type: Input
            }], lineNumbers: [{
                type: Input
            }], selectOnLineNumbers: [{
                type: Input
            }], lineNumbersMinChars: [{
                type: Input
            }], glyphMargin: [{
                type: Input
            }], lineDecorationsWidth: [{
                type: Input
            }], revealHorizontalRightPadding: [{
                type: Input
            }], roundedSelection: [{
                type: Input
            }], theme: [{
                type: Input
            }], readOnly: [{
                type: Input
            }], scrollbar: [{
                type: Input
            }], fixedOverflowWidgets: [{
                type: Input
            }], overviewRulerLanes: [{
                type: Input
            }], cursorBlinking: [{
                type: Input
            }], mouseWheelZoom: [{
                type: Input
            }], cursorStyle: [{
                type: Input
            }], fontLigatures: [{
                type: Input
            }], disableTranslate3d: [{
                type: Input
            }], disableMonospaceOptimizations: [{
                type: Input
            }], hideCursorInOverviewRuler: [{
                type: Input
            }], scrollBeyondLastLine: [{
                type: Input
            }], automaticLayout: [{
                type: Input
            }], wrappingColumn: [{
                type: Input
            }], wordWrap: [{
                type: Input
            }], wrappingIndent: [{
                type: Input
            }], wordWrapBreakBeforeCharacters: [{
                type: Input
            }], wordWrapBreakAfterCharacters: [{
                type: Input
            }], wordWrapBreakObtrusiveCharacters: [{
                type: Input
            }], stopRenderingLineAfter: [{
                type: Input
            }], hover: [{
                type: Input
            }], contextmenu: [{
                type: Input
            }], mouseWheelScrollSensitivity: [{
                type: Input
            }], quickSuggestions: [{
                type: Input
            }], quickSuggestionsDelay: [{
                type: Input
            }], parameterHints: [{
                type: Input
            }], iconsInSuggestions: [{
                type: Input
            }], autoClosingBrackets: [{
                type: Input
            }], formatOnType: [{
                type: Input
            }], formatOnPaste: [{
                type: Input
            }], suggestOnTriggerCharacters: [{
                type: Input
            }], acceptSuggestionOnEnter: [{
                type: Input
            }], acceptSuggestionOnCommitCharacter: [{
                type: Input
            }], snippetSuggestions: [{
                type: Input
            }], emptySelectionClipboard: [{
                type: Input
            }], tabCompletion: [{
                type: Input
            }], wordBasedSuggestions: [{
                type: Input
            }], suggestFontSize: [{
                type: Input
            }], suggestLineHeight: [{
                type: Input
            }], selectionHighlight: [{
                type: Input
            }], codeLens: [{
                type: Input
            }], folding: [{
                type: Input
            }], renderWhitespace: [{
                type: Input
            }], renderControlCharacters: [{
                type: Input
            }], renderIndentGuides: [{
                type: Input
            }], renderLineHighlight: [{
                type: Input
            }], useTabStops: [{
                type: Input
            }], fontFamily: [{
                type: Input
            }], fontWeight: [{
                type: Input
            }], fontSize: [{
                type: Input
            }], lineHeight: [{
                type: Input
            }], language: [{
                type: Input
            }], value: [{
                type: Input
            }], valueToCompare: [{
                type: Input
            }] } });

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
class MonacoEditorControlModule {
}
MonacoEditorControlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
MonacoEditorControlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorControlModule, declarations: [MonacoEditorControlComponent], imports: [CommonModule,
        FormsModule,
        ResizeListenerModule], exports: [MonacoEditorControlComponent] });
MonacoEditorControlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorControlModule, imports: [[
            CommonModule,
            FormsModule,
            ResizeListenerModule
        ]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorControlModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [MonacoEditorControlComponent],
                    exports: [MonacoEditorControlComponent],
                    imports: [
                        CommonModule,
                        FormsModule,
                        ResizeListenerModule
                    ]
                }]
        }] });

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
/**
 * Configuration options for editor scrollbars
 */
class EditorScrollbarOptions {
}

/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
class MonacoEditorModule {
}
MonacoEditorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
MonacoEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorModule, declarations: [MonacoEditorComponent], imports: [CommonModule,
        FormsModule,
        MonacoEditorControlModule], exports: [MonacoEditorComponent] });
MonacoEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorModule, imports: [[
            CommonModule,
            FormsModule,
            MonacoEditorControlModule
        ]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: MonacoEditorModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [MonacoEditorComponent],
                    exports: [MonacoEditorComponent],
                    imports: [
                        CommonModule,
                        FormsModule,
                        MonacoEditorControlModule
                    ]
                }]
        }] });

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

export { EditorScrollbarOptions, MonacoEditorComponent, MonacoEditorModule };
//# sourceMappingURL=deja-js-component-v2-monaco-editor.mjs.map
