import { Component, EventEmitter, Input, Output } from '@angular/core';
import { TapConnectionStoreService } from '../tap-connection-store.service';
import * as i0 from "@angular/core";
import * as i1 from "../tap-connection-store.service";
import * as i2 from "@angular/common";
import * as i3 from "@ionic/angular";
export class TapConnectionStoreItemComponent {
    constructor(tapConnectionStoreService) {
        this.tapConnectionStoreService = tapConnectionStoreService;
        this.selected = new EventEmitter();
    }
    connect() {
        if (this.item) {
            this.selected.emit(this.item);
        }
    }
    remove() {
        if (this.item) {
            this.tapConnectionStoreService.remove(this.item);
        }
    }
}
/** @nocollapse */ TapConnectionStoreItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TapConnectionStoreItemComponent, deps: [{ token: i1.TapConnectionStoreService }], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ TapConnectionStoreItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TapConnectionStoreItemComponent, selector: "tap-connection-store-item", inputs: { item: "item" }, outputs: { selected: "selected" }, ngImport: i0, template: "<ion-card *ngIf=\"item\" (click)=\"connect()\" [button]=\"true\">\n  <ion-list class=\"store-list\">\n    <ion-item style=\"margin-bottom: 4px\">\n      &nbsp;\n      <span class=\"title\">{{ item.config.appName }}</span>\n      &nbsp;\n      <ion-button slot=\"end\" color=\"danger\" fill=\"clear\" (click)=\"remove()\">\n        <ion-icon name=\"close\"></ion-icon>\n        <!-- &nbsp; Remove -->\n      </ion-button>\n    </ion-item>\n    <!-- <ion-item\n\t\t\tclass=\"extra-info\">\n\t\t\t<ion-icon name=\"time\"></ion-icon>\n\t\t\t&nbsp;\n\t\t\t{{ item.meta.lastConnection | date }}\n\t\t</ion-item> -->\n    <!-- <ion-item class=\"extra-info\">\n\t\t\t<ion-icon name=\"information-circle\"></ion-icon>\n      &nbsp;\n      v{{ item.config.version }}\n\t\t</ion-item> -->\n    <ion-item class=\"extra-info\" lines=\"none\">\n      <ion-icon color=\"primary\" name=\"hardware-chip\"></ion-icon>\n      &nbsp;\n      <!-- <ion-label>Serial number</ion-label> -->\n      {{ item.config.serialNumber }}\n      <ion-badge slot=\"end\">\n        {{ item.connection.type }}\n      </ion-badge>\n    </ion-item>\n    <ion-item\n      *ngIf=\"item.connection.type === 'mqtt'\"\n      class=\"extra-info\"\n      lines=\"none\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon color=\"primary\" name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.endpoint }}</span>\n    </ion-item>\n    <ion-item\n      *ngIf=\"item.connection.type === 'ble'\"\n      class=\"extra-info\"\n      lines=\"none\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon color=\"primary\" name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.mac }}</span>\n    </ion-item>\n    <ion-item\n      *ngIf=\"\n        item.connection.type === 'socket' ||\n        item.connection.type === 'websocket'\n      \"\n      lines=\"none\"\n      class=\"extra-info\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon color=\"primary\" name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.url }}</span>\n    </ion-item>\n    <ion-item\n      *ngIf=\"item.connection.type === 'wifi'\"\n      class=\"extra-info\"\n      lines=\"none\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon color=\"primary\" name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.ssid }}</span>\n    </ion-item>\n    <!-- <ion-item>\n\t\t\t\t\t<ion-buttons slot=\"end\">\n\t\t\t\t\t\n\t\t\t\t\t\t<ion-button slot=\"end\" color=\"primary\" fill=\"clear\" (click)=\"connect()\">\n\t\t\t\t\t\t\t<ion-icon name=\"log-in\"></ion-icon>\n\t\t\t\t\t\t\t&nbsp; Connect\n\t\t\t\t\t\t</ion-button>\n\t\t\t\t\t</ion-buttons>\n\t\t\t\t</ion-item> -->\n  </ion-list>\n</ion-card>\n", styles: [".config-version{font-size:.8em;opacity:.7}.extra-info{font-size:.95em;opacity:.7;padding-top:0;padding-bottom:0;--min-height: 16px}.store-list{padding-top:0}.title{font-size:1.1em}ion-card{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.IonBadge, selector: "ion-badge", inputs: ["color", "mode"] }, { kind: "component", type: i3.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i3.IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: i3.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i3.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i3.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TapConnectionStoreItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'tap-connection-store-item', template: "<ion-card *ngIf=\"item\" (click)=\"connect()\" [button]=\"true\">\n  <ion-list class=\"store-list\">\n    <ion-item style=\"margin-bottom: 4px\">\n      &nbsp;\n      <span class=\"title\">{{ item.config.appName }}</span>\n      &nbsp;\n      <ion-button slot=\"end\" color=\"danger\" fill=\"clear\" (click)=\"remove()\">\n        <ion-icon name=\"close\"></ion-icon>\n        <!-- &nbsp; Remove -->\n      </ion-button>\n    </ion-item>\n    <!-- <ion-item\n\t\t\tclass=\"extra-info\">\n\t\t\t<ion-icon name=\"time\"></ion-icon>\n\t\t\t&nbsp;\n\t\t\t{{ item.meta.lastConnection | date }}\n\t\t</ion-item> -->\n    <!-- <ion-item class=\"extra-info\">\n\t\t\t<ion-icon name=\"information-circle\"></ion-icon>\n      &nbsp;\n      v{{ item.config.version }}\n\t\t</ion-item> -->\n    <ion-item class=\"extra-info\" lines=\"none\">\n      <ion-icon color=\"primary\" name=\"hardware-chip\"></ion-icon>\n      &nbsp;\n      <!-- <ion-label>Serial number</ion-label> -->\n      {{ item.config.serialNumber }}\n      <ion-badge slot=\"end\">\n        {{ item.connection.type }}\n      </ion-badge>\n    </ion-item>\n    <ion-item\n      *ngIf=\"item.connection.type === 'mqtt'\"\n      class=\"extra-info\"\n      lines=\"none\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon color=\"primary\" name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.endpoint }}</span>\n    </ion-item>\n    <ion-item\n      *ngIf=\"item.connection.type === 'ble'\"\n      class=\"extra-info\"\n      lines=\"none\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon color=\"primary\" name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.mac }}</span>\n    </ion-item>\n    <ion-item\n      *ngIf=\"\n        item.connection.type === 'socket' ||\n        item.connection.type === 'websocket'\n      \"\n      lines=\"none\"\n      class=\"extra-info\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon color=\"primary\" name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.url }}</span>\n    </ion-item>\n    <ion-item\n      *ngIf=\"item.connection.type === 'wifi'\"\n      class=\"extra-info\"\n      lines=\"none\"\n    >\n      <!-- <ion-label>Last connection</ion-label> -->\n      <ion-icon color=\"primary\" name=\"link\"></ion-icon>\n      &nbsp;\n      <span class=\"\">{{ item.connection.info.ssid }}</span>\n    </ion-item>\n    <!-- <ion-item>\n\t\t\t\t\t<ion-buttons slot=\"end\">\n\t\t\t\t\t\n\t\t\t\t\t\t<ion-button slot=\"end\" color=\"primary\" fill=\"clear\" (click)=\"connect()\">\n\t\t\t\t\t\t\t<ion-icon name=\"log-in\"></ion-icon>\n\t\t\t\t\t\t\t&nbsp; Connect\n\t\t\t\t\t\t</ion-button>\n\t\t\t\t\t</ion-buttons>\n\t\t\t\t</ion-item> -->\n  </ion-list>\n</ion-card>\n", styles: [".config-version{font-size:.8em;opacity:.7}.extra-info{font-size:.95em;opacity:.7;padding-top:0;padding-bottom:0;--min-height: 16px}.store-list{padding-top:0}.title{font-size:1.1em}ion-card{cursor:pointer}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.TapConnectionStoreService }]; }, propDecorators: { item: [{
                type: Input
            }], selected: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 