import { Component, Input, Output, EventEmitter } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@c8y/ngx-components";
import * as i2 from "@angular/common";
import * as i3 from "ngx-bootstrap/tooltip";
export class OpcuaServerListComponent {
    constructor() {
        this.serverList = [];
        this.present = new EventEmitter();
    }
    presentConfig(server) {
        server.active = true;
        this.present.emit(server);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OpcuaServerListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: OpcuaServerListComponent, selector: "opcua-server-list", inputs: { serverList: "serverList" }, outputs: { present: "present" }, ngImport: i0, template: "<!-- add active class to c8y-stacked-item when clicked -->\n<div class=\"card-block\" *ngIf=\"serverList.length === 0\">\n  <c8y-ui-empty-state\n    class=\"m-l-auto p-l-8 d-flex p-r-16\"\n    [icon]=\"'server'\"\n    [title]=\"'No servers found.' | translate\"\n    [subtitle]=\"'Click below to add a new server.' | translate\"\n  ></c8y-ui-empty-state>\n</div>\n<div\n  class=\"c8y-stacked-item\"\n  [class.active]=\"server.active\"\n  *ngFor=\"let server of serverList\"\n  (click)=\"presentConfig(server)\"\n>\n  <i [c8yIcon]=\"'server'\" class=\"icon-20\"></i>\n  <div class=\"p-l-16 text-truncate\">\n    <p id=\"serverName\" class=\"text-truncate\">{{ server.name }}</p>\n    <small id=\"serverUrl\" class=\"text-truncate text-muted\">{{ server.config.serverUrl }}</small>\n  </div>\n  <div class=\"m-l-auto p-l-8 d-flex p-r-16 a-i-center\">\n    <device-status class=\"p-r-8\" [mo]=\"server\"></device-status>\n    <button\n      class=\"btn btn-dot text-gray-darker\"\n      type=\"button\"\n      [attr.aria-label]=\"server.quickInfo.padlockMsg | translate\"\n      tooltip=\"{{ server.quickInfo.padlockMsg | translate }}\"\n      placement=\"left\"\n      container=\"body\"\n    >\n      <i [c8yIcon]=\"server.quickInfo.padlock\"></i>\n    </button>\n  </div>\n</div>\n", dependencies: [{ kind: "component", type: i1.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.DeviceStatusComponent, selector: "device-status, c8y-device-status", inputs: ["mo", "size"] }, { 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: i1.C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OpcuaServerListComponent, decorators: [{
            type: Component,
            args: [{ selector: 'opcua-server-list', template: "<!-- add active class to c8y-stacked-item when clicked -->\n<div class=\"card-block\" *ngIf=\"serverList.length === 0\">\n  <c8y-ui-empty-state\n    class=\"m-l-auto p-l-8 d-flex p-r-16\"\n    [icon]=\"'server'\"\n    [title]=\"'No servers found.' | translate\"\n    [subtitle]=\"'Click below to add a new server.' | translate\"\n  ></c8y-ui-empty-state>\n</div>\n<div\n  class=\"c8y-stacked-item\"\n  [class.active]=\"server.active\"\n  *ngFor=\"let server of serverList\"\n  (click)=\"presentConfig(server)\"\n>\n  <i [c8yIcon]=\"'server'\" class=\"icon-20\"></i>\n  <div class=\"p-l-16 text-truncate\">\n    <p id=\"serverName\" class=\"text-truncate\">{{ server.name }}</p>\n    <small id=\"serverUrl\" class=\"text-truncate text-muted\">{{ server.config.serverUrl }}</small>\n  </div>\n  <div class=\"m-l-auto p-l-8 d-flex p-r-16 a-i-center\">\n    <device-status class=\"p-r-8\" [mo]=\"server\"></device-status>\n    <button\n      class=\"btn btn-dot text-gray-darker\"\n      type=\"button\"\n      [attr.aria-label]=\"server.quickInfo.padlockMsg | translate\"\n      tooltip=\"{{ server.quickInfo.padlockMsg | translate }}\"\n      placement=\"left\"\n      container=\"body\"\n    >\n      <i [c8yIcon]=\"server.quickInfo.padlock\"></i>\n    </button>\n  </div>\n</div>\n" }]
        }], propDecorators: { serverList: [{
                type: Input
            }], present: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BjdWEtc2VydmVyLWxpc3QuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvdG9jb2wtb3BjdWEvb3BjdWEtc2VydmVyLWxpc3QuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vcHJvdG9jb2wtb3BjdWEvb3BjdWEtc2VydmVyLWxpc3QuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLGVBQWUsQ0FBQzs7Ozs7QUFPdkUsTUFBTSxPQUFPLHdCQUF3QjtJQUpyQztRQUtXLGVBQVUsR0FBa0IsRUFBRSxDQUFDO1FBQzlCLFlBQU8sR0FBRyxJQUFJLFlBQVksRUFBZSxDQUFDO0tBTXJEO0lBSkMsYUFBYSxDQUFDLE1BQW1CO1FBQy9CLE1BQU0sQ0FBQyxNQUFNLEdB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