/**
 * @fileoverview added by tsickle
 * Generated from: common/activity-reporter/banner-activity-reporter.component.ts
 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { __extends } from "tslib";
/*!
 * Copyright 2020 VMware, Inc.
 * SPDX-License-Identifier: BSD-2-Clause
 */
import { Component, Inject, Input } from '@angular/core';
import { TranslationService } from '@vcd/i18n';
import { ActivityPromiseResolver } from './activity-promise-resolver';
import { ActivityReporter } from './activity-reporter';
/**
 * Shows a banner to the user to represent the state of an activity.
 */
var BannerActivityReporterComponent = /** @class */ (function (_super) {
    __extends(BannerActivityReporterComponent, _super);
    function BannerActivityReporterComponent(translationService, promiseResolver) {
        var _this = _super.call(this, promiseResolver) || this;
        _this.translationService = translationService;
        _this.running = false;
        /**
         * The translated message that is displayed to the user while loading.
         */
        _this.loadingMessage = _this.translationService.translateAsync('vcd.cc.loading');
        return _this;
    }
    /**
     * Begins to show the banner with a loading indicator.
     */
    /**
     * Begins to show the banner with a loading indicator.
     * @return {?}
     */
    BannerActivityReporterComponent.prototype.startActivity = /**
     * Begins to show the banner with a loading indicator.
     * @return {?}
     */
    function () {
        this.running = true;
        this.successMessage = null;
        this.errorText = null;
    };
    /**
     * Shows the given {@param errorText} to the user.
     */
    /**
     * Shows the given {\@param errorText} to the user.
     * @param {?} errorText
     * @return {?}
     */
    BannerActivityReporterComponent.prototype.reportError = /**
     * Shows the given {\@param errorText} to the user.
     * @param {?} errorText
     * @return {?}
     */
    function (errorText) {
        this.errorText = errorText;
        this.running = false;
    };
    /**
     * Shows the given {@param successMessage} to the user.
     */
    /**
     * Shows the given {\@param successMessage} to the user.
     * @param {?} successMessage
     * @return {?}
     */
    BannerActivityReporterComponent.prototype.reportSuccess = /**
     * Shows the given {\@param successMessage} to the user.
     * @param {?} successMessage
     * @return {?}
     */
    function (successMessage) {
        if (successMessage) {
            this.successMessage = successMessage;
        }
        this.running = false;
    };
    /**
     * Closes the error message if displayed.
     */
    /**
     * Closes the error message if displayed.
     * @return {?}
     */
    BannerActivityReporterComponent.prototype.onErrorClosed = /**
     * Closes the error message if displayed.
     * @return {?}
     */
    function () {
        this.errorText = null;
    };
    /**
     * Closes the success message if displayed.
     */
    /**
     * Closes the success message if displayed.
     * @return {?}
     */
    BannerActivityReporterComponent.prototype.onSuccessClosed = /**
     * Closes the success message if displayed.
     * @return {?}
     */
    function () {
        this.successMessage = null;
    };
    /*
     * Reset the banner activity state manually.
     *
     * Call it when banner should be reset to its default state.
     */
    /*
         * Reset the banner activity state manually.
         *
         * Call it when banner should be reset to its default state.
         */
    /**
     * @return {?}
     */
    BannerActivityReporterComponent.prototype.reset = /*
         * Reset the banner activity state manually.
         *
         * Call it when banner should be reset to its default state.
         */
    /**
     * @return {?}
     */
    function () {
        this.running = false;
        this.errorText = null;
        this.successMessage = null;
    };
    BannerActivityReporterComponent.decorators = [
        { type: Component, args: [{
                    selector: 'vcd-banner-activity-reporter',
                    template: "<clr-alert *ngIf=\"running\" clrAlertType=\"alert-info\" [clrAlertClosable]=\"false\">\n    <div>{{ loadingMessage | lazyString }}</div>\n</clr-alert>\n\n<clr-alert *ngIf=\"errorText\" clrAlertType=\"danger\" (clrAlertClosed)=\"onErrorClosed()\">\n    <div clr-alert-item class=\"alert-item\">\n        <span class=\"alert-text\">\n            {{ errorText }}\n        </span>\n    </div>\n</clr-alert>\n\n<clr-alert *ngIf=\"successMessage\" clrAlertType=\"success\" (clrAlertClosed)=\"onSuccessClosed()\">\n    <div clr-alert-item class=\"alert-item\">\n        <span class=\"alert-text\">\n            {{ successMessage }}\n        </span>\n    </div>\n</clr-alert>\n"
                }] }
    ];
    /** @nocollapse */
    BannerActivityReporterComponent.ctorParameters = function () { return [
        { type: TranslationService },
        { type: ActivityPromiseResolver, decorators: [{ type: Inject, args: [ActivityPromiseResolver,] }] }
    ]; };
    BannerActivityReporterComponent.propDecorators = {
        loadingMessage: [{ type: Input }]
    };
    return BannerActivityReporterComponent;
}(ActivityReporter));
export { BannerActivityReporterComponent };
if (false) {
    /** @type {?} */
    BannerActivityReporterComponent.prototype.running;
    /** @type {?} */
    BannerActivityReporterComponent.prototype.errorText;
    /** @type {?} */
    BannerActivityReporterComponent.prototype.successMessage;
    /**
     * The translated message that is displayed to the user while loading.
     * @type {?}
     */
    BannerActivityReporterComponent.prototype.loadingMessage;
    /**
     * @type {?}
     * @private
     */
    BannerActivityReporterComponent.prototype.translationService;
}
//# sourceMappingURL=data:application/json;base64, 