/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,uselessCode} checked by tsc
 */
import * as tslib_1 from "tslib";
import { Injectable, EventEmitter } from '@angular/core';
import { StorageService } from '@dotgov/core';
var FVFormBuilderService = /** @class */ (function (_super) {
    tslib_1.__extends(FVFormBuilderService, _super);
    function FVFormBuilderService() {
        var _this = _super.call(this) || this;
        _this.onFocus = new EventEmitter();
        _this.onFocusLost = new EventEmitter();
        _this._processBuilderStatusChanged = new EventEmitter();
        return _this;
    }
    Object.defineProperty(FVFormBuilderService.prototype, "processBuilderStatus", {
        get: /**
         * @return {?}
         */
        function () {
            return this._processBuilderStatus;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FVFormBuilderService.prototype, "canRunBuilder", {
        get: /**
         * @return {?}
         */
        function () {
            return this._canRunProcessBuilder;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FVFormBuilderService.prototype, "focus", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.onFocus.emit(value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FVFormBuilderService.prototype, "focusLost", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            this.onFocusLost.emit(value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FVFormBuilderService.prototype, "processBuilder", {
        set: /**
         * @param {?} value
         * @return {?}
         */
        function (value) {
            if (!this._canRunProcessBuilder) {
                return;
            }
            this._processBuilderStatus = value;
            this._processBuilderStatusChanged.emit(value);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FVFormBuilderService.prototype, "_canRunBuilder", {
        set: /**
         * @param {?} userData
         * @return {?}
         */
        function (userData) {
            /** @type {?} */
            var isAdmin = userData && userData.isAdmin;
            this._canRunProcessBuilder = userData ? isAdmin : false;
        },
        enumerable: true,
        configurable: true
    });
    FVFormBuilderService.decorators = [
        { type: Injectable },
    ];
    /** @nocollapse */
    FVFormBuilderService.ctorParameters = function () { return []; };
    return FVFormBuilderService;
}(StorageService));
export { FVFormBuilderService };
if (false) {
    /** @type {?} */
    FVFormBuilderService.prototype.onFocus;
    /** @type {?} */
    FVFormBuilderService.prototype.onFocusLost;
    /** @type {?} */
    FVFormBuilderService.prototype._canRunProcessBuilder;
    /** @type {?} */
    FVFormBuilderService.prototype._processBuilderStatus;
    /** @type {?} */
    FVFormBuilderService.prototype._processBuilderStatusChanged;
}

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