import { Component, EventEmitter, Input, Output } from '@angular/core';
import { C8yStepper, WizardComponent } from '@c8y/ngx-components';
import { EcosystemService } from '../../ecosystem.service';
import * as i0 from "@angular/core";
import * as i1 from "../../ecosystem.service";
import * as i2 from "@c8y/ngx-components";
import * as i3 from "@angular/common";
export class DuplicateApplicationListComponent {
    constructor(ecosystemService, wizardComponent) {
        this.ecosystemService = ecosystemService;
        this.wizardComponent = wizardComponent;
        this.onSelectedApp = new EventEmitter();
    }
    select(selectedApp) {
        this.onSelectedApp.emit(selectedApp);
        this.stepper.next();
    }
    cancel() {
        this.wizardComponent.close();
    }
    back() {
        this.wizardComponent.reset();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DuplicateApplicationListComponent, deps: [{ token: i1.EcosystemService }, { token: i2.WizardComponent }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DuplicateApplicationListComponent, selector: "c8y-duplicate-application-list", inputs: { stepper: "stepper", existingApps: "existingApps" }, outputs: { onSelectedApp: "onSelectedApp" }, ngImport: i0, template: "<div class=\"c8y-wizard-list-nav\">\n  <button\n    (click)=\"select(app)\"\n    *ngFor=\"let app of existingApps\"\n    class=\"list-group-item text-truncate p-t-8 p-b-8 bg-level-0\"\n    type=\"button\"\n  >\n    <c8y-app-icon\n      [app]=\"app\"\n      [contextPath]=\"app.contextPath\"\n      [name]=\"app.name\"\n      class=\"list-group-icon\"\n    ></c8y-app-icon>\n    <span [innerText]=\"app | humanizeAppName | async\" class=\"pointer\"></span>\n    <span [ngClass]=\"ecosystemService.getAppState(app).class\" class=\"label m-l-16\">\n      {{ ecosystemService.getAppState(app).label | translate }}\n    </span>\n  </button>\n</div>\n<c8y-wizard-footer>\n  <button (click)=\"back()\" class=\"btn btn-default\" title=\"{{ 'Back' | translate }}\" type=\"button\">\n    {{ 'Back' | translate }}\n  </button>\n  <button\n    (click)=\"cancel()\"\n    class=\"btn btn-default\"\n    title=\"{{ 'Cancel' | translate }}\"\n    type=\"button\"\n  >\n    {{ 'Cancel' | translate }}\n  </button>\n</c8y-wizard-footer>\n", dependencies: [{ kind: "component", type: i2.AppIconComponent, selector: "c8y-app-icon", inputs: ["contextPath", "name", "app"] }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.WizardFooterComponent, selector: "c8y-wizard-footer" }, { kind: "pipe", type: i2.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.HumanizeAppNamePipe, name: "humanizeAppName" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DuplicateApplicationListComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-duplicate-application-list', template: "<div class=\"c8y-wizard-list-nav\">\n  <button\n    (click)=\"select(app)\"\n    *ngFor=\"let app of existingApps\"\n    class=\"list-group-item text-truncate p-t-8 p-b-8 bg-level-0\"\n    type=\"button\"\n  >\n    <c8y-app-icon\n      [app]=\"app\"\n      [contextPath]=\"app.contextPath\"\n      [name]=\"app.name\"\n      class=\"list-group-icon\"\n    ></c8y-app-icon>\n    <span [innerText]=\"app | humanizeAppName | async\" class=\"pointer\"></span>\n    <span [ngClass]=\"ecosystemService.getAppState(app).class\" class=\"label m-l-16\">\n      {{ ecosystemService.getAppState(app).label | translate }}\n    </span>\n  </button>\n</div>\n<c8y-wizard-footer>\n  <button (click)=\"back()\" class=\"btn btn-default\" title=\"{{ 'Back' | translate }}\" type=\"button\">\n    {{ 'Back' | translate }}\n  </button>\n  <button\n    (click)=\"cancel()\"\n    class=\"btn btn-default\"\n    title=\"{{ 'Cancel' | translate }}\"\n    type=\"button\"\n  >\n    {{ 'Cancel' | translate }}\n  </button>\n</c8y-wizard-footer>\n" }]
        }], ctorParameters: () => [{ type: i1.EcosystemService }, { type: i2.WizardComponent }], propDecorators: { stepper: [{
                type: Input
            }], existingApps: [{
                type: Input
            }], onSelectedApp: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 