/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Component, } from '@angular/core';
import { ControlContainer, NgForm } from '@angular/forms';
import { FVAbstractControl } from '../../../shared/abstract-control.component';
import { TranspilationService } from '../../../../services/transpilation.service';
import { ProcessService } from '../../../../services/process.service';
import { DomSanitizer } from '@angular/platform-browser';
var FVControlsHtmlContentComponent = /** @class */ (function (_super) {
    tslib_1.__extends(FVControlsHtmlContentComponent, _super);
    function FVControlsHtmlContentComponent(process, transpilation, sanitizer) {
        var _this = _super.call(this, process) || this;
        _this.process = process;
        _this.transpilation = transpilation;
        _this.sanitizer = sanitizer;
        return _this;
    }
    /**
     * @return {?}
     */
    FVControlsHtmlContentComponent.prototype.ngAfterViewInit = /**
     * @return {?}
     */
    function () {
        var _this = this;
        _super.prototype.AfterViewInit.call(this);
        if (!this.control || !this.control.content) {
            this.warn('Custom HTML without content!!');
            return;
        }
        this.transpilation.transpileHtml(this.control.content).then(function (html) {
            _this._html = _this.sanitizer.bypassSecurityTrustHtml(html);
        });
    };
    Object.defineProperty(FVControlsHtmlContentComponent.prototype, "html", {
        get: /**
         * @return {?}
         */
        function () {
            return this._html;
        },
        enumerable: true,
        configurable: true
    });
    FVControlsHtmlContentComponent.decorators = [
        { type: Component, args: [{
                    selector: 'fv-controls-html-content',
                    template: "<div *ngIf=\"control\" class=\"controlBox\">\n  <i *ngIf=\"buttonsDebug\" (click)=\"debugStatus =! debugStatus\" class=\"fa fa-stethoscope\"></i>\n  <div *ngIf=\"debugStatus\" [innerText]=\"debugText()\"></div>\n  <div [innerHtml]=\"html\"></div>\n</div>",
                    viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
                    styles: [".col{display:inline-flex;flex-basis:0;flex-grow:1;max-width:100%;min-width:50%}.col fv-form-tab{padding:0 5px;display:block;width:100%}.col fv-form-tab .controls-row{margin:0;padding:0}.col fv-form-tab div{max-width:100%}.columns-0,.columns-1{width:100%;min-width:100%;max-width:100%}.columns-2{width:50%;min-width:50%;max-width:50%}.columns-3{width:33.33%;max-width:33.33%;min-width:33.33%}.columns-4{width:25%;max-width:25%;min-width:25%}.controlBox .input-group{display:inline-flex;width:100%;margin-top:5px}.controlBox>.input-group>button:not(.input-group-addon),.controlBox>.input-group>input,.controlBox>.input-group>select{height:40px!important;width:100%;padding:10px}.controlBox .input-group button.input-group-addon{position:relative;width:35px;height:40px}.controlBox .input-group span.controlName{color:red}.controlBox .input-group button.input-group-addon i{position:absolute;top:10px;bottom:0;left:0;right:0}.has-text-centered,.table,.table thead th{text-align:center}.gridForm{width:100%;padding:0;margin:0 0 10px}.gridForm .input-group>.form-control{max-width:50%;border-radius:unset;margin-right:10px;min-width:80px;min-height:45px}.gridForm .input-group>.addon{background:0 0;border:none;color:#36c}.grid-table tbody>tr>td{vertical-align:middle}span.required{color:red}form:not(.ng-untouched) .ng-invalid{border:1px solid red}form:not(.ng-untouched) .ng-invalid.input-group-addon{border-left:none!important}span.error-block{color:red}@media screen and (max-width:426px){.columns-2,.columns-3,.columns-4{width:100%;max-width:100%;min-width:100%}}.tree:last-of-type(.accordion){margin:0}select:disabled{background:#eee}navigator-bot,navigator-top{display:flex}fv-menu-folder:last-of-type>accordion:last-of-type{margin:0;padding:0}.button-group>button:not(:last-child):not(:first-child){margin-left:0!important;padding-left:0!important;margin-right:0!important;padding-right:0!important}.fv_container,.fv_container>*,navigator-after,navigator-before{all:inherit!important;padding:0!important}.lookup-form .gridInputs{width:100%}.lookup-form .gridInputs select{width:40%}.lookup-form .gridInputs input{width:60%}.lookup-form .gridInputs,.lookup-form .gridInputs input,.lookup-form .gridInputs select{max-width:100%}.noMarginY{margin-top:0!important;margin-bottom:0!important}.placeholder,ng-select input:-moz-placeholder,ng-select input:-ms-input-placeholder,ng-select input:-webkit-input-placeholder,ng-select input:placeholder{color:#a9a9a9}select-dropdown>div{position:relative!important;top:0!important}select-dropdown div.options{text-align:left}bs-datepicker-navigation-view{display:block;width:100%;text-align:center}.bs-datepicker-head .previous{float:left}.bs-datepicker-head .next{float:right}textarea{min-height:45px;min-width:100%}.modal-dialog>.modal-content{max-height:100vh}.modal-content>.modal-body{max-height:85vh;overflow-y:auto;padding:2rem 2rem 40px}.modal-content fv-navigator.nav-bottom{display:block;height:50px;position:fixed;bottom:0;left:0;right:0;padding:0 3rem;background-color:#fdfdfd9e;border-bottom-right-radius:10px;border-bottom-left-radius:10px;margin:0 2px;z-index:999}.modal-content fv-navigator.nav-bottom.low-height{position:absolute}.modal-content fv-navigator .docked-buttons{width:auto}.modal-content fv-navigator .btn-col:not(.bottom){max-width:unset;padding:6px!important}.modal-dialog .modal-header .pull-right span{font-size:inherit!important}.basic-commands button{margin-right:5px;text-transform:capitalize}"]
                }] }
    ];
    /** @nocollapse */
    FVControlsHtmlContentComponent.ctorParameters = function () { return [
        { type: ProcessService },
        { type: TranspilationService },
        { type: DomSanitizer }
    ]; };
    return FVControlsHtmlContentComponent;
}(FVAbstractControl));
export { FVControlsHtmlContentComponent };
if (false) {
    /** @type {?} */
    FVControlsHtmlContentComponent.prototype._html;
    /** @type {?} */
    FVControlsHtmlContentComponent.prototype.process;
    /** @type {?} */
    FVControlsHtmlContentComponent.prototype.transpilation;
    /** @type {?} */
    FVControlsHtmlContentComponent.prototype.sanitizer;
}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbC1jb250ZW50LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0Bkb3Rnb3YvZm9ybXZpZXdlci8iLCJzb3VyY2VzIjpbImxpYi9jb21wb25lbnRzL3JlbmRlcmVyL2NvbnRyb2xzL0h0bWxDb250ZW50L2h0bWwtY29udGVudC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsU0FBUyxHQUF5QixNQUFNLGVBQWUsQ0FBQztBQUNqRSxPQUFPLEVBQU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