import { Component, Input } from '@angular/core';
import { AGGREGATION_ICONS, AGGREGATION_TEXTS } from '../../../aggregation/aggregation.model';
import { gettext } from '../../../i18n';
import * as i0 from "@angular/core";
import * as i1 from "../../../common/icon.directive";
import * as i2 from "@angular/common";
import * as i3 from "ngx-bootstrap/tooltip";
import * as i4 from "@ngx-translate/core";
export class WidgetTimeContextIconBar {
    constructor() {
        this.AGGREGATION_ICONS = AGGREGATION_ICONS;
        this.AGGREGATION_TEXTS = AGGREGATION_TEXTS;
    }
    ngOnInit() {
        if (this.config.displaySettings.globalRealtimeContext &&
            !this.config.displaySettings.globalTimeContext) {
            this.globalContextButtonText = gettext('This widget is in sync with the dashboard realtime context.');
        }
        else {
            this.globalContextButtonText = gettext('This widget is in sync with the dashboard time range.');
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextIconBar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: WidgetTimeContextIconBar, selector: "c8y-widget-time-context-icon-bar", inputs: { config: "config" }, ngImport: i0, template: "<span class=\"m-l-auto d-flex\">\n  <button\n    class=\"btn btn-clean btn-no-focus\"\n    [attr.aria-label]=\"'Aggregation' | translate\"\n    tooltip=\"{{\n      (config?.aggregation ? AGGREGATION_TEXTS[config.aggregation] : AGGREGATION_TEXTS.undefined)\n        | translate\n    }}\"\n    placement=\"top\"\n    container=\"body\"\n    type=\"button\"\n    *ngIf=\"config.displaySettings.globalAggregationContext\"\n    [adaptivePosition]=\"false\"\n  >\n    <i\n      class=\"icon-14\"\n      [c8yIcon]=\"\n        config?.aggregation ? AGGREGATION_ICONS[config.aggregation] : AGGREGATION_ICONS.undefined\n      \"\n    ></i>\n  </button>\n  <button\n    class=\"btn c8y-realtime btn-no-focus\"\n    [attr.aria-label]=\"(config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate\"\n    tooltip=\"{{ (config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate }}\"\n    placement=\"top\"\n    container=\"body\"\n    type=\"button\"\n    *ngIf=\"config?.widgetInstanceGlobalTimeContext\"\n  >\n    <span\n      class=\"c8y-pulse m-0\"\n      [ngClass]=\"{ active: config?.realtime, inactive: !config?.realtime }\"\n    ></span>\n  </button>\n  <button\n    class=\"btn btn-clean btn-no-focus p-l-4 p-r-0\"\n    [attr.aria-label]=\"globalContextButtonText | translate\"\n    [tooltip]=\"globalContextButtonText | translate\"\n    placement=\"top\"\n    container=\"body\"\n    data-cy=\"dashboard-child--global-date-context-indicator\"\n    *ngIf=\"config?.widgetInstanceGlobalTimeContext\"\n  >\n    <span class=\"tag tag--success chip\">\n      <i c8yIcon=\"clock\"></i>\n      {{ 'Realtime' | translate }}\n    </span>\n  </button>\n</span>\n", dependencies: [{ kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: WidgetTimeContextIconBar, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-widget-time-context-icon-bar', template: "<span class=\"m-l-auto d-flex\">\n  <button\n    class=\"btn btn-clean btn-no-focus\"\n    [attr.aria-label]=\"'Aggregation' | translate\"\n    tooltip=\"{{\n      (config?.aggregation ? AGGREGATION_TEXTS[config.aggregation] : AGGREGATION_TEXTS.undefined)\n        | translate\n    }}\"\n    placement=\"top\"\n    container=\"body\"\n    type=\"button\"\n    *ngIf=\"config.displaySettings.globalAggregationContext\"\n    [adaptivePosition]=\"false\"\n  >\n    <i\n      class=\"icon-14\"\n      [c8yIcon]=\"\n        config?.aggregation ? AGGREGATION_ICONS[config.aggregation] : AGGREGATION_ICONS.undefined\n      \"\n    ></i>\n  </button>\n  <button\n    class=\"btn c8y-realtime btn-no-focus\"\n    [attr.aria-label]=\"(config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate\"\n    tooltip=\"{{ (config?.realtime ? 'Realtime active' : 'Realtime inactive') | translate }}\"\n    placement=\"top\"\n    container=\"body\"\n    type=\"button\"\n    *ngIf=\"config?.widgetInstanceGlobalTimeContext\"\n  >\n    <span\n      class=\"c8y-pulse m-0\"\n      [ngClass]=\"{ active: config?.realtime, inactive: !config?.realtime }\"\n    ></span>\n  </button>\n  <button\n    class=\"btn btn-clean btn-no-focus p-l-4 p-r-0\"\n    [attr.aria-label]=\"globalContextButtonText | translate\"\n    [tooltip]=\"globalContextButtonText | translate\"\n    placement=\"top\"\n    container=\"body\"\n    data-cy=\"dashboard-child--global-date-context-indicator\"\n    *ngIf=\"config?.widgetInstanceGlobalTimeContext\"\n  >\n    <span class=\"tag tag--success chip\">\n      <i c8yIcon=\"clock\"></i>\n      {{ 'Realtime' | translate }}\n    </span>\n  </button>\n</span>\n" }]
        }], propDecorators: { config: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 