import { __decorate, __metadata } from "tslib";
import { handlePixel } from '@alauda/ui';
import { ChangeDetectionStrategy, Component, ContentChildren, EventEmitter, HostBinding, Input, Output, QueryList, } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { get, isFunction, isObjectLike, isString, last } from 'lodash-es';
import { combineLatest, map, merge, Observable, of, ReplaySubject, switchMap, } from 'rxjs';
import { ACTION, CREATED_TIME, LINK, UPDATE, } from '../core/constants/constants';
import { isFieldNotAvailable } from '../core/pipes/field-not-available.pipe';
import { CREATOR, NAME } from '../core/services/k8s-util.service';
import { K8sResourceAction } from '../core/types/k8s/raw';
import { isK8sResource, noop, trackByUid } from '../core/utils/common';
import { ObservableInput } from '../core/utils/decorators';
import { publishRef } from '../core/utils/operators';
import { K8SResourceList } from '../k8s-resource-list/k8s-resource-list';
import { TableCellDefDirective } from './helpers.directive';
import { KNOWN_COLUMNS, TableUtilService } from './util.service';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "./util.service";
function TableComponent_ng_container_3_aui_table_header_cell_1_ng_container_1_span_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 16);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const columnDef_r14 = i0.ɵɵnextContext(3).$implicit;
    i0.ɵɵproperty("start", columnDef_r14.sort.direction);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 2, columnDef_r14.label || columnDef_r14.name));
} }
function TableComponent_ng_container_3_aui_table_header_cell_1_ng_container_1_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const columnDef_r14 = i0.ɵɵnextContext(3).$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, columnDef_r14.label || columnDef_r14.name));
} }
function TableComponent_ng_container_3_aui_table_header_cell_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_container_3_aui_table_header_cell_1_ng_container_1_span_1_Template, 3, 4, "span", 15);
    i0.ɵɵtemplate(2, TableComponent_ng_container_3_aui_table_header_cell_1_ng_container_1_span_2_Template, 3, 3, "span", 14);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const columnDef_r14 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", columnDef_r14.sort);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !columnDef_r14.sort);
} }
function TableComponent_ng_container_3_aui_table_header_cell_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "aui-table-header-cell");
    i0.ɵɵtemplate(1, TableComponent_ng_container_3_aui_table_header_cell_1_ng_container_1_Template, 3, 2, "ng-container", 14);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const columnDef_r14 = i0.ɵɵnextContext().$implicit;
    const ctx_r15 = i0.ɵɵnextContext();
    i0.ɵɵstyleMap(columnDef_r14.style);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", columnDef_r14.name !== ctx_r15.ACTION);
} }
function TableComponent_ng_container_3_aui_table_cell_2_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
const _c0 = function (a0, a1, a2, a3, a4) { return { $implicit: a0, index: a1, even: a2, odd: a3, last: a4 }; };
function TableComponent_ng_container_3_aui_table_cell_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_container_3_aui_table_cell_2_ng_container_1_ng_container_1_Template, 1, 0, "ng-container", 21);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const template_r34 = ctx.ngIf;
    const ctx_r36 = i0.ɵɵnextContext();
    const data_r24 = ctx_r36.$implicit;
    const index_r25 = ctx_r36.index;
    const even_r26 = ctx_r36.even;
    const odd_r27 = ctx_r36.odd;
    const last_r28 = ctx_r36.last;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", template_r34)("ngTemplateOutletContext", i0.ɵɵpureFunction5(2, _c0, data_r24, index_r25, even_r26, odd_r27, last_r28));
} }
function TableComponent_ng_container_3_aui_table_cell_2_ng_template_3_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
const _c1 = function (a0, a1) { return { columnDef: a0, value: a1 }; };
function TableComponent_ng_container_3_aui_table_cell_2_ng_template_3_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_container_3_aui_table_cell_2_ng_template_3_ng_container_0_ng_container_1_Template, 1, 0, "ng-container", 21);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const value_r38 = ctx.ngIf;
    const columnDef_r14 = i0.ɵɵnextContext(3).$implicit;
    i0.ɵɵnextContext();
    const _r6 = i0.ɵɵreference(13);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", _r6)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c1, columnDef_r14, value_r38));
} }
function TableComponent_ng_container_3_aui_table_cell_2_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TableComponent_ng_container_3_aui_table_cell_2_ng_template_3_ng_container_0_Template, 2, 5, "ng-container", 18);
    i0.ɵɵpipe(1, "pure");
} if (rf & 2) {
    const data_r24 = i0.ɵɵnextContext().$implicit;
    const _r32 = i0.ɵɵreference(6);
    const columnDef_r14 = i0.ɵɵnextContext().$implicit;
    const ctx_r31 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngIf", columnDef_r14.path != null && i0.ɵɵpipeBind4(1, 2, data_r24, ctx_r31.getValueFromPath, columnDef_r14.name, columnDef_r14.path))("ngIfElse", _r32);
} }
function TableComponent_ng_container_3_aui_table_cell_2_ng_template_5_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
const _c2 = function (a0, a1) { return { data: a0, columnDef: a1 }; };
function TableComponent_ng_container_3_aui_table_cell_2_ng_template_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TableComponent_ng_container_3_aui_table_cell_2_ng_template_5_ng_container_0_Template, 1, 0, "ng-container", 21);
} if (rf & 2) {
    const data_r24 = i0.ɵɵnextContext().$implicit;
    const columnDef_r14 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵnextContext();
    const _r4 = i0.ɵɵreference(11);
    i0.ɵɵproperty("ngTemplateOutlet", _r4)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c2, data_r24, columnDef_r14));
} }
function TableComponent_ng_container_3_aui_table_cell_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "aui-table-cell", 17);
    i0.ɵɵtemplate(1, TableComponent_ng_container_3_aui_table_cell_2_ng_container_1_Template, 2, 8, "ng-container", 18);
    i0.ɵɵpipe(2, "pure");
    i0.ɵɵtemplate(3, TableComponent_ng_container_3_aui_table_cell_2_ng_template_3_Template, 2, 7, "ng-template", null, 19, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵtemplate(5, TableComponent_ng_container_3_aui_table_cell_2_ng_template_5_Template, 1, 5, "ng-template", null, 20, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const _r30 = i0.ɵɵreference(4);
    const columnDef_r14 = i0.ɵɵnextContext().$implicit;
    const ctx_r16 = i0.ɵɵnextContext();
    i0.ɵɵstyleMap(columnDef_r14.style);
    i0.ɵɵproperty("direction", columnDef_r14.direction)("ngClass", columnDef_r14.class);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind2(2, 6, columnDef_r14.name, ctx_r16.getColumnTemplate))("ngIfElse", _r30);
} }
function TableComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0, 11);
    i0.ɵɵtemplate(1, TableComponent_ng_container_3_aui_table_header_cell_1_Template, 2, 3, "aui-table-header-cell", 12);
    i0.ɵɵtemplate(2, TableComponent_ng_container_3_aui_table_cell_2_Template, 7, 9, "aui-table-cell", 13);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const columnDef_r14 = ctx.$implicit;
    i0.ɵɵproperty("auiTableColumnDef", columnDef_r14.name);
} }
function TableComponent_aui_table_header_row_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "aui-table-header-row");
} }
function TableComponent_aui_table_row_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "aui-table-row");
} }
const _c3 = function (a0) { return { name: a0 }; };
function TableComponent_ng_container_9_ng_container_1_div_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const finalResourceName_r54 = ctx.ngIf;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(2, 1, "no_named_data_hint", i0.ɵɵpureFunction1(8, _c3, i0.ɵɵpipeBind3(3, 4, finalResourceName_r54, null, true))), " ");
} }
function TableComponent_ng_container_9_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 25);
    i0.ɵɵtemplate(1, TableComponent_ng_container_9_ng_container_1_div_1_ng_container_1_Template, 4, 10, "ng-container", 18);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r50 = i0.ɵɵnextContext(3);
    const _r12 = i0.ɵɵreference(20);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 2, ctx_r50.finalResourceName$))("ngIfElse", _r12);
} }
function TableComponent_ng_container_9_ng_container_1_ng_template_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "acl-k8s-resource-list-footer", 26);
    i0.ɵɵpipe(1, "async");
} if (rf & 2) {
    const ctx_r52 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("list", ctx_r52.list)("resourceName", i0.ɵɵpipeBind1(1, 2, ctx_r52.finalResourceName$));
} }
function TableComponent_ng_container_9_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_container_9_ng_container_1_div_1_Template, 3, 4, "div", 23);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵpipe(3, "async");
    i0.ɵɵtemplate(4, TableComponent_ng_container_9_ng_container_1_ng_template_4_Template, 2, 4, "ng-template", null, 24, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const _r51 = i0.ɵɵreference(5);
    const ctx_r48 = i0.ɵɵnextContext(2);
    let tmp_0_0;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !((tmp_0_0 = i0.ɵɵpipeBind1(2, 2, ctx_r48.filteredItems$)) == null ? null : tmp_0_0.length) && ((tmp_0_0 = i0.ɵɵpipeBind1(3, 4, ctx_r48.list.items$)) == null ? null : tmp_0_0.length))("ngIfElse", _r51);
} }
function TableComponent_ng_container_9_div_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r55 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", ctx_r55.noDataHint || i0.ɵɵpipeBind2(2, 1, "no_named_data_hint", i0.ɵɵpureFunction1(8, _c3, i0.ɵɵpipeBind3(3, 4, ctx_r55.resourceName, null, true))), " ");
} }
function TableComponent_ng_container_9_div_2_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "aui-icon", 28);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
} if (rf & 2) {
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, "loading_please_wait"), " ");
} }
function TableComponent_ng_container_9_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 25);
    i0.ɵɵtemplate(1, TableComponent_ng_container_9_div_2_ng_container_1_Template, 4, 10, "ng-container", 18);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵtemplate(3, TableComponent_ng_container_9_div_2_ng_template_3_Template, 3, 3, "ng-template", null, 27, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const _r56 = i0.ɵɵreference(4);
    const ctx_r49 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 2, ctx_r49.finalDataSource$))("ngIfElse", _r56);
} }
function TableComponent_ng_container_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_container_9_ng_container_1_Template, 6, 6, "ng-container", 14);
    i0.ɵɵtemplate(2, TableComponent_ng_container_9_div_2_Template, 5, 4, "div", 22);
    i0.ɵɵpipe(3, "async");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    let tmp_1_0;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r3.list);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r3.list && !((tmp_1_0 = i0.ɵɵpipeBind1(3, 2, ctx_r3.filteredItems$)) == null ? null : tmp_1_0.length));
} }
const _c4 = function (a0, a2) { return [a0, "detail", a2]; };
function TableComponent_ng_template_10_ng_container_1_div_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "a", 37);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const name_r66 = i0.ɵɵnextContext().ngIf;
    const ctx_r67 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(5, _c4, i0.ɵɵpipeBind1(2, 3, ctx_r67.isListPage$) ? ".." : ".", name_r66))("auiTooltip", name_r66);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", name_r66, " ");
} }
function TableComponent_ng_template_10_ng_container_1_div_1_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 38);
    i0.ɵɵpipe(1, "aclIsDeleting");
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const name_r66 = i0.ɵɵnextContext().ngIf;
    const data_r58 = i0.ɵɵnextContext(2).data;
    i0.ɵɵclassProp("deleting-text", i0.ɵɵpipeBind1(1, 4, data_r58));
    i0.ɵɵproperty("auiTooltip", name_r66);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(name_r66);
} }
function TableComponent_ng_template_10_ng_container_1_div_1_acl_deleting_tag_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "acl-deleting-tag", 39);
} if (rf & 2) {
    const data_r58 = i0.ɵɵnextContext(3).data;
    i0.ɵɵproperty("resource", data_r58);
} }
function TableComponent_ng_template_10_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 34);
    i0.ɵɵtemplate(1, TableComponent_ng_template_10_ng_container_1_div_1_ng_container_1_Template, 4, 8, "ng-container", 18);
    i0.ɵɵpipe(2, "aclIsDeleting");
    i0.ɵɵtemplate(3, TableComponent_ng_template_10_ng_container_1_div_1_ng_template_3_Template, 3, 6, "ng-template", null, 35, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵtemplate(5, TableComponent_ng_template_10_ng_container_1_div_1_acl_deleting_tag_5_Template, 1, 1, "acl-deleting-tag", 36);
    i0.ɵɵpipe(6, "pure");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const _r68 = i0.ɵɵreference(4);
    const ctx_r75 = i0.ɵɵnextContext(2);
    const columnDef_r59 = ctx_r75.columnDef;
    const data_r58 = ctx_r75.data;
    const ctx_r64 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", (columnDef_r59.extra == null ? null : columnDef_r59.extra.link) !== false && !i0.ɵɵpipeBind1(2, 3, data_r58))("ngIfElse", _r68);
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind2(6, 5, data_r58, ctx_r64.isK8sResource));
} }
function TableComponent_ng_template_10_ng_container_1_div_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 40);
    i0.ɵɵpipe(1, "aclIsDeleting");
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const displayName_r76 = ctx.ngIf;
    const data_r58 = i0.ɵɵnextContext(2).data;
    i0.ɵɵclassProp("deleting-text", i0.ɵɵpipeBind1(1, 3, data_r58));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", displayName_r76, " ");
} }
function TableComponent_ng_template_10_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_template_10_ng_container_1_div_1_Template, 7, 8, "div", 32);
    i0.ɵɵpipe(2, "pure");
    i0.ɵɵtemplate(3, TableComponent_ng_template_10_ng_container_1_div_3_Template, 3, 5, "div", 33);
    i0.ɵɵpipe(4, "pure");
    i0.ɵɵpipe(5, "aclDisplayName");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r78 = i0.ɵɵnextContext();
    const data_r58 = ctx_r78.data;
    const columnDef_r59 = ctx_r78.columnDef;
    const ctx_r60 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind3(2, 2, data_r58, ctx_r60.getValueFromPath, columnDef_r59.name));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind2(4, 6, data_r58, ctx_r60.isK8sResource) ? i0.ɵɵpipeBind1(5, 9, data_r58) : data_r58.displayName);
} }
function TableComponent_ng_template_10_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelement(1, "acl-relative-time", 41);
    i0.ɵɵpipe(2, "pure");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r79 = i0.ɵɵnextContext();
    const data_r58 = ctx_r79.data;
    const columnDef_r59 = ctx_r79.columnDef;
    const ctx_r61 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("time", i0.ɵɵpipeBind3(2, 1, data_r58, ctx_r61.getValueFromPath, columnDef_r59.name));
} }
const _c5 = function (a0, a1) { return { $implicit: a0, columnDef: a1 }; };
function TableComponent_ng_template_10_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "button", 42);
    i0.ɵɵelement(2, "aui-icon", 43);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r80 = i0.ɵɵnextContext();
    const data_r58 = ctx_r80.data;
    const columnDef_r59 = ctx_r80.columnDef;
    i0.ɵɵnextContext();
    const _r8 = i0.ɵɵreference(15);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("square", true)("auiDropdown", _r8)("auiDropdownContext", i0.ɵɵpureFunction2(3, _c5, data_r58, columnDef_r59));
} }
function TableComponent_ng_template_10_ng_container_4_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function TableComponent_ng_template_10_ng_container_4_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_template_10_ng_container_4_ng_container_1_ng_container_1_Template, 1, 0, "ng-container", 21);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const value_r82 = ctx.ngIf;
    const columnDef_r59 = i0.ɵɵnextContext(2).columnDef;
    i0.ɵɵnextContext();
    const _r6 = i0.ɵɵreference(13);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", _r6)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c1, columnDef_r59, value_r82));
} }
function TableComponent_ng_template_10_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_template_10_ng_container_4_ng_container_1_Template, 2, 5, "ng-container", 18);
    i0.ɵɵpipe(2, "pure");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r85 = i0.ɵɵnextContext();
    const data_r58 = ctx_r85.data;
    const columnDef_r59 = ctx_r85.columnDef;
    const ctx_r63 = i0.ɵɵnextContext();
    const _r10 = i0.ɵɵreference(18);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind3(2, 2, data_r58, ctx_r63.getValueFromPath, columnDef_r59.name))("ngIfElse", _r10);
} }
function TableComponent_ng_template_10_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0, 29);
    i0.ɵɵtemplate(1, TableComponent_ng_template_10_ng_container_1_Template, 6, 11, "ng-container", 30);
    i0.ɵɵtemplate(2, TableComponent_ng_template_10_ng_container_2_Template, 3, 5, "ng-container", 30);
    i0.ɵɵtemplate(3, TableComponent_ng_template_10_ng_container_3_Template, 3, 6, "ng-container", 30);
    i0.ɵɵtemplate(4, TableComponent_ng_template_10_ng_container_4_Template, 3, 6, "ng-container", 31);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const columnDef_r59 = ctx.columnDef;
    const ctx_r5 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngSwitch", columnDef_r59.name);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r5.NAME);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r5.CREATED_TIME);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngSwitchCase", ctx_r5.ACTION);
} }
function TableComponent_ng_template_12_ng_container_0_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 46);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const text_r89 = i0.ɵɵnextContext().ngIf;
    i0.ɵɵproperty("auiTooltip", text_r89);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", text_r89, " ");
} }
function TableComponent_ng_template_12_ng_container_0_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtext(0);
} if (rf & 2) {
    const text_r89 = i0.ɵɵnextContext().ngIf;
    i0.ɵɵtextInterpolate(text_r89);
} }
function TableComponent_ng_template_12_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_template_12_ng_container_0_div_1_Template, 2, 2, "div", 44);
    i0.ɵɵtemplate(2, TableComponent_ng_template_12_ng_container_0_ng_template_2_Template, 1, 1, "ng-template", null, 45, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const _r91 = i0.ɵɵreference(3);
    const columnDef_r86 = i0.ɵɵnextContext().columnDef;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", columnDef_r86.ellipsis)("ngIfElse", _r91);
} }
function TableComponent_ng_template_12_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TableComponent_ng_template_12_ng_container_0_Template, 4, 2, "ng-container", 18);
    i0.ɵɵpipe(1, "translate");
    i0.ɵɵpipe(2, "pure");
} if (rf & 2) {
    const columnDef_r86 = ctx.columnDef;
    const value_r87 = ctx.value;
    const ctx_r7 = i0.ɵɵnextContext();
    const _r10 = i0.ɵɵreference(18);
    i0.ɵɵproperty("ngIf", columnDef_r86.translate == null ? value_r87 : i0.ɵɵpipeBind1(1, 2, i0.ɵɵpipeBind3(2, 4, value_r87, columnDef_r86.translate, ctx_r7.finalContext)))("ngIfElse", _r10);
} }
function TableComponent_ng_container_16_acl_disabled_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r102 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "acl-disabled-container", 48);
    i0.ɵɵlistener("click", function TableComponent_ng_container_16_acl_disabled_container_1_Template_acl_disabled_container_click_0_listener() { i0.ɵɵrestoreView(_r102); const ctx_r101 = i0.ɵɵnextContext(); const data_r96 = ctx_r101.$implicit; const columnDef_r97 = ctx_r101.columnDef; const ctx_r100 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r100.onUpdate(data_r96, columnDef_r97)); });
    i0.ɵɵpipe(1, "pure");
    i0.ɵɵpipe(2, "pure");
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵpipe(4, "pure");
    i0.ɵɵelementStart(5, "aui-menu-item");
    i0.ɵɵtext(6);
    i0.ɵɵpipe(7, "translate");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r103 = i0.ɵɵnextContext();
    const columnDef_r97 = ctx_r103.columnDef;
    const data_r96 = ctx_r103.$implicit;
    const ctx_r98 = i0.ɵɵnextContext();
    i0.ɵɵproperty("isAllowed", !ctx_r98.permissions || ctx_r98.permissions.update)("isDisabled", i0.ɵɵpipeBind2(1, 4, columnDef_r97.extra == null ? null : columnDef_r97.extra.update == null ? null : columnDef_r97.extra.update.disabled.handler, ctx_r98.isFunction) && i0.ɵɵpipeBind3(2, 7, data_r96, columnDef_r97.extra.update.disabled.handler, ctx_r98.finalContext))("tooltip", i0.ɵɵpipeBind1(3, 11, i0.ɵɵpipeBind4(4, 13, columnDef_r97.extra == null ? null : columnDef_r97.extra.update == null ? null : columnDef_r97.extra.update.disabled.tooltip, ctx_r98.getValue, data_r96, ctx_r98.finalContext)));
    i0.ɵɵadvance(6);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(7, 18, "update"));
} }
function TableComponent_ng_container_16_acl_disabled_container_2_Template(rf, ctx) { if (rf & 1) {
    const _r106 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "acl-disabled-container", 48);
    i0.ɵɵlistener("click", function TableComponent_ng_container_16_acl_disabled_container_2_Template_acl_disabled_container_click_0_listener() { i0.ɵɵrestoreView(_r106); const data_r96 = i0.ɵɵnextContext().$implicit; const ctx_r104 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r104.delete.emit(data_r96)); });
    i0.ɵɵpipe(1, "pure");
    i0.ɵɵpipe(2, "pure");
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵpipe(4, "pure");
    i0.ɵɵelementStart(5, "aui-menu-item");
    i0.ɵɵtext(6);
    i0.ɵɵpipe(7, "translate");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r107 = i0.ɵɵnextContext();
    const columnDef_r97 = ctx_r107.columnDef;
    const data_r96 = ctx_r107.$implicit;
    const ctx_r99 = i0.ɵɵnextContext();
    i0.ɵɵproperty("isAllowed", !ctx_r99.permissions || ctx_r99.permissions.delete)("isDisabled", i0.ɵɵpipeBind2(1, 4, columnDef_r97.extra == null ? null : columnDef_r97.extra.delete == null ? null : columnDef_r97.extra.delete.disabled.handler, ctx_r99.isFunction) && i0.ɵɵpipeBind3(2, 7, data_r96, columnDef_r97.extra.delete.disabled.handler, ctx_r99.finalContext))("tooltip", i0.ɵɵpipeBind1(3, 11, i0.ɵɵpipeBind4(4, 13, columnDef_r97.extra == null ? null : columnDef_r97.extra.delete == null ? null : columnDef_r97.extra.delete.disabled.tooltip, ctx_r99.getValue, data_r96, ctx_r99.finalContext)));
    i0.ɵɵadvance(6);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(7, 18, "delete"));
} }
function TableComponent_ng_container_16_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_ng_container_16_acl_disabled_container_1_Template, 8, 20, "acl-disabled-container", 47);
    i0.ɵɵtemplate(2, TableComponent_ng_container_16_acl_disabled_container_2_Template, 8, 20, "acl-disabled-container", 47);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const columnDef_r97 = ctx.columnDef;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", (columnDef_r97.extra == null ? null : columnDef_r97.extra.update) !== false);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", (columnDef_r97.extra == null ? null : columnDef_r97.extra.delete) !== false);
} }
function TableComponent_ng_template_17_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtext(0);
    i0.ɵɵpipe(1, "aclFieldNotAvailable");
} if (rf & 2) {
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(1, 1, null));
} }
function TableComponent_ng_template_19_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtext(0);
    i0.ɵɵpipe(1, "translate");
} if (rf & 2) {
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(1, 1, "no_data"));
} }
export class TableComponent {
    constructor(router, route, util) {
        this.router = router;
        this.route = route;
        this.util = util;
        this.trackBy = this.trackByFn;
        this.update = new EventEmitter();
        this.delete = new EventEmitter();
        this.finalDataSource$ = this.dataSource$.pipe(switchMap(dataSource => dataSource instanceof Observable ? dataSource : of(dataSource)), publishRef());
        this.finalResourceName$ = combineLatest([this.list$, this.resourceName$]).pipe(switchMap(([list, resourceName]) => !list || resourceName
            ? of(resourceName)
            : list.rawResponse$.pipe(map(res => res?.kind.slice(0, -4).toLowerCase()))), publishRef());
        this.columnDefs$ = this.columns$.pipe(map((columns = []) => columns.map(column => {
            column = isString(column) ? { name: column } : column;
            if (!('path' in column) && !KNOWN_COLUMNS.has(column.name)) {
                column.path = column.name;
            }
            this.normalizeColumnDefSort(column);
            this.normalizeColumnDefTranslate(column);
            return this.normalizeActionColumnDef(column);
        })), publishRef());
        this.columnNames$ = this.columnDefs$.pipe(map(columns => columns.map(column => column.name)), publishRef());
        this.activeSort$$ = new ReplaySubject(1);
        this.activeSort$ = merge(this.activeSort$$, this.columnDefs$.pipe(map(columnDefs => {
            const columnDef = columnDefs.find(column => column.sort?.active);
            return columnDef
                ? { active: columnDef.name, direction: columnDef.sort.direction }
                : null;
        }))).pipe(publishRef());
        this.filteredItems$ = combineLatest([
            combineLatest([this.list$, this.finalDataSource$]).pipe(switchMap(([list, dataSource]) => (list ? list.items$ : of(dataSource)))),
            this.columnDefs$,
            this.activeSort$,
            this.filterParams$,
            this.filterFn$,
        ]).pipe(map(([items, columnDefs, activeSort, filterParams, filterFn = this.util.defaultFilterFn,]) => filterFn.call(this.finalContext, items, columnDefs, activeSort, filterParams, this.finalContext)), publishRef());
        this.isListPage$ = this.route.url.pipe(map(() => this.isListPage), publishRef());
        this.isFunction = isFunction;
        this.isK8sResource = isK8sResource;
        this.isFieldNotAvailable = isFieldNotAvailable;
        this.getValueFromPath = this.util.getValueFromPath;
        this.NAME = NAME;
        this.CREATOR = CREATOR;
        this.CREATED_TIME = CREATED_TIME;
        this.ACTION = ACTION;
        this.getColumnTemplate = this.getColumnTemplate.bind(this);
    }
    get finalContext() {
        return this.context ?? this.util;
    }
    get scrollWrapper() {
        return !!this.sticky;
    }
    get scrollWrapperHeight() {
        return handlePixel(this.sticky);
    }
    get isListPage() {
        return this.route.routeConfig?.path === 'list';
    }
    normalizeColumnDefTranslate(column) {
        let { translate } = column;
        if (translate == null) {
            return column;
        }
        if (translate === true) {
            translate = '';
        }
        if (isString(translate)) {
            column.translate = (value) => translate + value;
        }
        else if (isObjectLike(translate)) {
            column.translate = (value) => get(translate, value);
        }
        return column;
    }
    normalizeColumnDefSort(column) {
        const { sort } = column;
        if (sort == null) {
            return column;
        }
        if (sort === true) {
            column.sort = {
                direction: 'asc',
            };
        }
        else if (isString(sort)) {
            column.sort = {
                direction: sort,
            };
        }
        else if (isFunction(sort)) {
            column.sort = {
                direction: 'asc',
                handler: sort,
            };
        }
        else if (sort.direction == null) {
            sort.direction = 'asc';
        }
        return column;
    }
    normalizeActionColumnDef(column) {
        if (column.name !== ACTION || !column.extra) {
            return column;
        }
        const extra = column.extra;
        [K8sResourceAction.DELETE, K8sResourceAction.UPDATE].forEach(action => {
            if (!extra[action]) {
                return;
            }
            let handler = extra[action].disabled;
            if (handler == null) {
                handler = noop;
            }
            if (isFunction(handler)) {
                extra[action].disabled = { handler };
            }
        });
        return column;
    }
    getColumnTemplate(column) {
        return this.tableCellDefs.find(def => def.aclTableCellDef === column)
            ?.templateRef;
    }
    trackByFn(index, item) {
        return isK8sResource(item)
            ? trackByUid(index, item)
            : get(item, NAME, index);
    }
    onUpdate(data, columnDef) {
        this.update.emit(data);
        if (get(columnDef.extra, [UPDATE, LINK]) !== false) {
            this.router.navigate([
                this.isListPage ? '..' : '.',
                UPDATE,
                this.getValueFromPath(data, NAME),
            ], {
                relativeTo: this.route,
            });
        }
    }
    getValue(functionOrValue, ...args) {
        return isFunction(functionOrValue)
            ? functionOrValue.call(last(args), ...args)
            : functionOrValue;
    }
}
TableComponent.ɵfac = function TableComponent_Factory(t) { return new (t || TableComponent)(i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i1.ActivatedRoute), i0.ɵɵdirectiveInject(i2.TableUtilService)); };
TableComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TableComponent, selectors: [["acl-table"]], contentQueries: function TableComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
        i0.ɵɵcontentQuery(dirIndex, TableCellDefDirective, 4);
    } if (rf & 2) {
        let _t;
        i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tableCellDefs = _t);
    } }, hostVars: 4, hostBindings: function TableComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵstyleProp("max-height", ctx.scrollWrapperHeight);
        i0.ɵɵclassProp("aui-table__scroll-wrapper", ctx.scrollWrapper);
    } }, inputs: { list: "list", dataSource: "dataSource", resourceName: "resourceName", sticky: "sticky", permissions: "permissions", columns: "columns", filterParams: "filterParams", context: "context", filterFn: "filterFn", trackBy: "trackBy", noDataHint: "noDataHint" }, outputs: { update: "update", delete: "delete" }, decls: 21, vars: 18, consts: [["auiSort", "", 3, "active", "direction", "dataSource", "trackBy", "sortChange"], [3, "auiTableColumnDef", 4, "ngFor", "ngForOf"], [4, "auiTableHeaderRowDef", "auiTableHeaderRowDefSticky"], [4, "auiTableRowDef", "auiTableRowDefColumns"], [4, "auiTablePlaceholderDef"], ["defaultTableCell", ""], ["tableCellContent", ""], ["menu", ""], [4, "auiMenuContent"], ["empty", ""], ["noData", ""], [3, "auiTableColumnDef"], [3, "style", 4, "auiTableHeaderCellDef"], [3, "direction", "ngClass", "style", 4, "auiTableCellDef"], [4, "ngIf"], ["aui-sort-header", "", 3, "start", 4, "ngIf"], ["aui-sort-header", "", 3, "start"], [3, "direction", "ngClass"], [4, "ngIf", "ngIfElse"], ["tableCellDefTpl", ""], ["defaultTableCellTpl", ""], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], ["class", "empty-placeholder", 4, "ngIf"], ["class", "empty-placeholder", 4, "ngIf", "ngIfElse"], ["listFooter", ""], [1, "empty-placeholder"], [3, "list", "resourceName"], ["loading", ""], ["size", "16px", "icon", "spinner", 1, "acl-loading-mask__icon"], [3, "ngSwitch"], [4, "ngSwitchCase"], [4, "ngSwitchDefault"], ["class", "aui-table__cell__name", 4, "ngIf"], ["class", "aui-table__cell__display-name", 3, "deleting-text", 4, "ngIf"], [1, "aui-table__cell__name"], ["plainName", ""], [3, "resource", 4, "ngIf"], [3, "routerLink", "auiTooltip"], [3, "auiTooltip"], [3, "resource"], [1, "aui-table__cell__display-name"], [3, "time"], ["aui-button", "text", "size", "small", 3, "square", "auiDropdown", "auiDropdownContext"], ["icon", "basic:ellipsis_v_s"], ["class", "text-overflow", 3, "auiTooltip", 4, "ngIf", "ngIfElse"], ["plainText", ""], [1, "text-overflow", 3, "auiTooltip"], [3, "isAllowed", "isDisabled", "tooltip", "click", 4, "ngIf"], [3, "isAllowed", "isDisabled", "tooltip", "click"]], template: function TableComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "aui-table", 0);
        i0.ɵɵlistener("sortChange", function TableComponent_Template_aui_table_sortChange_0_listener($event) { return ctx.activeSort$$.next($event); });
        i0.ɵɵpipe(1, "async");
        i0.ɵɵpipe(2, "async");
        i0.ɵɵtemplate(3, TableComponent_ng_container_3_Template, 3, 1, "ng-container", 1);
        i0.ɵɵpipe(4, "async");
        i0.ɵɵtemplate(5, TableComponent_aui_table_header_row_5_Template, 1, 0, "aui-table-header-row", 2);
        i0.ɵɵpipe(6, "async");
        i0.ɵɵtemplate(7, TableComponent_aui_table_row_7_Template, 1, 0, "aui-table-row", 3);
        i0.ɵɵpipe(8, "async");
        i0.ɵɵtemplate(9, TableComponent_ng_container_9_Template, 4, 4, "ng-container", 4);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(10, TableComponent_ng_template_10_Template, 5, 4, "ng-template", null, 5, i0.ɵɵtemplateRefExtractor);
        i0.ɵɵtemplate(12, TableComponent_ng_template_12_Template, 3, 8, "ng-template", null, 6, i0.ɵɵtemplateRefExtractor);
        i0.ɵɵelementStart(14, "aui-menu", null, 7);
        i0.ɵɵtemplate(16, TableComponent_ng_container_16_Template, 3, 2, "ng-container", 8);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(17, TableComponent_ng_template_17_Template, 2, 3, "ng-template", null, 9, i0.ɵɵtemplateRefExtractor);
        i0.ɵɵtemplate(19, TableComponent_ng_template_19_Template, 2, 3, "ng-template", null, 10, i0.ɵɵtemplateRefExtractor);
    } if (rf & 2) {
        let tmp_0_0;
        let tmp_1_0;
        i0.ɵɵproperty("active", (tmp_0_0 = i0.ɵɵpipeBind1(1, 8, ctx.activeSort$)) == null ? null : tmp_0_0.active)("direction", (tmp_1_0 = i0.ɵɵpipeBind1(2, 10, ctx.activeSort$)) == null ? null : tmp_1_0.direction)("dataSource", ctx.filteredItems$)("trackBy", ctx.trackBy);
        i0.ɵɵadvance(3);
        i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(4, 12, ctx.columnDefs$));
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("auiTableHeaderRowDef", i0.ɵɵpipeBind1(6, 14, ctx.columnNames$))("auiTableHeaderRowDefSticky", !!ctx.sticky);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("auiTableRowDefColumns", i0.ɵɵpipeBind1(8, 16, ctx.columnNames$));
    } }, styles: [".deleting-text[_ngcontent-%COMP%]{color:rgb(var(--aui-color-disabled-text))}"], changeDetection: 0 });
__decorate([
    ObservableInput(),
    __metadata("design:type", Observable)
], TableComponent.prototype, "list$", void 0);
__decorate([
    ObservableInput(),
    __metadata("design:type", Observable)
], TableComponent.prototype, "dataSource$", void 0);
__decorate([
    ObservableInput(),
    __metadata("design:type", Observable)
], TableComponent.prototype, "resourceName$", void 0);
__decorate([
    ObservableInput(),
    __metadata("design:type", Observable)
], TableComponent.prototype, "columns$", void 0);
__decorate([
    ObservableInput(),
    __metadata("design:type", Observable)
], TableComponent.prototype, "filterParams$", void 0);
__decorate([
    ObservableInput(),
    __metadata("design:type", Observable)
], TableComponent.prototype, "filterFn$", void 0);
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableComponent, [{
        type: Component,
        args: [{ selector: 'acl-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<aui-table\n  auiSort\n  [active]=\"(activeSort$ | async)?.active\"\n  [direction]=\"(activeSort$ | async)?.direction\"\n  [dataSource]=\"filteredItems$\"\n  [trackBy]=\"trackBy\"\n  (sortChange)=\"activeSort$$.next($event)\"\n>\n  <ng-container\n    *ngFor=\"let columnDef of columnDefs$ | async\"\n    [auiTableColumnDef]=\"columnDef.name\"\n  >\n    <aui-table-header-cell\n      *auiTableHeaderCellDef\n      [style]=\"columnDef.style\"\n    >\n      <ng-container *ngIf=\"columnDef.name !== ACTION\">\n        <span\n          *ngIf=\"columnDef.sort\"\n          aui-sort-header\n          [start]=\"columnDef.sort.direction\"\n          >{{ columnDef.label || columnDef.name | translate }}</span\n        >\n        <span *ngIf=\"!columnDef.sort\">{{\n          columnDef.label || columnDef.name | translate\n        }}</span>\n      </ng-container>\n    </aui-table-header-cell>\n\n    <aui-table-cell\n      *auiTableCellDef=\"\n        let data;\n        let index = index;\n        let even = even;\n        let odd = odd;\n        let last = last\n      \"\n      [direction]=\"columnDef.direction\"\n      [ngClass]=\"columnDef.class\"\n      [style]=\"columnDef.style\"\n    >\n      <ng-container\n        *ngIf=\"\n          columnDef.name | pure: getColumnTemplate as template;\n          else tableCellDefTpl\n        \"\n      >\n        <ng-container\n          *ngTemplateOutlet=\"\n            template;\n            context: {\n              $implicit: data,\n              index: index,\n              even: even,\n              odd: odd,\n              last: last\n            }\n          \"\n        ></ng-container>\n      </ng-container>\n      <ng-template #tableCellDefTpl>\n        <ng-container\n          *ngIf=\"\n            columnDef.path != null &&\n              (data\n                | pure\n                  : getValueFromPath\n                  : columnDef.name\n                  : columnDef.path) as value;\n            else defaultTableCellTpl\n          \"\n        >\n          <ng-container\n            *ngTemplateOutlet=\"\n              tableCellContent;\n              context: { columnDef: columnDef, value: value }\n            \"\n          ></ng-container>\n        </ng-container>\n      </ng-template>\n      <ng-template #defaultTableCellTpl>\n        <ng-container\n          *ngTemplateOutlet=\"\n            defaultTableCell;\n            context: { data: data, columnDef: this.columnDef }\n          \"\n        ></ng-container>\n      </ng-template>\n    </aui-table-cell>\n  </ng-container>\n\n  <aui-table-header-row\n    *auiTableHeaderRowDef=\"columnNames$ | async; sticky: !!sticky\"\n  ></aui-table-header-row>\n  <aui-table-row\n    *auiTableRowDef=\"let row; columns: columnNames$ | async\"\n  ></aui-table-row>\n\n  <ng-container *auiTablePlaceholderDef>\n    <ng-container *ngIf=\"list\">\n      <div\n        *ngIf=\"\n          !(filteredItems$ | async)?.length && (list.items$ | async)?.length;\n          else listFooter\n        \"\n        class=\"empty-placeholder\"\n      >\n        <ng-container\n          *ngIf=\"finalResourceName$ | async as finalResourceName; else noData\"\n        >\n          {{\n            'no_named_data_hint'\n              | translate: { name: finalResourceName | translate: null:true }\n          }}\n        </ng-container>\n      </div>\n      <ng-template #listFooter>\n        <acl-k8s-resource-list-footer\n          [list]=\"list\"\n          [resourceName]=\"finalResourceName$ | async\"\n        ></acl-k8s-resource-list-footer>\n      </ng-template>\n    </ng-container>\n    <div\n      *ngIf=\"!list && !(filteredItems$ | async)?.length\"\n      class=\"empty-placeholder\"\n    >\n      <ng-container *ngIf=\"finalDataSource$ | async; else loading\">\n        {{\n          noDataHint ||\n            ('no_named_data_hint'\n              | translate: { name: resourceName | translate: null:true })\n        }}\n      </ng-container>\n      <ng-template #loading>\n        <aui-icon\n          class=\"acl-loading-mask__icon\"\n          size=\"16px\"\n          icon=\"spinner\"\n        ></aui-icon>\n        {{ 'loading_please_wait' | translate }}\n      </ng-template>\n    </div>\n  </ng-container>\n</aui-table>\n\n<ng-template\n  #defaultTableCell\n  let-data=\"data\"\n  let-columnDef=\"columnDef\"\n>\n  <ng-container [ngSwitch]=\"columnDef.name\">\n    <ng-container *ngSwitchCase=\"NAME\">\n      <div\n        *ngIf=\"data | pure: getValueFromPath:columnDef.name as name\"\n        class=\"aui-table__cell__name\"\n      >\n        <ng-container\n          *ngIf=\"\n            columnDef.extra?.link !== false && !(data | aclIsDeleting);\n            else plainName\n          \"\n        >\n          <a\n            [routerLink]=\"[(isListPage$ | async) ? '..' : '.', 'detail', name]\"\n            [auiTooltip]=\"name\"\n          >\n            {{ name }}\n          </a>\n        </ng-container>\n        <ng-template #plainName>\n          <span\n            [auiTooltip]=\"name\"\n            [class.deleting-text]=\"data | aclIsDeleting\"\n            >{{ name }}</span\n          >\n        </ng-template>\n        <acl-deleting-tag\n          *ngIf=\"data | pure: isK8sResource\"\n          [resource]=\"data\"\n        ></acl-deleting-tag>\n      </div>\n      <div\n        *ngIf=\"\n          (data | pure: isK8sResource)\n            ? (data | aclDisplayName)\n            : data.displayName as displayName\n        \"\n        class=\"aui-table__cell__display-name\"\n        [class.deleting-text]=\"data | aclIsDeleting\"\n      >\n        {{ displayName }}\n      </div>\n    </ng-container>\n    <ng-container *ngSwitchCase=\"CREATED_TIME\">\n      <acl-relative-time\n        [time]=\"data | pure: getValueFromPath:columnDef.name\"\n      ></acl-relative-time>\n    </ng-container>\n    <ng-container *ngSwitchCase=\"ACTION\">\n      <button\n        aui-button=\"text\"\n        [square]=\"true\"\n        size=\"small\"\n        [auiDropdown]=\"menu\"\n        [auiDropdownContext]=\"{ $implicit: data, columnDef: columnDef }\"\n      >\n        <aui-icon icon=\"basic:ellipsis_v_s\"></aui-icon>\n      </button>\n    </ng-container>\n    <ng-container *ngSwitchDefault>\n      <ng-container\n        *ngIf=\"\n          data | pure: getValueFromPath:columnDef.name as value;\n          else empty\n        \"\n      >\n        <ng-container\n          *ngTemplateOutlet=\"\n            tableCellContent;\n            context: { columnDef: columnDef, value: value }\n          \"\n        ></ng-container>\n      </ng-container>\n    </ng-container>\n  </ng-container>\n</ng-template>\n\n<ng-template\n  #tableCellContent\n  let-columnDef=\"columnDef\"\n  let-value=\"value\"\n>\n  <ng-container\n    *ngIf=\"\n      columnDef.translate == null\n        ? value\n        : (value | pure: columnDef.translate:finalContext | translate) as text;\n      else empty\n    \"\n  >\n    <div\n      *ngIf=\"columnDef.ellipsis; else plainText\"\n      class=\"text-overflow\"\n      [auiTooltip]=\"text\"\n    >\n      {{ text }}\n    </div>\n    <ng-template #plainText>{{ text }}</ng-template>\n  </ng-container>\n</ng-template>\n\n<aui-menu #menu>\n  <ng-container *auiMenuContent=\"let data; let columnDef = columnDef\">\n    <acl-disabled-container\n      *ngIf=\"columnDef.extra?.update !== false\"\n      [isAllowed]=\"!permissions || permissions.update\"\n      [isDisabled]=\"\n        (columnDef.extra?.update?.disabled.handler | pure: isFunction) &&\n        (data | pure: columnDef.extra.update.disabled.handler:finalContext)\n      \"\n      [tooltip]=\"\n        columnDef.extra?.update?.disabled.tooltip\n          | pure: getValue:data:finalContext\n          | translate\n      \"\n      (click)=\"onUpdate(data, columnDef)\"\n    >\n      <aui-menu-item>{{ 'update' | translate }}</aui-menu-item>\n    </acl-disabled-container>\n    <acl-disabled-container\n      *ngIf=\"columnDef.extra?.delete !== false\"\n      [isAllowed]=\"!permissions || permissions.delete\"\n      [isDisabled]=\"\n        (columnDef.extra?.delete?.disabled.handler | pure: isFunction) &&\n        (data | pure: columnDef.extra.delete.disabled.handler:finalContext)\n      \"\n      [tooltip]=\"\n        columnDef.extra?.delete?.disabled.tooltip\n          | pure: getValue:data:finalContext\n          | translate\n      \"\n      (click)=\"delete.emit(data)\"\n    >\n      <aui-menu-item>{{ 'delete' | translate }}</aui-menu-item>\n    </acl-disabled-container>\n  </ng-container>\n</aui-menu>\n\n<ng-template #empty>{{ null | aclFieldNotAvailable }}</ng-template>\n\n<ng-template #noData>{{ 'no_data' | translate }}</ng-template>\n", styles: [".deleting-text{color:rgb(var(--aui-color-disabled-text))}\n"] }]
    }], function () { return [{ type: i1.Router }, { type: i1.ActivatedRoute }, { type: i2.TableUtilService }]; }, { list: [{
            type: Input
        }], list$: [], dataSource: [{
            type: Input
        }], dataSource$: [], resourceName: [{
            type: Input
        }], resourceName$: [], sticky: [{
            type: Input
        }], permissions: [{
            type: Input
        }], columns: [{
            type: Input
        }], columns$: [], filterParams: [{
            type: Input
        }], filterParams$: [], context: [{
            type: Input
        }], filterFn: [{
            type: Input
        }], filterFn$: [], trackBy: [{
            type: Input
        }], noDataHint: [{
            type: Input
        }], update: [{
            type: Output
        }], delete: [{
            type: Output
        }], tableCellDefs: [{
            type: ContentChildren,
            args: [TableCellDefDirective]
        }], scrollWrapper: [{
            type: HostBinding,
            args: ['class.aui-table__scroll-wrapper']
        }], scrollWrapperHeight: [{
            type: HostBinding,
            args: ['style.max-height']
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 