import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostBinding, inject, Input, Output, ViewChild } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { BehaviorSubject, defer, fromEvent, Subject } from 'rxjs';
import { debounceTime, takeUntil, tap } from 'rxjs/operators';
import { isNullOrUndefined, isUndefined } from '@ironsource/fusion-ui/utils';
import { GenericPipe } from '@ironsource/fusion-ui/pipes/generic';
import { CheckboxComponent } from '@ironsource/fusion-ui/components/checkbox/v4';
import { TooltipComponent, TooltipDirective } from '@ironsource/fusion-ui/components/tooltip/v4';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import { TableService } from '@ironsource/fusion-ui/components/table/common/services';
import { CONFIG_TABLE_BY_UI_STYLE, ROW_CLICK_SUPPRESS_FOR_PARENT_SELECTORS, TableColumnTypeEnum } from '@ironsource/fusion-ui/components/table/common/entities';
import { UniqueIdService } from '@ironsource/fusion-ui/services/unique-id';
import { TestIdsService } from '@ironsource/fusion-ui/services/test-ids';
import { TableTestIdModifiers } from '@ironsource/fusion-ui/entities';
import { TableEmptyComponent } from './components/table-empty/table-empty.component';
import { TableBasicComponent } from './components/table-basic/table-basic.component';
import { TableLoadingComponent } from './components/table-loading/table-loading.component';
import { SearchComponent } from '@ironsource/fusion-ui/components/search/v4';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "@ironsource/fusion-ui/components/icon/v1";
const _c0 = ["stringCell"];
const _c1 = ["checkboxCell"];
const _c2 = ["templateCell"];
const _c3 = ["table"];
const _c4 = ["tableWrapper"];
const _c5 = ["tableBody"];
const _c6 = [[["", 8, "fu-table-header"]], [["", 8, "fu-table-footer"]]];
const _c7 = [".fu-table-header", ".fu-table-footer"];
function _forTrack0($index, $item) { return this.trackByFunc; }
function _forTrack1($index, $item) { return this.subHeader; }
const _c8 = () => ({ $implicit: true });
function TableV4Component_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵprojection(0);
} }
function TableV4Component_Conditional_0_Conditional_2_Conditional_0_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 11);
    i0.ɵɵpipe(1, "generic");
} if (rf & 2) {
    let tmp_6_0;
    const ctx_r0 = i0.ɵɵnextContext(4);
    i0.ɵɵproperty("name", (tmp_6_0 = ctx_r0.options == null ? null : ctx_r0.options.tableLabel == null ? null : ctx_r0.options.tableLabel.icon) !== null && tmp_6_0 !== undefined ? tmp_6_0 : ctx_r0.iconTooltip)("fusionTooltip", ctx_r0.options == null ? null : ctx_r0.options.tableLabel == null ? null : ctx_r0.options.tableLabel.tooltip)("testId", i0.ɵɵpipeBind3(1, 3, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.HEADER_TOOLTIP));
} }
function TableV4Component_Conditional_0_Conditional_2_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 8)(1, "div", 10);
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(4, TableV4Component_Conditional_0_Conditional_2_Conditional_0_Conditional_4_Template, 2, 7, "fusion-icon", 11);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(2, 3, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.LABEL));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", ctx_r0.options == null ? null : ctx_r0.options.tableLabel == null ? null : ctx_r0.options.tableLabel.text, " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional((ctx_r0.options == null ? null : ctx_r0.options.tableLabel == null ? null : ctx_r0.options.tableLabel.tooltip) ? 4 : -1);
} }
function TableV4Component_Conditional_0_Conditional_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-search", 9);
    i0.ɵɵpipe(1, "generic");
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("placeholder", ctx_r0.options == null ? null : ctx_r0.options.searchOptions == null ? null : ctx_r0.options.searchOptions.placeholder)("formControl", ctx_r0.searchFormControl)("testId", i0.ɵɵpipeBind3(1, 3, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.SEARCH));
} }
function TableV4Component_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TableV4Component_Conditional_0_Conditional_2_Conditional_0_Template, 5, 7, "div", 8)(1, TableV4Component_Conditional_0_Conditional_2_Conditional_1_Template, 2, 7, "fusion-search", 9);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵconditional((ctx_r0.options == null ? null : ctx_r0.options.tableLabel) ? 0 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional((ctx_r0.options == null ? null : ctx_r0.options.searchOptions) ? 1 : -1);
} }
function TableV4Component_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 4);
    i0.ɵɵtemplate(1, TableV4Component_Conditional_0_Conditional_1_Template, 1, 0)(2, TableV4Component_Conditional_0_Conditional_2_Template, 2, 2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r0.hasCustomHeader ? 1 : 2);
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_Conditional_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0, 19);
} if (rf & 2) {
    i0.ɵɵnextContext(5);
    const headerExpandColumn_r2 = i0.ɵɵreference(7);
    i0.ɵɵproperty("ngTemplateOutlet", headerExpandColumn_r2)("ngTemplateOutletContext", i0.ɵɵpureFunction0(2, _c8));
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_Conditional_1_For_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 21);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const subheader_r3 = ctx.$implicit;
    const ɵ$index_39_r4 = ctx.$index;
    const ctx_r0 = i0.ɵɵnextContext(5);
    i0.ɵɵclassProp("fu-border-left", !(ɵ$index_39_r4 === 0));
    i0.ɵɵattribute("colspan", ɵ$index_39_r4 === 0 && !!(ctx_r0.options == null ? null : ctx_r0.options.rowsExpandableOptions) ? subheader_r3.colspan + 1 : subheader_r3.colspan);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", subheader_r3.name, " ");
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr");
    i0.ɵɵtemplate(1, TableV4Component_Conditional_4_Conditional_2_Conditional_0_Conditional_1_Conditional_1_Template, 1, 3, "ng-container", 19);
    i0.ɵɵrepeaterCreate(2, TableV4Component_Conditional_4_Conditional_2_Conditional_0_Conditional_1_For_3_Template, 2, 4, "td", 20, _forTrack1, true);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(4);
    i0.ɵɵadvance();
    i0.ɵɵconditional(!!(ctx_r0.options == null ? null : ctx_r0.options.rowsExpandableOptions) ? 1 : -1);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r0.subHeader);
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0, 17);
} if (rf & 2) {
    i0.ɵɵnextContext(4);
    const headerExpandColumn_r2 = i0.ɵɵreference(7);
    i0.ɵɵproperty("ngTemplateOutlet", headerExpandColumn_r2);
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    const _r5 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-checkbox", 25);
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵlistener("changed", function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_3_Template_fusion_checkbox_changed_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r0.tableService.onRowsSelectChanged(ctx_r0.options.isGroupedTable, ctx_r0.rows, $event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(5);
    i0.ɵɵproperty("checked", ctx_r0.tableService.isAllRowsSelected(ctx_r0.rows))("isIndeterminate", ctx_r0.tableService.isPartialSelected(ctx_r0.rows));
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(1, 3, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.COLUMN_HEADER_SELECT_ALL));
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_4_Template(rf, ctx) { }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 27);
    i0.ɵɵpipe(1, "generic");
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext(2);
    const column_r7 = ctx_r7.$implicit;
    const ɵ$index_48_r9 = ctx_r7.$index;
    const ctx_r0 = i0.ɵɵnextContext(4);
    i0.ɵɵproperty("fusionTooltip", column_r7.tooltip)("name", column_r7.tooltipIcon || ctx_r0.iconTooltip);
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(1, 3, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.COLUMN_TOOLTIP + ɵ$index_48_r9));
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_4_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 30);
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵelement(2, "fusion-icon", 32);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ɵ$index_48_r9 = i0.ɵɵnextContext(3).$index;
    const ctx_r0 = i0.ɵɵnextContext(4);
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(1, 2, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.COLUMN_SORT_UP + ɵ$index_48_r9));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("name", ctx_r0.iconArrowUp);
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_4_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 31);
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵelement(2, "fusion-icon", 32);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ɵ$index_48_r9 = i0.ɵɵnextContext(3).$index;
    const ctx_r0 = i0.ɵɵnextContext(4);
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(1, 2, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.COLUMN_SORT_DOWN + ɵ$index_48_r9));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("name", ctx_r0.iconArrowDown);
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    const _r10 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 29);
    i0.ɵɵlistener("click", function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_4_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r10); const column_r7 = i0.ɵɵnextContext(2).$implicit; const ctx_r0 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r0.onHeaderClicked(column_r7)); });
    i0.ɵɵtemplate(1, TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_4_Conditional_1_Template, 3, 6, "div", 30)(2, TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_4_Conditional_2_Template, 3, 6, "div", 31);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const column_r7 = i0.ɵɵnextContext(2).$implicit;
    i0.ɵɵadvance();
    i0.ɵɵconditional(column_r7.sort === "asc" ? 1 : column_r7.sort === "desc" ? 2 : -1);
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 26);
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵlistener("click", function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r6); const column_r7 = i0.ɵɵnextContext().$implicit; const ctx_r0 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r0.onHeaderClicked(column_r7)); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(3, TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_3_Template, 2, 7, "fusion-icon", 27)(4, TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Conditional_4_Template, 3, 1, "div", 28);
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext();
    const column_r7 = ctx_r7.$implicit;
    const ɵ$index_48_r9 = ctx_r7.$index;
    const ctx_r0 = i0.ɵɵnextContext(4);
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(1, 4, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.COLUMN_TITLE + ɵ$index_48_r9));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1("", column_r7.title, " ");
    i0.ɵɵadvance();
    i0.ɵɵconditional(column_r7.tooltip ? 3 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r0.tableService.isColumnSortable(column_r7) ? 4 : -1);
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 22);
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵelementStart(2, "div", 23);
    i0.ɵɵtemplate(3, TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_3_Template, 2, 7, "fusion-checkbox", 24)(4, TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_4_Template, 0, 0)(5, TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Conditional_5_Template, 5, 8);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    let tmp_27_0;
    const column_r7 = ctx.$implicit;
    const ɵ$index_48_r9 = ctx.$index;
    const ɵ$count_48_r11 = ctx.$count;
    const ctx_r0 = i0.ɵɵnextContext(4);
    i0.ɵɵstyleProp("width", ctx_r0.tableService.setWidth(ɵ$index_48_r9 === ɵ$count_48_r11 - 1, column_r7.width))("min-width", column_r7.width)("top", ctx_r0.options == null ? null : ctx_r0.options.stickyHeaderTopOffset, "px");
    i0.ɵɵproperty("ngClass", ctx_r0.tableService.getColumnClasses(column_r7, true))("ngStyle", ctx_r0.tableService.getColumnStyle(column_r7));
    i0.ɵɵattribute("data-col-key", column_r7.key)("data-editable", ctx_r0.tableService.isTypeInputEdit(column_r7))("data-testid", i0.ɵɵpipeBind3(1, 13, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.tableTestIdModifiers.COLUMN_HEADER + ɵ$index_48_r9));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngClass", (tmp_27_0 = column_r7.headerAlign) !== null && tmp_27_0 !== undefined ? tmp_27_0 : ctx_r0.tableService.getCellAlignByColumnType(column_r7));
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r0.tableService.isTypeCheckbox(column_r7) && ctx_r0.isAllRowsSelectable && !ctx_r0.isEmpty && ctx_r0.isCheckboxTitleShown ? 3 : column_r7.filter && column_r7.filter.options ? 4 : 5);
} }
function TableV4Component_Conditional_4_Conditional_2_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "thead", 15);
    i0.ɵɵtemplate(1, TableV4Component_Conditional_4_Conditional_2_Conditional_0_Conditional_1_Template, 4, 1, "tr");
    i0.ɵɵelementStart(2, "tr", 16);
    i0.ɵɵtemplate(3, TableV4Component_Conditional_4_Conditional_2_Conditional_0_Conditional_3_Template, 1, 1, "ng-container", 17);
    i0.ɵɵrepeaterCreate(4, TableV4Component_Conditional_4_Conditional_2_Conditional_0_For_5_Template, 6, 17, "td", 18, _forTrack0, true);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("hidden", (ctx_r0.isEmpty || ctx_r0.loading && !ctx_r0.isLoadingOverlay) && ctx_r0.hideHeaderOnEmpty);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r0.subHeader.length ? 1 : -1);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngStyle", !!ctx_r0.options.rowsOptions && !!ctx_r0.options.rowsOptions.headerRow ? ctx_r0.options.rowsOptions.headerRow.style : null);
    i0.ɵɵadvance();
    i0.ɵɵconditional(!!(ctx_r0.options == null ? null : ctx_r0.options.rowsExpandableOptions) ? 3 : -1);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r0.columns);
} }
function TableV4Component_Conditional_4_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TableV4Component_Conditional_4_Conditional_2_Conditional_0_Template, 6, 4, "thead", 15);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵconditional(ctx_r0.columns.length ? 0 : -1);
} }
function TableV4Component_Conditional_4_Conditional_3_Template(rf, ctx) { if (rf & 1) {
    const _r12 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tbody", 33, 3);
    i0.ɵɵlistener("rowSelected", function TableV4Component_Conditional_4_Conditional_3_Template_tbody_rowSelected_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.selectionChanged.emit($event)); })("expandRow", function TableV4Component_Conditional_4_Conditional_3_Template_tbody_expandRow_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.doExpandRow($event)); })("click", function TableV4Component_Conditional_4_Conditional_3_Template_tbody_click_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onTableBodyClicked($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("rows", ctx_r0.tableRows)("columns", ctx_r0.columns)("options", ctx_r0.options)("expandedRows", ctx_r0.expandedRows)("testId", ctx_r0.testId);
} }
function TableV4Component_Conditional_4_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "tbody", 13);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("fusionTableEmpty", ctx_r0.colsCount)("customContent", ctx_r0.options == null ? null : ctx_r0.options.customNoData)("type", ctx_r0.options == null ? null : ctx_r0.options.emptyTableType)("header", ctx_r0.options == null ? null : ctx_r0.options.noDataMessage)("subHeader", ctx_r0.options == null ? null : ctx_r0.options.noDataSubMessage);
} }
function TableV4Component_Conditional_4_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "tbody", 14);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("fusionTableLoading", ctx_r0.colsCount);
} }
function TableV4Component_Conditional_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "table", 5, 2);
    i0.ɵɵtemplate(2, TableV4Component_Conditional_4_Conditional_2_Template, 1, 1)(3, TableV4Component_Conditional_4_Conditional_3_Template, 2, 5, "tbody", 12)(4, TableV4Component_Conditional_4_Conditional_4_Template, 1, 5, "tbody", 13)(5, TableV4Component_Conditional_4_Conditional_5_Template, 1, 1, "tbody", 14);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("id", ctx_r0.id);
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ctx_r0.columns && ctx_r0.options ? 2 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(!ctx_r0.options.isGroupedTable && (!ctx_r0.loading || ctx_r0.isLoadingOverlay) && !ctx_r0.isEmpty ? 3 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(!ctx_r0.loading && ctx_r0.isEmpty ? 4 : -1);
    i0.ɵɵadvance();
    i0.ɵɵconditional(ctx_r0.loading && !ctx_r0.isLoadingOverlay || (ctx_r0.options == null ? null : ctx_r0.options.pagination) && ctx_r0.options.pagination.loading || ctx_r0.isEmpty && ctx_r0.loading ? 5 : -1);
} }
function TableV4Component_Conditional_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵprojection(1, 1);
    i0.ɵɵelementEnd();
} }
function TableV4Component_ng_template_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 34);
    i0.ɵɵelement(1, "span");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const isSubHeader_r13 = ctx.$implicit;
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵstyleProp("top", ctx_r0.options == null ? null : ctx_r0.options.stickyHeaderTopOffset, "px");
    i0.ɵɵclassProp("fu-header-group", isSubHeader_r13)("sticky-left", ctx_r0.options == null ? null : ctx_r0.options.rowsExpandableOptions == null ? null : ctx_r0.options.rowsExpandableOptions.sticky);
} }
export class TableV4Component {
    constructor() {
        // region public props
        /** @internal */
        this.tableService = inject(TableService);
        /** @internal */
        this.isRowsInit = false;
        /** @internal */
        this.tableMainError = false;
        /** @internal */
        this.shownGoTopButton$ = new BehaviorSubject(false);
        /** @internal */
        this.subHeader = [];
        /** @internal */
        this.iconArrowUp = 'ph/arrow-up';
        /** @internal */
        this.iconArrowDown = 'ph/arrow-down';
        /** @internal */
        this.iconTooltip = 'ph/question';
        // endregion
        // region E2E test id
        /** @internal */
        this.testIdsService = inject(TestIdsService);
        /** @internal */
        this.tableTestIdModifiers = TableTestIdModifiers;
        // endregion
        // region inputs
        // region table element id
        this.uniqueService = inject(UniqueIdService);
        this.id = `fuDataGrid_${this.uniqueService.getUniqueId()}`;
        this._options = {};
        this._columns = [];
        this._rows = [];
        this._expandedRows = {};
        this.sortTableOnDataChanges = false;
        this.hasCustomHeader = false;
        this.hasCustomFooter = false;
        // endregion
        // region outputs
        this.sortChanged = new EventEmitter();
        this.selectionChanged = this.tableService.selectionChanged;
        this.rowModelChange = this.tableService.rowModelChange;
        this.rowClicked = new EventEmitter();
        this.scrollDown = new EventEmitter();
        this.rowActionClicked = this.tableService.rowActionClicked;
        this.expandRow = new EventEmitter();
        this.expandedRowsChange = new EventEmitter();
        this.currentExpandedMap = {};
        this.onDestroy$ = new Subject();
    }
    // endregion
    // region options
    set options(value) {
        if (!isNullOrUndefined(value)) {
            this._options = value;
            this.tableService.hasRowspanRows = value.hasRowSpan ?? false;
            this.tableService.rowsExpandableKey = value.rowsExpandableOptions?.key;
        }
    }
    get options() {
        return this._options;
    }
    // endregion
    // region columns
    set columns(value) {
        if (Array.isArray(value)) {
            this._columns = value;
            this.subHeader = this.getSubHeaders(this._columns);
        }
    }
    get columns() {
        return this._columns;
    }
    // endregion
    // region rows
    set rows(value) {
        if (Array.isArray(value)) {
            this._rows = this.tableService.setRowsMetadata([...value]);
            this.initRows();
        }
    }
    get rows() {
        return this._rows;
    }
    // endregion
    // region expandedRows
    /** @internal */
    set expandedRows(value) {
        this.onExternalExpandRowChanged(value);
        this._expandedRows = value;
    }
    get expandedRows() {
        return this._expandedRows;
    }
    // endregion
    // region HostBindings
    get isFixedHeader() {
        return !isNullOrUndefined(this.options) && !isNullOrUndefined(this.options.stickyHeader) && this.options.stickyHeader;
    }
    get noTableFrame() {
        return !(!!this.options?.tableLabel || !!this.options?.searchOptions);
    }
    get noTableFooter() {
        return !this.noTableFrame && this.options?.noTableFooter;
    }
    get isEmpty() {
        return this.tableService.isTableEmpty(this.rows, this.options.isGroupedTable, this.options.hasTotalsRow);
    }
    get isLoading() {
        return this.loading;
    }
    get onVerticalScroll() {
        if (this.tableWrapperElement) {
            return this.tableWrapperElement.nativeElement.scrollTop > 0;
        }
    }
    // endregion
    // region getters
    get isCheckboxTitleShown() {
        return this.columns ? this.columns.some(column => column.type === TableColumnTypeEnum.Checkbox && column.title !== '') : false;
    }
    get isLoadingOverlay() {
        return (isNullOrUndefined(this.options) || // default - true
            isNullOrUndefined(this.options.isLoadingOverlayMode) || // default - true
            this.options.isLoadingOverlayMode // get from options
        );
    }
    get tableRows() {
        return this.rows;
    }
    get groupedTableRows() {
        return this.rows;
    }
    get colsCount() {
        let columnsCount = Array.isArray(this.columns) ? this.columns.length : 1;
        if (!!this.options && this.options.rowsExpandableOptions) {
            columnsCount += !!this.options.rowsExpandableOptions.expandLevels ? this.options.rowsExpandableOptions.expandLevels : 1;
        }
        return columnsCount;
    }
    get scrollElement() {
        const scrollElement = this.tableWrapperElement.nativeElement;
        if (this.options.scrollElementSelector) {
            return document.querySelector(this.options.scrollElementSelector) || scrollElement;
        }
        return scrollElement;
    }
    // endregion
    ngOnInit() {
        this.tableService.clearSelectedRows();
        this.searchFormControl = new FormControl(this.options?.searchOptions?.initalValue || '');
        if (!!this.options.rowsExpandableOptions) {
            try {
                this.tableService.setExpandLevelByExpandOptions(this.options.rowsExpandableOptions);
            }
            catch (e) {
                this.tableMainError = true;
                throw new Error(e);
            }
        }
        this.options.tableId = this.id;
        this.noDataMessage = isNullOrUndefined(this.options.noDataMessage) ? 'No Data to Display' : this.options.noDataMessage;
        this.noDataSubMessage = this.options.noDataSubMessage ?? '';
        this.hideHeaderOnEmpty = !isNullOrUndefined(this.options.hideHeaderOnEmpty) ? this.options.hideHeaderOnEmpty : false;
        this.isAllRowsSelectable = typeof this.options.isAllRowsSelectable === 'undefined' ? true : this.options.isAllRowsSelectable;
        this.scrollListeners();
        this.configIconNames = CONFIG_TABLE_BY_UI_STYLE[`style_v2`];
        this.wrapperClasses = this.getWrapperClasses();
        this.initColumns();
        this.ignoredParentSelectorsRowClickEvent = ROW_CLICK_SUPPRESS_FOR_PARENT_SELECTORS.concat(this.options.rowsOptions?.ignoredParentSelectorsRowClickEvent ?? []);
        if (this.sortTableOnDataChanges && this.columns.find(col => !!col.sort)) {
            this.doLocalSorting();
        }
        this.searchFormControl.valueChanges.pipe(takeUntil(this.onDestroy$), debounceTime(500)).subscribe(value => {
            this.options?.searchOptions.onSearch.emit(value);
        });
    }
    ngOnDestroy() {
        this.onDestroy$.next();
        this.onDestroy$.complete();
    }
    ngAfterViewInit() {
        const columns = this.tableElement.nativeElement.querySelectorAll('thead tr td');
        columns.forEach((column, index) => {
            if (!column.style.width && column?.dataset?.editable === 'true') {
                column.style.width = `${column.clientWidth}px`;
            }
        });
    }
    /** @internal */
    onHeaderClicked(col) {
        if (!this.tableService.isColumnSortable(col)) {
            return;
        }
        const sortKey = col.key;
        if (!(this.options && this.options.sortingType && this.options.sortingType === 'external')) {
            this.localSorting(sortKey);
        }
        this.sortChanged.emit(sortKey);
    }
    /** @internal */
    filterColumn(column, filterIn) {
        if (column.filter.changed && column.filter.options) {
            const isAllFiltered = column.filter.options.length === filterIn.length || filterIn.length === 0;
            column.filter.changed.emit(isAllFiltered ? [] : filterIn);
        }
    }
    /** @internal */
    replaceSelectedRows({ selectedTableRows, iditicationFunc }) {
        this.tableService.replaceSelectedRows({ selectedTableRows, iditicationFunc });
    }
    /** @internal */
    doExpandRow({ rowIndex, row, isExpanded, successCallback, failedCallback, updateMap }) {
        if (!!this.expandRow.observers.length) {
            // has expandRow event subscription in host
            if (Array.isArray(this.rows)) {
                const innerEntityType = this.options.rowsExpandableOptions?.innerEntityType ?? 'innerRows';
                this.expandRow.emit({ rowIndex, row, isExpanded, successCallback, failedCallback, updateMap, innerEntityType });
                this.currentExpandedMap = { ...this.currentExpandedMap, [rowIndex]: isExpanded };
            }
        }
        else {
            successCallback();
            this.updateExpandedRowsMap(rowIndex, isExpanded);
        }
    }
    /** @internal */
    trackByFunc(index, column) {
        return column && column.key ? column.key : index;
    }
    /** @internal */
    getTableClientWidth() {
        if (this.tableWrapperElement) {
            return this.tableWrapperElement.nativeElement.clientWidth;
        }
    }
    /** @internal */
    onTableBodyClicked($event) {
        if (!this.isElementChildOfSuppressed($event.target)) {
            const rowEl = $event.target.closest('tr');
            if (!isNullOrUndefined(rowEl)) {
                const rowIndex = rowEl.dataset.rowIdx;
                const rowData = this.rows[rowIndex];
                this.rowClicked.emit({ $event, rowIndex, rowEl, rowData });
            }
        }
    }
    /** @internal */
    onClickReturnTop() {
        const viewPortElement = this.scrollElement || document.documentElement;
        const currentScroll = viewPortElement.scrollTop || document.body.scrollTop;
        if (currentScroll > 0) {
            (function smoothScroll() {
                let currentScroll = viewPortElement.scrollTop || document.body.scrollTop;
                if (currentScroll > 0) {
                    window.requestAnimationFrame(smoothScroll);
                    viewPortElement.scrollTo(0, currentScroll - currentScroll / 8);
                }
            })();
        }
    }
    initColumns() {
        if (this.options.rowActionsMenu?.stickyActionButton) {
            this._columns = [...this.columns, { key: 'row_actions_column', title: '', width: '52px' }];
        }
    }
    initRows() {
        if (!this.options?.isGroupedTable && this.rows?.length) {
            this.tableService.initSelectedRows(this.rows);
        }
        this.doLocalSorting();
        // check for rowspan columns
        this.tableService.setRowspanColumnsData(this.rows, this._columns.map(col => col.key));
    }
    getSubHeaders(columns) {
        if (columns.some(item => !!item.groupName)) {
            return columns.reduce((groups, column, idx, columns) => {
                if (column.groupName) {
                    groups.push({ name: column.groupName ?? '&nbsp;', colspan: 1 });
                }
                else {
                    if (groups[groups.length - 1] && groups[groups.length - 1].name) {
                        groups[groups.length - 1].colspan++;
                    }
                    else {
                        groups.push({ name: ' ', colspan: 1 });
                    }
                }
                return groups;
            }, []);
        }
        else {
            return [];
        }
    }
    doLocalSorting() {
        if (Array.isArray(this.rows) && this.columns && this.sortTableOnDataChanges) {
            const sortedColumn = this.columns.find(col => !!col.sort);
            if (sortedColumn) {
                sortedColumn.sort = sortedColumn.sort === 'asc' ? 'desc' : 'asc';
                this.localSorting(sortedColumn.key);
            }
        }
    }
    isElementChildOfSuppressed(element) {
        return this.ignoredParentSelectorsRowClickEvent.some((selector) => {
            return element.closest(selector);
        });
    }
    updateExpandedRowsMap(rowIndex, isExpanded) {
        this._expandedRows = { ...this._expandedRows, [rowIndex]: isExpanded };
        this.expandedRowsChange.emit(this._expandedRows);
    }
    onExternalExpandRowChanged(newValue) {
        const diffMap = this.getRowsToExpandToggle(this.currentExpandedMap, newValue);
        this.currentExpandedMap = newValue;
        if (diffMap.includes('default')) {
            const rowsInTable = this.rows.length;
            [...Array(rowsInTable).keys()].forEach(rowIndex => {
                this.callOnExpandRow({
                    rowIndex: rowIndex,
                    row: this.rows[rowIndex],
                    isExpanded: newValue['default']
                });
            });
        }
        else {
            diffMap.forEach(rowIndex => {
                this.callOnExpandRow({
                    rowIndex: parseInt(rowIndex, 10),
                    row: this.rows[rowIndex],
                    isExpanded: newValue[rowIndex]
                });
            });
        }
    }
    callOnExpandRow({ rowIndex, row, isExpanded }) {
        this.tableBodyComponent.onExpandRow({ rowIndex, row, isExpanded }, false);
    }
    getRowsToExpandToggle(curValue, newValue) {
        return Object.keys(newValue)
            .map(key => {
            if (newValue[key] !== curValue[key]) {
                return key;
            }
            return null;
        })
            .filter(Boolean);
    }
    getWrapperClasses() {
        const classes = [];
        if (!!this.options && !!this.options.rowHeight) {
            classes.push(`is-row-height-${this.options.rowHeight}`);
        }
        if (this.options?.stickyHeader && this.options?.scrollElementSelector) {
            classes.push(`fu-stocky-to-external`);
        }
        if (this.options.stickyHeader || this.options?.pagination?.enable) {
            classes.push(`fu-table-sticky-header`);
        }
        return classes;
    }
    scrollListeners() {
        defer(() => fromEvent(this.scrollElement, 'scroll').pipe(takeUntil(this.onDestroy$), tap(_ => {
            const scrollLeft = this.scrollElement.scrollLeft;
            if (this.lastScrollLeftValue !== scrollLeft) {
                this.isScrollRight = scrollLeft > 0;
                this.lastScrollLeftValue = scrollLeft;
            }
        }), debounceTime(10))).subscribe(this.onScroll.bind(this));
    }
    localSorting(sortKey) {
        let isAscSort;
        const tableRows = [...this.rows];
        // reset header sort options
        this.columns.forEach(col => {
            if (col.key !== sortKey) {
                if (!isUndefined(col.sort)) {
                    col.sort = '';
                }
            }
            else {
                col.sort = col.sort === '' ? 'asc' : col.sort === 'asc' ? 'desc' : 'asc';
                isAscSort = col.sort === 'asc';
            }
        });
        let totalRow = [];
        let otherRows = [];
        if (!isNullOrUndefined(this.options.hasTotalsRow) && this.options.hasTotalsRow) {
            totalRow = tableRows.slice(0, 1);
            otherRows = tableRows.slice(1);
        }
        else {
            otherRows = tableRows;
        }
        otherRows.sort((a, b) => {
            if (isNullOrUndefined(a[sortKey]) || isNullOrUndefined(b[sortKey])) {
                return 0;
            }
            // if data type - numeric
            if (!Array.isArray(a[sortKey]) && !isNaN(a[sortKey]) && !isNaN(b[sortKey]) && a[sortKey] - parseFloat(a[sortKey]) + 1 >= 0) {
                return isAscSort ? a[sortKey] - b[sortKey] : (a[sortKey] - b[sortKey]) * -1;
            }
            // if it string;
            const strA = a[sortKey].toString().toUpperCase();
            const strB = b[sortKey].toString().toUpperCase();
            if (strA < strB) {
                return isAscSort ? -1 : 1;
            }
            if (strA > strB) {
                return isAscSort ? 1 : -1;
            }
            return 0;
        });
        this._rows = [...totalRow, ...otherRows].filter(Boolean);
    }
    onScroll($event) {
        this.tableService.tableScrolled.emit($event);
        if (this.options.hasReturnToTopButton) {
            this.shownGoTopButton$.next(this.scrollElement.scrollTop > this.tableElement.nativeElement.offsetTop);
        }
        const target = $event.target || $event;
        if (!this.options.pagination || this.options.pagination.loading || !this.options.pagination.enable) {
            return;
        }
        const top = this.scrollElement.scrollTop;
        if (top >= this.tableElement.nativeElement.offsetHeight - this.scrollElement.offsetHeight - 100) {
            if (!this.options.pagination.handleLoadingFromHost) {
                this.options.pagination.loading = true;
            }
            this.scrollDown.emit(target);
        }
    }
    static { this.ɵfac = function TableV4Component_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableV4Component)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TableV4Component, selectors: [["fusion-table"]], viewQuery: function TableV4Component_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(_c0, 5);
            i0.ɵɵviewQuery(_c1, 5);
            i0.ɵɵviewQuery(_c2, 5);
            i0.ɵɵviewQuery(_c3, 5);
            i0.ɵɵviewQuery(_c4, 7);
            i0.ɵɵviewQuery(_c5, 5);
        } if (rf & 2) {
            let _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.stringCell = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.checkboxCell = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.templateCell = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tableElement = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tableWrapperElement = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tableBodyComponent = _t.first);
        } }, hostAttrs: [1, "fusion-v4"], hostVars: 14, hostBindings: function TableV4Component_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassProp("fixed-table", ctx.isFixedHeader)("fu-no-table-frame", ctx.noTableFrame)("fu-no-table-footer", ctx.noTableFooter)("is-empty", ctx.isEmpty)("is-loading", ctx.isLoading)("on-scroll-right", ctx.isScrollRight)("on-vertical-scroll", ctx.onVerticalScroll);
        } }, inputs: { testId: "testId", id: "id", options: "options", columns: "columns", rows: "rows", expandedRows: "expandedRows", loading: "loading", sortTableOnDataChanges: "sortTableOnDataChanges", hasCustomHeader: "hasCustomHeader", hasCustomFooter: "hasCustomFooter" }, outputs: { sortChanged: "sortChanged", selectionChanged: "selectionChanged", rowModelChange: "rowModelChange", rowClicked: "rowClicked", scrollDown: "scrollDown", rowActionClicked: "rowActionClicked", expandRow: "expandRow", expandedRowsChange: "expandedRowsChange" }, standalone: true, features: [i0.ɵɵProvidersFeature([TableService]), i0.ɵɵStandaloneFeature], ngContentSelectors: _c7, decls: 8, vars: 6, consts: [["tableWrapper", ""], ["headerExpandColumn", ""], ["table", ""], ["tableBody", ""], [1, "fu-table-header-wrapper"], [3, "id"], [1, "tableWrap", 3, "ngClass"], [1, "fu-table-footer-wrapper"], [1, "fu-table-label"], [3, "placeholder", "formControl", "testId"], [1, "fu-table-label-text"], [1, "fu-header-tooltip-icon", 3, "name", "fusionTooltip", "testId"], ["fusionTableBasic", "", 3, "rows", "columns", "options", "expandedRows", "testId"], [3, "fusionTableEmpty", "customContent", "type", "header", "subHeader"], [3, "fusionTableLoading"], [3, "hidden"], [3, "ngStyle"], [3, "ngTemplateOutlet"], [3, "ngClass", "ngStyle", "width", "min-width", "top"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "fu-header-group", 3, "fu-border-left"], [1, "fu-header-group"], [3, "ngClass", "ngStyle"], [1, "fu-header-cell-content", 3, "ngClass"], ["title", "select / un-select all", 1, "is-regular", 3, "checked", "isIndeterminate"], ["title", "select / un-select all", 1, "is-regular", 3, "changed", "checked", "isIndeterminate"], [1, "fu-header-text", 3, "click"], [1, "fu-header-tooltip-icon", 3, "fusionTooltip", "name"], [1, "fu-sort-wrapper"], [1, "fu-sort-wrapper", 3, "click"], [1, "fu-sort-up"], [1, "fu-sort-down"], [3, "name"], ["fusionTableBasic", "", 3, "rowSelected", "expandRow", "click", "rows", "columns", "options", "expandedRows", "testId"], [1, "expand-column"]], template: function TableV4Component_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef(_c6);
            i0.ɵɵtemplate(0, TableV4Component_Conditional_0_Template, 3, 1, "div", 4);
            i0.ɵɵelement(1, "div", 5);
            i0.ɵɵelementStart(2, "div", 6, 0);
            i0.ɵɵtemplate(4, TableV4Component_Conditional_4_Template, 6, 5, "table", 5);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(5, TableV4Component_Conditional_5_Template, 2, 0, "div", 7)(6, TableV4Component_ng_template_6_Template, 2, 6, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
        } if (rf & 2) {
            i0.ɵɵconditional(ctx.hasCustomHeader || (ctx.options == null ? null : ctx.options.tableLabel) ? 0 : -1);
            i0.ɵɵadvance();
            i0.ɵɵpropertyInterpolate1("id", "", ctx.id, "_tableTeleportWrapper");
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngClass", ctx.wrapperClasses);
            i0.ɵɵadvance(2);
            i0.ɵɵconditional(!ctx.tableMainError ? 4 : -1);
            i0.ɵɵadvance();
            i0.ɵɵconditional(ctx.hasCustomFooter ? 5 : -1);
        } }, dependencies: [CommonModule, i1.NgClass, i1.NgTemplateOutlet, i1.NgStyle, GenericPipe,
            ReactiveFormsModule, i2.NgControlStatus, i2.FormControlDirective, IconModule, i3.IconComponent, CheckboxComponent,
            SearchComponent,
            TooltipDirective,
            TableEmptyComponent,
            TableLoadingComponent,
            TableBasicComponent], styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";.font-v4-bold[_ngcontent-%COMP%], .font-v4-tab-label-2[_ngcontent-%COMP%], .font-v4-chart-2[_ngcontent-%COMP%], .font-v4-chart-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:700;-webkit-font-smoothing:antialiased}.font-v4-semibold[_ngcontent-%COMP%], .font-v4-chip-label[_ngcontent-%COMP%], [_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%], .font-v4-table-label[_ngcontent-%COMP%], .font-v4-button[_ngcontent-%COMP%], .font-v4-heading-6[_ngcontent-%COMP%], .font-v4-heading-5[_ngcontent-%COMP%], .font-v4-heading-4[_ngcontent-%COMP%], [_nghost-%COMP%]   .fu-table-header-wrapper[_ngcontent-%COMP%]   .fu-table-label[_ngcontent-%COMP%]   .fu-table-label-text[_ngcontent-%COMP%], .font-v4-heading-3[_ngcontent-%COMP%], .font-v4-heading-2[_ngcontent-%COMP%], .font-v4-heading-1[_ngcontent-%COMP%], .font-v4-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:600;-webkit-font-smoothing:antialiased}.font-v4-medium[_ngcontent-%COMP%], .font-v4-tab-label-1[_ngcontent-%COMP%], .font-v4-input-label[_ngcontent-%COMP%], .font-v4-overline[_ngcontent-%COMP%], .font-v4-subtitle-2[_ngcontent-%COMP%], .font-v4-subtitle-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:500;-webkit-font-smoothing:antialiased}.font-v4-regular[_ngcontent-%COMP%], .font-v4-caption[_ngcontent-%COMP%], .font-v4-body-2[_ngcontent-%COMP%], [_nghost-%COMP%]   .fu-table-footer-wrapper[_ngcontent-%COMP%], .font-v4-body-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased}.font-v4-title[_ngcontent-%COMP%]{font-size:2.5rem;line-height:3rem;letter-spacing:-.055rem}.font-v4-heading-1[_ngcontent-%COMP%]{font-size:1.5rem;line-height:1.75rem;letter-spacing:-.0285rem}.font-v4-heading-2[_ngcontent-%COMP%]{font-size:1.125rem;line-height:1.75rem;letter-spacing:-.01575rem}[_nghost-%COMP%]   .fu-table-header-wrapper[_ngcontent-%COMP%]   .fu-table-label[_ngcontent-%COMP%]   .fu-table-label-text[_ngcontent-%COMP%], .font-v4-heading-3[_ngcontent-%COMP%]{font-size:1rem;line-height:1.5rem;letter-spacing:-.011rem}.font-v4-heading-4[_ngcontent-%COMP%]{font-size:.875rem;line-height:1rem;letter-spacing:unset}.font-v4-heading-5[_ngcontent-%COMP%]{font-size:.8125rem;line-height:16px;letter-spacing:unset}.font-v4-heading-6[_ngcontent-%COMP%]{font-size:.75rem;line-height:.75rem;letter-spacing:0}[_nghost-%COMP%]   .fu-table-footer-wrapper[_ngcontent-%COMP%], .font-v4-body-1[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-body-2[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-subtitle-1[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-subtitle-2[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-chart-1[_ngcontent-%COMP%]{font-size:1.5rem;line-height:1.5rem;letter-spacing:-.015rem}.font-v4-chart-2[_ngcontent-%COMP%]{font-size:1.25rem;line-height:1.25rem;letter-spacing:-.0125rem}.font-v4-button[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:.00875rem}.font-v4-overline[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem;letter-spacing:.045rem;text-transform:uppercase}.font-v4-caption[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%], .font-v4-table-label[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:.00813rem}.font-v4-input-label[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1rem;letter-spacing:.00813rem}.font-v4-tab-label-1[_ngcontent-%COMP%], .font-v4-tab-label-2[_ngcontent-%COMP%]{font-size:.875rem;line-height:1rem}.font-v4-chip-label[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem;letter-spacing:normal}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]::-webkit-scrollbar{background-color:transparent;border-left:var(--fu-scroll-border, solid 0px transparent);border-top:var(--fu-scroll-border, solid 0px transparent);width:var(--fu-scroll-width, 4px);height:var(--fu-scroll-width, 4px)}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]::-webkit-scrollbar-track{background-color:var(--fu-scroll-bg-color, transparent)}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background-color:var(--fu-scroll-button-bg-color, rgba(83, 87, 91, .3));border-radius:var(--fu-scroll-button-border-radius, 4px)}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]::-webkit-scrollbar-button{display:none}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes _ngcontent-%COMP%_shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}[_nghost-%COMP%]{--fu-scroll-width: 6px;--fu-scroll-border: solid 1px var(--common-divider, hsl(0, 0%, 86.8%));--fu-scroll-button-bg-color: var(--default-light, hsl(0, 0%, 89.5%));--table-border-width: 1px;--table-border-type: solid;--table-border-radius: 4px;--table-border-color: var(--common-divider, hsl(0, 0%, 86.8%));--table-border: var(--table-border-width) var(--table-border-type) var(--table-border-color);--table-text-color: var(--text-primary, hsl(0, 0%, 12.5%));--table-header-bg-color: var(--background-paper-elevation-0, hsl(0, 0%, 97.5%));--table-header-search-width: 220px;--table-header-cell-height: 40px;--table-header-cell-padding: 0 16px;--table-header-cell-bg-color: var(--background-paper-elevation-0, hsl(0, 0%, 97.5%));--table-header-cell-gap: 4px;--table-header-text-color: var(--table-text-color);--table-header-sort-icon-color: var(--action-active, hsl(0, 0%, 50.3%));--table-header-sort-icon-size: 20px;--table-header-tooltip-icon-size: 16px;--table-header-tooltip-icon-color: var(--action-active, hsl(0, 0%, 50.3%));--table-footer-height: 48px;--table-footer-padding: 14px 16px;--table-footer-gap: 8px;--table-footer-text-color: var(--table-text-color);--table-footer-bg-color: var(--background-paper-elevation-0, hsl(0, 0%, 97.5%));--table-empty-state-padding: 48px;--table-checkbox-cell-width: 32px;--table-body-border: var(--table-border);--table-row-height: 48px;--table-row-cell-lr-padding: 16px;--table-row-cell-padding: 0 var(--table-row-cell-lr-padding);--table-expand-icon-color: var(--action-active, hsl(0, 0%, 50.3%));--table-expand-icon-size: 20px;--table-expand-cell-width: 46px;--table-row-hover-background-color: var(--background-paper-elevation-1, hsl(0, 0%, 94.6%));--table-odd-row-background-color: #FFFFFF;--table-even-row-background-color: #FFFFFF;--table-row-loading-opacity: .7;position:relative;width:100%;height:100%;display:flex;flex-direction:column;border:var(--table-border);border-radius:var(--table-border-radius)}[_nghost-%COMP%]   .fu-table-header-wrapper[_ngcontent-%COMP%]{display:flex;height:var(--spacing-800, 64px);padding:0px var(--spacing-300, 24px);align-items:center;gap:8px;border-top-left-radius:var(--table-border-radius);border-top-right-radius:var(--table-border-radius);border-bottom:var(--table-border);background-color:var(--table-header-bg-color)}[_nghost-%COMP%]   .fu-table-header-wrapper[_ngcontent-%COMP%]   .fu-table-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;flex:1}[_nghost-%COMP%]   .fu-table-header-wrapper[_ngcontent-%COMP%]   .fu-table-label[_ngcontent-%COMP%]   .fu-table-label-text[_ngcontent-%COMP%]{color:var(--table-header-text-color)}[_nghost-%COMP%]   .fu-table-header-wrapper[_ngcontent-%COMP%]   .fu-table-label[_ngcontent-%COMP%]   .fu-header-tooltip-icon[_ngcontent-%COMP%]{width:var(--table-header-tooltip-icon-size);height:var(--table-header-tooltip-icon-size);color:var(--table-header-tooltip-icon-color)}[_nghost-%COMP%]   .fu-table-header-wrapper[_ngcontent-%COMP%]   fusion-search[_ngcontent-%COMP%]{width:var(--table-header-search-width)}[_nghost-%COMP%]   .fu-table-footer-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;height:var(--table-footer-height);padding:var(--table-footer-padding);gap:var(--table-footer-gap);background-color:var(--table-footer-bg-color);border-top:var(--table-border);border-bottom-left-radius:var(--table-border-radius);border-bottom-right-radius:var(--table-border-radius);color:var(--table-footer-text-color)}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]{flex-grow:1;display:block}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]{border:none;margin:0;border-collapse:collapse;border-spacing:0;width:100%}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{height:var(--table-header-cell-height);padding:var(--table-header-cell-padding);background-color:var(--table-header-cell-bg-color);border-bottom:var(--table-border)}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   .fu-header-cell-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--table-header-cell-gap)}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   .fu-header-cell-content.right[_ngcontent-%COMP%]{justify-content:flex-end}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   .fu-header-cell-content.center[_ngcontent-%COMP%]{justify-content:center}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   .fu-sort-wrapper[_ngcontent-%COMP%]{display:none;width:var(--table-header-sort-icon-size);height:var(--table-header-sort-icon-size)}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   .fu-sort-wrapper[_ngcontent-%COMP%]:hover{cursor:pointer}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   .fu-sort-wrapper[_ngcontent-%COMP%]   fusion-icon[_ngcontent-%COMP%]{width:var(--table-header-sort-icon-size);height:var(--table-header-sort-icon-size);color:var(--table-header-sort-icon-color)}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td.is-sort.asc[_ngcontent-%COMP%]   .fu-sort-wrapper[_ngcontent-%COMP%], [_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td.is-sort.desc[_ngcontent-%COMP%]   .fu-sort-wrapper[_ngcontent-%COMP%]{display:inherit}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td.is-sort[_ngcontent-%COMP%] > div.fu-header-cell-content[_ngcontent-%COMP%]   .fu-header-text[_ngcontent-%COMP%]:hover{cursor:pointer}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   fusion-icon.fu-header-tooltip-icon[_ngcontent-%COMP%]{width:var(--table-header-tooltip-icon-size);height:var(--table-header-tooltip-icon-size);color:var(--table-header-tooltip-icon-color)}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]   td.is-checkbox-holder[_ngcontent-%COMP%]{width:var(--table-checkbox-cell-width)}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]{height:100%;overflow:auto}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{position:sticky;top:0;z-index:3;outline:var(--table-border)}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.sticky-left[_ngcontent-%COMP%]{position:sticky;left:0;z-index:2}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.sticky-left[_ngcontent-%COMP%]:after{content:\"\";position:absolute;top:0;right:-1px;height:100%;width:1px;border-right:var(--table-border)}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.sticky-right[_ngcontent-%COMP%]{position:sticky;right:0;z-index:2}[_nghost-%COMP%]   .tableWrap.fu-table-sticky-header[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.sticky-right[_ngcontent-%COMP%]:nth-child(1 of.sticky-right):before{content:\"\";position:absolute;top:0;left:-1px;height:100%;width:1px;border-left:var(--table-border)}[_nghost-%COMP%]:not(:has(.fu-table-header-wrapper))   .tableWrap[_ngcontent-%COMP%]{border-top-left-radius:var(--table-border-radius);border-top-right-radius:var(--table-border-radius)}[_nghost-%COMP%]:not(:has(.fu-table-footer-wrapper))   .tableWrap[_ngcontent-%COMP%]{border-bottom-left-radius:var(--table-border-radius);border-bottom-right-radius:var(--table-border-radius)}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableV4Component, [{
        type: Component,
        args: [{ selector: 'fusion-table', standalone: true, host: { class: 'fusion-v4' }, imports: [
                    CommonModule,
                    GenericPipe,
                    ReactiveFormsModule,
                    IconModule,
                    CheckboxComponent,
                    SearchComponent,
                    TooltipDirective,
                    TooltipComponent,
                    TableEmptyComponent,
                    TableLoadingComponent,
                    TableBasicComponent
                ], providers: [TableService], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (hasCustomHeader || options?.tableLabel) {\n    <div class=\"fu-table-header-wrapper\">\n        @if (hasCustomHeader) {\n            <ng-content select=\".fu-table-header\"></ng-content>\n        } @else {\n            @if (options?.tableLabel) {\n                <div class=\"fu-table-label\">\n                    <div class=\"fu-table-label-text\"\n                         [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:tableTestIdModifiers.LABEL\">\n                        {{ options?.tableLabel?.text }}\n                    </div>\n                    @if (options?.tableLabel?.tooltip) {\n                        <fusion-icon class=\"fu-header-tooltip-icon\"\n                                     [name]=\"options?.tableLabel?.icon ?? iconTooltip\"\n                                     [fusionTooltip]=\"options?.tableLabel?.tooltip\"\n                                     [testId]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:tableTestIdModifiers.HEADER_TOOLTIP\"\n                        ></fusion-icon>\n                    }\n                </div>\n            }\n            @if (options?.searchOptions) {\n                <fusion-search\n                        [placeholder]=\"options?.searchOptions?.placeholder\"\n                        [formControl]=\"searchFormControl\"\n                        [testId]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:tableTestIdModifiers.SEARCH\"\n                ></fusion-search>\n            }\n        }\n    </div>\n}\n<div id=\"{{id}}_tableTeleportWrapper\"></div>\n<div #tableWrapper class=\"tableWrap\" [ngClass]=\"wrapperClasses\">\n    @if (!tableMainError) {\n        <table [id]=\"id\" #table>\n            <!-- region Table Header-->\n            @if (columns && options) {\n                @if (columns.length) {\n                    <thead [hidden]=\"(isEmpty || (loading && !isLoadingOverlay)) && hideHeaderOnEmpty\">\n                    <!-- region SubHeader-->\n                        @if (subHeader.length) {\n                            <tr>\n                                @if (!!options?.rowsExpandableOptions) {\n                                    <ng-container [ngTemplateOutlet]=\"headerExpandColumn\"\n                                                  [ngTemplateOutletContext]=\"{$implicit: true}\"\n                                    ></ng-container>\n                                }\n                                @for (subheader of subHeader; track subHeader; let isFirst = $first) {\n                                    <td class=\"fu-header-group\"\n                                        [class.fu-border-left]=\"!isFirst\"\n                                        [attr.colspan]=\"(isFirst && !!options?.rowsExpandableOptions) ? subheader.colspan + 1 : subheader.colspan\"\n                                    >\n                                        {{ subheader.name }}\n                                    </td>\n                                }\n                            </tr>\n                        }\n                    <!-- endregion SubHeader-->\n                    <!-- region Header-->\n                    <tr [ngStyle]=\"!!options.rowsOptions && !!options.rowsOptions.headerRow ? options.rowsOptions.headerRow.style : null\">\n                        @if (!!options?.rowsExpandableOptions) {\n                            <ng-container [ngTemplateOutlet]=\"headerExpandColumn\"></ng-container>\n                        }\n                        @for (column of columns; track trackByFunc; let isLast = $last; let isFirst = $first; let idx = $index) {\n                            <td\n                                    [attr.data-col-key]=\"column.key\"\n                                    [ngClass]=\"tableService.getColumnClasses(column, true)\"\n                                    [ngStyle]=\"tableService.getColumnStyle(column)\"\n                                    [style.width]=\"tableService.setWidth(isLast, column.width)\"\n                                    [style.min-width]=\"column.width\"\n                                    [style.top.px]=\"options?.stickyHeaderTopOffset\"\n                                    [attr.data-editable]=\"tableService.isTypeInputEdit(column)\"\n                                    [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.COLUMN_HEADER+idx)\"\n                            >\n                                <div class=\"fu-header-cell-content\"\n                                     [ngClass]=\"column.headerAlign ?? tableService.getCellAlignByColumnType(column)\"\n                                >\n                                @if (tableService.isTypeCheckbox(column) && isAllRowsSelectable && !isEmpty && isCheckboxTitleShown) {\n                                    <fusion-checkbox class=\"is-regular\" title=\"select / un-select all\"\n                                                     [checked]=\"tableService.isAllRowsSelected(rows)\"\n                                                     [isIndeterminate]=\"tableService.isPartialSelected(rows)\"\n                                                     (changed)=\"tableService.onRowsSelectChanged(options.isGroupedTable, rows, $event)\"\n                                                     [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:tableTestIdModifiers.COLUMN_HEADER_SELECT_ALL\"\n                                    ></fusion-checkbox>\n                                } @else if (column.filter && column.filter.options) {\n                                    <!-- todo: Add support for filter column -->\n                                            <!--<fusion-multi-dropdown\n                                                        placeholder=\"Please Select\"\n                                                        class=\"filter\"\n                                                        [selected]=\"column.filter.selected\"\n                                                        [options]=\"column.filter.options\"\n                                                        (selectedChange)=\"filterColumn(column, $event)\"\n                                                        [confirm]=\"true\"\n                                                        [search]=\"true\"\n                                                        selectAllLabel=\"Select All <span class='grey'>(No Filters)</span>\"\n                                                >\n                                                </fusion-multi-dropdown>-->\n                                } @else {\n                                    <div class=\"fu-header-text\"\n                                         (click)=\"onHeaderClicked(column)\"\n                                         [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.COLUMN_TITLE+idx)\"\n                                    >{{ column.title }}\n                                    </div>\n                                    @if (column.tooltip) {\n                                        <fusion-icon class=\"fu-header-tooltip-icon\"\n                                                     [fusionTooltip]=\"column.tooltip\"\n                                                     [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.COLUMN_TOOLTIP+idx)\"\n                                                     [name]=\"column.tooltipIcon || iconTooltip\"\n                                        ></fusion-icon>\n                                    }\n                                    @if (tableService.isColumnSortable(column)) {\n                                            <div class=\"fu-sort-wrapper\" (click)=\"onHeaderClicked(column)\">\n                                            @if (column.sort === 'asc') {\n                                                <div class=\"fu-sort-up\"\n                                                     [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.COLUMN_SORT_UP+idx)\">\n                                                    <fusion-icon [name]=\"iconArrowUp\"></fusion-icon>\n                                                </div>\n                                            } @else if (column.sort === 'desc') {\n                                                <div class=\"fu-sort-down\"\n                                                     [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.COLUMN_SORT_DOWN+idx)\">\n                                                    <fusion-icon [name]=\"iconArrowDown\"></fusion-icon>\n                                                </div>\n                                            }\n                                        </div>\n                                    }\n                                }\n                                </div>\n                            </td>\n                        }\n                    </tr>\n                    <!-- endregion Header-->\n                    </thead>\n                }\n            }\n            <!-- endregion Table Header-->\n            <!-- region Table Body-->\n            @if (!options.isGroupedTable && (!loading || isLoadingOverlay) && !isEmpty) {\n                <tbody #tableBody\n                       fusionTableBasic\n                       [rows]=\"tableRows\"\n                       [columns]=\"columns\"\n                       [options]=\"options\"\n                       [expandedRows]=\"expandedRows\"\n                       [testId]=\"testId\"\n                       (rowSelected)=\"selectionChanged.emit($event)\"\n                       (expandRow)=\"doExpandRow($event)\"\n                       (click)=\"onTableBodyClicked($event)\"\n                ></tbody>\n            }\n            <!-- region grouped Table Body-->\n            <!--\n                            <tbody\n                                    *ngIf=\"options.isGroupedTable && (!loading || isLoadingOverlay) && !isEmpty\"\n                                    fusionTableGrouped\n                                    [rows]=\"groupedTableRows\"\n                                    [columns]=\"columns\"\n                                    [options]=\"options\"\n                                    (rowSelected)=\"selectionChanged.emit($event)\"\n                            ></tbody>\n            -->\n            <!-- endregion grouped Table Body-->\n            <!-- region table empty-->\n            @if (!loading && isEmpty) {\n                <tbody\n                        [fusionTableEmpty]=\"colsCount\"\n                        [customContent]=\"options?.customNoData\"\n                        [type]=\"options?.emptyTableType\"\n                        [header]=\"options?.noDataMessage\"\n                        [subHeader]=\"options?.noDataSubMessage\"\n                ></tbody>\n            }\n            <!-- endregion table empty-->\n            <!-- region table loading-->\n            @if ((loading && !isLoadingOverlay) ||\n            (options?.pagination && options.pagination.loading) ||\n            (isEmpty && loading)) {\n                <tbody [fusionTableLoading]=\"colsCount\"></tbody>\n            }\n            <!-- endregion table loading-->\n            <!-- endregion Table Body-->\n        </table>\n    }\n</div>\n@if (hasCustomFooter) {\n    <div class=\"fu-table-footer-wrapper\">\n        <ng-content select=\".fu-table-footer\"></ng-content>\n    </div>\n}\n\n<ng-template #headerExpandColumn let-isSubHeader>\n    <td class=\"expand-column\"\n        [class.fu-header-group]=\"isSubHeader\"\n        [class.sticky-left]=\"options?.rowsExpandableOptions?.sticky\"\n        [style.top.px]=\"options?.stickyHeaderTopOffset\"\n    ><span></span></td>\n</ng-template>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";.font-v4-bold,.font-v4-tab-label-2,.font-v4-chart-2,.font-v4-chart-1{font-family:Inter,sans-serif;font-weight:700;-webkit-font-smoothing:antialiased}.font-v4-semibold,.font-v4-chip-label,:host .tableWrap table thead tr td,.font-v4-table-label,.font-v4-button,.font-v4-heading-6,.font-v4-heading-5,.font-v4-heading-4,:host .fu-table-header-wrapper .fu-table-label .fu-table-label-text,.font-v4-heading-3,.font-v4-heading-2,.font-v4-heading-1,.font-v4-title{font-family:Inter,sans-serif;font-weight:600;-webkit-font-smoothing:antialiased}.font-v4-medium,.font-v4-tab-label-1,.font-v4-input-label,.font-v4-overline,.font-v4-subtitle-2,.font-v4-subtitle-1{font-family:Inter,sans-serif;font-weight:500;-webkit-font-smoothing:antialiased}.font-v4-regular,.font-v4-caption,.font-v4-body-2,:host .fu-table-footer-wrapper,.font-v4-body-1{font-family:Inter,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased}.font-v4-title{font-size:2.5rem;line-height:3rem;letter-spacing:-.055rem}.font-v4-heading-1{font-size:1.5rem;line-height:1.75rem;letter-spacing:-.0285rem}.font-v4-heading-2{font-size:1.125rem;line-height:1.75rem;letter-spacing:-.01575rem}:host .fu-table-header-wrapper .fu-table-label .fu-table-label-text,.font-v4-heading-3{font-size:1rem;line-height:1.5rem;letter-spacing:-.011rem}.font-v4-heading-4{font-size:.875rem;line-height:1rem;letter-spacing:unset}.font-v4-heading-5{font-size:.8125rem;line-height:16px;letter-spacing:unset}.font-v4-heading-6{font-size:.75rem;line-height:.75rem;letter-spacing:0}:host .fu-table-footer-wrapper,.font-v4-body-1{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-body-2{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-subtitle-1{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-subtitle-2{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-chart-1{font-size:1.5rem;line-height:1.5rem;letter-spacing:-.015rem}.font-v4-chart-2{font-size:1.25rem;line-height:1.25rem;letter-spacing:-.0125rem}.font-v4-button{font-size:.875rem;line-height:1.25rem;letter-spacing:.00875rem}.font-v4-overline{font-size:.75rem;line-height:1rem;letter-spacing:.045rem;text-transform:uppercase}.font-v4-caption{font-size:.75rem;line-height:1rem}:host .tableWrap table thead tr td,.font-v4-table-label{font-size:.8125rem;line-height:1.25rem;letter-spacing:.00813rem}.font-v4-input-label{font-size:.8125rem;line-height:1rem;letter-spacing:.00813rem}.font-v4-tab-label-1,.font-v4-tab-label-2{font-size:.875rem;line-height:1rem}.font-v4-chip-label{font-size:.75rem;line-height:1rem;letter-spacing:normal}:host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host .tableWrap.fu-table-sticky-header::-webkit-scrollbar{background-color:transparent;border-left:var(--fu-scroll-border, solid 0px transparent);border-top:var(--fu-scroll-border, solid 0px transparent);width:var(--fu-scroll-width, 4px);height:var(--fu-scroll-width, 4px)}:host .tableWrap.fu-table-sticky-header::-webkit-scrollbar-track{background-color:var(--fu-scroll-bg-color, transparent)}:host .tableWrap.fu-table-sticky-header::-webkit-scrollbar-thumb{background-color:var(--fu-scroll-button-bg-color, rgba(83, 87, 91, .3));border-radius:var(--fu-scroll-button-border-radius, 4px)}:host .tableWrap.fu-table-sticky-header::-webkit-scrollbar-button{display:none}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}:host{--fu-scroll-width: 6px;--fu-scroll-border: solid 1px var(--common-divider, hsl(0, 0%, 86.8%));--fu-scroll-button-bg-color: var(--default-light, hsl(0, 0%, 89.5%));--table-border-width: 1px;--table-border-type: solid;--table-border-radius: 4px;--table-border-color: var(--common-divider, hsl(0, 0%, 86.8%));--table-border: var(--table-border-width) var(--table-border-type) var(--table-border-color);--table-text-color: var(--text-primary, hsl(0, 0%, 12.5%));--table-header-bg-color: var(--background-paper-elevation-0, hsl(0, 0%, 97.5%));--table-header-search-width: 220px;--table-header-cell-height: 40px;--table-header-cell-padding: 0 16px;--table-header-cell-bg-color: var(--background-paper-elevation-0, hsl(0, 0%, 97.5%));--table-header-cell-gap: 4px;--table-header-text-color: var(--table-text-color);--table-header-sort-icon-color: var(--action-active, hsl(0, 0%, 50.3%));--table-header-sort-icon-size: 20px;--table-header-tooltip-icon-size: 16px;--table-header-tooltip-icon-color: var(--action-active, hsl(0, 0%, 50.3%));--table-footer-height: 48px;--table-footer-padding: 14px 16px;--table-footer-gap: 8px;--table-footer-text-color: var(--table-text-color);--table-footer-bg-color: var(--background-paper-elevation-0, hsl(0, 0%, 97.5%));--table-empty-state-padding: 48px;--table-checkbox-cell-width: 32px;--table-body-border: var(--table-border);--table-row-height: 48px;--table-row-cell-lr-padding: 16px;--table-row-cell-padding: 0 var(--table-row-cell-lr-padding);--table-expand-icon-color: var(--action-active, hsl(0, 0%, 50.3%));--table-expand-icon-size: 20px;--table-expand-cell-width: 46px;--table-row-hover-background-color: var(--background-paper-elevation-1, hsl(0, 0%, 94.6%));--table-odd-row-background-color: #FFFFFF;--table-even-row-background-color: #FFFFFF;--table-row-loading-opacity: .7;position:relative;width:100%;height:100%;display:flex;flex-direction:column;border:var(--table-border);border-radius:var(--table-border-radius)}:host .fu-table-header-wrapper{display:flex;height:var(--spacing-800, 64px);padding:0px var(--spacing-300, 24px);align-items:center;gap:8px;border-top-left-radius:var(--table-border-radius);border-top-right-radius:var(--table-border-radius);border-bottom:var(--table-border);background-color:var(--table-header-bg-color)}:host .fu-table-header-wrapper .fu-table-label{display:flex;align-items:center;gap:4px;flex:1}:host .fu-table-header-wrapper .fu-table-label .fu-table-label-text{color:var(--table-header-text-color)}:host .fu-table-header-wrapper .fu-table-label .fu-header-tooltip-icon{width:var(--table-header-tooltip-icon-size);height:var(--table-header-tooltip-icon-size);color:var(--table-header-tooltip-icon-color)}:host .fu-table-header-wrapper fusion-search{width:var(--table-header-search-width)}:host .fu-table-footer-wrapper{display:flex;align-items:center;height:var(--table-footer-height);padding:var(--table-footer-padding);gap:var(--table-footer-gap);background-color:var(--table-footer-bg-color);border-top:var(--table-border);border-bottom-left-radius:var(--table-border-radius);border-bottom-right-radius:var(--table-border-radius);color:var(--table-footer-text-color)}:host .tableWrap{flex-grow:1;display:block}:host .tableWrap table{border:none;margin:0;border-collapse:collapse;border-spacing:0;width:100%}:host .tableWrap table thead tr td{height:var(--table-header-cell-height);padding:var(--table-header-cell-padding);background-color:var(--table-header-cell-bg-color);border-bottom:var(--table-border)}:host .tableWrap table thead tr td .fu-header-cell-content{display:flex;align-items:center;gap:var(--table-header-cell-gap)}:host .tableWrap table thead tr td .fu-header-cell-content.right{justify-content:flex-end}:host .tableWrap table thead tr td .fu-header-cell-content.center{justify-content:center}:host .tableWrap table thead tr td .fu-sort-wrapper{display:none;width:var(--table-header-sort-icon-size);height:var(--table-header-sort-icon-size)}:host .tableWrap table thead tr td .fu-sort-wrapper:hover{cursor:pointer}:host .tableWrap table thead tr td .fu-sort-wrapper fusion-icon{width:var(--table-header-sort-icon-size);height:var(--table-header-sort-icon-size);color:var(--table-header-sort-icon-color)}:host .tableWrap table thead tr td.is-sort.asc .fu-sort-wrapper,:host .tableWrap table thead tr td.is-sort.desc .fu-sort-wrapper{display:inherit}:host .tableWrap table thead tr td.is-sort>div.fu-header-cell-content .fu-header-text:hover{cursor:pointer}:host .tableWrap table thead tr td fusion-icon.fu-header-tooltip-icon{width:var(--table-header-tooltip-icon-size);height:var(--table-header-tooltip-icon-size);color:var(--table-header-tooltip-icon-color)}:host .tableWrap table thead tr td.is-checkbox-holder{width:var(--table-checkbox-cell-width)}:host .tableWrap.fu-table-sticky-header{height:100%;overflow:auto}:host .tableWrap.fu-table-sticky-header table thead{position:sticky;top:0;z-index:3;outline:var(--table-border)}:host .tableWrap.fu-table-sticky-header table thead td.sticky-left{position:sticky;left:0;z-index:2}:host .tableWrap.fu-table-sticky-header table thead td.sticky-left:after{content:\"\";position:absolute;top:0;right:-1px;height:100%;width:1px;border-right:var(--table-border)}:host .tableWrap.fu-table-sticky-header table thead td.sticky-right{position:sticky;right:0;z-index:2}:host .tableWrap.fu-table-sticky-header table thead td.sticky-right:nth-child(1 of.sticky-right):before{content:\"\";position:absolute;top:0;left:-1px;height:100%;width:1px;border-left:var(--table-border)}:host:not(:has(.fu-table-header-wrapper)) .tableWrap{border-top-left-radius:var(--table-border-radius);border-top-right-radius:var(--table-border-radius)}:host:not(:has(.fu-table-footer-wrapper)) .tableWrap{border-bottom-left-radius:var(--table-border-radius);border-bottom-right-radius:var(--table-border-radius)}\n"] }]
    }], null, { testId: [{
            type: Input
        }], id: [{
            type: Input
        }], options: [{
            type: Input
        }], columns: [{
            type: Input
        }], rows: [{
            type: Input
        }], expandedRows: [{
            type: Input
        }], loading: [{
            type: Input
        }], sortTableOnDataChanges: [{
            type: Input
        }], hasCustomHeader: [{
            type: Input
        }], hasCustomFooter: [{
            type: Input
        }], sortChanged: [{
            type: Output
        }], selectionChanged: [{
            type: Output
        }], rowModelChange: [{
            type: Output
        }], rowClicked: [{
            type: Output
        }], scrollDown: [{
            type: Output
        }], rowActionClicked: [{
            type: Output
        }], expandRow: [{
            type: Output
        }], expandedRowsChange: [{
            type: Output
        }], stringCell: [{
            type: ViewChild,
            args: ['stringCell']
        }], checkboxCell: [{
            type: ViewChild,
            args: ['checkboxCell']
        }], templateCell: [{
            type: ViewChild,
            args: ['templateCell']
        }], tableElement: [{
            type: ViewChild,
            args: ['table']
        }], tableWrapperElement: [{
            type: ViewChild,
            args: ['tableWrapper', { static: true }]
        }], tableBodyComponent: [{
            type: ViewChild,
            args: ['tableBody']
        }], isFixedHeader: [{
            type: HostBinding,
            args: ['class.fixed-table']
        }], noTableFrame: [{
            type: HostBinding,
            args: ['class.fu-no-table-frame']
        }], noTableFooter: [{
            type: HostBinding,
            args: ['class.fu-no-table-footer']
        }], isEmpty: [{
            type: HostBinding,
            args: ['class.is-empty']
        }], isLoading: [{
            type: HostBinding,
            args: ['class.is-loading']
        }], isScrollRight: [{
            type: HostBinding,
            args: ['class.on-scroll-right']
        }], onVerticalScroll: [{
            type: HostBinding,
            args: ['class.on-vertical-scroll']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableV4Component, { className: "TableV4Component", filePath: "table-v4.component.ts", lineNumber: 67 }); })();
//# sourceMappingURL=data:application/json;base64, 