import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { AuditRecordType } from '@c8y/client';
import { gettext } from '@c8y/ngx-components';
import * as i0 from "@angular/core";
import * as i1 from "@c8y/ngx-components";
import * as i2 from "@angular/common";
import * as i3 from "@c8y/ngx-components/operations/bulk-single-operations-list";
import * as i4 from "./operation-details.component";
export class OperationDetailsTabsComponent {
    constructor() {
        this.AuditRecordType = AuditRecordType;
        this.readOnly = false;
        this.onRetryFailedOperations = new EventEmitter();
        this.showFailedOperation = new EventEmitter();
        this.tabs = [];
    }
    ngOnInit() {
        this.template = this.detailsTemplate;
        this.tabs = [
            {
                label: gettext('Details'),
                path: null,
                icon: 'asterisk',
                template: this.detailsTemplate
            },
            {
                label: gettext('History of changes'),
                path: null,
                icon: 'archive',
                template: this.auditTemplate
            }
        ];
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OperationDetailsTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: OperationDetailsTabsComponent, selector: "c8y-operation-details-tabs", inputs: { operation: "operation", readOnly: "readOnly", bulkOperationModalDetailsService: "bulkOperationModalDetailsService" }, outputs: { onRetryFailedOperations: "onRetryFailedOperations", showFailedOperation: "showFailedOperation" }, viewQueries: [{ propertyName: "detailsTemplate", first: true, predicate: ["details"], descendants: true, static: true }, { propertyName: "auditTemplate", first: true, predicate: ["audit"], descendants: true, static: true }], ngImport: i0, template: "<div\n  class=\"tabContainer\"\n  #container\n>\n  <ul class=\"nav nav-tabs nav-tabsc8y\">\n    <li\n      [ngClass]=\"{ active: tab.template === template }\"\n      *ngFor=\"let tab of tabs\"\n    >\n      <button\n        class=\"btn\"\n        [title]=\"tab.label | translate\"\n        (click)=\"template = tab.template\"\n      >\n        <i [c8yIcon]=\"tab.icon\"></i>\n        <span class=\"txt\">{{ tab.label | translate }}</span>\n      </button>\n    </li>\n  </ul>\n</div>\n\n<ng-container *ngTemplateOutlet=\"template\"></ng-container>\n\n<ng-template #details>\n  <c8y-operation-li-details\n    [operation]=\"operation\"\n    (showFailedOperation)=\"showFailedOperation.emit($event)\"\n    [bulkOperationModalDetailsService]=\"bulkOperationModalDetailsService\"\n  ></c8y-operation-li-details>\n</ng-template>\n\n<ng-template #audit>\n  <c8y-audit-log\n    [source]=\"operation.id\"\n    [type]=\"\n      !!operation.operationPrototype ? AuditRecordType.BULK_OPERATION : AuditRecordType.OPERATION\n    \"\n  ></c8y-audit-log>\n</ng-template>\n\n<c8y-single-operations-list\n  class=\"d-flex d-col\"\n  *ngIf=\"operation.operationPrototype\"\n  [bulkOperation]=\"operation\"\n  [readOnly]=\"readOnly\"\n  (onRetryFailedOperations)=\"onRetryFailedOperations.emit($event)\"\n></c8y-single-operations-list>\n", dependencies: [{ kind: "component", type: i1.AuditLogComponent, selector: "c8y-audit-log", inputs: ["source", "type"] }, { kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.SingleOperationsListComponent, selector: "c8y-single-operations-list", inputs: ["bulkOperation", "readOnly"], outputs: ["onRetryFailedOperations"] }, { kind: "component", type: i4.OperationListItemDetailsComponent, selector: "c8y-operation-li-details", inputs: ["operation", "bulkOperationModalDetailsService"], outputs: ["showFailedOperation"] }, { kind: "pipe", type: i1.C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: OperationDetailsTabsComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-operation-details-tabs', template: "<div\n  class=\"tabContainer\"\n  #container\n>\n  <ul class=\"nav nav-tabs nav-tabsc8y\">\n    <li\n      [ngClass]=\"{ active: tab.template === template }\"\n      *ngFor=\"let tab of tabs\"\n    >\n      <button\n        class=\"btn\"\n        [title]=\"tab.label | translate\"\n        (click)=\"template = tab.template\"\n      >\n        <i [c8yIcon]=\"tab.icon\"></i>\n        <span class=\"txt\">{{ tab.label | translate }}</span>\n      </button>\n    </li>\n  </ul>\n</div>\n\n<ng-container *ngTemplateOutlet=\"template\"></ng-container>\n\n<ng-template #details>\n  <c8y-operation-li-details\n    [operation]=\"operation\"\n    (showFailedOperation)=\"showFailedOperation.emit($event)\"\n    [bulkOperationModalDetailsService]=\"bulkOperationModalDetailsService\"\n  ></c8y-operation-li-details>\n</ng-template>\n\n<ng-template #audit>\n  <c8y-audit-log\n    [source]=\"operation.id\"\n    [type]=\"\n      !!operation.operationPrototype ? AuditRecordType.BULK_OPERATION : AuditRecordType.OPERATION\n    \"\n  ></c8y-audit-log>\n</ng-template>\n\n<c8y-single-operations-list\n  class=\"d-flex d-col\"\n  *ngIf=\"operation.operationPrototype\"\n  [bulkOperation]=\"operation\"\n  [readOnly]=\"readOnly\"\n  (onRetryFailedOperations)=\"onRetryFailedOperations.emit($event)\"\n></c8y-single-operations-list>\n" }]
        }], propDecorators: { operation: [{
                type: Input
            }], readOnly: [{
                type: Input
            }], bulkOperationModalDetailsService: [{
                type: Input
            }], onRetryFailedOperations: [{
                type: Output
            }], showFailedOperation: [{
                type: Output
            }], detailsTemplate: [{
                type: ViewChild,
                args: ['details', { static: true }]
            }], auditTemplate: [{
                type: ViewChild,
                args: ['audit', { static: true }]
            }] } });
//# sourceMappingURL=data:application/json;base64, 