{"version":3,"file":"9511.js","sources":["webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModel/clientSideRowModel.js","webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModel/filterStage.js","webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModel/sortStage.js","webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModel/flattenStage.js","webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModel/sortService.js","webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModel/filterService.js","webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModel/immutableService.js","webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModel/clientSideNodeManager.js","webpack://frontend/./node_modules/@ag-grid-community/client-side-row-model/dist/esm/es5/clientSideRowModelModule.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/modules/moduleNames.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/event.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/columnFactory.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/columnModel.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/columnUtils.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/displayedGroupCreator.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/agStackComponentsRegistry.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/promise.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/customTooltipFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/component.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/floating/provided/readOnlyFloatingFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/managedFocusFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/providedFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agAbstractLabel.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agAbstractField.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agPickerField.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agList.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agSelect.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agAbstractInputField.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/simpleFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/scalarFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/date/dateFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/floating/provided/simpleFloatingFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/date/dateFloatingFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/date/defaultDateComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/number/numberFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/text/textFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/floating/provided/textInputFloatingFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/number/numberFloatingFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/text/textFloatingFilter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/column/sortIndicatorComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/column/headerComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/columnGroup/headerGroupComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/popupComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellEditors/largeTextCellEditor.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellEditors/selectCellEditor.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellEditors/popupSelectCellEditor.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellEditors/textCellEditor.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellEditors/popupTextCellEditor.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellRenderers/animateShowChangeCellRenderer.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellRenderers/animateSlideCellRenderer.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/rowNode.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/checkboxSelectionComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/dragAndDrop/dragAndDropService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/row/rowDragComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellRenderers/groupCellRendererCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellRenderers/groupCellRenderer.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellRenderers/loadingCellRenderer.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/overlays/loadingOverlayComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/overlays/noRowsOverlayComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/tooltipComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/framework/userComponentRegistry.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/framework/userComponentFactory.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/interfaces/iExcelCreator.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/dragAndDrop/dragService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/filterManager.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/abstractCell/abstractHeaderCellComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/floatingFilter/headerFilterCellComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/styling/layoutFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/gridBodyScrollFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/rowDragFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/gridBodyCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/interfaces/IRangeService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cell/cellPositionFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cell/cellCustomStyleFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/tooltipFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cell/cellMouseListenerFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cell/cellKeyboardListenerFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/dndSourceComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cell/cellCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/row/rowCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/rowContainer/rowContainerEventsFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/viewportSizeFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/rowContainer/setPinnedLeftWidthFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/rowContainer/setPinnedRightWidthFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/rowContainer/setHeightFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/rowContainer/dragListenerFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/centerWidthFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/rowContainer/rowContainerCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/gridBodyComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/scrollVisibleService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/mouseEventService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/navigationService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cellEditors/popupEditorWrapper.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cell/cellComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/row/rowComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/rowContainer/rowContainerComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/columnDrag/bodyDropTarget.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/column/headerCellComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/columnGroup/headerGroupCellComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/row/headerRowComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/abstractCell/abstractHeaderCellCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/interfaces/iClientSideRowModel.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/features/setLeftFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/hoverFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/floatingFilter/headerFilterCellCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/column/resizeFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agCheckbox.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/column/selectAllFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/column/headerCellCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/columnGroup/groupResizeFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/columnGroup/groupWidthFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/columnGroup/headerGroupCellCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/row/headerRowCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/rowContainer/headerRowContainerCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/rowContainer/headerRowContainerComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/common/headerNavigationService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/gridHeaderCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/gridHeaderComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/common/horizontalResizeService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/column/standardMenu.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/layout/tabbedLayout.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/misc/resizeObserverService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/misc/animationFrameService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/features/positionableFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/autoWidthCalculator.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/features/stickyRowFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/rowRenderer.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/valueFormatterService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/pinnedRowModel/pinnedRowModel.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/interfaces/serverSideTransaction.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rowNodeCache/rowNodeBlock.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rowNodeCache/rowNodeBlockLoader.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/pagination/paginationProxy.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/styling/stylingService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agRadioButton.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agToggleButton.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agInputTextField.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agInputTextArea.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agInputNumberField.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agInputRange.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agSlider.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agAngleSelect.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agColorPanel.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agPanel.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agDialog.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agColorPicker.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agGroupComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/tabGuardCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/tabGuardComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agMenuList.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agMenuPanel.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/agMenuItemComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/focusService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/popupService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/virtualList.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/cellNavigationService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/alignedGridsService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/selectionService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/valueService/valueService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/valueService/expressionService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/templateService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/logger.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridComp/gridCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridComp/gridComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/sortController.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/columnHoverService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/columnAnimationService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/autoGroupColService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/pagination/paginationAutoPageSizeService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/valueService/valueCache.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/valueService/changeDetectionService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/framework/agComponentUtils.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/framework/componentMetadataProvider.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/environment.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/rowContainerHeightService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rowNodes/selectableService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/pagination/paginationComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/overlays/overlayWrapperComponent.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/rowPosition.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/cellPosition.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/undoRedo/undoRedoStack.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/undoRedo/undoRedoService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/common/headerPosition.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/ctrlsService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/ctrlsFactory.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/fakeHScrollCtrl.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/fakeHScrollComp.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridBodyComp/pinnedWidthService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/rowNodeEventThrottle.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/interfaces/iSparklineCellRendererParams.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/browser.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/dom.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/object.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/generic.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/columnKeyCreator.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/function.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/context/context.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/eventService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/constants/constants.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/modules/moduleRegistry.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/column.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/array.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/columnGroup.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/providedColumnGroup.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/defaultColumnTypes.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/context/beanStub.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/eventKeys.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/groupInstanceIdCreator.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/string.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/map.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/colDefUtil.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/propertyKeys.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/componentUtil.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/entities/sideBar.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/fuzzyMatch.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/number.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridOptionsWrapper.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/color.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/csv.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/general.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/aria.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/date.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/icon.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/constants/keyCode.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/keyboard.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/mouse.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/rowNode.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/set.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/utils.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/numberSequence.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/timer.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cssClassManager.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/componentAnnotations.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/date/dateCompWrapper.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/provided/optionsFactory.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/filterLocaleText.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/widgets/touchListener.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/framework/componentTypes.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/filter/floating/floatingFilterMapper.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/autoScrollService.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/cell/cellRangeFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/beans.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/columnDrag/bodyDropPivotTarget.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/columnDrag/moveColumnFeature.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/headerRendering/cells/cssClassApplier.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/gridApi.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/misc/simpleHttpRequest.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/utils/changedPath.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/vanillaFrameworkOverrides.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/columnApi.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/columns/columnDefFactory.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rendering/row/rowCssClassCalculator.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/rowNodes/rowNodeSorter.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/grid.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/functions.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/components/framework/frameworkComponentWrapper.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/interfaces/iChartOptions.js","webpack://frontend/./node_modules/@ag-grid-community/core/dist/esm/es5/main.js","webpack://frontend/agGridReact.tsx","webpack://frontend/legacy/agGridReactLegacy.ts","webpack://frontend/legacy/legacyReactComponent.ts","webpack://frontend/reactUi/agGridReactUi.tsx","webpack://frontend/reactUi/beansContext.tsx","webpack://frontend/reactUi/cellRenderer/detailCellRenderer.tsx","webpack://frontend/reactUi/cellRenderer/groupCellRenderer.tsx","webpack://frontend/reactUi/cells/cellComp.tsx","webpack://frontend/reactUi/cells/popupEditorComp.tsx","webpack://frontend/reactUi/cells/showJsRenderer.tsx","webpack://frontend/reactUi/gridBodyComp.tsx","webpack://frontend/reactUi/gridComp.tsx","webpack://frontend/reactUi/header/gridHeaderComp.tsx","webpack://frontend/reactUi/header/headerCellComp.tsx","webpack://frontend/reactUi/header/headerFilterCellComp.tsx","webpack://frontend/reactUi/header/headerGroupCellComp.tsx","webpack://frontend/reactUi/header/headerRowComp.tsx","webpack://frontend/reactUi/header/headerRowContainerComp.tsx","webpack://frontend/reactUi/jsComp.tsx","webpack://frontend/reactUi/reactComment.tsx","webpack://frontend/reactUi/rows/rowComp.tsx","webpack://frontend/reactUi/rows/rowContainerComp.tsx","webpack://frontend/reactUi/tabGuardComp.tsx","webpack://frontend/reactUi/useEffectOnce.tsx","webpack://frontend/reactUi/utils.tsx","webpack://frontend/shared/agGridColumn.ts","webpack://frontend/shared/changeDetectionService.ts","webpack://frontend/shared/keyGenerator.ts","webpack://frontend/shared/newReactComponent.ts","webpack://frontend/shared/portalManager.ts","webpack://frontend/shared/reactComponent.ts","webpack://frontend/shared/reactFrameworkOverrides.tsx","webpack://frontend/./node_modules/@ag-grid-community/react/main.js","webpack://frontend/./node_modules/@ag-grid-enterprise/core/dist/esm/es5/licenseManager.js","webpack://frontend/./node_modules/@ag-grid-enterprise/core/dist/esm/es5/license/md5.js","webpack://frontend/./node_modules/@ag-grid-enterprise/core/dist/esm/es5/license/watermark.js","webpack://frontend/./node_modules/@ag-grid-enterprise/core/dist/esm/es5/agGridEnterpriseModule.js"],"sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { _, Autowired, Bean, BeanStub, ChangedPath, Constants, Events, GridOptionsWrapper, Optional, PostConstruct, ClientSideRowModelSteps, RowNode, RowHighlightPosition } from \"@ag-grid-community/core\";\nimport { ClientSideNodeManager } from \"./clientSideNodeManager\";\nvar RecursionType;\n(function (RecursionType) {\n RecursionType[RecursionType[\"Normal\"] = 0] = \"Normal\";\n RecursionType[RecursionType[\"AfterFilter\"] = 1] = \"AfterFilter\";\n RecursionType[RecursionType[\"AfterFilterAndSort\"] = 2] = \"AfterFilterAndSort\";\n RecursionType[RecursionType[\"PivotNodes\"] = 3] = \"PivotNodes\";\n})(RecursionType || (RecursionType = {}));\nvar ClientSideRowModel = /** @class */ (function (_super) {\n __extends(ClientSideRowModel, _super);\n function ClientSideRowModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.onRowHeightChanged_debounced = _.debounce(_this.onRowHeightChanged.bind(_this), 100);\n _this.rowsToDisplay = []; // the rows mapped to rows to display\n return _this;\n }\n ClientSideRowModel.prototype.init = function () {\n var refreshEverythingFunc = this.refreshModel.bind(this, { step: ClientSideRowModelSteps.EVERYTHING });\n var animate = !this.gridOptionsWrapper.isSuppressAnimationFrame();\n var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, {\n step: ClientSideRowModelSteps.EVERYTHING,\n afterColumnsChanged: true,\n keepRenderedRows: true,\n animate: animate\n });\n this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refreshEverythingAfterColsChangedFunc);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc);\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: ClientSideRowModelSteps.PIVOT }));\n this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this));\n this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc);\n var refreshMapListener = this.refreshModel.bind(this, {\n step: ClientSideRowModelSteps.MAP,\n keepRenderedRows: true,\n animate: animate\n });\n this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_GROUP_REMOVE_SINGLE_CHILDREN, refreshMapListener);\n this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_GROUP_REMOVE_LOWEST_SINGLE_CHILDREN, refreshMapListener);\n this.rootNode = new RowNode(this.beans);\n this.nodeManager = new ClientSideNodeManager(this.rootNode, this.gridOptionsWrapper, this.eventService, this.columnModel, this.selectionService, this.beans);\n };\n ClientSideRowModel.prototype.start = function () {\n var rowData = this.gridOptionsWrapper.getRowData();\n if (rowData) {\n this.setRowData(rowData);\n }\n };\n ClientSideRowModel.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) {\n var atLeastOneChange;\n var res = false;\n // we do this multiple times as changing the row heights can also change the first and last rows,\n // so the first pass can make lots of rows smaller, which means the second pass we end up changing\n // more rows.\n do {\n atLeastOneChange = false;\n var rowAtStartPixel = this.getRowIndexAtPixel(startPixel);\n var rowAtEndPixel = this.getRowIndexAtPixel(endPixel);\n // keep check to current page if doing pagination\n var firstRow = Math.max(rowAtStartPixel, startLimitIndex);\n var lastRow = Math.min(rowAtEndPixel, endLimitIndex);\n for (var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) {\n var rowNode = this.getRow(rowIndex);\n if (rowNode.rowHeightEstimated) {\n var rowHeight = this.gridOptionsWrapper.getRowHeightForNode(rowNode);\n rowNode.setRowHeight(rowHeight.height);\n atLeastOneChange = true;\n res = true;\n }\n }\n if (atLeastOneChange) {\n this.setRowTopAndRowIndex();\n }\n } while (atLeastOneChange);\n return res;\n };\n ClientSideRowModel.prototype.setRowTopAndRowIndex = function () {\n var defaultRowHeight = this.gridOptionsWrapper.getDefaultRowHeight();\n var nextRowTop = 0;\n // mapping displayed rows is not needed for this method, however it's used in\n // clearRowTopAndRowIndex(), and given we are looping through this.rowsToDisplay here,\n // we create the map here for performance reasons, so we don't loop a second time\n // in clearRowTopAndRowIndex()\n var displayedRowsMapped = new Set();\n // we don't estimate if doing fullHeight or autoHeight, as all rows get rendered all the time\n // with these two layouts.\n var allowEstimate = this.gridOptionsWrapper.getDomLayout() === Constants.DOM_LAYOUT_NORMAL;\n for (var i = 0; i < this.rowsToDisplay.length; i++) {\n var rowNode = this.rowsToDisplay[i];\n if (rowNode.id != null) {\n displayedRowsMapped.add(rowNode.id);\n }\n if (rowNode.rowHeight == null) {\n var rowHeight = this.gridOptionsWrapper.getRowHeightForNode(rowNode, allowEstimate, defaultRowHeight);\n rowNode.setRowHeight(rowHeight.height, rowHeight.estimated);\n }\n rowNode.setRowTop(nextRowTop);\n rowNode.setRowIndex(i);\n nextRowTop += rowNode.rowHeight;\n }\n return displayedRowsMapped;\n };\n ClientSideRowModel.prototype.clearRowTopAndRowIndex = function (changedPath, displayedRowsMapped) {\n var changedPathActive = changedPath.isActive();\n var clearIfNotDisplayed = function (rowNode) {\n if (rowNode && rowNode.id != null && !displayedRowsMapped.has(rowNode.id)) {\n rowNode.clearRowTopAndRowIndex();\n }\n };\n var recurse = function (rowNode) {\n clearIfNotDisplayed(rowNode);\n clearIfNotDisplayed(rowNode.detailNode);\n clearIfNotDisplayed(rowNode.sibling);\n if (rowNode.hasChildren()) {\n if (rowNode.childrenAfterGroup) {\n // if a changedPath is active, it means we are here because of a transaction update or\n // a change detection. neither of these impacts the open/closed state of groups. so if\n // a group is not open this time, it was not open last time. so we know all closed groups\n // already have their top positions cleared. so there is no need to traverse all the way\n // when changedPath is active and the rowNode is not expanded.\n var isRootNode = rowNode.level == -1; // we need to give special consideration for root node,\n // as expanded=undefined for root node\n var skipChildren = changedPathActive && !isRootNode && !rowNode.expanded;\n if (!skipChildren) {\n rowNode.childrenAfterGroup.forEach(recurse);\n }\n }\n }\n };\n recurse(this.rootNode);\n };\n // returns false if row was moved, otherwise true\n ClientSideRowModel.prototype.ensureRowsAtPixel = function (rowNodes, pixel, increment) {\n var _this = this;\n if (increment === void 0) { increment = 0; }\n var indexAtPixelNow = this.getRowIndexAtPixel(pixel);\n var rowNodeAtPixelNow = this.getRow(indexAtPixelNow);\n var animate = !this.gridOptionsWrapper.isSuppressAnimationFrame();\n if (rowNodeAtPixelNow === rowNodes[0]) {\n return false;\n }\n rowNodes.forEach(function (rowNode) {\n _.removeFromArray(_this.rootNode.allLeafChildren, rowNode);\n });\n rowNodes.forEach(function (rowNode, idx) {\n _.insertIntoArray(_this.rootNode.allLeafChildren, rowNode, Math.max(indexAtPixelNow + increment, 0) + idx);\n });\n this.refreshModel({\n step: ClientSideRowModelSteps.EVERYTHING,\n keepRenderedRows: true,\n keepEditingRows: true,\n animate: animate\n });\n return true;\n };\n ClientSideRowModel.prototype.highlightRowAtPixel = function (rowNode, pixel) {\n var indexAtPixelNow = pixel != null ? this.getRowIndexAtPixel(pixel) : null;\n var rowNodeAtPixelNow = indexAtPixelNow != null ? this.getRow(indexAtPixelNow) : null;\n if (!rowNodeAtPixelNow || !rowNode || rowNodeAtPixelNow === rowNode || pixel == null) {\n if (this.lastHighlightedRow) {\n this.lastHighlightedRow.setHighlighted(null);\n this.lastHighlightedRow = null;\n }\n return;\n }\n var highlight = this.getHighlightPosition(pixel, rowNodeAtPixelNow);\n if (this.lastHighlightedRow && this.lastHighlightedRow !== rowNodeAtPixelNow) {\n this.lastHighlightedRow.setHighlighted(null);\n this.lastHighlightedRow = null;\n }\n rowNodeAtPixelNow.setHighlighted(highlight);\n this.lastHighlightedRow = rowNodeAtPixelNow;\n };\n ClientSideRowModel.prototype.getHighlightPosition = function (pixel, rowNode) {\n if (!rowNode) {\n var index = this.getRowIndexAtPixel(pixel);\n rowNode = this.getRow(index || 0);\n if (!rowNode) {\n return RowHighlightPosition.Below;\n }\n }\n var rowTop = rowNode.rowTop, rowHeight = rowNode.rowHeight;\n return pixel - rowTop < rowHeight / 2 ? RowHighlightPosition.Above : RowHighlightPosition.Below;\n };\n ClientSideRowModel.prototype.getLastHighlightedRowNode = function () {\n return this.lastHighlightedRow;\n };\n ClientSideRowModel.prototype.isLastRowIndexKnown = function () {\n return true;\n };\n ClientSideRowModel.prototype.getRowCount = function () {\n if (this.rowsToDisplay) {\n return this.rowsToDisplay.length;\n }\n return 0;\n };\n ClientSideRowModel.prototype.getTopLevelRowCount = function () {\n var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode;\n if (showingRootNode) {\n return 1;\n }\n var filteredChildren = this.rootNode.childrenAfterAggFilter;\n return filteredChildren ? filteredChildren.length : 0;\n };\n ClientSideRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) {\n var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode;\n if (showingRootNode) {\n return topLevelIndex;\n }\n var rowNode = this.rootNode.childrenAfterSort[topLevelIndex];\n if (this.gridOptionsWrapper.isGroupHideOpenParents()) {\n // if hideOpenParents, and this row open, then this row is now displayed at this index, first child is\n while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) {\n rowNode = rowNode.childrenAfterSort[0];\n }\n }\n return rowNode.rowIndex;\n };\n ClientSideRowModel.prototype.getRowBounds = function (index) {\n if (_.missing(this.rowsToDisplay)) {\n return null;\n }\n var rowNode = this.rowsToDisplay[index];\n if (rowNode) {\n return {\n rowTop: rowNode.rowTop,\n rowHeight: rowNode.rowHeight\n };\n }\n return null;\n };\n ClientSideRowModel.prototype.onRowGroupOpened = function () {\n var animate = this.gridOptionsWrapper.isAnimateRows();\n this.refreshModel({ step: ClientSideRowModelSteps.MAP, keepRenderedRows: true, animate: animate });\n };\n ClientSideRowModel.prototype.onFilterChanged = function (event) {\n if (event.afterDataChange) {\n return;\n }\n var animate = this.gridOptionsWrapper.isAnimateRows();\n var primaryOrQuickFilterChanged = event.columns.length === 0 || event.columns.some(function (col) { return col.isPrimary(); });\n var step = primaryOrQuickFilterChanged ? ClientSideRowModelSteps.FILTER : ClientSideRowModelSteps.FILTER_AGGREGATES;\n this.refreshModel({ step: step, keepRenderedRows: true, animate: animate });\n };\n ClientSideRowModel.prototype.onSortChanged = function () {\n var animate = this.gridOptionsWrapper.isAnimateRows();\n this.refreshModel({ step: ClientSideRowModelSteps.SORT, keepRenderedRows: true, animate: animate, keepEditingRows: true });\n };\n ClientSideRowModel.prototype.getType = function () {\n return Constants.ROW_MODEL_TYPE_CLIENT_SIDE;\n };\n ClientSideRowModel.prototype.onValueChanged = function () {\n if (this.columnModel.isPivotActive()) {\n this.refreshModel({ step: ClientSideRowModelSteps.PIVOT });\n }\n else {\n this.refreshModel({ step: ClientSideRowModelSteps.AGGREGATE });\n }\n };\n ClientSideRowModel.prototype.createChangePath = function (rowNodeTransactions) {\n // for updates, if the row is updated at all, then we re-calc all the values\n // in that row. we could compare each value to each old value, however if we\n // did this, we would be calling the valueService twice, once on the old value\n // and once on the new value. so it's less valueGetter calls if we just assume\n // each column is different. that way the changedPath is used so that only\n // the impacted parent rows are recalculated, parents who's children have\n // not changed are not impacted.\n var noTransactions = _.missingOrEmpty(rowNodeTransactions);\n var changedPath = new ChangedPath(false, this.rootNode);\n if (noTransactions || this.gridOptionsWrapper.isTreeData()) {\n changedPath.setInactive();\n }\n return changedPath;\n };\n ClientSideRowModel.prototype.isSuppressModelUpdateAfterUpdateTransaction = function (params) {\n if (!this.gridOptionsWrapper.isSuppressModelUpdateAfterUpdateTransaction()) {\n return false;\n }\n // return true if we are only doing update transactions\n if (params.rowNodeTransactions == null) {\n return false;\n }\n var transWithAddsOrDeletes = params.rowNodeTransactions.filter(function (tx) {\n return (tx.add != null && tx.add.length > 0) || (tx.remove != null && tx.remove.length > 0);\n });\n var transactionsContainUpdatesOnly = transWithAddsOrDeletes == null || transWithAddsOrDeletes.length == 0;\n return transactionsContainUpdatesOnly;\n };\n ClientSideRowModel.prototype.refreshModel = function (params) {\n if (this.isSuppressModelUpdateAfterUpdateTransaction(params)) {\n return;\n }\n // this goes through the pipeline of stages. what's in my head is similar\n // to the diagram on this page:\n // http://commons.apache.org/sandbox/commons-pipeline/pipeline_basics.html\n // however we want to keep the results of each stage, hence we manually call\n // each step rather than have them chain each other.\n // fallthrough in below switch is on purpose,\n // eg if STEP_FILTER, then all steps below this\n // step get done\n // let start: number;\n // console.log('======= start =======');\n var changedPath = this.createChangePath(params.rowNodeTransactions);\n switch (params.step) {\n case ClientSideRowModelSteps.EVERYTHING:\n this.doRowGrouping(params.groupState, params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged);\n case ClientSideRowModelSteps.FILTER:\n this.doFilter(changedPath);\n case ClientSideRowModelSteps.PIVOT:\n this.doPivot(changedPath);\n case ClientSideRowModelSteps.AGGREGATE: // depends on agg fields\n this.doAggregate(changedPath);\n case ClientSideRowModelSteps.FILTER_AGGREGATES:\n this.doFilterAggregates(changedPath);\n case ClientSideRowModelSteps.SORT:\n this.doSort(params.rowNodeTransactions, changedPath);\n case ClientSideRowModelSteps.MAP:\n this.doRowsToDisplay();\n }\n // set all row tops to null, then set row tops on all visible rows. if we don't\n // do this, then the algorithm below only sets row tops, old row tops from old rows\n // will still lie around\n var displayedNodesMapped = this.setRowTopAndRowIndex();\n this.clearRowTopAndRowIndex(changedPath, displayedNodesMapped);\n var event = {\n type: Events.EVENT_MODEL_UPDATED,\n animate: params.animate,\n keepRenderedRows: params.keepRenderedRows,\n newData: params.newData,\n newPage: false,\n keepUndoRedoStack: params.keepUndoRedoStack\n };\n this.eventService.dispatchEvent(event);\n };\n ClientSideRowModel.prototype.isEmpty = function () {\n var rowsMissing = _.missing(this.rootNode.allLeafChildren) || this.rootNode.allLeafChildren.length === 0;\n return _.missing(this.rootNode) || rowsMissing || !this.columnModel.isReady();\n };\n ClientSideRowModel.prototype.isRowsToRender = function () {\n return _.exists(this.rowsToDisplay) && this.rowsToDisplay.length > 0;\n };\n ClientSideRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) {\n // if lastSelectedNode is missing, we start at the first row\n var firstRowHit = !lastInRange;\n var lastRowHit = false;\n var lastRow;\n var result = [];\n var groupsSelectChildren = this.gridOptionsWrapper.isGroupSelectsChildren();\n this.forEachNodeAfterFilterAndSort(function (rowNode) {\n var lookingForLastRow = firstRowHit && !lastRowHit;\n // check if we need to flip the select switch\n if (!firstRowHit) {\n if (rowNode === lastInRange || rowNode === firstInRange) {\n firstRowHit = true;\n }\n }\n var skipThisGroupNode = rowNode.group && groupsSelectChildren;\n if (!skipThisGroupNode) {\n var inRange = firstRowHit && !lastRowHit;\n var childOfLastRow = rowNode.isParentOfNode(lastRow);\n if (inRange || childOfLastRow) {\n result.push(rowNode);\n }\n }\n if (lookingForLastRow) {\n if (rowNode === lastInRange || rowNode === firstInRange) {\n lastRowHit = true;\n if (rowNode === lastInRange) {\n lastRow = lastInRange;\n }\n else {\n lastRow = firstInRange;\n }\n }\n }\n });\n return result;\n };\n ClientSideRowModel.prototype.setDatasource = function (datasource) {\n console.error('AG Grid: should never call setDatasource on clientSideRowController');\n };\n ClientSideRowModel.prototype.getTopLevelNodes = function () {\n return this.rootNode ? this.rootNode.childrenAfterGroup : null;\n };\n ClientSideRowModel.prototype.getRootNode = function () {\n return this.rootNode;\n };\n ClientSideRowModel.prototype.getRow = function (index) {\n return this.rowsToDisplay[index];\n };\n ClientSideRowModel.prototype.isRowPresent = function (rowNode) {\n return this.rowsToDisplay.indexOf(rowNode) >= 0;\n };\n ClientSideRowModel.prototype.getRowIndexAtPixel = function (pixelToMatch) {\n if (this.isEmpty() || this.rowsToDisplay.length === 0) {\n return -1;\n }\n // do binary search of tree\n // http://oli.me.uk/2013/06/08/searching-javascript-arrays-with-a-binary-search/\n var bottomPointer = 0;\n var topPointer = this.rowsToDisplay.length - 1;\n // quick check, if the pixel is out of bounds, then return last row\n if (pixelToMatch <= 0) {\n // if pixel is less than or equal zero, it's always the first row\n return 0;\n }\n var lastNode = _.last(this.rowsToDisplay);\n if (lastNode.rowTop <= pixelToMatch) {\n return this.rowsToDisplay.length - 1;\n }\n var oldBottomPointer = -1;\n var oldTopPointer = -1;\n while (true) {\n var midPointer = Math.floor((bottomPointer + topPointer) / 2);\n var currentRowNode = this.rowsToDisplay[midPointer];\n if (this.isRowInPixel(currentRowNode, pixelToMatch)) {\n return midPointer;\n }\n if (currentRowNode.rowTop < pixelToMatch) {\n bottomPointer = midPointer + 1;\n }\n else if (currentRowNode.rowTop > pixelToMatch) {\n topPointer = midPointer - 1;\n }\n // infinite loops happen when there is space between rows. this can happen\n // when Auto Height is active, cos we re-calculate row tops asyncronously\n // when row heights change, which can temporarly result in gaps between rows.\n var caughtInInfiniteLoop = oldBottomPointer === bottomPointer\n && oldTopPointer === topPointer;\n if (caughtInInfiniteLoop) {\n return midPointer;\n }\n oldBottomPointer = bottomPointer;\n oldTopPointer = topPointer;\n }\n };\n ClientSideRowModel.prototype.isRowInPixel = function (rowNode, pixelToMatch) {\n var topPixel = rowNode.rowTop;\n var bottomPixel = rowNode.rowTop + rowNode.rowHeight;\n var pixelInRow = topPixel <= pixelToMatch && bottomPixel > pixelToMatch;\n return pixelInRow;\n };\n ClientSideRowModel.prototype.forEachLeafNode = function (callback) {\n if (this.rootNode.allLeafChildren) {\n this.rootNode.allLeafChildren.forEach(function (rowNode, index) { return callback(rowNode, index); });\n }\n };\n ClientSideRowModel.prototype.forEachNode = function (callback) {\n this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterGroup, callback, RecursionType.Normal, 0);\n };\n ClientSideRowModel.prototype.forEachNodeAfterFilter = function (callback) {\n this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterAggFilter, callback, RecursionType.AfterFilter, 0);\n };\n ClientSideRowModel.prototype.forEachNodeAfterFilterAndSort = function (callback) {\n this.recursivelyWalkNodesAndCallback(this.rootNode.childrenAfterSort, callback, RecursionType.AfterFilterAndSort, 0);\n };\n ClientSideRowModel.prototype.forEachPivotNode = function (callback) {\n this.recursivelyWalkNodesAndCallback([this.rootNode], callback, RecursionType.PivotNodes, 0);\n };\n // iterates through each item in memory, and calls the callback function\n // nodes - the rowNodes to traverse\n // callback - the user provided callback\n // recursion type - need this to know what child nodes to recurse, eg if looking at all nodes, or filtered notes etc\n // index - works similar to the index in forEach in javascript's array function\n ClientSideRowModel.prototype.recursivelyWalkNodesAndCallback = function (nodes, callback, recursionType, index) {\n if (!nodes) {\n return index;\n }\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n callback(node, index++);\n // go to the next level if it is a group\n if (node.hasChildren()) {\n // depending on the recursion type, we pick a difference set of children\n var nodeChildren = null;\n switch (recursionType) {\n case RecursionType.Normal:\n nodeChildren = node.childrenAfterGroup;\n break;\n case RecursionType.AfterFilter:\n nodeChildren = node.childrenAfterAggFilter;\n break;\n case RecursionType.AfterFilterAndSort:\n nodeChildren = node.childrenAfterSort;\n break;\n case RecursionType.PivotNodes:\n // for pivot, we don't go below leafGroup levels\n nodeChildren = !node.leafGroup ? node.childrenAfterSort : null;\n break;\n }\n if (nodeChildren) {\n index = this.recursivelyWalkNodesAndCallback(nodeChildren, callback, recursionType, index);\n }\n }\n }\n return index;\n };\n // it's possible to recompute the aggregate without doing the other parts\n // + gridApi.recomputeAggregates()\n ClientSideRowModel.prototype.doAggregate = function (changedPath) {\n if (this.aggregationStage) {\n this.aggregationStage.execute({ rowNode: this.rootNode, changedPath: changedPath });\n }\n };\n ClientSideRowModel.prototype.doFilterAggregates = function (changedPath) {\n if (this.filterAggregatesStage) {\n this.filterAggregatesStage.execute({ rowNode: this.rootNode, changedPath: changedPath });\n }\n else {\n // If filterAggregatesStage is undefined, then so is the grouping stage, so all children should be on the rootNode.\n this.rootNode.childrenAfterAggFilter = this.rootNode.childrenAfterFilter;\n }\n };\n // + gridApi.expandAll()\n // + gridApi.collapseAll()\n ClientSideRowModel.prototype.expandOrCollapseAll = function (expand) {\n var usingTreeData = this.gridOptionsWrapper.isTreeData();\n var usingPivotMode = this.columnModel.isPivotActive();\n var recursiveExpandOrCollapse = function (rowNodes) {\n if (!rowNodes) {\n return;\n }\n rowNodes.forEach(function (rowNode) {\n var actionRow = function () {\n rowNode.expanded = expand;\n recursiveExpandOrCollapse(rowNode.childrenAfterGroup);\n };\n if (usingTreeData) {\n var hasChildren = _.exists(rowNode.childrenAfterGroup);\n if (hasChildren) {\n actionRow();\n }\n return;\n }\n if (usingPivotMode) {\n var notLeafGroup = !rowNode.leafGroup;\n if (notLeafGroup) {\n actionRow();\n }\n return;\n }\n var isRowGroup = rowNode.group;\n if (isRowGroup) {\n actionRow();\n }\n });\n };\n if (this.rootNode) {\n recursiveExpandOrCollapse(this.rootNode.childrenAfterGroup);\n }\n this.refreshModel({ step: ClientSideRowModelSteps.MAP });\n var eventSource = expand ? 'expandAll' : 'collapseAll';\n var event = {\n type: Events.EVENT_EXPAND_COLLAPSE_ALL,\n source: eventSource\n };\n this.eventService.dispatchEvent(event);\n };\n ClientSideRowModel.prototype.doSort = function (rowNodeTransactions, changedPath) {\n this.sortStage.execute({\n rowNode: this.rootNode,\n rowNodeTransactions: rowNodeTransactions,\n changedPath: changedPath\n });\n };\n ClientSideRowModel.prototype.doRowGrouping = function (groupState, rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) {\n if (this.groupStage) {\n if (rowNodeTransactions) {\n this.groupStage.execute({\n rowNode: this.rootNode,\n rowNodeTransactions: rowNodeTransactions,\n rowNodeOrder: rowNodeOrder,\n changedPath: changedPath\n });\n }\n else {\n this.groupStage.execute({\n rowNode: this.rootNode,\n changedPath: changedPath,\n afterColumnsChanged: afterColumnsChanged\n });\n // set open/closed state on groups\n this.restoreGroupState(groupState);\n }\n if (this.gridOptionsWrapper.isGroupSelectsChildren()) {\n this.selectionService.updateGroupsFromChildrenSelections(changedPath);\n }\n }\n else {\n this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren;\n if (this.rootNode.sibling) {\n this.rootNode.sibling.childrenAfterGroup = this.rootNode.childrenAfterGroup;\n }\n this.rootNode.updateHasChildren();\n }\n };\n ClientSideRowModel.prototype.restoreGroupState = function (groupState) {\n if (!groupState) {\n return;\n }\n _.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) {\n // if the group was open last time, then open it this time. however\n // if was not open last time, then don't touch the group, so the 'groupDefaultExpanded'\n // setting will take effect.\n if (typeof groupState[key] === 'boolean') {\n node.expanded = groupState[key];\n }\n });\n };\n ClientSideRowModel.prototype.doFilter = function (changedPath) {\n this.filterStage.execute({ rowNode: this.rootNode, changedPath: changedPath });\n };\n ClientSideRowModel.prototype.doPivot = function (changedPath) {\n if (this.pivotStage) {\n this.pivotStage.execute({ rowNode: this.rootNode, changedPath: changedPath });\n }\n };\n ClientSideRowModel.prototype.getGroupState = function () {\n if (!this.rootNode.childrenAfterGroup || !this.gridOptionsWrapper.isRememberGroupStateWhenNewData()) {\n return null;\n }\n var result = {};\n _.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { return result[key] = node.expanded; });\n return result;\n };\n ClientSideRowModel.prototype.getCopyOfNodesMap = function () {\n return this.nodeManager.getCopyOfNodesMap();\n };\n ClientSideRowModel.prototype.getRowNode = function (id) {\n // although id is typed a string, this could be called by the user, and they could have passed a number\n var idIsGroup = typeof id == 'string' && id.indexOf(RowNode.ID_PREFIX_ROW_GROUP) == 0;\n if (idIsGroup) {\n // only one users complained about getRowNode not working for groups, after years of\n // this working for normal rows. so have done quick implementation. if users complain\n // about performance, then GroupStage should store / manage created groups in a map,\n // which is a chunk of work.\n var res_1 = undefined;\n this.forEachNode(function (node) {\n if (node.id === id) {\n res_1 = node;\n }\n });\n return res_1;\n }\n return this.nodeManager.getRowNode(id);\n };\n // rows: the rows to put into the model\n ClientSideRowModel.prototype.setRowData = function (rowData) {\n // no need to invalidate cache, as the cache is stored on the rowNode,\n // so new rowNodes means the cache is wiped anyway.\n // remember group state, so we can expand groups that should be expanded\n var groupState = this.getGroupState();\n this.nodeManager.setRowData(rowData);\n // - clears selection\n this.selectionService.reset();\n // - updates filters\n this.filterManager.onNewRowsLoaded('rowDataUpdated');\n // this event kicks off:\n // - shows 'no rows' overlay if needed\n var rowDataUpdatedEvent = {\n type: Events.EVENT_ROW_DATA_UPDATED\n };\n this.eventService.dispatchEvent(rowDataUpdatedEvent);\n this.refreshModel({\n step: ClientSideRowModelSteps.EVERYTHING,\n groupState: groupState,\n newData: true\n });\n };\n ClientSideRowModel.prototype.batchUpdateRowData = function (rowDataTransaction, callback) {\n var _this = this;\n if (this.applyAsyncTransactionsTimeout == null) {\n this.rowDataTransactionBatch = [];\n var waitMillis = this.gridOptionsWrapper.getAsyncTransactionWaitMillis();\n this.applyAsyncTransactionsTimeout = window.setTimeout(function () {\n _this.executeBatchUpdateRowData();\n }, waitMillis);\n }\n this.rowDataTransactionBatch.push({ rowDataTransaction: rowDataTransaction, callback: callback });\n };\n ClientSideRowModel.prototype.flushAsyncTransactions = function () {\n if (this.applyAsyncTransactionsTimeout != null) {\n clearTimeout(this.applyAsyncTransactionsTimeout);\n this.executeBatchUpdateRowData();\n }\n };\n ClientSideRowModel.prototype.executeBatchUpdateRowData = function () {\n var _this = this;\n this.valueCache.onDataChanged();\n var callbackFuncsBound = [];\n var rowNodeTrans = [];\n // The rowGroup stage uses rowNodeOrder if order was provided. if we didn't pass 'true' to\n // commonUpdateRowData, using addIndex would have no effect when grouping.\n var forceRowNodeOrder = false;\n if (this.rowDataTransactionBatch) {\n this.rowDataTransactionBatch.forEach(function (tranItem) {\n var rowNodeTran = _this.nodeManager.updateRowData(tranItem.rowDataTransaction, undefined);\n rowNodeTrans.push(rowNodeTran);\n if (tranItem.callback) {\n callbackFuncsBound.push(tranItem.callback.bind(null, rowNodeTran));\n }\n if (typeof tranItem.rowDataTransaction.addIndex === 'number') {\n forceRowNodeOrder = true;\n }\n });\n }\n this.commonUpdateRowData(rowNodeTrans, undefined, forceRowNodeOrder);\n // do callbacks in next VM turn so it's async\n if (callbackFuncsBound.length > 0) {\n window.setTimeout(function () {\n callbackFuncsBound.forEach(function (func) { return func(); });\n }, 0);\n }\n if (rowNodeTrans.length > 0) {\n var event_1 = {\n type: Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,\n results: rowNodeTrans\n };\n this.eventService.dispatchEvent(event_1);\n }\n this.rowDataTransactionBatch = null;\n this.applyAsyncTransactionsTimeout = undefined;\n };\n ClientSideRowModel.prototype.updateRowData = function (rowDataTran, rowNodeOrder) {\n this.valueCache.onDataChanged();\n var rowNodeTran = this.nodeManager.updateRowData(rowDataTran, rowNodeOrder);\n // if doing immutableData, addIndex is never present. however if doing standard transaction, and user\n // provided addIndex, then this is used in updateRowData. However if doing Enterprise, then the rowGroup\n // stage also uses the\n var forceRowNodeOrder = typeof rowDataTran.addIndex === 'number';\n this.commonUpdateRowData([rowNodeTran], rowNodeOrder, forceRowNodeOrder);\n return rowNodeTran;\n };\n ClientSideRowModel.prototype.createRowNodeOrder = function () {\n var suppressSortOrder = this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder();\n if (suppressSortOrder) {\n return;\n }\n var orderMap = {};\n if (this.rootNode && this.rootNode.allLeafChildren) {\n for (var index = 0; index < this.rootNode.allLeafChildren.length; index++) {\n var node = this.rootNode.allLeafChildren[index];\n orderMap[node.id] = index;\n }\n }\n return orderMap;\n };\n // common to updateRowData and batchUpdateRowData\n ClientSideRowModel.prototype.commonUpdateRowData = function (rowNodeTrans, rowNodeOrder, forceRowNodeOrder) {\n var animate = !this.gridOptionsWrapper.isSuppressAnimationFrame();\n if (forceRowNodeOrder) {\n rowNodeOrder = this.createRowNodeOrder();\n }\n this.refreshModel({\n step: ClientSideRowModelSteps.EVERYTHING,\n rowNodeTransactions: rowNodeTrans,\n rowNodeOrder: rowNodeOrder,\n keepRenderedRows: true,\n keepEditingRows: true,\n animate: animate\n });\n // - updates filters\n this.filterManager.onNewRowsLoaded('rowDataUpdated');\n var event = {\n type: Events.EVENT_ROW_DATA_UPDATED\n };\n this.eventService.dispatchEvent(event);\n };\n ClientSideRowModel.prototype.doRowsToDisplay = function () {\n this.rowsToDisplay = this.flattenStage.execute({ rowNode: this.rootNode });\n };\n ClientSideRowModel.prototype.onRowHeightChanged = function () {\n this.refreshModel({ step: ClientSideRowModelSteps.MAP, keepRenderedRows: true, keepEditingRows: true, keepUndoRedoStack: true });\n };\n /** This method is debounced. It is used for row auto-height. If we don't debounce,\n * then the Row Models will end up recalculating each row position\n * for each row height change and result in the Row Renderer laying out rows.\n * This is particularly bad if using print layout, and showing eg 1,000 rows,\n * each row will change it's height, causing Row Model to update 1,000 times.\n */\n ClientSideRowModel.prototype.onRowHeightChangedDebounced = function () {\n this.onRowHeightChanged_debounced();\n };\n ClientSideRowModel.prototype.resetRowHeights = function () {\n var atLeastOne = false;\n this.forEachNode(function (rowNode) {\n rowNode.setRowHeight(rowNode.rowHeight, true);\n // we keep the height each row is at, however we set estimated=true rather than clear the height.\n // this means the grid will not reset the row heights back to defaults, rather it will re-calc\n // the height for each row as the row is displayed. otherwise the scroll will jump when heights are reset.\n var detailNode = rowNode.detailNode;\n if (detailNode) {\n detailNode.setRowHeight(detailNode.rowHeight, true);\n }\n atLeastOne = true;\n });\n if (atLeastOne) {\n this.onRowHeightChanged();\n }\n };\n __decorate([\n Autowired('columnModel')\n ], ClientSideRowModel.prototype, \"columnModel\", void 0);\n __decorate([\n Autowired('selectionService')\n ], ClientSideRowModel.prototype, \"selectionService\", void 0);\n __decorate([\n Autowired('filterManager')\n ], ClientSideRowModel.prototype, \"filterManager\", void 0);\n __decorate([\n Autowired('valueCache')\n ], ClientSideRowModel.prototype, \"valueCache\", void 0);\n __decorate([\n Autowired('beans')\n ], ClientSideRowModel.prototype, \"beans\", void 0);\n __decorate([\n Autowired('filterStage')\n ], ClientSideRowModel.prototype, \"filterStage\", void 0);\n __decorate([\n Autowired('sortStage')\n ], ClientSideRowModel.prototype, \"sortStage\", void 0);\n __decorate([\n Autowired('flattenStage')\n ], ClientSideRowModel.prototype, \"flattenStage\", void 0);\n __decorate([\n Optional('groupStage')\n ], ClientSideRowModel.prototype, \"groupStage\", void 0);\n __decorate([\n Optional('aggregationStage')\n ], ClientSideRowModel.prototype, \"aggregationStage\", void 0);\n __decorate([\n Optional('pivotStage')\n ], ClientSideRowModel.prototype, \"pivotStage\", void 0);\n __decorate([\n Optional('filterAggregatesStage')\n ], ClientSideRowModel.prototype, \"filterAggregatesStage\", void 0);\n __decorate([\n PostConstruct\n ], ClientSideRowModel.prototype, \"init\", null);\n ClientSideRowModel = __decorate([\n Bean('rowModel')\n ], ClientSideRowModel);\n return ClientSideRowModel;\n}(BeanStub));\nexport { ClientSideRowModel };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Autowired, Bean, BeanStub } from \"@ag-grid-community/core\";\nvar FilterStage = /** @class */ (function (_super) {\n __extends(FilterStage, _super);\n function FilterStage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FilterStage.prototype.execute = function (params) {\n var changedPath = params.changedPath;\n this.filterService.filter(changedPath);\n };\n __decorate([\n Autowired('filterService')\n ], FilterStage.prototype, \"filterService\", void 0);\n FilterStage = __decorate([\n Bean('filterStage')\n ], FilterStage);\n return FilterStage;\n}(BeanStub));\nexport { FilterStage };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { _, Autowired, Bean, BeanStub } from \"@ag-grid-community/core\";\nvar SortStage = /** @class */ (function (_super) {\n __extends(SortStage, _super);\n function SortStage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SortStage.prototype.execute = function (params) {\n var _this = this;\n var sortOptions = this.sortController.getSortOptions();\n var sortActive = _.exists(sortOptions) && sortOptions.length > 0;\n var deltaSort = sortActive\n && _.exists(params.rowNodeTransactions)\n // in time we can remove this check, so that delta sort is always\n // on if transactions are present. it's off for now so that we can\n // selectively turn it on and test it with some select users before\n // rolling out to everyone.\n && this.gridOptionsWrapper.isDeltaSort();\n var sortContainsGroupColumns = sortOptions.some(function (opt) { return !!_this.columnModel.getGroupDisplayColumnForGroup(opt.column.getId()); });\n this.sortService.sort(sortOptions, sortActive, deltaSort, params.rowNodeTransactions, params.changedPath, sortContainsGroupColumns);\n };\n __decorate([\n Autowired('sortService')\n ], SortStage.prototype, \"sortService\", void 0);\n __decorate([\n Autowired('sortController')\n ], SortStage.prototype, \"sortController\", void 0);\n __decorate([\n Autowired('columnModel')\n ], SortStage.prototype, \"columnModel\", void 0);\n SortStage = __decorate([\n Bean('sortStage')\n ], SortStage);\n return SortStage;\n}(BeanStub));\nexport { SortStage };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { _, Autowired, Bean, BeanStub, RowNode } from \"@ag-grid-community/core\";\nvar FlattenStage = /** @class */ (function (_super) {\n __extends(FlattenStage, _super);\n function FlattenStage() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FlattenStage.prototype.execute = function (params) {\n var rootNode = params.rowNode;\n // even if not doing grouping, we do the mapping, as the client might\n // of passed in data that already has a grouping in it somewhere\n var result = [];\n // putting value into a wrapper so it's passed by reference\n var nextRowTop = { value: 0 };\n var skipLeafNodes = this.columnModel.isPivotMode();\n // if we are reducing, and not grouping, then we want to show the root node, as that\n // is where the pivot values are\n var showRootNode = skipLeafNodes && rootNode.leafGroup;\n var topList = showRootNode ? [rootNode] : rootNode.childrenAfterSort;\n this.recursivelyAddToRowsToDisplay(topList, result, nextRowTop, skipLeafNodes, 0);\n // we do not want the footer total if the gris is empty\n var atLeastOneRowPresent = result.length > 0;\n var includeGroupTotalFooter = !showRootNode\n // don't show total footer when showRootNode is true (i.e. in pivot mode and no groups)\n && atLeastOneRowPresent\n && this.gridOptionsWrapper.isGroupIncludeTotalFooter();\n if (includeGroupTotalFooter) {\n this.ensureFooterNodeExists(rootNode);\n this.addRowNodeToRowsToDisplay(rootNode.sibling, result, nextRowTop, 0);\n }\n return result;\n };\n FlattenStage.prototype.recursivelyAddToRowsToDisplay = function (rowsToFlatten, result, nextRowTop, skipLeafNodes, uiLevel) {\n if (_.missingOrEmpty(rowsToFlatten)) {\n return;\n }\n var hideOpenParents = this.gridOptionsWrapper.isGroupHideOpenParents();\n // these two are mutually exclusive, so if first set, we don't set the second\n var groupRemoveSingleChildren = this.gridOptionsWrapper.isGroupRemoveSingleChildren();\n var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsWrapper.isGroupRemoveLowestSingleChildren();\n for (var i = 0; i < rowsToFlatten.length; i++) {\n var rowNode = rowsToFlatten[i];\n // check all these cases, for working out if this row should be included in the final mapped list\n var isParent = rowNode.hasChildren();\n var isSkippedLeafNode = skipLeafNodes && !isParent;\n var isRemovedSingleChildrenGroup = groupRemoveSingleChildren &&\n isParent &&\n rowNode.childrenAfterGroup.length === 1;\n var isRemovedLowestSingleChildrenGroup = groupRemoveLowestSingleChildren &&\n isParent &&\n rowNode.leafGroup &&\n rowNode.childrenAfterGroup.length === 1;\n // hide open parents means when group is open, we don't show it. we also need to make sure the\n // group is expandable in the first place (as leaf groups are not expandable if pivot mode is on).\n // the UI will never allow expanding leaf groups, however the user might via the API (or menu option 'expand all')\n var neverAllowToExpand = skipLeafNodes && rowNode.leafGroup;\n var isHiddenOpenParent = hideOpenParents && rowNode.expanded && !rowNode.master && (!neverAllowToExpand);\n var thisRowShouldBeRendered = !isSkippedLeafNode && !isHiddenOpenParent &&\n !isRemovedSingleChildrenGroup && !isRemovedLowestSingleChildrenGroup;\n if (thisRowShouldBeRendered) {\n this.addRowNodeToRowsToDisplay(rowNode, result, nextRowTop, uiLevel);\n }\n // if we are pivoting, we never map below the leaf group\n if (skipLeafNodes && rowNode.leafGroup) {\n continue;\n }\n if (isParent) {\n var excludedParent = isRemovedSingleChildrenGroup || isRemovedLowestSingleChildrenGroup;\n // we traverse the group if it is expended, however we always traverse if the parent node\n // was removed (as the group will never be opened if it is not displayed, we show the children instead)\n if (rowNode.expanded || excludedParent) {\n // if the parent was excluded, then ui level is that of the parent\n var uiLevelForChildren = excludedParent ? uiLevel : uiLevel + 1;\n this.recursivelyAddToRowsToDisplay(rowNode.childrenAfterSort, result, nextRowTop, skipLeafNodes, uiLevelForChildren);\n // put a footer in if user is looking for it\n if (this.gridOptionsWrapper.isGroupIncludeFooter()) {\n this.ensureFooterNodeExists(rowNode);\n this.addRowNodeToRowsToDisplay(rowNode.sibling, result, nextRowTop, uiLevel);\n }\n }\n }\n else if (rowNode.master && rowNode.expanded) {\n var detailNode = this.createDetailNode(rowNode);\n this.addRowNodeToRowsToDisplay(detailNode, result, nextRowTop, uiLevel);\n }\n }\n };\n // duplicated method, it's also in floatingRowModel\n FlattenStage.prototype.addRowNodeToRowsToDisplay = function (rowNode, result, nextRowTop, uiLevel) {\n var isGroupMultiAutoColumn = this.gridOptionsWrapper.isGroupMultiAutoColumn();\n result.push(rowNode);\n rowNode.setUiLevel(isGroupMultiAutoColumn ? 0 : uiLevel);\n };\n FlattenStage.prototype.ensureFooterNodeExists = function (groupNode) {\n // only create footer node once, otherwise we have daemons and\n // the animate screws up with the daemons hanging around\n if (_.exists(groupNode.sibling)) {\n return;\n }\n var footerNode = new RowNode(this.beans);\n Object.keys(groupNode).forEach(function (key) {\n footerNode[key] = groupNode[key];\n });\n footerNode.footer = true;\n footerNode.setRowTop(null);\n footerNode.setRowIndex(null);\n // manually set oldRowTop to null so we discard any\n // previous information about its position.\n footerNode.oldRowTop = null;\n if (_.exists(footerNode.id)) {\n footerNode.id = 'rowGroupFooter_' + footerNode.id;\n }\n // get both header and footer to reference each other as siblings. this is never undone,\n // only overwritten. so if a group is expanded, then contracted, it will have a ghost\n // sibling - but that's fine, as we can ignore this if the header is contracted.\n footerNode.sibling = groupNode;\n groupNode.sibling = footerNode;\n };\n FlattenStage.prototype.createDetailNode = function (masterNode) {\n if (_.exists(masterNode.detailNode)) {\n return masterNode.detailNode;\n }\n var detailNode = new RowNode(this.beans);\n detailNode.detail = true;\n detailNode.selectable = false;\n detailNode.parent = masterNode;\n if (_.exists(masterNode.id)) {\n detailNode.id = 'detail_' + masterNode.id;\n }\n detailNode.data = masterNode.data;\n detailNode.level = masterNode.level + 1;\n masterNode.detailNode = detailNode;\n return detailNode;\n };\n __decorate([\n Autowired('columnModel')\n ], FlattenStage.prototype, \"columnModel\", void 0);\n __decorate([\n Autowired('beans')\n ], FlattenStage.prototype, \"beans\", void 0);\n FlattenStage = __decorate([\n Bean('flattenStage')\n ], FlattenStage);\n return FlattenStage;\n}(BeanStub));\nexport { FlattenStage };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { _, Autowired, Bean, PostConstruct, BeanStub } from \"@ag-grid-community/core\";\nvar SortService = /** @class */ (function (_super) {\n __extends(SortService, _super);\n function SortService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n SortService.prototype.init = function () {\n this.postSortFunc = this.gridOptionsWrapper.getPostSortFunc();\n };\n SortService.prototype.sort = function (sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) {\n var _this = this;\n var groupMaintainOrder = this.gridOptionsWrapper.isGroupMaintainOrder();\n var groupColumnsPresent = this.columnModel.getAllGridColumns().some(function (c) { return c.isRowGroupActive(); });\n var allDirtyNodes = {};\n if (useDeltaSort && rowNodeTransactions) {\n allDirtyNodes = this.calculateDirtyNodes(rowNodeTransactions);\n }\n var isPivotMode = this.columnModel.isPivotMode();\n var callback = function (rowNode) {\n // we clear out the 'pull down open parents' first, as the values mix up the sorting\n _this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterAggFilter, true);\n // It's pointless to sort rows which aren't being displayed. in pivot mode we don't need to sort the leaf group children.\n var skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup;\n // Javascript sort is non deterministic when all the array items are equals, ie Comparator always returns 0,\n // so to ensure the array keeps its order, add an additional sorting condition manually, in this case we\n // are going to inspect the original array position. This is what sortedRowNodes is for.\n var skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns;\n if (!sortActive || skipSortingGroups || skipSortingPivotLeafs) {\n // when 'groupMaintainOrder' is enabled we skip sorting groups unless we are sorting on group columns\n var childrenToBeSorted = rowNode.childrenAfterAggFilter.slice(0);\n if (groupMaintainOrder && rowNode.childrenAfterSort) {\n var indexedOrders_1 = rowNode.childrenAfterSort.reduce(function (acc, row, idx) {\n acc[row.id] = idx;\n return acc;\n }, {});\n childrenToBeSorted.sort(function (row1, row2) { return (indexedOrders_1[row1.id] || 0) - (indexedOrders_1[row2.id] || 0); });\n }\n rowNode.childrenAfterSort = childrenToBeSorted;\n }\n else if (useDeltaSort) {\n rowNode.childrenAfterSort = _this.doDeltaSort(rowNode, allDirtyNodes, changedPath, sortOptions);\n }\n else {\n rowNode.childrenAfterSort = _this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions);\n }\n if (rowNode.sibling) {\n rowNode.sibling.childrenAfterSort = rowNode.childrenAfterSort;\n }\n _this.updateChildIndexes(rowNode);\n if (_this.postSortFunc) {\n var params = { nodes: rowNode.childrenAfterSort };\n _this.postSortFunc(params);\n }\n };\n if (changedPath) {\n changedPath.forEachChangedNodeDepthFirst(callback);\n }\n this.updateGroupDataForHideOpenParents(changedPath);\n };\n SortService.prototype.calculateDirtyNodes = function (rowNodeTransactions) {\n var dirtyNodes = {};\n var addNodesFunc = function (rowNodes) {\n if (rowNodes) {\n rowNodes.forEach(function (rowNode) { return dirtyNodes[rowNode.id] = true; });\n }\n };\n // all leaf level nodes in the transaction were impacted\n if (rowNodeTransactions) {\n rowNodeTransactions.forEach(function (tran) {\n addNodesFunc(tran.add);\n addNodesFunc(tran.update);\n addNodesFunc(tran.remove);\n });\n }\n return dirtyNodes;\n };\n SortService.prototype.doDeltaSort = function (rowNode, allTouchedNodes, changedPath, sortOptions) {\n var _this = this;\n var unsortedRows = rowNode.childrenAfterAggFilter;\n var oldSortedRows = rowNode.childrenAfterSort;\n if (!oldSortedRows) {\n return this.rowNodeSorter.doFullSort(unsortedRows, sortOptions);\n }\n var untouchedRowsMap = {};\n var touchedRows = [];\n unsortedRows.forEach(function (row) {\n if (allTouchedNodes[row.id] || !changedPath.canSkip(row)) {\n touchedRows.push(row);\n }\n else {\n untouchedRowsMap[row.id] = true;\n }\n });\n var sortedUntouchedRows = oldSortedRows.filter(function (child) { return untouchedRowsMap[child.id]; });\n var mapNodeToSortedNode = function (rowNode, pos) { return ({ currentPos: pos, rowNode: rowNode }); };\n var sortedChangedRows = touchedRows\n .map(mapNodeToSortedNode)\n .sort(function (a, b) { return _this.rowNodeSorter.compareRowNodes(sortOptions, a, b); });\n return this.mergeSortedArrays(sortOptions, sortedChangedRows, sortedUntouchedRows.map(mapNodeToSortedNode)).map(function (_a) {\n var rowNode = _a.rowNode;\n return rowNode;\n });\n };\n // Merge two sorted arrays into each other\n SortService.prototype.mergeSortedArrays = function (sortOptions, arr1, arr2) {\n var res = [];\n var i = 0;\n var j = 0;\n // Traverse both array, adding them in order\n while (i < arr1.length && j < arr2.length) {\n // Check if current element of first\n // array is smaller than current element\n // of second array. If yes, store first\n // array element and increment first array\n // index. Otherwise do same with second array\n var compareResult = this.rowNodeSorter.compareRowNodes(sortOptions, arr1[i], arr2[j]);\n if (compareResult < 0) {\n res.push(arr1[i++]);\n }\n else {\n res.push(arr2[j++]);\n }\n }\n // add remaining from arr1\n while (i < arr1.length) {\n res.push(arr1[i++]);\n }\n // add remaining from arr2\n while (j < arr2.length) {\n res.push(arr2[j++]);\n }\n return res;\n };\n SortService.prototype.updateChildIndexes = function (rowNode) {\n if (_.missing(rowNode.childrenAfterSort)) {\n return;\n }\n var listToSort = rowNode.childrenAfterSort;\n for (var i = 0; i < listToSort.length; i++) {\n var child = listToSort[i];\n var firstChild = i === 0;\n var lastChild = i === rowNode.childrenAfterSort.length - 1;\n child.setFirstChild(firstChild);\n child.setLastChild(lastChild);\n child.setChildIndex(i);\n }\n };\n SortService.prototype.updateGroupDataForHideOpenParents = function (changedPath) {\n var _this = this;\n if (!this.gridOptionsWrapper.isGroupHideOpenParents()) {\n return;\n }\n if (this.gridOptionsWrapper.isTreeData()) {\n var msg_1 = \"AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level).\";\n _.doOnce(function () { return console.warn(msg_1); }, 'sortService.hideOpenParentsWithTreeData');\n return false;\n }\n // recurse breadth first over group nodes after sort to 'pull down' group data to child groups\n var callback = function (rowNode) {\n _this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterSort, false);\n rowNode.childrenAfterSort.forEach(function (child) {\n if (child.hasChildren()) {\n callback(child);\n }\n });\n };\n if (changedPath) {\n changedPath.executeFromRootNode(function (rowNode) { return callback(rowNode); });\n }\n };\n SortService.prototype.pullDownGroupDataForHideOpenParents = function (rowNodes, clearOperation) {\n var _this = this;\n if (!this.gridOptionsWrapper.isGroupHideOpenParents() || _.missing(rowNodes)) {\n return;\n }\n rowNodes.forEach(function (childRowNode) {\n var groupDisplayCols = _this.columnModel.getGroupDisplayColumns();\n groupDisplayCols.forEach(function (groupDisplayCol) {\n var showRowGroup = groupDisplayCol.getColDef().showRowGroup;\n if (typeof showRowGroup !== 'string') {\n console.error('AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup');\n return;\n }\n var displayingGroupKey = showRowGroup;\n var rowGroupColumn = _this.columnModel.getPrimaryColumn(displayingGroupKey);\n var thisRowNodeMatches = rowGroupColumn === childRowNode.rowGroupColumn;\n if (thisRowNodeMatches) {\n return;\n }\n if (clearOperation) {\n // if doing a clear operation, we clear down the value for every possible group column\n childRowNode.setGroupValue(groupDisplayCol.getId(), undefined);\n }\n else {\n // if doing a set operation, we set only where the pull down is to occur\n var parentToStealFrom = childRowNode.getFirstChildOfFirstChild(rowGroupColumn);\n if (parentToStealFrom) {\n childRowNode.setGroupValue(groupDisplayCol.getId(), parentToStealFrom.key);\n }\n }\n });\n });\n };\n __decorate([\n Autowired('columnModel')\n ], SortService.prototype, \"columnModel\", void 0);\n __decorate([\n Autowired('rowNodeSorter')\n ], SortService.prototype, \"rowNodeSorter\", void 0);\n __decorate([\n PostConstruct\n ], SortService.prototype, \"init\", null);\n SortService = __decorate([\n Bean('sortService')\n ], SortService);\n return SortService;\n}(BeanStub));\nexport { SortService };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Autowired, Bean, BeanStub } from \"@ag-grid-community/core\";\nvar FilterService = /** @class */ (function (_super) {\n __extends(FilterService, _super);\n function FilterService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FilterService.prototype.filter = function (changedPath) {\n var filterActive = this.filterManager.isColumnFilterPresent()\n || this.filterManager.isQuickFilterPresent()\n || this.filterManager.isExternalFilterPresent();\n this.filterNodes(filterActive, changedPath);\n };\n FilterService.prototype.filterNodes = function (filterActive, changedPath) {\n var _this = this;\n var filterCallback = function (rowNode, includeChildNodes) {\n // recursively get all children that are groups to also filter\n if (rowNode.hasChildren()) {\n // result of filter for this node. when filtering tree data, includeChildNodes = true when parent passes\n if (filterActive && !includeChildNodes) {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup.filter(function (childNode) {\n // a group is included in the result if it has any children of it's own.\n // by this stage, the child groups are already filtered\n var passBecauseChildren = childNode.childrenAfterFilter && childNode.childrenAfterFilter.length > 0;\n // both leaf level nodes and tree data nodes have data. these get added if\n // the data passes the filter\n var passBecauseDataPasses = childNode.data\n && _this.filterManager.doesRowPassFilter({ rowNode: childNode });\n // note - tree data nodes pass either if a) they pass themselves or b) any children of that node pass\n return passBecauseChildren || passBecauseDataPasses;\n });\n }\n else {\n // if not filtering, the result is the original list\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;\n }\n }\n else {\n rowNode.childrenAfterFilter = rowNode.childrenAfterGroup;\n }\n if (rowNode.sibling) {\n rowNode.sibling.childrenAfterFilter = rowNode.childrenAfterFilter;\n }\n };\n if (this.doingTreeDataFiltering()) {\n var treeDataDepthFirstFilter_1 = function (rowNode, alreadyFoundInParent) {\n // tree data filter traverses the hierarchy depth first and includes child nodes if parent passes\n // filter, and parent nodes will be include if any children exist.\n if (rowNode.childrenAfterGroup) {\n for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) {\n var childNode = rowNode.childrenAfterGroup[i];\n // first check if current node passes filter before invoking child nodes\n var foundInParent = alreadyFoundInParent\n || _this.filterManager.doesRowPassFilter({ rowNode: childNode });\n if (childNode.childrenAfterGroup) {\n treeDataDepthFirstFilter_1(rowNode.childrenAfterGroup[i], foundInParent);\n }\n else {\n filterCallback(childNode, foundInParent);\n }\n }\n }\n filterCallback(rowNode, alreadyFoundInParent);\n };\n var treeDataFilterCallback = function (rowNode) { return treeDataDepthFirstFilter_1(rowNode, false); };\n changedPath.executeFromRootNode(treeDataFilterCallback);\n }\n else {\n var defaultFilterCallback = function (rowNode) { return filterCallback(rowNode, false); };\n changedPath.forEachChangedNodeDepthFirst(defaultFilterCallback, true);\n }\n };\n FilterService.prototype.doingTreeDataFiltering = function () {\n return this.gridOptionsWrapper.isTreeData() && !this.gridOptionsWrapper.isExcludeChildrenWhenTreeDataFiltering();\n };\n __decorate([\n Autowired('filterManager')\n ], FilterService.prototype, \"filterManager\", void 0);\n FilterService = __decorate([\n Bean(\"filterService\")\n ], FilterService);\n return FilterService;\n}(BeanStub));\nexport { FilterService };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { Autowired, Bean, BeanStub, Constants, PostConstruct, _ } from \"@ag-grid-community/core\";\nvar ImmutableService = /** @class */ (function (_super) {\n __extends(ImmutableService, _super);\n function ImmutableService() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ImmutableService.prototype.postConstruct = function () {\n if (this.rowModel.getType() === Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {\n this.clientSideRowModel = this.rowModel;\n }\n };\n ImmutableService.prototype.isActive = function () {\n return this.gridOptionsWrapper.isImmutableData();\n };\n ImmutableService.prototype.setRowData = function (rowData) {\n var transactionAndMap = this.createTransactionForRowData(rowData);\n if (!transactionAndMap) {\n return;\n }\n var _a = __read(transactionAndMap, 2), transaction = _a[0], orderIdMap = _a[1];\n var nodeTransaction = this.clientSideRowModel.updateRowData(transaction, orderIdMap);\n // need to force updating of full width rows - note this wouldn't be necessary the full width cell comp listened\n // to the data change event on the row node and refreshed itself.\n if (nodeTransaction) {\n this.rowRenderer.refreshFullWidthRows(nodeTransaction.update);\n }\n };\n // converts the setRowData() command to a transaction\n ImmutableService.prototype.createTransactionForRowData = function (rowData) {\n if (_.missing(this.clientSideRowModel)) {\n console.error('AG Grid: ImmutableService only works with ClientSideRowModel');\n return;\n }\n var getRowIdFunc = this.gridOptionsWrapper.getRowIdFunc();\n if (getRowIdFunc == null) {\n console.error('AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!');\n return;\n }\n // convert the data into a transaction object by working out adds, removes and updates\n var transaction = {\n remove: [],\n update: [],\n add: []\n };\n var existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap();\n var suppressSortOrder = this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder();\n var orderMap = suppressSortOrder ? undefined : {};\n if (_.exists(rowData)) {\n // split all the new data in the following:\n // if new, push to 'add'\n // if update, push to 'update'\n // if not changed, do not include in the transaction\n rowData.forEach(function (data, index) {\n var id = getRowIdFunc({ data: data, level: 0 });\n var existingNode = existingNodesMap[id];\n if (orderMap) {\n orderMap[id] = index;\n }\n if (existingNode) {\n var dataHasChanged = existingNode.data !== data;\n if (dataHasChanged) {\n transaction.update.push(data);\n }\n // otherwise, if data not changed, we just don't include it anywhere, as it's not a delta\n // remove from list, so we know the item is not to be removed\n existingNodesMap[id] = undefined;\n }\n else {\n transaction.add.push(data);\n }\n });\n }\n // at this point, all rows that are left, should be removed\n _.iterateObject(existingNodesMap, function (id, rowNode) {\n if (rowNode) {\n transaction.remove.push(rowNode.data);\n }\n });\n return [transaction, orderMap];\n };\n __decorate([\n Autowired('rowModel')\n ], ImmutableService.prototype, \"rowModel\", void 0);\n __decorate([\n Autowired('rowRenderer')\n ], ImmutableService.prototype, \"rowRenderer\", void 0);\n __decorate([\n Autowired('columnApi')\n ], ImmutableService.prototype, \"columnApi\", void 0);\n __decorate([\n Autowired('gridApi')\n ], ImmutableService.prototype, \"gridApi\", void 0);\n __decorate([\n Autowired('filterManager')\n ], ImmutableService.prototype, \"filterManager\", void 0);\n __decorate([\n PostConstruct\n ], ImmutableService.prototype, \"postConstruct\", null);\n ImmutableService = __decorate([\n Bean('immutableService')\n ], ImmutableService);\n return ImmutableService;\n}(BeanStub));\nexport { ImmutableService };\n","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n};\nimport { Events, RowNode, _ } from \"@ag-grid-community/core\";\nvar ClientSideNodeManager = /** @class */ (function () {\n function ClientSideNodeManager(rootNode, gridOptionsWrapper, eventService, columnModel, selectionService, beans) {\n this.nextId = 0;\n // when user is provide the id's, we also keep a map of ids to row nodes for convenience\n this.allNodesMap = {};\n this.rootNode = rootNode;\n this.gridOptionsWrapper = gridOptionsWrapper;\n this.eventService = eventService;\n this.columnModel = columnModel;\n this.beans = beans;\n this.selectionService = selectionService;\n this.rootNode.group = true;\n this.rootNode.level = -1;\n this.rootNode.id = ClientSideNodeManager.ROOT_NODE_ID;\n this.rootNode.allLeafChildren = [];\n this.rootNode.childrenAfterGroup = [];\n this.rootNode.childrenAfterSort = [];\n this.rootNode.childrenAfterAggFilter = [];\n this.rootNode.childrenAfterFilter = [];\n // if we make this class a bean, then can annotate postConstruct\n this.postConstruct();\n }\n // @PostConstruct - this is not a bean, so postConstruct called by constructor\n ClientSideNodeManager.prototype.postConstruct = function () {\n // func below doesn't have 'this' pointer, so need to pull out these bits\n this.suppressParentsInRowNodes = this.gridOptionsWrapper.isSuppressParentsInRowNodes();\n this.isRowMasterFunc = this.gridOptionsWrapper.getIsRowMasterFunc();\n this.doingTreeData = this.gridOptionsWrapper.isTreeData();\n this.doingMasterDetail = this.gridOptionsWrapper.isMasterDetail();\n };\n ClientSideNodeManager.prototype.getCopyOfNodesMap = function () {\n return _.cloneObject(this.allNodesMap);\n };\n ClientSideNodeManager.prototype.getRowNode = function (id) {\n return this.allNodesMap[id];\n };\n ClientSideNodeManager.prototype.setRowData = function (rowData) {\n var _this = this;\n if (typeof rowData === 'string') {\n console.warn('AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first');\n return;\n }\n var rootNode = this.rootNode;\n var sibling = this.rootNode.sibling;\n rootNode.childrenAfterFilter = null;\n rootNode.childrenAfterGroup = null;\n rootNode.childrenAfterAggFilter = null;\n rootNode.childrenAfterSort = null;\n rootNode.childrenMapped = null;\n rootNode.updateHasChildren();\n this.nextId = 0;\n this.allNodesMap = {};\n if (rowData) {\n // we use rootNode as the parent, however if using ag-grid-enterprise, the grouping stage\n // sets the parent node on each row (even if we are not grouping). so setting parent node\n // here is for benefit of ag-grid-community users\n rootNode.allLeafChildren = rowData.map(function (dataItem) { return _this.createNode(dataItem, _this.rootNode, ClientSideNodeManager.TOP_LEVEL); });\n }\n else {\n rootNode.allLeafChildren = [];\n rootNode.childrenAfterGroup = [];\n }\n if (sibling) {\n sibling.childrenAfterFilter = rootNode.childrenAfterFilter;\n sibling.childrenAfterGroup = rootNode.childrenAfterGroup;\n sibling.childrenAfterAggFilter = rootNode.childrenAfterAggFilter;\n sibling.childrenAfterSort = rootNode.childrenAfterSort;\n sibling.childrenMapped = rootNode.childrenMapped;\n sibling.allLeafChildren = rootNode.allLeafChildren;\n }\n };\n ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) {\n var rowNodeTransaction = {\n remove: [],\n update: [],\n add: []\n };\n var nodesToUnselect = [];\n this.executeRemove(rowDataTran, rowNodeTransaction, nodesToUnselect);\n this.executeUpdate(rowDataTran, rowNodeTransaction, nodesToUnselect);\n this.executeAdd(rowDataTran, rowNodeTransaction);\n this.updateSelection(nodesToUnselect);\n if (rowNodeOrder) {\n _.sortRowNodesByOrder(this.rootNode.allLeafChildren, rowNodeOrder);\n }\n return rowNodeTransaction;\n };\n ClientSideNodeManager.prototype.updateSelection = function (nodesToUnselect) {\n var selectionChanged = nodesToUnselect.length > 0;\n if (selectionChanged) {\n nodesToUnselect.forEach(function (rowNode) {\n rowNode.setSelected(false, false, true);\n });\n }\n // we do this regardless of nodes to unselect or not, as it's possible\n // a new node was inserted, so a parent that was previously selected (as all\n // children were selected) should not be tri-state (as new one unselected against\n // all other selected children).\n this.selectionService.updateGroupsFromChildrenSelections();\n if (selectionChanged) {\n var event_1 = {\n type: Events.EVENT_SELECTION_CHANGED\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n ClientSideNodeManager.prototype.executeAdd = function (rowDataTran, rowNodeTransaction) {\n var _this = this;\n var add = rowDataTran.add, addIndex = rowDataTran.addIndex;\n if (_.missingOrEmpty(add)) {\n return;\n }\n // create new row nodes for each data item\n var newNodes = add.map(function (item) { return _this.createNode(item, _this.rootNode, ClientSideNodeManager.TOP_LEVEL); });\n // add new row nodes to the root nodes 'allLeafChildren'\n var useIndex = typeof addIndex === 'number' && addIndex >= 0;\n var nodesBeforeIndex;\n var nodesAfterIndex;\n if (useIndex) {\n // new rows are inserted in one go by concatenating them in between the existing rows at the desired index.\n // this is much faster than splicing them individually into 'allLeafChildren' when there are large inserts.\n // allLeafChildren can be out of order, so we loop over all the Nodes to find the correct index that\n // represents the position `addIndex` intended to be.\n var allLeafChildren_1 = this.rootNode.allLeafChildren;\n // if addIndex is 0, it should always be added at the start of the array\n // there is no need to verify the order of node by nodeIndex.\n var normalizedAddIndex = addIndex === 0 ? 0 : (allLeafChildren_1.reduce(function (prevIdx, currNode, currIdx) {\n var _a;\n var rowIndex = currNode.rowIndex;\n var prevValueAtIndex = (_a = allLeafChildren_1[prevIdx]) === null || _a === void 0 ? void 0 : _a.rowIndex;\n var shouldUpdateIndex = rowIndex != null && prevValueAtIndex != null && rowIndex < addIndex && rowIndex > prevValueAtIndex;\n return shouldUpdateIndex ? currIdx : prevIdx;\n }, 0) + 1);\n nodesBeforeIndex = allLeafChildren_1.slice(0, normalizedAddIndex);\n nodesAfterIndex = allLeafChildren_1.slice(normalizedAddIndex, allLeafChildren_1.length);\n }\n else {\n nodesBeforeIndex = this.rootNode.allLeafChildren;\n nodesAfterIndex = [];\n }\n this.rootNode.allLeafChildren = __spread(nodesBeforeIndex, newNodes, nodesAfterIndex);\n if (this.rootNode.sibling) {\n this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren;\n }\n // add new row nodes to the transaction add items\n rowNodeTransaction.add = newNodes;\n };\n ClientSideNodeManager.prototype.executeRemove = function (rowDataTran, rowNodeTransaction, nodesToUnselect) {\n var _this = this;\n var remove = rowDataTran.remove;\n if (_.missingOrEmpty(remove)) {\n return;\n }\n var rowIdsRemoved = {};\n remove.forEach(function (item) {\n var rowNode = _this.lookupRowNode(item);\n if (!rowNode) {\n return;\n }\n // do delete - setting 'suppressFinishActions = true' to ensure EVENT_SELECTION_CHANGED is not raised for\n // each row node updated, instead it is raised once by the calling code if any selected nodes exist.\n if (rowNode.isSelected()) {\n nodesToUnselect.push(rowNode);\n }\n // so row renderer knows to fade row out (and not reposition it)\n rowNode.clearRowTopAndRowIndex();\n // NOTE: were we could remove from allLeaveChildren, however _.removeFromArray() is expensive, especially\n // if called multiple times (eg deleting lots of rows) and if allLeafChildren is a large list\n rowIdsRemoved[rowNode.id] = true;\n // _.removeFromArray(this.rootNode.allLeafChildren, rowNode);\n delete _this.allNodesMap[rowNode.id];\n rowNodeTransaction.remove.push(rowNode);\n });\n this.rootNode.allLeafChildren = this.rootNode.allLeafChildren.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; });\n if (this.rootNode.sibling) {\n this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren;\n }\n };\n ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) {\n var _this = this;\n var update = rowDataTran.update;\n if (_.missingOrEmpty(update)) {\n return;\n }\n update.forEach(function (item) {\n var rowNode = _this.lookupRowNode(item);\n if (!rowNode) {\n return;\n }\n rowNode.updateData(item);\n if (!rowNode.selectable && rowNode.isSelected()) {\n nodesToUnselect.push(rowNode);\n }\n _this.setMasterForRow(rowNode, item, ClientSideNodeManager.TOP_LEVEL, false);\n rowNodeTransaction.update.push(rowNode);\n });\n };\n ClientSideNodeManager.prototype.lookupRowNode = function (data) {\n var getRowIdFunc = this.gridOptionsWrapper.getRowIdFunc();\n var rowNode;\n if (getRowIdFunc) {\n // find rowNode using id\n var id = getRowIdFunc({ data: data, level: 0 });\n rowNode = this.allNodesMap[id];\n if (!rowNode) {\n console.error(\"AG Grid: could not find row id=\" + id + \", data item was not found for this id\");\n return null;\n }\n }\n else {\n // find rowNode using object references\n rowNode = this.rootNode.allLeafChildren.find(function (node) { return node.data === data; });\n if (!rowNode) {\n console.error(\"AG Grid: could not find data item as object was not found\", data);\n console.error(\"Consider using getRowId to help the Grid find matching row data\");\n return null;\n }\n }\n return rowNode || null;\n };\n ClientSideNodeManager.prototype.createNode = function (dataItem, parent, level) {\n var node = new RowNode(this.beans);\n node.group = false;\n this.setMasterForRow(node, dataItem, level, true);\n if (parent && !this.suppressParentsInRowNodes) {\n node.parent = parent;\n }\n node.level = level;\n node.setDataAndId(dataItem, this.nextId.toString());\n if (this.allNodesMap[node.id]) {\n console.warn(\"AG Grid: duplicate node id '\" + node.id + \"' detected from getRowId callback, this could cause issues in your grid.\");\n }\n this.allNodesMap[node.id] = node;\n this.nextId++;\n return node;\n };\n ClientSideNodeManager.prototype.setMasterForRow = function (rowNode, data, level, setExpanded) {\n if (this.doingTreeData) {\n rowNode.setMaster(false);\n if (setExpanded) {\n rowNode.expanded = false;\n }\n }\n else {\n // this is the default, for when doing grid data\n if (this.doingMasterDetail) {\n // if we are doing master detail, then the\n // default is that everything can be a Master Row.\n if (this.isRowMasterFunc) {\n rowNode.setMaster(this.isRowMasterFunc(data));\n }\n else {\n rowNode.setMaster(true);\n }\n }\n else {\n rowNode.setMaster(false);\n }\n if (setExpanded) {\n var rowGroupColumns = this.columnModel.getRowGroupColumns();\n var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0;\n // need to take row group into account when determining level\n var masterRowLevel = level + numRowGroupColumns;\n rowNode.expanded = rowNode.master ? this.isExpanded(masterRowLevel) : false;\n }\n }\n };\n ClientSideNodeManager.prototype.isExpanded = function (level) {\n var expandByDefault = this.gridOptionsWrapper.getGroupDefaultExpanded();\n if (expandByDefault === -1) {\n return true;\n }\n return level < expandByDefault;\n };\n ClientSideNodeManager.TOP_LEVEL = 0;\n ClientSideNodeManager.ROOT_NODE_ID = 'ROOT_NODE_ID';\n return ClientSideNodeManager;\n}());\nexport { ClientSideNodeManager };\n","import { ModuleNames } from \"@ag-grid-community/core\";\nimport { ClientSideRowModel } from \"./clientSideRowModel/clientSideRowModel\";\nimport { FilterStage } from \"./clientSideRowModel/filterStage\";\nimport { SortStage } from \"./clientSideRowModel/sortStage\";\nimport { FlattenStage } from \"./clientSideRowModel/flattenStage\";\nimport { SortService } from \"./clientSideRowModel/sortService\";\nimport { FilterService } from \"./clientSideRowModel/filterService\";\nimport { ImmutableService } from \"./clientSideRowModel/immutableService\";\nexport var ClientSideRowModelModule = {\n moduleName: ModuleNames.ClientSideRowModelModule,\n beans: [FilterStage, SortStage, FlattenStage, SortService, FilterService, ImmutableService],\n rowModels: { clientSide: ClientSideRowModel }\n};\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nexport var ModuleNames;\n(function (ModuleNames) {\n // when using modules, user references this\n ModuleNames[\"CommunityCoreModule\"] = \"@ag-grid-community/core\";\n // when not using modules, user references this\n ModuleNames[\"CommunityAllModules\"] = \"@ag-grid-community/all\";\n // community modules\n ModuleNames[\"InfiniteRowModelModule\"] = \"@ag-grid-community/infinite-row-model\";\n ModuleNames[\"ClientSideRowModelModule\"] = \"@ag-grid-community/client-side-row-model\";\n ModuleNames[\"CsvExportModule\"] = \"@ag-grid-community/csv-export\";\n // enterprise core - users never import on this, but other enterprise modules do\n ModuleNames[\"EnterpriseCoreModule\"] = \"@ag-grid-enterprise/core\";\n // when not using modules, user references this\n ModuleNames[\"EnterpriseAllModules\"] = \"@ag-grid-enterprise/all\";\n // enterprise modules\n ModuleNames[\"RowGroupingModule\"] = \"@ag-grid-enterprise/row-grouping\";\n ModuleNames[\"ColumnToolPanelModule\"] = \"@ag-grid-enterprise/column-tool-panel\";\n ModuleNames[\"FiltersToolPanelModule\"] = \"@ag-grid-enterprise/filter-tool-panel\";\n ModuleNames[\"MenuModule\"] = \"@ag-grid-enterprise/menu\";\n ModuleNames[\"SetFilterModule\"] = \"@ag-grid-enterprise/set-filter\";\n ModuleNames[\"MultiFilterModule\"] = \"@ag-grid-enterprise/multi-filter\";\n ModuleNames[\"StatusBarModule\"] = \"@ag-grid-enterprise/status-bar\";\n ModuleNames[\"SideBarModule\"] = \"@ag-grid-enterprise/side-bar\";\n ModuleNames[\"RangeSelectionModule\"] = \"@ag-grid-enterprise/range-selection\";\n ModuleNames[\"MasterDetailModule\"] = \"@ag-grid-enterprise/master-detail\";\n ModuleNames[\"RichSelectModule\"] = \"@ag-grid-enterprise/rich-select\";\n ModuleNames[\"GridChartsModule\"] = \"@ag-grid-enterprise/charts\";\n ModuleNames[\"ViewportRowModelModule\"] = \"@ag-grid-enterprise/viewport-row-model\";\n ModuleNames[\"ServerSideRowModelModule\"] = \"@ag-grid-enterprise/server-side-row-model\";\n ModuleNames[\"ExcelExportModule\"] = \"@ag-grid-enterprise/excel-export\";\n ModuleNames[\"ClipboardModule\"] = \"@ag-grid-enterprise/clipboard\";\n ModuleNames[\"SparklinesModule\"] = \"@ag-grid-enterprise/sparklines\";\n // framework wrappers currently don't provide beans, comps etc, so no need to be modules,\n // however i argue they should be as in theory they 'could' provide beans etc\n ModuleNames[\"AngularModule\"] = \"@ag-grid-community/angular\";\n ModuleNames[\"ReactModule\"] = \"@ag-grid-community/react\";\n ModuleNames[\"VueModule\"] = \"@ag-grid-community/vue\";\n ModuleNames[\"PolymerModule\"] = \"@ag-grid-community/polymer\";\n // and then this, which is definitely not a grid module, as it should not have any dependency\n // on the grid (ie shouldn't even reference the Module interface)\n // ChartsModule = \"@ag-grid-community/charts-core\",\n})(ModuleNames || (ModuleNames = {}));\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nimport { includes } from './array';\nvar AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation';\nvar PASSIVE_EVENTS = ['touchstart', 'touchend', 'touchmove', 'touchcancel'];\nvar supports = {};\n/**\n * a user once raised an issue - they said that when you opened a popup (eg context menu)\n * and then clicked on a selection checkbox, the popup wasn't closed. this is because the\n * popup listens for clicks on the body, however ag-grid WAS stopping propagation on the\n * checkbox clicks (so the rows didn't pick them up as row selection selection clicks).\n * to get around this, we have a pattern to stop propagation for the purposes of AG Grid,\n * but we still let the event pass back to the body.\n * @param {Event} event\n */\nexport function stopPropagationForAgGrid(event) {\n event[AG_GRID_STOP_PROPAGATION] = true;\n}\nexport function isStopPropagationForAgGrid(event) {\n return event[AG_GRID_STOP_PROPAGATION] === true;\n}\nexport var isEventSupported = (function () {\n var tags = {\n select: 'input',\n change: 'input',\n submit: 'form',\n reset: 'form',\n error: 'img',\n load: 'img',\n abort: 'img'\n };\n var eventChecker = function (eventName) {\n if (typeof supports[eventName] === 'boolean') {\n return supports[eventName];\n }\n var el = document.createElement(tags[eventName] || 'div');\n eventName = 'on' + eventName;\n return supports[eventName] = (eventName in el);\n };\n return eventChecker;\n})();\nexport function getCtrlForEvent(gridOptionsWrapper, event, type) {\n var sourceElement = event.target;\n while (sourceElement) {\n var renderedComp = gridOptionsWrapper.getDomData(sourceElement, type);\n if (renderedComp) {\n return renderedComp;\n }\n sourceElement = sourceElement.parentElement;\n }\n return null;\n}\n/**\n * @deprecated\n * Adds all type of change listeners to an element, intended to be a text field\n * @param {HTMLElement} element\n * @param {EventListener} listener\n */\nexport function addChangeListener(element, listener) {\n element.addEventListener('changed', listener);\n element.addEventListener('paste', listener);\n element.addEventListener('input', listener);\n}\nexport function isElementInEventPath(element, event) {\n if (!event || !element) {\n return false;\n }\n return getEventPath(event).indexOf(element) >= 0;\n}\nexport function createEventPath(event) {\n var res = [];\n var pointer = event.target;\n while (pointer) {\n res.push(pointer);\n pointer = pointer.parentElement;\n }\n return res;\n}\n/**\n * firefox doesn't have event.path set, or any alternative to it, so we hack\n * it in. this is needed as it's to late to work out the path when the item is\n * removed from the dom. used by MouseEventService, where it works out if a click\n * was from the current grid, or a detail grid (master / detail).\n * @param {Event} event\n */\nexport function addAgGridEventPath(event) {\n event.__agGridEventPath = getEventPath(event);\n}\n/**\n * Gets the path for an Event.\n * https://stackoverflow.com/questions/39245488/event-path-undefined-with-firefox-and-vue-js\n * https://developer.mozilla.org/en-US/docs/Web/API/Event\n * @param {Event} event\n * @returns {EventTarget[]}\n */\nexport function getEventPath(event) {\n var eventNoType = event;\n if (eventNoType.path) {\n // Chrome supports path\n return eventNoType.path;\n }\n if (eventNoType.composedPath) {\n // Firefox supports composePath\n return eventNoType.composedPath();\n }\n if (eventNoType.__agGridEventPath) {\n // Firefox supports composePath\n return eventNoType.__agGridEventPath;\n }\n // and finally, if none of the above worked,\n // we create the path ourselves\n return createEventPath(event);\n}\nexport function addSafePassiveEventListener(frameworkOverrides, eElement, event, listener) {\n var isPassive = includes(PASSIVE_EVENTS, event);\n var options = isPassive ? { passive: true } : undefined;\n // this check is here for certain scenarios where I believe the user must be destroying\n // the grid somehow but continuing for it to be used\n if (frameworkOverrides && frameworkOverrides.addEventListener) {\n frameworkOverrides.addEventListener(eElement, event, listener, options);\n }\n}\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nimport { ColumnKeyCreator } from \"./columnKeyCreator\";\nimport { ProvidedColumnGroup } from \"../entities/providedColumnGroup\";\nimport { Column } from \"../entities/column\";\nimport { Autowired, Bean, Qualifier } from \"../context/context\";\nimport { DefaultColumnTypes } from \"../entities/defaultColumnTypes\";\nimport { BeanStub } from \"../context/beanStub\";\nimport { Constants } from \"../constants/constants\";\nimport { iterateObject, mergeDeep } from '../utils/object';\nimport { attrToNumber, attrToBoolean } from '../utils/generic';\nimport { removeFromArray } from '../utils/array';\n// takes ColDefs and ColGroupDefs and turns them into Columns and OriginalGroups\nvar ColumnFactory = /** @class */ (function (_super) {\n __extends(ColumnFactory, _super);\n function ColumnFactory() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnFactory.prototype.setBeans = function (loggerFactory) {\n this.logger = loggerFactory.create('ColumnFactory');\n };\n ColumnFactory.prototype.createColumnTree = function (defs, primaryColumns, existingTree) {\n // column key creator dishes out unique column id's in a deterministic way,\n // so if we have two grids (that could be master/slave) with same column definitions,\n // then this ensures the two grids use identical id's.\n var columnKeyCreator = new ColumnKeyCreator();\n var _a = this.extractExistingTreeData(existingTree), existingCols = _a.existingCols, existingGroups = _a.existingGroups, existingColKeys = _a.existingColKeys;\n columnKeyCreator.addExistingKeys(existingColKeys);\n // create am unbalanced tree that maps the provided definitions\n var unbalancedTree = this.recursivelyCreateColumns(defs, 0, primaryColumns, existingCols, columnKeyCreator, existingGroups);\n var treeDept = this.findMaxDept(unbalancedTree, 0);\n this.logger.log('Number of levels for grouped columns is ' + treeDept);\n var columnTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator);\n var deptFirstCallback = function (child, parent) {\n if (child instanceof ProvidedColumnGroup) {\n child.setupExpandable();\n }\n // we set the original parents at the end, rather than when we go along, as balancing the tree\n // adds extra levels into the tree. so we can only set parents when balancing is done.\n child.setOriginalParent(parent);\n };\n this.columnUtils.depthFirstOriginalTreeSearch(null, columnTree, deptFirstCallback);\n return {\n columnTree: columnTree,\n treeDept: treeDept\n };\n };\n ColumnFactory.prototype.extractExistingTreeData = function (existingTree) {\n var existingCols = [];\n var existingGroups = [];\n var existingColKeys = [];\n if (existingTree) {\n this.columnUtils.depthFirstOriginalTreeSearch(null, existingTree, function (item) {\n if (item instanceof ProvidedColumnGroup) {\n var group = item;\n existingGroups.push(group);\n }\n else {\n var col = item;\n existingColKeys.push(col.getId());\n existingCols.push(col);\n }\n });\n }\n return { existingCols: existingCols, existingGroups: existingGroups, existingColKeys: existingColKeys };\n };\n ColumnFactory.prototype.createForAutoGroups = function (autoGroupCols, gridBalancedTree) {\n var _this = this;\n return autoGroupCols.map(function (col) { return _this.createAutoGroupTreeItem(gridBalancedTree, col); });\n };\n ColumnFactory.prototype.createAutoGroupTreeItem = function (balancedColumnTree, column) {\n var dept = this.findDepth(balancedColumnTree);\n // at the end, this will be the top of the tree item.\n var nextChild = column;\n for (var i = dept - 1; i >= 0; i--) {\n var autoGroup = new ProvidedColumnGroup(null, \"FAKE_PATH_\" + column.getId() + \"}_\" + i, true, i);\n this.context.createBean(autoGroup);\n autoGroup.setChildren([nextChild]);\n nextChild.setOriginalParent(autoGroup);\n nextChild = autoGroup;\n }\n // at this point, the nextChild is the top most item in the tree\n return nextChild;\n };\n ColumnFactory.prototype.findDepth = function (balancedColumnTree) {\n var dept = 0;\n var pointer = balancedColumnTree;\n while (pointer && pointer[0] && pointer[0] instanceof ProvidedColumnGroup) {\n dept++;\n pointer = pointer[0].getChildren();\n }\n return dept;\n };\n ColumnFactory.prototype.balanceColumnTree = function (unbalancedTree, currentDept, columnDept, columnKeyCreator) {\n var result = [];\n // go through each child, for groups, recurse a level deeper,\n // for columns we need to pad\n for (var i = 0; i < unbalancedTree.length; i++) {\n var child = unbalancedTree[i];\n if (child instanceof ProvidedColumnGroup) {\n // child is a group, all we do is go to the next level of recursion\n var originalGroup = child;\n var newChildren = this.balanceColumnTree(originalGroup.getChildren(), currentDept + 1, columnDept, columnKeyCreator);\n originalGroup.setChildren(newChildren);\n result.push(originalGroup);\n }\n else {\n // child is a column - so here we add in the padded column groups if needed\n var firstPaddedGroup = void 0;\n var currentPaddedGroup = void 0;\n // this for loop will NOT run any loops if no padded column groups are needed\n for (var j = columnDept - 1; j >= currentDept; j--) {\n var newColId = columnKeyCreator.getUniqueKey(null, null);\n var colGroupDefMerged = this.createMergedColGroupDef(null);\n var paddedGroup = new ProvidedColumnGroup(colGroupDefMerged, newColId, true, currentDept);\n this.context.createBean(paddedGroup);\n if (currentPaddedGroup) {\n currentPaddedGroup.setChildren([paddedGroup]);\n }\n currentPaddedGroup = paddedGroup;\n if (!firstPaddedGroup) {\n firstPaddedGroup = currentPaddedGroup;\n }\n }\n // likewise this if statement will not run if no padded groups\n if (firstPaddedGroup && currentPaddedGroup) {\n result.push(firstPaddedGroup);\n var hasGroups = unbalancedTree.some(function (leaf) { return leaf instanceof ProvidedColumnGroup; });\n if (hasGroups) {\n currentPaddedGroup.setChildren([child]);\n continue;\n }\n else {\n currentPaddedGroup.setChildren(unbalancedTree);\n break;\n }\n }\n result.push(child);\n }\n }\n return result;\n };\n ColumnFactory.prototype.findMaxDept = function (treeChildren, dept) {\n var maxDeptThisLevel = dept;\n for (var i = 0; i < treeChildren.length; i++) {\n var abstractColumn = treeChildren[i];\n if (abstractColumn instanceof ProvidedColumnGroup) {\n var originalGroup = abstractColumn;\n var newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1);\n if (maxDeptThisLevel < newDept) {\n maxDeptThisLevel = newDept;\n }\n }\n }\n return maxDeptThisLevel;\n };\n ColumnFactory.prototype.recursivelyCreateColumns = function (defs, level, primaryColumns, existingColsCopy, columnKeyCreator, existingGroups) {\n var _this = this;\n return (defs || []).map(function (def) {\n if (_this.isColumnGroup(def)) {\n return _this.createColumnGroup(primaryColumns, def, level, existingColsCopy, columnKeyCreator, existingGroups);\n }\n else {\n return _this.createColumn(primaryColumns, def, existingColsCopy, columnKeyCreator);\n }\n });\n };\n ColumnFactory.prototype.createColumnGroup = function (primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, existingGroups) {\n var colGroupDefMerged = this.createMergedColGroupDef(colGroupDef);\n var groupId = columnKeyCreator.getUniqueKey(colGroupDefMerged.groupId || null, null);\n var existingGroup = this.findExistingGroup(colGroupDef, existingGroups);\n var providedGroup;\n if (existingGroup) {\n providedGroup = existingGroup;\n providedGroup.reset(colGroupDefMerged, level);\n removeFromArray(existingGroups, existingGroup);\n }\n else {\n providedGroup = new ProvidedColumnGroup(colGroupDefMerged, groupId, false, level);\n this.context.createBean(providedGroup);\n }\n var children = this.recursivelyCreateColumns(colGroupDefMerged.children, level + 1, primaryColumns, existingColumns, columnKeyCreator, existingGroups);\n providedGroup.setChildren(children);\n return providedGroup;\n };\n ColumnFactory.prototype.createMergedColGroupDef = function (colGroupDef) {\n var colGroupDefMerged = {};\n Object.assign(colGroupDefMerged, this.gridOptionsWrapper.getDefaultColGroupDef());\n Object.assign(colGroupDefMerged, colGroupDef);\n this.checkForDeprecatedItems(colGroupDefMerged);\n return colGroupDefMerged;\n };\n ColumnFactory.prototype.createColumn = function (primaryColumns, colDef, existingColsCopy, columnKeyCreator) {\n var colDefMerged = this.mergeColDefs(colDef);\n this.checkForDeprecatedItems(colDefMerged);\n // see if column already exists\n var column = this.findExistingColumn(colDef, existingColsCopy);\n // make sure we remove, so if user provided duplicate id, then we don't have more than\n // one column instance for colDef with common id\n if (existingColsCopy && column) {\n removeFromArray(existingColsCopy, column);\n }\n if (!column) {\n // no existing column, need to create one\n var colId = columnKeyCreator.getUniqueKey(colDefMerged.colId, colDefMerged.field);\n column = new Column(colDefMerged, colDef, colId, primaryColumns);\n this.context.createBean(column);\n }\n else {\n column.setColDef(colDefMerged, colDef);\n this.applyColumnState(column, colDefMerged);\n }\n return column;\n };\n ColumnFactory.prototype.applyColumnState = function (column, colDef) {\n // flex\n var flex = attrToNumber(colDef.flex);\n if (flex !== undefined) {\n column.setFlex(flex);\n }\n // width - we only set width if column is not flexing\n var noFlexThisCol = column.getFlex() <= 0;\n if (noFlexThisCol) {\n // both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width)\n var width = attrToNumber(colDef.width);\n if (width != null) {\n column.setActualWidth(width);\n }\n else {\n // otherwise set the width again, in case min or max width has changed,\n // and width needs to be adjusted.\n var widthBeforeUpdate = column.getActualWidth();\n column.setActualWidth(widthBeforeUpdate);\n }\n }\n // sort - anything but undefined will set sort, thus null or empty string will clear the sort\n if (colDef.sort !== undefined) {\n if (colDef.sort == Constants.SORT_ASC || colDef.sort == Constants.SORT_DESC) {\n column.setSort(colDef.sort);\n }\n else {\n column.setSort(undefined);\n }\n }\n // sorted at - anything but undefined, thus null will clear the sortIndex\n var sortIndex = attrToNumber(colDef.sortIndex);\n if (sortIndex !== undefined) {\n column.setSortIndex(sortIndex);\n }\n // hide - anything but undefined, thus null will clear the hide\n var hide = attrToBoolean(colDef.hide);\n if (hide !== undefined) {\n column.setVisible(!hide);\n }\n // pinned - anything but undefined, thus null or empty string will remove pinned\n if (colDef.pinned !== undefined) {\n column.setPinned(colDef.pinned);\n }\n };\n ColumnFactory.prototype.findExistingColumn = function (newColDef, existingColsCopy) {\n return (existingColsCopy || []).find(function (existingCol) {\n var existingColDef = existingCol.getUserProvidedColDef();\n if (!existingColDef) {\n return false;\n }\n var newHasId = newColDef.colId != null;\n var newHasField = newColDef.field != null;\n if (newHasId) {\n return existingCol.getId() === newColDef.colId;\n }\n if (newHasField) {\n return existingColDef.field === newColDef.field;\n }\n // if no id or field present, then try object equivalence.\n if (existingColDef === newColDef) {\n return true;\n }\n return false;\n });\n };\n ColumnFactory.prototype.findExistingGroup = function (newGroupDef, existingGroups) {\n return existingGroups.find(function (existingGroup) {\n var existingDef = existingGroup.getColGroupDef();\n if (!existingDef) {\n return false;\n }\n var newHasId = newGroupDef.groupId != null;\n if (newHasId) {\n return existingGroup.getId() === newGroupDef.groupId;\n }\n return false;\n });\n };\n ColumnFactory.prototype.mergeColDefs = function (colDef) {\n // start with empty merged definition\n var colDefMerged = {};\n // merge properties from default column definitions\n var defaultColDef = this.gridOptionsWrapper.getDefaultColDef();\n mergeDeep(colDefMerged, defaultColDef, false, true);\n // merge properties from column type properties\n var columnType = colDef.type;\n if (!columnType) {\n columnType = defaultColDef && defaultColDef.type;\n }\n // if type of both colDef and defaultColDef, then colDef gets preference\n if (columnType) {\n this.assignColumnTypes(columnType, colDefMerged);\n }\n // merge properties from column definitions\n mergeDeep(colDefMerged, colDef, false, true);\n var autoGroupColDef = this.gridOptionsWrapper.getAutoGroupColumnDef();\n var isSortingCoupled = this.gridOptionsWrapper.isColumnsSortingCoupledToGroup();\n if (colDef.rowGroup && autoGroupColDef && isSortingCoupled) {\n // override the sort for row group columns where the autoGroupColDef defines these values.\n mergeDeep(colDefMerged, { sort: autoGroupColDef.sort, initialSort: autoGroupColDef.initialSort }, false, true);\n }\n return colDefMerged;\n };\n ColumnFactory.prototype.assignColumnTypes = function (type, colDefMerged) {\n var typeKeys = [];\n if (type instanceof Array) {\n var invalidArray = type.some(function (a) { return typeof a !== 'string'; });\n if (invalidArray) {\n console.warn(\"AG Grid: if colDef.type is supplied an array it should be of type 'string[]'\");\n }\n else {\n typeKeys = type;\n }\n }\n else if (typeof type === 'string') {\n typeKeys = type.split(',');\n }\n else {\n console.warn(\"AG Grid: colDef.type should be of type 'string' | 'string[]'\");\n return;\n }\n // merge user defined with default column types\n var allColumnTypes = Object.assign({}, DefaultColumnTypes);\n var userTypes = this.gridOptionsWrapper.getColumnTypes() || {};\n iterateObject(userTypes, function (key, value) {\n if (key in allColumnTypes) {\n console.warn(\"AG Grid: the column type '\" + key + \"' is a default column type and cannot be overridden.\");\n }\n else {\n allColumnTypes[key] = value;\n }\n });\n typeKeys.forEach(function (t) {\n var typeColDef = allColumnTypes[t.trim()];\n if (typeColDef) {\n mergeDeep(colDefMerged, typeColDef, false, true);\n }\n else {\n console.warn(\"AG Grid: colDef.type '\" + t + \"' does not correspond to defined gridOptions.columnTypes\");\n }\n });\n };\n ColumnFactory.prototype.checkForDeprecatedItems = function (colDef) {\n if (colDef) {\n var colDefNoType = colDef; // take out the type, so we can access attributes not defined in the type\n if (colDefNoType.group !== undefined) {\n console.warn('AG Grid: colDef.group is invalid, please check documentation on how to do grouping as it changed in version 3');\n }\n if (colDefNoType.headerGroup !== undefined) {\n console.warn('AG Grid: colDef.headerGroup is invalid, please check documentation on how to do grouping as it changed in version 3');\n }\n if (colDefNoType.headerGroupShow !== undefined) {\n console.warn('AG Grid: colDef.headerGroupShow is invalid, should be columnGroupShow, please check documentation on how to do grouping as it changed in version 3');\n }\n if (colDefNoType.suppressRowGroup !== undefined) {\n console.warn('AG Grid: colDef.suppressRowGroup is deprecated, please use colDef.type instead');\n }\n if (colDefNoType.suppressAggregation !== undefined) {\n console.warn('AG Grid: colDef.suppressAggregation is deprecated, please use colDef.type instead');\n }\n if (colDefNoType.suppressRowGroup || colDefNoType.suppressAggregation) {\n console.warn('AG Grid: colDef.suppressAggregation and colDef.suppressRowGroup are deprecated, use allowRowGroup, allowPivot and allowValue instead');\n }\n if (colDefNoType.displayName) {\n console.warn(\"AG Grid: Found displayName \" + colDefNoType.displayName + \", please use headerName instead, displayName is deprecated.\");\n colDefNoType.headerName = colDefNoType.displayName;\n }\n }\n };\n // if object has children, we assume it's a group\n ColumnFactory.prototype.isColumnGroup = function (abstractColDef) {\n return abstractColDef.children !== undefined;\n };\n __decorate([\n Autowired('columnUtils')\n ], ColumnFactory.prototype, \"columnUtils\", void 0);\n __decorate([\n __param(0, Qualifier('loggerFactory'))\n ], ColumnFactory.prototype, \"setBeans\", null);\n ColumnFactory = __decorate([\n Bean('columnFactory')\n ], ColumnFactory);\n return ColumnFactory;\n}(BeanStub));\nexport { ColumnFactory };\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spread = (this && this.__spread) || function () {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n};\nimport { ColumnGroup } from '../entities/columnGroup';\nimport { Column } from '../entities/column';\nimport { Events } from '../events';\nimport { BeanStub } from \"../context/beanStub\";\nimport { ProvidedColumnGroup } from '../entities/providedColumnGroup';\nimport { GroupInstanceIdCreator } from './groupInstanceIdCreator';\nimport { Autowired, Bean, Optional, PostConstruct, Qualifier } from '../context/context';\nimport { Constants } from '../constants/constants';\nimport { areEqual, last, removeFromArray, moveInArray, includes, insertIntoArray, removeAllFromArray } from '../utils/array';\nimport { missingOrEmpty, exists, missing, attrToBoolean, attrToNumber } from '../utils/generic';\nimport { camelCaseToHumanText } from '../utils/string';\nimport { convertToMap } from '../utils/map';\nimport { doOnce } from '../utils/function';\nimport { GridOptionsWrapper } from '../gridOptionsWrapper';\nvar ColumnModel = /** @class */ (function (_super) {\n __extends(ColumnModel, _super);\n function ColumnModel() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // header row count, based on user provided columns\n _this.primaryHeaderRowCount = 0;\n _this.secondaryHeaderRowCount = 0;\n // header row count, either above, or based on pivoting if we are pivoting\n _this.gridHeaderRowCount = 0;\n // leave level columns of the displayed trees\n _this.displayedColumnsLeft = [];\n _this.displayedColumnsRight = [];\n _this.displayedColumnsCenter = [];\n // all three lists above combined\n _this.displayedColumns = [];\n // for fast lookup, to see if a column or group is still displayed\n _this.displayedColumnsAndGroupsMap = {};\n // all columns to be rendered\n _this.viewportColumns = [];\n // A hash key to keep track of changes in viewport columns\n _this.viewportColumnsHash = '';\n // same as viewportColumns, except we always include columns with headerAutoHeight\n _this.headerViewportColumns = [];\n // all columns to be rendered in the centre\n _this.viewportColumnsCenter = [];\n // same as viewportColumnsCenter, except we always include columns with headerAutoHeight\n _this.headerViewportColumnsCenter = [];\n _this.autoHeightActiveAtLeastOnce = false;\n _this.rowGroupColumns = [];\n _this.valueColumns = [];\n _this.pivotColumns = [];\n _this.ready = false;\n _this.autoGroupsNeedBuilding = false;\n _this.forceRecreateAutoGroups = false;\n _this.pivotMode = false;\n _this.bodyWidth = 0;\n _this.leftWidth = 0;\n _this.rightWidth = 0;\n _this.bodyWidthDirty = true;\n _this.flexColsCalculatedAtLestOnce = false;\n return _this;\n }\n ColumnModel.prototype.init = function () {\n var _this = this;\n this.suppressColumnVirtualisation = this.gridOptionsWrapper.isSuppressColumnVirtualisation();\n var pivotMode = this.gridOptionsWrapper.isPivotMode();\n if (this.isPivotSettingAllowed(pivotMode)) {\n this.pivotMode = pivotMode;\n }\n this.usingTreeData = this.gridOptionsWrapper.isTreeData();\n this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_GROUP_DISPLAY_TYPE, function () { return _this.onAutoGroupColumnDefChanged(); });\n this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_AUTO_GROUP_COLUMN_DEF, function () { return _this.onAutoGroupColumnDefChanged(); });\n this.addManagedListener(this.gridOptionsWrapper, GridOptionsWrapper.PROP_DEFAULT_COL_DEF, function () { return _this.onDefaultColDefChanged(); });\n };\n ColumnModel.prototype.onAutoGroupColumnDefChanged = function () {\n this.autoGroupsNeedBuilding = true;\n this.forceRecreateAutoGroups = true;\n this.updateGridColumns();\n this.updateDisplayedColumns('gridOptionsChanged');\n };\n ColumnModel.prototype.onDefaultColDefChanged = function () {\n // likewise for autoGroupCol, the default col def impacts this\n this.forceRecreateAutoGroups = true;\n this.createColumnsFromColumnDefs(true);\n };\n ColumnModel.prototype.setColumnDefs = function (columnDefs, source) {\n if (source === void 0) { source = 'api'; }\n var colsPreviouslyExisted = !!this.columnDefs;\n this.columnDefs = columnDefs;\n this.createColumnsFromColumnDefs(colsPreviouslyExisted, source);\n };\n ColumnModel.prototype.createColumnsFromColumnDefs = function (colsPreviouslyExisted, source) {\n var _this = this;\n if (source === void 0) { source = 'api'; }\n // only need to raise before/after events if updating columns, never if setting columns for first time\n var raiseEventsFunc = colsPreviouslyExisted ? this.compareColumnStatesAndRaiseEvents(source) : undefined;\n // always invalidate cache on changing columns, as the column id's for the new columns\n // could overlap with the old id's, so the cache would return old values for new columns.\n this.valueCache.expire();\n // NOTE ==================\n // we should be destroying the existing columns and groups if they exist, for example, the original column\n // group adds a listener to the columns, it should be also removing the listeners\n this.autoGroupsNeedBuilding = true;\n var oldPrimaryColumns = this.primaryColumns;\n var oldPrimaryTree = this.primaryColumnTree;\n var balancedTreeResult = this.columnFactory.createColumnTree(this.columnDefs, true, oldPrimaryTree);\n this.primaryColumnTree = balancedTreeResult.columnTree;\n this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1;\n this.primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);\n this.primaryColumnsMap = {};\n this.primaryColumns.forEach(function (col) { return _this.primaryColumnsMap[col.getId()] = col; });\n this.extractRowGroupColumns(source, oldPrimaryColumns);\n this.extractPivotColumns(source, oldPrimaryColumns);\n this.extractValueColumns(source, oldPrimaryColumns);\n this.ready = true;\n // if we are showing secondary columns, then no need to update grid columns\n // at this point, as it's the pivot service responsibility to change these\n // if we are no longer pivoting (ie and need to revert back to primary, otherwise\n // we shouldn't be touching the primary).\n var gridColsNotProcessed = this.gridColsArePrimary === undefined;\n var processGridCols = this.gridColsArePrimary || gridColsNotProcessed;\n if (processGridCols) {\n this.updateGridColumns();\n if (colsPreviouslyExisted && !this.gridOptionsWrapper.isMaintainColumnOrder()) {\n this.orderGridColumnsLikePrimary();\n }\n this.updateDisplayedColumns(source);\n this.checkViewportColumns();\n }\n // this event is not used by AG Grid, but left here for backwards compatibility,\n // in case applications use it\n this.dispatchEverythingChanged(source);\n if (raiseEventsFunc) {\n raiseEventsFunc();\n }\n this.dispatchNewColumnsLoaded();\n };\n ColumnModel.prototype.dispatchNewColumnsLoaded = function () {\n var newColumnsLoadedEvent = {\n type: Events.EVENT_NEW_COLUMNS_LOADED\n };\n this.eventService.dispatchEvent(newColumnsLoadedEvent);\n };\n // this event is legacy, no grid code listens to it. instead the grid listens to New Columns Loaded\n ColumnModel.prototype.dispatchEverythingChanged = function (source) {\n if (source === void 0) { source = 'api'; }\n var eventEverythingChanged = {\n type: Events.EVENT_COLUMN_EVERYTHING_CHANGED,\n source: source\n };\n this.eventService.dispatchEvent(eventEverythingChanged);\n };\n ColumnModel.prototype.orderGridColumnsLikePrimary = function () {\n var _this = this;\n var primaryColumns = this.primaryColumns;\n if (!primaryColumns) {\n return;\n }\n this.gridColumns.sort(function (colA, colB) {\n var primaryIndexA = primaryColumns.indexOf(colA);\n var primaryIndexB = primaryColumns.indexOf(colB);\n // if both cols are present in primary, then we just return the position,\n // so position is maintained.\n var indexAPresent = primaryIndexA >= 0;\n var indexBPresent = primaryIndexB >= 0;\n if (indexAPresent && indexBPresent) {\n return primaryIndexA - primaryIndexB;\n }\n if (indexAPresent) {\n // B is auto group column, so put B first\n return 1;\n }\n if (indexBPresent) {\n // A is auto group column, so put A first\n return -1;\n }\n // otherwise both A and B are auto-group columns. so we just keep the order\n // as they were already in.\n var gridIndexA = _this.gridColumns.indexOf(colA);\n var gridIndexB = _this.gridColumns.indexOf(colB);\n return gridIndexA - gridIndexB;\n });\n this.gridColumns = this.placeLockedColumns(this.gridColumns);\n };\n ColumnModel.prototype.getAllDisplayedAutoHeightCols = function () {\n return this.displayedAutoHeightCols;\n };\n ColumnModel.prototype.setViewport = function () {\n if (this.gridOptionsWrapper.isEnableRtl()) {\n this.viewportLeft = this.bodyWidth - this.scrollPosition - this.scrollWidth;\n this.viewportRight = this.bodyWidth - this.scrollPosition;\n }\n else {\n this.viewportLeft = this.scrollPosition;\n this.viewportRight = this.scrollWidth + this.scrollPosition;\n }\n };\n // used by clipboard service, to know what columns to paste into\n ColumnModel.prototype.getDisplayedColumnsStartingAt = function (column) {\n var currentColumn = column;\n var columns = [];\n while (currentColumn != null) {\n columns.push(currentColumn);\n currentColumn = this.getDisplayedColAfter(currentColumn);\n }\n return columns;\n };\n // checks what columns are currently displayed due to column virtualisation. fires an event\n // if the list of columns has changed.\n // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit()\n ColumnModel.prototype.checkViewportColumns = function () {\n // check displayCenterColumnTree exists first, as it won't exist when grid is initialising\n if (this.displayedColumnsCenter == null) {\n return;\n }\n var viewportColumnsChanged = this.extractViewport();\n if (!viewportColumnsChanged) {\n return;\n }\n var event = {\n type: Events.EVENT_VIRTUAL_COLUMNS_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.setViewportPosition = function (scrollWidth, scrollPosition) {\n if (scrollWidth !== this.scrollWidth || scrollPosition !== this.scrollPosition || this.bodyWidthDirty) {\n this.scrollWidth = scrollWidth;\n this.scrollPosition = scrollPosition;\n // we need to call setVirtualViewportLeftAndRight() at least once after the body width changes,\n // as the viewport can stay the same, but in RTL, if body width changes, we need to work out the\n // virtual columns again\n this.bodyWidthDirty = true;\n this.setViewport();\n if (this.ready) {\n this.checkViewportColumns();\n }\n }\n };\n ColumnModel.prototype.isPivotMode = function () {\n return this.pivotMode;\n };\n ColumnModel.prototype.isPivotSettingAllowed = function (pivot) {\n if (pivot && this.gridOptionsWrapper.isTreeData()) {\n console.warn(\"AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'\");\n return false;\n }\n return true;\n };\n ColumnModel.prototype.setPivotMode = function (pivotMode, source) {\n if (source === void 0) { source = 'api'; }\n if (pivotMode === this.pivotMode || !this.isPivotSettingAllowed(this.pivotMode)) {\n return;\n }\n this.pivotMode = pivotMode;\n // we need to update grid columns to cover the scenario where user has groupSuppressAutoColumn=true, as\n // this means we don't use auto group column UNLESS we are in pivot mode (it's mandatory in pivot mode),\n // so need to updateGridColumn() to check it autoGroupCol needs to be added / removed\n this.autoGroupsNeedBuilding = true;\n this.updateGridColumns();\n this.updateDisplayedColumns(source);\n var event = {\n type: Events.EVENT_COLUMN_PIVOT_MODE_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) {\n if (missing(this.secondaryColumns)) {\n return null;\n }\n var valueColumnToFind = this.getPrimaryColumn(valueColKey);\n var foundColumn = null;\n this.secondaryColumns.forEach(function (column) {\n var thisPivotKeys = column.getColDef().pivotKeys;\n var pivotValueColumn = column.getColDef().pivotValueColumn;\n var pivotKeyMatches = areEqual(thisPivotKeys, pivotKeys);\n var pivotValueMatches = pivotValueColumn === valueColumnToFind;\n if (pivotKeyMatches && pivotValueMatches) {\n foundColumn = column;\n }\n });\n return foundColumn;\n };\n ColumnModel.prototype.setBeans = function (loggerFactory) {\n this.logger = loggerFactory.create('columnModel');\n };\n ColumnModel.prototype.setFirstRightAndLastLeftPinned = function (source) {\n var lastLeft;\n var firstRight;\n if (this.gridOptionsWrapper.isEnableRtl()) {\n lastLeft = this.displayedColumnsLeft ? this.displayedColumnsLeft[0] : null;\n firstRight = this.displayedColumnsRight ? last(this.displayedColumnsRight) : null;\n }\n else {\n lastLeft = this.displayedColumnsLeft ? last(this.displayedColumnsLeft) : null;\n firstRight = this.displayedColumnsRight ? this.displayedColumnsRight[0] : null;\n }\n this.gridColumns.forEach(function (column) {\n column.setLastLeftPinned(column === lastLeft, source);\n column.setFirstRightPinned(column === firstRight, source);\n });\n };\n ColumnModel.prototype.autoSizeColumns = function (params) {\n var _this = this;\n var columns = params.columns, skipHeader = params.skipHeader, skipHeaderGroups = params.skipHeaderGroups, stopAtGroup = params.stopAtGroup, _a = params.source, source = _a === void 0 ? 'api' : _a;\n // because of column virtualisation, we can only do this function on columns that are\n // actually rendered, as non-rendered columns (outside the viewport and not rendered\n // due to column virtualisation) are not present. this can result in all rendered columns\n // getting narrowed, which in turn introduces more rendered columns on the RHS which\n // did not get autosized in the original run, leaving the visible grid with columns on\n // the LHS sized, but RHS no. so we keep looping through the visible columns until\n // no more cols are available (rendered) to be resized\n // we autosize after animation frames finish in case any cell renderers need to complete first. this can\n // happen eg if client code is calling api.autoSizeAllColumns() straight after grid is initialised, but grid\n // hasn't fully drawn out all the cells yet (due to cell renderers in animation frames).\n this.animationFrameService.flushAllFrames();\n // keep track of which cols we have resized in here\n var columnsAutosized = [];\n // initialise with anything except 0 so that while loop executes at least once\n var changesThisTimeAround = -1;\n var shouldSkipHeader = skipHeader != null ? skipHeader : this.gridOptionsWrapper.isSkipHeaderOnAutoSize();\n var shouldSkipHeaderGroups = skipHeaderGroups != null ? skipHeaderGroups : shouldSkipHeader;\n while (changesThisTimeAround !== 0) {\n changesThisTimeAround = 0;\n this.actionOnGridColumns(columns, function (column) {\n // if already autosized, skip it\n if (columnsAutosized.indexOf(column) >= 0) {\n return false;\n }\n // get how wide this col should be\n var preferredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column, shouldSkipHeader);\n // preferredWidth = -1 if this col is not on the screen\n if (preferredWidth > 0) {\n var newWidth = _this.normaliseColumnWidth(column, preferredWidth);\n column.setActualWidth(newWidth, source);\n columnsAutosized.push(column);\n changesThisTimeAround++;\n }\n return true;\n }, source);\n }\n if (!shouldSkipHeaderGroups) {\n this.autoSizeColumnGroupsByColumns(columns, stopAtGroup);\n }\n this.fireColumnResizedEvent(columnsAutosized, true, 'autosizeColumns');\n };\n ColumnModel.prototype.fireColumnResizedEvent = function (columns, finished, source, flexColumns) {\n if (flexColumns === void 0) { flexColumns = null; }\n if (columns && columns.length) {\n var event_1 = {\n type: Events.EVENT_COLUMN_RESIZED,\n columns: columns,\n column: columns.length === 1 ? columns[0] : null,\n flexColumns: flexColumns,\n finished: finished,\n source: source\n };\n this.eventService.dispatchEvent(event_1);\n }\n };\n ColumnModel.prototype.autoSizeColumn = function (key, skipHeader, source) {\n if (source === void 0) { source = \"api\"; }\n if (key) {\n this.autoSizeColumns({ columns: [key], skipHeader: skipHeader, skipHeaderGroups: true, source: source });\n }\n };\n ColumnModel.prototype.autoSizeColumnGroupsByColumns = function (keys, stopAtGroup) {\n var e_1, _a, e_2, _b;\n var columnGroups = new Set();\n var columns = this.getGridColumns(keys);\n columns.forEach(function (col) {\n var parent = col.getParent();\n while (parent && parent != stopAtGroup) {\n if (!parent.isPadding()) {\n columnGroups.add(parent);\n }\n parent = parent.getParent();\n }\n });\n var headerGroupCtrl;\n var resizedColumns = [];\n try {\n for (var columnGroups_1 = __values(columnGroups), columnGroups_1_1 = columnGroups_1.next(); !columnGroups_1_1.done; columnGroups_1_1 = columnGroups_1.next()) {\n var columnGroup = columnGroups_1_1.value;\n try {\n for (var _c = (e_2 = void 0, __values(this.ctrlsService.getHeaderRowContainerCtrls())), _d = _c.next(); !_d.done; _d = _c.next()) {\n var headerContainerCtrl = _d.value;\n headerGroupCtrl = headerContainerCtrl.getHeaderCtrlForColumn(columnGroup);\n if (headerGroupCtrl) {\n break;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_2) throw e_2.error; }\n }\n if (headerGroupCtrl) {\n headerGroupCtrl.resizeLeafColumnsToFit();\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (columnGroups_1_1 && !columnGroups_1_1.done && (_a = columnGroups_1.return)) _a.call(columnGroups_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return resizedColumns;\n };\n ColumnModel.prototype.autoSizeAllColumns = function (skipHeader, source) {\n if (source === void 0) { source = \"api\"; }\n var allDisplayedColumns = this.getAllDisplayedColumns();\n this.autoSizeColumns({ columns: allDisplayedColumns, skipHeader: skipHeader, source: source });\n };\n // Possible candidate for reuse (alot of recursive traversal duplication)\n ColumnModel.prototype.getColumnsFromTree = function (rootColumns) {\n var result = [];\n var recursiveFindColumns = function (childColumns) {\n for (var i = 0; i < childColumns.length; i++) {\n var child = childColumns[i];\n if (child instanceof Column) {\n result.push(child);\n }\n else if (child instanceof ProvidedColumnGroup) {\n recursiveFindColumns(child.getChildren());\n }\n }\n };\n recursiveFindColumns(rootColumns);\n return result;\n };\n ColumnModel.prototype.getAllDisplayedTrees = function () {\n if (this.displayedTreeLeft && this.displayedTreeRight && this.displayedTreeCentre) {\n return this.displayedTreeLeft\n .concat(this.displayedTreeCentre)\n .concat(this.displayedTreeRight);\n }\n return null;\n };\n // + columnSelectPanel\n ColumnModel.prototype.getPrimaryColumnTree = function () {\n return this.primaryColumnTree;\n };\n // + gridPanel -> for resizing the body and setting top margin\n ColumnModel.prototype.getHeaderRowCount = function () {\n return this.gridHeaderRowCount;\n };\n // + headerRenderer -> setting pinned body width\n ColumnModel.prototype.getDisplayedTreeLeft = function () {\n return this.displayedTreeLeft;\n };\n // + headerRenderer -> setting pinned body width\n ColumnModel.prototype.getDisplayedTreeRight = function () {\n return this.displayedTreeRight;\n };\n // + headerRenderer -> setting pinned body width\n ColumnModel.prototype.getDisplayedTreeCentre = function () {\n return this.displayedTreeCentre;\n };\n // gridPanel -> ensureColumnVisible\n ColumnModel.prototype.isColumnDisplayed = function (column) {\n return this.getAllDisplayedColumns().indexOf(column) >= 0;\n };\n // + csvCreator\n ColumnModel.prototype.getAllDisplayedColumns = function () {\n return this.displayedColumns;\n };\n ColumnModel.prototype.getViewportColumns = function () {\n return this.viewportColumns;\n };\n ColumnModel.prototype.getDisplayedLeftColumnsForRow = function (rowNode) {\n if (!this.colSpanActive) {\n return this.displayedColumnsLeft;\n }\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsLeft);\n };\n ColumnModel.prototype.getDisplayedRightColumnsForRow = function (rowNode) {\n if (!this.colSpanActive) {\n return this.displayedColumnsRight;\n }\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsRight);\n };\n ColumnModel.prototype.getDisplayedColumnsForRow = function (rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {\n var result = [];\n var lastConsideredCol = null;\n var _loop_1 = function (i) {\n var col = displayedColumns[i];\n var maxAllowedColSpan = displayedColumns.length - i;\n var colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan);\n var columnsToCheckFilter = [col];\n if (colSpan > 1) {\n var colsToRemove = colSpan - 1;\n for (var j = 1; j <= colsToRemove; j++) {\n columnsToCheckFilter.push(displayedColumns[i + j]);\n }\n i += colsToRemove;\n }\n // see which cols we should take out for column virtualisation\n var filterPasses;\n if (filterCallback) {\n // if user provided a callback, means some columns may not be in the viewport.\n // the user will NOT provide a callback if we are talking about pinned areas,\n // as pinned areas have no horizontal scroll and do not virtualise the columns.\n // if lots of columns, that means column spanning, and we set filterPasses = true\n // if one or more of the columns spanned pass the filter.\n filterPasses = false;\n columnsToCheckFilter.forEach(function (colForFilter) {\n if (filterCallback(colForFilter)) {\n filterPasses = true;\n }\n });\n }\n else {\n filterPasses = true;\n }\n if (filterPasses) {\n if (result.length === 0 && lastConsideredCol) {\n var gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;\n if (gapBeforeColumn) {\n result.push(lastConsideredCol);\n }\n }\n result.push(col);\n }\n lastConsideredCol = col;\n out_i_1 = i;\n };\n var out_i_1;\n for (var i = 0; i < displayedColumns.length; i++) {\n _loop_1(i);\n i = out_i_1;\n }\n return result;\n };\n // + rowRenderer\n // if we are not column spanning, this just returns back the virtual centre columns,\n // however if we are column spanning, then different rows can have different virtual\n // columns, so we have to work out the list for each individual row.\n ColumnModel.prototype.getViewportCenterColumnsForRow = function (rowNode) {\n var _this = this;\n if (!this.colSpanActive) {\n return this.viewportColumnsCenter;\n }\n var emptySpaceBeforeColumn = function (col) {\n var left = col.getLeft();\n return exists(left) && left > _this.viewportLeft;\n };\n // if doing column virtualisation, then we filter based on the viewport.\n var filterCallback = this.suppressColumnVirtualisation ? null : this.isColumnInRowViewport.bind(this);\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsCenter, filterCallback, emptySpaceBeforeColumn);\n };\n ColumnModel.prototype.getAriaColumnIndex = function (col) {\n return this.getAllGridColumns().indexOf(col) + 1;\n };\n ColumnModel.prototype.isColumnInHeaderViewport = function (col) {\n // for headers, we never filter out autoHeaderHeight columns, if calculating\n if (col.isAutoHeaderHeight()) {\n return true;\n }\n return this.isColumnInRowViewport(col);\n };\n ColumnModel.prototype.isColumnInRowViewport = function (col) {\n // we never filter out autoHeight columns, as we need them in the DOM for calculating Auto Height\n if (col.isAutoHeight()) {\n return true;\n }\n var columnLeft = col.getLeft() || 0;\n var columnRight = columnLeft + col.getActualWidth();\n // adding 200 for buffer size, so some cols off viewport are rendered.\n // this helps horizontal scrolling so user rarely sees white space (unless\n // they scroll horizontally fast). however we are conservative, as the more\n // buffer the slower the vertical redraw speed\n var leftBounds = this.viewportLeft - 200;\n var rightBounds = this.viewportRight + 200;\n var columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds;\n var columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds;\n return !columnToMuchLeft && !columnToMuchRight;\n };\n // used by:\n // + angularGrid -> setting pinned body width\n // note: this should be cached\n ColumnModel.prototype.getDisplayedColumnsLeftWidth = function () {\n return this.getWidthOfColsInList(this.displayedColumnsLeft);\n };\n // note: this should be cached\n ColumnModel.prototype.getDisplayedColumnsRightWidth = function () {\n return this.getWidthOfColsInList(this.displayedColumnsRight);\n };\n ColumnModel.prototype.updatePrimaryColumnList = function (keys, masterList, actionIsAdd, columnCallback, eventType, source) {\n var _this = this;\n if (source === void 0) { source = \"api\"; }\n if (!keys || missingOrEmpty(keys)) {\n return;\n }\n var atLeastOne = false;\n keys.forEach(function (key) {\n var columnToAdd = _this.getPrimaryColumn(key);\n if (!columnToAdd) {\n return;\n }\n if (actionIsAdd) {\n if (masterList.indexOf(columnToAdd) >= 0) {\n return;\n }\n masterList.push(columnToAdd);\n }\n else {\n if (masterList.indexOf(columnToAdd) < 0) {\n return;\n }\n removeFromArray(masterList, columnToAdd);\n }\n columnCallback(columnToAdd);\n atLeastOne = true;\n });\n if (!atLeastOne) {\n return;\n }\n if (this.autoGroupsNeedBuilding) {\n this.updateGridColumns();\n }\n this.updateDisplayedColumns(source);\n var event = {\n type: eventType,\n columns: masterList,\n column: masterList.length === 1 ? masterList[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.setRowGroupColumns = function (colKeys, source) {\n if (source === void 0) { source = \"api\"; }\n this.autoGroupsNeedBuilding = true;\n this.setPrimaryColumnList(colKeys, this.rowGroupColumns, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.setRowGroupActive.bind(this), source);\n };\n ColumnModel.prototype.setRowGroupActive = function (active, column, source) {\n if (active === column.isRowGroupActive()) {\n return;\n }\n column.setRowGroupActive(active, source);\n if (active && !this.gridOptionsWrapper.isSuppressRowGroupHidesColumns()) {\n this.setColumnVisible(column, false, source);\n }\n if (!active && !this.gridOptionsWrapper.isSuppressMakeColumnVisibleAfterUnGroup()) {\n this.setColumnVisible(column, true, source);\n }\n };\n ColumnModel.prototype.addRowGroupColumn = function (key, source) {\n if (source === void 0) { source = \"api\"; }\n if (key) {\n this.addRowGroupColumns([key], source);\n }\n };\n ColumnModel.prototype.addRowGroupColumns = function (keys, source) {\n if (source === void 0) { source = \"api\"; }\n this.autoGroupsNeedBuilding = true;\n this.updatePrimaryColumnList(keys, this.rowGroupColumns, true, this.setRowGroupActive.bind(this, true), Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source);\n };\n ColumnModel.prototype.removeRowGroupColumns = function (keys, source) {\n if (source === void 0) { source = \"api\"; }\n this.autoGroupsNeedBuilding = true;\n this.updatePrimaryColumnList(keys, this.rowGroupColumns, false, this.setRowGroupActive.bind(this, false), Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source);\n };\n ColumnModel.prototype.removeRowGroupColumn = function (key, source) {\n if (source === void 0) { source = \"api\"; }\n if (key) {\n this.removeRowGroupColumns([key], source);\n }\n };\n ColumnModel.prototype.addPivotColumns = function (keys, source) {\n if (source === void 0) { source = \"api\"; }\n this.updatePrimaryColumnList(keys, this.pivotColumns, true, function (column) { return column.setPivotActive(true, source); }, Events.EVENT_COLUMN_PIVOT_CHANGED, source);\n };\n ColumnModel.prototype.setPivotColumns = function (colKeys, source) {\n if (source === void 0) { source = \"api\"; }\n this.setPrimaryColumnList(colKeys, this.pivotColumns, Events.EVENT_COLUMN_PIVOT_CHANGED, function (added, column) {\n column.setPivotActive(added, source);\n }, source);\n };\n ColumnModel.prototype.addPivotColumn = function (key, source) {\n if (source === void 0) { source = \"api\"; }\n this.addPivotColumns([key], source);\n };\n ColumnModel.prototype.removePivotColumns = function (keys, source) {\n if (source === void 0) { source = \"api\"; }\n this.updatePrimaryColumnList(keys, this.pivotColumns, false, function (column) { return column.setPivotActive(false, source); }, Events.EVENT_COLUMN_PIVOT_CHANGED, source);\n };\n ColumnModel.prototype.removePivotColumn = function (key, source) {\n if (source === void 0) { source = \"api\"; }\n this.removePivotColumns([key], source);\n };\n ColumnModel.prototype.setPrimaryColumnList = function (colKeys, masterList, eventName, columnCallback, source) {\n var _this = this;\n masterList.length = 0;\n if (exists(colKeys)) {\n colKeys.forEach(function (key) {\n var column = _this.getPrimaryColumn(key);\n if (column) {\n masterList.push(column);\n }\n });\n }\n (this.primaryColumns || []).forEach(function (column) {\n var added = masterList.indexOf(column) >= 0;\n columnCallback(added, column);\n });\n if (this.autoGroupsNeedBuilding) {\n this.updateGridColumns();\n }\n this.updateDisplayedColumns(source);\n this.fireColumnEvent(eventName, masterList, source);\n };\n ColumnModel.prototype.setValueColumns = function (colKeys, source) {\n if (source === void 0) { source = \"api\"; }\n this.setPrimaryColumnList(colKeys, this.valueColumns, Events.EVENT_COLUMN_VALUE_CHANGED, this.setValueActive.bind(this), source);\n };\n ColumnModel.prototype.setValueActive = function (active, column, source) {\n if (active === column.isValueActive()) {\n return;\n }\n column.setValueActive(active, source);\n if (active && !column.getAggFunc()) {\n var initialAggFunc = this.aggFuncService.getDefaultAggFunc(column);\n column.setAggFunc(initialAggFunc);\n }\n };\n ColumnModel.prototype.addValueColumns = function (keys, source) {\n if (source === void 0) { source = \"api\"; }\n this.updatePrimaryColumnList(keys, this.valueColumns, true, this.setValueActive.bind(this, true), Events.EVENT_COLUMN_VALUE_CHANGED, source);\n };\n ColumnModel.prototype.addValueColumn = function (colKey, source) {\n if (source === void 0) { source = \"api\"; }\n if (colKey) {\n this.addValueColumns([colKey], source);\n }\n };\n ColumnModel.prototype.removeValueColumn = function (colKey, source) {\n if (source === void 0) { source = \"api\"; }\n this.removeValueColumns([colKey], source);\n };\n ColumnModel.prototype.removeValueColumns = function (keys, source) {\n if (source === void 0) { source = \"api\"; }\n this.updatePrimaryColumnList(keys, this.valueColumns, false, this.setValueActive.bind(this, false), Events.EVENT_COLUMN_VALUE_CHANGED, source);\n };\n // returns the width we can set to this col, taking into consideration min and max widths\n ColumnModel.prototype.normaliseColumnWidth = function (column, newWidth) {\n var minWidth = column.getMinWidth();\n if (exists(minWidth) && newWidth < minWidth) {\n newWidth = minWidth;\n }\n var maxWidth = column.getMaxWidth();\n if (exists(maxWidth) && column.isGreaterThanMax(newWidth)) {\n newWidth = maxWidth;\n }\n return newWidth;\n };\n ColumnModel.prototype.getPrimaryOrGridColumn = function (key) {\n var column = this.getPrimaryColumn(key);\n return column || this.getGridColumn(key);\n };\n ColumnModel.prototype.setColumnWidths = function (columnWidths, shiftKey, // @takeFromAdjacent - if user has 'shift' pressed, then pixels are taken from adjacent column\n finished, // @finished - ends up in the event, tells the user if more events are to come\n source) {\n var _this = this;\n if (source === void 0) { source = \"api\"; }\n var sets = [];\n columnWidths.forEach(function (columnWidth) {\n var col = _this.getPrimaryOrGridColumn(columnWidth.key);\n if (!col) {\n return;\n }\n sets.push({\n width: columnWidth.newWidth,\n ratios: [1],\n columns: [col]\n });\n // if user wants to do shift resize by default, then we invert the shift operation\n var defaultIsShift = _this.gridOptionsWrapper.getColResizeDefault() === 'shift';\n if (defaultIsShift) {\n shiftKey = !shiftKey;\n }\n if (shiftKey) {\n var otherCol = _this.getDisplayedColAfter(col);\n if (!otherCol) {\n return;\n }\n var widthDiff = col.getActualWidth() - columnWidth.newWidth;\n var otherColWidth = otherCol.getActualWidth() + widthDiff;\n sets.push({\n width: otherColWidth,\n ratios: [1],\n columns: [otherCol]\n });\n }\n });\n if (sets.length === 0) {\n return;\n }\n this.resizeColumnSets({\n resizeSets: sets,\n finished: finished,\n source: source\n });\n };\n ColumnModel.prototype.checkMinAndMaxWidthsForSet = function (columnResizeSet) {\n var columns = columnResizeSet.columns, width = columnResizeSet.width;\n // every col has a min width, so sum them all up and see if we have enough room\n // for all the min widths\n var minWidthAccumulated = 0;\n var maxWidthAccumulated = 0;\n var maxWidthActive = true;\n columns.forEach(function (col) {\n var minWidth = col.getMinWidth();\n minWidthAccumulated += minWidth || 0;\n var maxWidth = col.getMaxWidth();\n if (exists(maxWidth) && maxWidth > 0) {\n maxWidthAccumulated += maxWidth;\n }\n else {\n // if at least one columns has no max width, it means the group of columns\n // then has no max width, as at least one column can take as much width as possible\n maxWidthActive = false;\n }\n });\n var minWidthPasses = width >= minWidthAccumulated;\n var maxWidthPasses = !maxWidthActive || (width <= maxWidthAccumulated);\n return minWidthPasses && maxWidthPasses;\n };\n // method takes sets of columns and resizes them. either all sets will be resized, or nothing\n // be resized. this is used for example when user tries to resize a group and holds shift key,\n // then both the current group (grows), and the adjacent group (shrinks), will get resized,\n // so that's two sets for this method.\n ColumnModel.prototype.resizeColumnSets = function (params) {\n var _this = this;\n var resizeSets = params.resizeSets, finished = params.finished, source = params.source;\n var passMinMaxCheck = !resizeSets || resizeSets.every(function (columnResizeSet) { return _this.checkMinAndMaxWidthsForSet(columnResizeSet); });\n if (!passMinMaxCheck) {\n // even though we are not going to resize beyond min/max size, we still need to raise event when finished\n if (finished) {\n var columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null;\n this.fireColumnResizedEvent(columns, finished, source);\n }\n return; // don't resize!\n }\n var changedCols = [];\n var allResizedCols = [];\n resizeSets.forEach(function (set) {\n var width = set.width, columns = set.columns, ratios = set.ratios;\n // keep track of pixels used, and last column gets the remaining,\n // to cater for rounding errors, and min width adjustments\n var newWidths = {};\n var finishedCols = {};\n columns.forEach(function (col) { return allResizedCols.push(col); });\n // the loop below goes through each col. if a col exceeds it's min/max width,\n // it then gets set to its min/max width and the column is removed marked as 'finished'\n // and the calculation is done again leaving this column out. take for example columns\n // {A, width: 50, maxWidth: 100}\n // {B, width: 50}\n // {C, width: 50}\n // and then the set is set to width 600 - on the first pass the grid tries to set each column\n // to 200. it checks A and sees 200 > 100 and so sets the width to 100. col A is then marked\n // as 'finished' and the calculation is done again with the remaining cols B and C, which end up\n // splitting the remaining 500 pixels.\n var finishedColsGrew = true;\n var loopCount = 0;\n var _loop_2 = function () {\n loopCount++;\n if (loopCount > 1000) {\n // this should never happen, but in the future, someone might introduce a bug here,\n // so we stop the browser from hanging and report bug properly\n console.error('AG Grid: infinite loop in resizeColumnSets');\n return \"break\";\n }\n finishedColsGrew = false;\n var subsetCols = [];\n var subsetRatioTotal = 0;\n var pixelsToDistribute = width;\n columns.forEach(function (col, index) {\n var thisColFinished = finishedCols[col.getId()];\n if (thisColFinished) {\n pixelsToDistribute -= newWidths[col.getId()];\n }\n else {\n subsetCols.push(col);\n var ratioThisCol = ratios[index];\n subsetRatioTotal += ratioThisCol;\n }\n });\n // because we are not using all of the ratios (cols can be missing),\n // we scale the ratio. if all columns are included, then subsetRatioTotal=1,\n // and so the ratioScale will be 1.\n var ratioScale = 1 / subsetRatioTotal;\n subsetCols.forEach(function (col, index) {\n var lastCol = index === (subsetCols.length - 1);\n var colNewWidth;\n if (lastCol) {\n colNewWidth = pixelsToDistribute;\n }\n else {\n colNewWidth = Math.round(ratios[index] * width * ratioScale);\n pixelsToDistribute -= colNewWidth;\n }\n var minWidth = col.getMinWidth();\n var maxWidth = col.getMaxWidth();\n if (exists(minWidth) && colNewWidth < minWidth) {\n colNewWidth = minWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n }\n else if (exists(maxWidth) && maxWidth > 0 && colNewWidth > maxWidth) {\n colNewWidth = maxWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n }\n newWidths[col.getId()] = colNewWidth;\n });\n };\n while (finishedColsGrew) {\n var state_1 = _loop_2();\n if (state_1 === \"break\")\n break;\n }\n columns.forEach(function (col) {\n var newWidth = newWidths[col.getId()];\n var actualWidth = col.getActualWidth();\n if (actualWidth !== newWidth) {\n col.setActualWidth(newWidth, source);\n changedCols.push(col);\n }\n });\n });\n // if no cols changed, then no need to update more or send event.\n var atLeastOneColChanged = changedCols.length > 0;\n var flexedCols = [];\n if (atLeastOneColChanged) {\n flexedCols = this.refreshFlexedColumns({ resizingCols: allResizedCols, skipSetLeft: true });\n this.setLeftValues(source);\n this.updateBodyWidths();\n this.checkViewportColumns();\n }\n // check for change first, to avoid unnecessary firing of events\n // however we always fire 'finished' events. this is important\n // when groups are resized, as if the group is changing slowly,\n // eg 1 pixel at a time, then each change will fire change events\n // in all the columns in the group, but only one with get the pixel.\n var colsForEvent = allResizedCols.concat(flexedCols);\n if (atLeastOneColChanged || finished) {\n this.fireColumnResizedEvent(colsForEvent, finished, source, flexedCols);\n }\n };\n ColumnModel.prototype.setColumnAggFunc = function (key, aggFunc, source) {\n if (source === void 0) { source = \"api\"; }\n if (!key) {\n return;\n }\n var column = this.getPrimaryColumn(key);\n if (!column) {\n return;\n }\n column.setAggFunc(aggFunc);\n this.fireColumnEvent(Events.EVENT_COLUMN_VALUE_CHANGED, [column], source);\n };\n ColumnModel.prototype.fireColumnEvent = function (type, columns, source) {\n var event = {\n type: type,\n columns: columns,\n column: (columns && columns.length == 1) ? columns[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.moveRowGroupColumn = function (fromIndex, toIndex, source) {\n if (source === void 0) { source = \"api\"; }\n var column = this.rowGroupColumns[fromIndex];\n this.rowGroupColumns.splice(fromIndex, 1);\n this.rowGroupColumns.splice(toIndex, 0, column);\n var event = {\n type: Events.EVENT_COLUMN_ROW_GROUP_CHANGED,\n columns: this.rowGroupColumns,\n column: this.rowGroupColumns.length === 1 ? this.rowGroupColumns[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.moveColumns = function (columnsToMoveKeys, toIndex, source) {\n if (source === void 0) { source = \"api\"; }\n this.columnAnimationService.start();\n if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) {\n console.warn('AG Grid: tried to insert columns in invalid location, toIndex = ' + toIndex);\n console.warn('AG Grid: remember that you should not count the moving columns when calculating the new index');\n return;\n }\n // we want to pull all the columns out first and put them into an ordered list\n var columnsToMove = this.getGridColumns(columnsToMoveKeys);\n var failedRules = !this.doesMovePassRules(columnsToMove, toIndex);\n if (failedRules) {\n return;\n }\n moveInArray(this.gridColumns, columnsToMove, toIndex);\n this.updateDisplayedColumns(source);\n var event = {\n type: Events.EVENT_COLUMN_MOVED,\n columns: columnsToMove,\n column: columnsToMove.length === 1 ? columnsToMove[0] : null,\n toIndex: toIndex,\n source: source\n };\n this.eventService.dispatchEvent(event);\n this.columnAnimationService.finish();\n };\n ColumnModel.prototype.doesMovePassRules = function (columnsToMove, toIndex) {\n // make a copy of what the grid columns would look like after the move\n var proposedColumnOrder = this.getProposedColumnOrder(columnsToMove, toIndex);\n return this.doesOrderPassRules(proposedColumnOrder);\n };\n ColumnModel.prototype.doesOrderPassRules = function (gridOrder) {\n if (!this.doesMovePassMarryChildren(gridOrder)) {\n return false;\n }\n if (!this.doesMovePassLockedPositions(gridOrder)) {\n return false;\n }\n return true;\n };\n ColumnModel.prototype.getProposedColumnOrder = function (columnsToMove, toIndex) {\n var proposedColumnOrder = this.gridColumns.slice();\n moveInArray(proposedColumnOrder, columnsToMove, toIndex);\n return proposedColumnOrder;\n };\n // returns the provided cols sorted in same order as they appear in grid columns. eg if grid columns\n // contains [a,b,c,d,e] and col passed is [e,a] then the passed cols are sorted into [a,e]\n ColumnModel.prototype.sortColumnsLikeGridColumns = function (cols) {\n var _this = this;\n if (!cols || cols.length <= 1) {\n return;\n }\n var notAllColsInGridColumns = cols.filter(function (c) { return _this.gridColumns.indexOf(c) < 0; }).length > 0;\n if (notAllColsInGridColumns) {\n return;\n }\n cols.sort(function (a, b) {\n var indexA = _this.gridColumns.indexOf(a);\n var indexB = _this.gridColumns.indexOf(b);\n return indexA - indexB;\n });\n };\n ColumnModel.prototype.doesMovePassLockedPositions = function (proposedColumnOrder) {\n // Placement is a number indicating 'left' 'center' or 'right' as 0 1 2\n var lastPlacement = 0;\n var rulePassed = true;\n var lockPositionToPlacement = function (position) {\n if (!position) { // false or undefined\n return 1;\n }\n if (position === true) {\n return 0;\n }\n return position === 'left' ? 0 : 2; // Otherwise 'right'\n };\n proposedColumnOrder.forEach(function (col) {\n var placement = lockPositionToPlacement(col.getColDef().lockPosition);\n if (placement < lastPlacement) { // If placement goes down, we're not in the correct order\n rulePassed = false;\n }\n lastPlacement = placement;\n });\n return rulePassed;\n };\n ColumnModel.prototype.doesMovePassMarryChildren = function (allColumnsCopy) {\n var rulePassed = true;\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (child) {\n if (!(child instanceof ProvidedColumnGroup)) {\n return;\n }\n var columnGroup = child;\n var colGroupDef = columnGroup.getColGroupDef();\n var marryChildren = colGroupDef && colGroupDef.marryChildren;\n if (!marryChildren) {\n return;\n }\n var newIndexes = [];\n columnGroup.getLeafColumns().forEach(function (col) {\n var newColIndex = allColumnsCopy.indexOf(col);\n newIndexes.push(newColIndex);\n });\n var maxIndex = Math.max.apply(Math, newIndexes);\n var minIndex = Math.min.apply(Math, newIndexes);\n // spread is how far the first column in this group is away from the last column\n var spread = maxIndex - minIndex;\n var maxSpread = columnGroup.getLeafColumns().length - 1;\n // if the columns\n if (spread > maxSpread) {\n rulePassed = false;\n }\n // console.log(`maxIndex = ${maxIndex}, minIndex = ${minIndex}, spread = ${spread}, maxSpread = ${maxSpread}, fail = ${spread > (count-1)}`)\n // console.log(allColumnsCopy.map( col => col.getColDef().field).join(','));\n });\n return rulePassed;\n };\n ColumnModel.prototype.moveColumn = function (key, toIndex, source) {\n if (source === void 0) { source = \"api\"; }\n this.moveColumns([key], toIndex, source);\n };\n ColumnModel.prototype.moveColumnByIndex = function (fromIndex, toIndex, source) {\n if (source === void 0) { source = \"api\"; }\n var column = this.gridColumns[fromIndex];\n this.moveColumn(column, toIndex, source);\n };\n ColumnModel.prototype.getColumnDefs = function () {\n var _this = this;\n if (!this.primaryColumns) {\n return;\n }\n var cols = this.primaryColumns.slice();\n if (this.gridColsArePrimary) {\n cols.sort(function (a, b) { return _this.gridColumns.indexOf(a) - _this.gridColumns.indexOf(b); });\n }\n else if (this.lastPrimaryOrder) {\n cols.sort(function (a, b) { return _this.lastPrimaryOrder.indexOf(a) - _this.lastPrimaryOrder.indexOf(b); });\n }\n return this.columnDefFactory.buildColumnDefs(cols, this.rowGroupColumns, this.pivotColumns);\n };\n // used by:\n // + angularGrid -> for setting body width\n // + rowController -> setting main row widths (when inserting and resizing)\n // need to cache this\n ColumnModel.prototype.getBodyContainerWidth = function () {\n return this.bodyWidth;\n };\n ColumnModel.prototype.getContainerWidth = function (pinned) {\n switch (pinned) {\n case Constants.PINNED_LEFT:\n return this.leftWidth;\n case Constants.PINNED_RIGHT:\n return this.rightWidth;\n default:\n return this.bodyWidth;\n }\n };\n // after setColumnWidth or updateGroupsAndDisplayedColumns\n ColumnModel.prototype.updateBodyWidths = function () {\n var newBodyWidth = this.getWidthOfColsInList(this.displayedColumnsCenter);\n var newLeftWidth = this.getWidthOfColsInList(this.displayedColumnsLeft);\n var newRightWidth = this.getWidthOfColsInList(this.displayedColumnsRight);\n // this is used by virtual col calculation, for RTL only, as a change to body width can impact displayed\n // columns, due to RTL inverting the y coordinates\n this.bodyWidthDirty = this.bodyWidth !== newBodyWidth;\n var atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth;\n if (atLeastOneChanged) {\n this.bodyWidth = newBodyWidth;\n this.leftWidth = newLeftWidth;\n this.rightWidth = newRightWidth;\n // when this fires, it is picked up by the gridPanel, which ends up in\n // gridPanel calling setWidthAndScrollPosition(), which in turn calls setViewportPosition()\n var event_2 = {\n type: Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,\n };\n this.eventService.dispatchEvent(event_2);\n }\n };\n // + rowController\n ColumnModel.prototype.getValueColumns = function () {\n return this.valueColumns ? this.valueColumns : [];\n };\n // + rowController\n ColumnModel.prototype.getPivotColumns = function () {\n return this.pivotColumns ? this.pivotColumns : [];\n };\n // + clientSideRowModel\n ColumnModel.prototype.isPivotActive = function () {\n return this.pivotColumns && this.pivotColumns.length > 0 && this.pivotMode;\n };\n // + toolPanel\n ColumnModel.prototype.getRowGroupColumns = function () {\n return this.rowGroupColumns ? this.rowGroupColumns : [];\n };\n // + rowController -> while inserting rows\n ColumnModel.prototype.getDisplayedCenterColumns = function () {\n return this.displayedColumnsCenter;\n };\n // + rowController -> while inserting rows\n ColumnModel.prototype.getDisplayedLeftColumns = function () {\n return this.displayedColumnsLeft;\n };\n ColumnModel.prototype.getDisplayedRightColumns = function () {\n return this.displayedColumnsRight;\n };\n ColumnModel.prototype.getDisplayedColumns = function (type) {\n switch (type) {\n case Constants.PINNED_LEFT:\n return this.getDisplayedLeftColumns();\n case Constants.PINNED_RIGHT:\n return this.getDisplayedRightColumns();\n default:\n return this.getDisplayedCenterColumns();\n }\n };\n // used by:\n // + clientSideRowController -> sorting, building quick filter text\n // + headerRenderer -> sorting (clearing icon)\n ColumnModel.prototype.getAllPrimaryColumns = function () {\n return this.primaryColumns ? this.primaryColumns.slice() : null;\n };\n ColumnModel.prototype.getSecondaryColumns = function () {\n return this.secondaryColumns ? this.secondaryColumns.slice() : null;\n };\n ColumnModel.prototype.getAllColumnsForQuickFilter = function () {\n return this.columnsForQuickFilter;\n };\n // + moveColumnController\n ColumnModel.prototype.getAllGridColumns = function () {\n return this.gridColumns;\n };\n ColumnModel.prototype.isEmpty = function () {\n return missingOrEmpty(this.gridColumns);\n };\n ColumnModel.prototype.isRowGroupEmpty = function () {\n return missingOrEmpty(this.rowGroupColumns);\n };\n ColumnModel.prototype.setColumnVisible = function (key, visible, source) {\n if (source === void 0) { source = \"api\"; }\n this.setColumnsVisible([key], visible, source);\n };\n ColumnModel.prototype.setColumnsVisible = function (keys, visible, source) {\n if (visible === void 0) { visible = false; }\n if (source === void 0) { source = \"api\"; }\n this.applyColumnState({\n state: keys.map(function (key) { return ({\n colId: typeof key === 'string' ? key : key.getColId(),\n hide: !visible,\n }); }),\n }, source);\n };\n ColumnModel.prototype.setColumnPinned = function (key, pinned, source) {\n if (source === void 0) { source = \"api\"; }\n if (key) {\n this.setColumnsPinned([key], pinned, source);\n }\n };\n ColumnModel.prototype.setColumnsPinned = function (keys, pinned, source) {\n if (source === void 0) { source = \"api\"; }\n if (this.gridOptionsWrapper.getDomLayout() === 'print') {\n console.warn(\"Changing the column pinning status is not allowed with domLayout='print'\");\n return;\n }\n this.columnAnimationService.start();\n var actualPinned;\n if (pinned === true || pinned === Constants.PINNED_LEFT) {\n actualPinned = Constants.PINNED_LEFT;\n }\n else if (pinned === Constants.PINNED_RIGHT) {\n actualPinned = Constants.PINNED_RIGHT;\n }\n else {\n actualPinned = null;\n }\n this.actionOnGridColumns(keys, function (col) {\n if (col.getPinned() !== actualPinned) {\n col.setPinned(actualPinned);\n return true;\n }\n return false;\n }, source, function () {\n var event = {\n type: Events.EVENT_COLUMN_PINNED,\n pinned: actualPinned,\n column: null,\n columns: null,\n source: source\n };\n return event;\n });\n this.columnAnimationService.finish();\n };\n // does an action on a set of columns. provides common functionality for looking up the\n // columns based on key, getting a list of effected columns, and then updated the event\n // with either one column (if it was just one col) or a list of columns\n // used by: autoResize, setVisible, setPinned\n ColumnModel.prototype.actionOnGridColumns = function (// the column keys this action will be on\n keys, \n // the action to do - if this returns false, the column was skipped\n // and won't be included in the event\n action, \n // should return back a column event of the right type\n source, createEvent) {\n var _this = this;\n if (missingOrEmpty(keys)) {\n return;\n }\n var updatedColumns = [];\n keys.forEach(function (key) {\n var column = _this.getGridColumn(key);\n if (!column) {\n return;\n }\n // need to check for false with type (ie !== instead of !=)\n // as not returning anything (undefined) would also be false\n var resultOfAction = action(column);\n if (resultOfAction !== false) {\n updatedColumns.push(column);\n }\n });\n if (!updatedColumns.length) {\n return;\n }\n this.updateDisplayedColumns(source);\n if (exists(createEvent) && createEvent) {\n var event_3 = createEvent();\n event_3.columns = updatedColumns;\n event_3.column = updatedColumns.length === 1 ? updatedColumns[0] : null;\n this.eventService.dispatchEvent(event_3);\n }\n };\n ColumnModel.prototype.getDisplayedColBefore = function (col) {\n var allDisplayedColumns = this.getAllDisplayedColumns();\n var oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex > 0) {\n return allDisplayedColumns[oldIndex - 1];\n }\n return null;\n };\n // used by:\n // + rowRenderer -> for navigation\n ColumnModel.prototype.getDisplayedColAfter = function (col) {\n var allDisplayedColumns = this.getAllDisplayedColumns();\n var oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex < (allDisplayedColumns.length - 1)) {\n return allDisplayedColumns[oldIndex + 1];\n }\n return null;\n };\n ColumnModel.prototype.getDisplayedGroupAfter = function (columnGroup) {\n return this.getDisplayedGroupAtDirection(columnGroup, 'After');\n };\n ColumnModel.prototype.getDisplayedGroupBefore = function (columnGroup) {\n return this.getDisplayedGroupAtDirection(columnGroup, 'Before');\n };\n ColumnModel.prototype.getDisplayedGroupAtDirection = function (columnGroup, direction) {\n // pick the last displayed column in this group\n var requiredLevel = columnGroup.getProvidedColumnGroup().getLevel() + columnGroup.getPaddingLevel();\n var colGroupLeafColumns = columnGroup.getDisplayedLeafColumns();\n var col = direction === 'After' ? last(colGroupLeafColumns) : colGroupLeafColumns[0];\n var getDisplayColMethod = \"getDisplayedCol\" + direction;\n while (true) {\n // keep moving to the next col, until we get to another group\n var column = this[getDisplayColMethod](col);\n if (!column) {\n return null;\n }\n var groupPointer = this.getColumnGroupAtLevel(column, requiredLevel);\n if (groupPointer !== columnGroup) {\n return groupPointer;\n }\n }\n };\n ColumnModel.prototype.getColumnGroupAtLevel = function (column, level) {\n // get group at same level as the one we are looking for\n var groupPointer = column.getParent();\n var originalGroupLevel;\n var groupPointerLevel;\n while (true) {\n var groupPointerProvidedColumnGroup = groupPointer.getProvidedColumnGroup();\n originalGroupLevel = groupPointerProvidedColumnGroup.getLevel();\n groupPointerLevel = groupPointer.getPaddingLevel();\n if (originalGroupLevel + groupPointerLevel <= level) {\n break;\n }\n groupPointer = groupPointer.getParent();\n }\n return groupPointer;\n };\n ColumnModel.prototype.isPinningLeft = function () {\n return this.displayedColumnsLeft.length > 0;\n };\n ColumnModel.prototype.isPinningRight = function () {\n return this.displayedColumnsRight.length > 0;\n };\n ColumnModel.prototype.getPrimaryAndSecondaryAndAutoColumns = function () {\n var _a;\n return (_a = []).concat.apply(_a, __spread([\n this.primaryColumns || [],\n this.groupAutoColumns || [],\n this.secondaryColumns || [],\n ]));\n };\n ColumnModel.prototype.getPrimaryAndAutoGroupCols = function () {\n var _a;\n return (_a = []).concat.apply(_a, __spread([\n this.primaryColumns || [],\n this.groupAutoColumns || [],\n ]));\n };\n ColumnModel.prototype.getPrimaryAndSecondaryColumns = function () {\n var _a;\n return (_a = []).concat.apply(_a, __spread([\n this.primaryColumns || [],\n this.secondaryColumns || [],\n ]));\n };\n ColumnModel.prototype.createStateItemFromColumn = function (column) {\n var rowGroupIndex = column.isRowGroupActive() ? this.rowGroupColumns.indexOf(column) : null;\n var pivotIndex = column.isPivotActive() ? this.pivotColumns.indexOf(column) : null;\n var aggFunc = column.isValueActive() ? column.getAggFunc() : null;\n var sort = column.getSort() != null ? column.getSort() : null;\n var sortIndex = column.getSortIndex() != null ? column.getSortIndex() : null;\n var flex = column.getFlex() != null && column.getFlex() > 0 ? column.getFlex() : null;\n var res = {\n colId: column.getColId(),\n width: column.getActualWidth(),\n hide: !column.isVisible(),\n pinned: column.getPinned(),\n sort: sort,\n sortIndex: sortIndex,\n aggFunc: aggFunc,\n rowGroup: column.isRowGroupActive(),\n rowGroupIndex: rowGroupIndex,\n pivot: column.isPivotActive(),\n pivotIndex: pivotIndex,\n flex: flex\n };\n return res;\n };\n ColumnModel.prototype.getColumnState = function () {\n if (missing(this.primaryColumns) || !this.isAlive()) {\n return [];\n }\n var colsForState = this.getPrimaryAndSecondaryAndAutoColumns();\n var res = colsForState.map(this.createStateItemFromColumn.bind(this));\n this.orderColumnStateList(res);\n return res;\n };\n ColumnModel.prototype.orderColumnStateList = function (columnStateList) {\n // for fast looking, store the index of each column\n var colIdToGridIndexMap = convertToMap(this.gridColumns.map(function (col, index) { return [col.getColId(), index]; }));\n columnStateList.sort(function (itemA, itemB) {\n var posA = colIdToGridIndexMap.has(itemA.colId) ? colIdToGridIndexMap.get(itemA.colId) : -1;\n var posB = colIdToGridIndexMap.has(itemB.colId) ? colIdToGridIndexMap.get(itemB.colId) : -1;\n return posA - posB;\n });\n };\n ColumnModel.prototype.resetColumnState = function (source) {\n // NOTE = there is one bug here that no customer has noticed - if a column has colDef.lockPosition,\n // this is ignored below when ordering the cols. to work, we should always put lockPosition cols first.\n // As a work around, developers should just put lockPosition columns first in their colDef list.\n if (source === void 0) { source = \"api\"; }\n // we can't use 'allColumns' as the order might of messed up, so get the primary ordered list\n var primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);\n var columnStates = [];\n // we start at 1000, so if user has mix of rowGroup and group specified, it will work with both.\n // eg IF user has ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=true,\n // THEN result will be ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=1000\n var letRowGroupIndex = 1000;\n var letPivotIndex = 1000;\n var colsToProcess = [];\n if (this.groupAutoColumns) {\n colsToProcess = colsToProcess.concat(this.groupAutoColumns);\n }\n if (primaryColumns) {\n colsToProcess = colsToProcess.concat(primaryColumns);\n }\n colsToProcess.forEach(function (column) {\n var getValueOrNull = function (a, b) { return a != null ? a : b != null ? b : null; };\n var colDef = column.getColDef();\n var sort = getValueOrNull(colDef.sort, colDef.initialSort);\n var sortIndex = getValueOrNull(colDef.sortIndex, colDef.initialSortIndex);\n var hide = getValueOrNull(colDef.hide, colDef.initialHide);\n var pinned = getValueOrNull(colDef.pinned, colDef.initialPinned);\n var width = getValueOrNull(colDef.width, colDef.initialWidth);\n var flex = getValueOrNull(colDef.flex, colDef.initialFlex);\n var rowGroupIndex = getValueOrNull(colDef.rowGroupIndex, colDef.initialRowGroupIndex);\n var rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup);\n if (rowGroupIndex == null && (rowGroup == null || rowGroup == false)) {\n rowGroupIndex = null;\n rowGroup = null;\n }\n var pivotIndex = getValueOrNull(colDef.pivotIndex, colDef.initialPivotIndex);\n var pivot = getValueOrNull(colDef.pivot, colDef.initialPivot);\n if (pivotIndex == null && (pivot == null || pivot == false)) {\n pivotIndex = null;\n pivot = null;\n }\n var aggFunc = getValueOrNull(colDef.aggFunc, colDef.initialAggFunc);\n var stateItem = {\n colId: column.getColId(),\n sort: sort,\n sortIndex: sortIndex,\n hide: hide,\n pinned: pinned,\n width: width,\n flex: flex,\n rowGroup: rowGroup,\n rowGroupIndex: rowGroupIndex,\n pivot: pivot,\n pivotIndex: pivotIndex,\n aggFunc: aggFunc,\n };\n if (missing(rowGroupIndex) && rowGroup) {\n stateItem.rowGroupIndex = letRowGroupIndex++;\n }\n if (missing(pivotIndex) && pivot) {\n stateItem.pivotIndex = letPivotIndex++;\n }\n columnStates.push(stateItem);\n });\n this.applyColumnState({ state: columnStates, applyOrder: true }, source);\n };\n ColumnModel.prototype.applyColumnState = function (params, source) {\n var _this = this;\n if (missingOrEmpty(this.primaryColumns)) {\n return false;\n }\n if (params && params.state && !params.state.forEach) {\n console.warn('AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.');\n return false;\n }\n var applyStates = function (states, existingColumns, getById) {\n var raiseEventsFunc = _this.compareColumnStatesAndRaiseEvents(source);\n _this.autoGroupsNeedBuilding = true;\n // at the end below, this list will have all columns we got no state for\n var columnsWithNoState = existingColumns.slice();\n var rowGroupIndexes = {};\n var pivotIndexes = {};\n var autoGroupColumnStates = [];\n // If pivoting is modified, these are the states we try to reapply after\n // the secondary columns are re-generated\n var unmatchedAndAutoStates = [];\n var unmatchedCount = 0;\n var previousRowGroupCols = _this.rowGroupColumns.slice();\n var previousPivotCols = _this.pivotColumns.slice();\n states.forEach(function (state) {\n var colId = state.colId || '';\n // auto group columns are re-created so deferring syncing with ColumnState\n var isAutoGroupColumn = colId.startsWith(Constants.GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupColumn) {\n autoGroupColumnStates.push(state);\n unmatchedAndAutoStates.push(state);\n return;\n }\n var column = getById(colId);\n if (!column) {\n unmatchedAndAutoStates.push(state);\n unmatchedCount += 1;\n }\n else {\n _this.syncColumnWithStateItem(column, state, params.defaultState, rowGroupIndexes, pivotIndexes, false, source);\n removeFromArray(columnsWithNoState, column);\n }\n });\n // anything left over, we got no data for, so add in the column as non-value, non-rowGroup and hidden\n var applyDefaultsFunc = function (col) {\n return _this.syncColumnWithStateItem(col, null, params.defaultState, rowGroupIndexes, pivotIndexes, false, source);\n };\n columnsWithNoState.forEach(applyDefaultsFunc);\n // sort the lists according to the indexes that were provided\n var comparator = function (indexes, oldList, colA, colB) {\n var indexA = indexes[colA.getId()];\n var indexB = indexes[colB.getId()];\n var aHasIndex = indexA != null;\n var bHasIndex = indexB != null;\n if (aHasIndex && bHasIndex) {\n // both a and b are new cols with index, so sort on index\n return indexA - indexB;\n }\n if (aHasIndex) {\n // a has an index, so it should be before a\n return -1;\n }\n if (bHasIndex) {\n // b has an index, so it should be before a\n return 1;\n }\n var oldIndexA = oldList.indexOf(colA);\n var oldIndexB = oldList.indexOf(colB);\n var aHasOldIndex = oldIndexA >= 0;\n var bHasOldIndex = oldIndexB >= 0;\n if (aHasOldIndex && bHasOldIndex) {\n // both a and b are old cols, so sort based on last order\n return oldIndexA - oldIndexB;\n }\n if (aHasOldIndex) {\n // a is old, b is new, so b is first\n return -1;\n }\n // this bit does matter, means both are new cols\n // but without index or that b is old and a is new\n return 1;\n };\n _this.rowGroupColumns.sort(comparator.bind(_this, rowGroupIndexes, previousRowGroupCols));\n _this.pivotColumns.sort(comparator.bind(_this, pivotIndexes, previousPivotCols));\n _this.updateGridColumns();\n // sync newly created auto group columns with ColumnState\n var autoGroupColsCopy = _this.groupAutoColumns ? _this.groupAutoColumns.slice() : [];\n autoGroupColumnStates.forEach(function (stateItem) {\n var autoCol = _this.getAutoColumn(stateItem.colId);\n removeFromArray(autoGroupColsCopy, autoCol);\n _this.syncColumnWithStateItem(autoCol, stateItem, params.defaultState, null, null, true, source);\n });\n // autogroup cols with nothing else, apply the default\n autoGroupColsCopy.forEach(applyDefaultsFunc);\n _this.applyOrderAfterApplyState(params);\n _this.updateDisplayedColumns(source);\n _this.dispatchEverythingChanged(source);\n raiseEventsFunc(); // Will trigger secondary column changes if pivoting modified\n return { unmatchedAndAutoStates: unmatchedAndAutoStates, unmatchedCount: unmatchedCount };\n };\n this.columnAnimationService.start();\n var _a = applyStates(params.state || [], this.primaryColumns || [], function (id) { return _this.getPrimaryColumn(id); }), unmatchedAndAutoStates = _a.unmatchedAndAutoStates, unmatchedCount = _a.unmatchedCount;\n // If there are still states left over, see if we can apply them to newly generated\n // secondary or auto columns. Also if defaults exist, ensure they are applied to secondary cols\n if (unmatchedAndAutoStates.length > 0 || exists(params.defaultState)) {\n unmatchedCount = applyStates(unmatchedAndAutoStates, this.secondaryColumns || [], function (id) { return _this.getSecondaryColumn(id); }).unmatchedCount;\n }\n this.columnAnimationService.finish();\n return unmatchedCount === 0; // Successful if no states unaccounted for\n };\n ColumnModel.prototype.applyOrderAfterApplyState = function (params) {\n var _this = this;\n if (!params.applyOrder || !params.state) {\n return;\n }\n var newOrder = [];\n var processedColIds = {};\n params.state.forEach(function (item) {\n if (!item.colId || processedColIds[item.colId]) {\n return;\n }\n var col = _this.gridColumnsMap[item.colId];\n if (col) {\n newOrder.push(col);\n processedColIds[item.colId] = true;\n }\n });\n // add in all other columns\n var autoGroupInsertIndex = 0;\n this.gridColumns.forEach(function (col) {\n var colId = col.getColId();\n var alreadyProcessed = processedColIds[colId] != null;\n if (alreadyProcessed) {\n return;\n }\n var isAutoGroupCol = colId.startsWith(Constants.GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupCol) {\n // auto group columns, if missing from state list, are added to the start.\n // it's common to have autoGroup missing, as grouping could be on by default\n // on a column, but the user could of since removed the grouping via the UI.\n // if we don't inc the insert index, autoGroups will be inserted in reverse order\n insertIntoArray(newOrder, col, autoGroupInsertIndex++);\n }\n else {\n // normal columns, if missing from state list, are added at the end\n newOrder.push(col);\n }\n });\n // this is already done in updateGridColumns, however we changed the order above (to match the order of the state\n // columns) so we need to do it again. we could of put logic into the order above to take into account fixed\n // columns, however if we did then we would have logic for updating fixed columns twice. reusing the logic here\n // is less sexy for the code here, but it keeps consistency.\n newOrder = this.placeLockedColumns(newOrder);\n if (!this.doesMovePassMarryChildren(newOrder)) {\n console.warn('AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.');\n return;\n }\n this.gridColumns = newOrder;\n };\n ColumnModel.prototype.compareColumnStatesAndRaiseEvents = function (source) {\n var _this = this;\n var startState = {\n rowGroupColumns: this.rowGroupColumns.slice(),\n pivotColumns: this.pivotColumns.slice(),\n valueColumns: this.valueColumns.slice()\n };\n var columnStateBefore = this.getColumnState();\n var columnStateBeforeMap = {};\n columnStateBefore.forEach(function (col) {\n columnStateBeforeMap[col.colId] = col;\n });\n return function () {\n if (_this.gridOptionsWrapper.isSuppressColumnStateEvents()) {\n return;\n }\n var colsForState = _this.getPrimaryAndSecondaryAndAutoColumns();\n // raises generic ColumnEvents where all columns are returned rather than what has changed\n var raiseWhenListsDifferent = function (eventType, colsBefore, colsAfter, idMapper) {\n var beforeList = colsBefore.map(idMapper);\n var afterList = colsAfter.map(idMapper);\n var unchanged = areEqual(beforeList, afterList);\n if (unchanged) {\n return;\n }\n // returning all columns rather than what has changed!\n var event = {\n type: eventType,\n columns: colsAfter,\n column: colsAfter.length === 1 ? colsAfter[0] : null,\n source: source\n };\n _this.eventService.dispatchEvent(event);\n };\n // determines which columns have changed according to supplied predicate\n var getChangedColumns = function (changedPredicate) {\n var changedColumns = [];\n colsForState.forEach(function (column) {\n var colStateBefore = columnStateBeforeMap[column.getColId()];\n if (colStateBefore && changedPredicate(colStateBefore, column)) {\n changedColumns.push(column);\n }\n });\n return changedColumns;\n };\n var columnIdMapper = function (c) { return c.getColId(); };\n raiseWhenListsDifferent(Events.EVENT_COLUMN_ROW_GROUP_CHANGED, startState.rowGroupColumns, _this.rowGroupColumns, columnIdMapper);\n raiseWhenListsDifferent(Events.EVENT_COLUMN_PIVOT_CHANGED, startState.pivotColumns, _this.pivotColumns, columnIdMapper);\n var valueChangePredicate = function (cs, c) {\n var oldActive = cs.aggFunc != null;\n var activeChanged = oldActive != c.isValueActive();\n // we only check aggFunc if the agg is active\n var aggFuncChanged = oldActive && cs.aggFunc != c.getAggFunc();\n return activeChanged || aggFuncChanged;\n };\n var changedValues = getChangedColumns(valueChangePredicate);\n if (changedValues.length > 0) {\n // we pass all value columns, now the ones that changed. this is the same\n // as pivot and rowGroup cols, but different to all other properties below.\n // this is more for backwards compatibility, as it's always been this way.\n // really it should be the other way, as the order of the cols makes no difference\n // for valueColumns (apart from displaying them in the tool panel).\n _this.fireColumnEvent(Events.EVENT_COLUMN_VALUE_CHANGED, _this.valueColumns, source);\n }\n var resizeChangePredicate = function (cs, c) { return cs.width != c.getActualWidth(); };\n _this.fireColumnResizedEvent(getChangedColumns(resizeChangePredicate), true, source);\n var pinnedChangePredicate = function (cs, c) { return cs.pinned != c.getPinned(); };\n _this.raiseColumnPinnedEvent(getChangedColumns(pinnedChangePredicate), source);\n var visibilityChangePredicate = function (cs, c) { return cs.hide == c.isVisible(); };\n _this.raiseColumnVisibleEvent(getChangedColumns(visibilityChangePredicate), source);\n var sortChangePredicate = function (cs, c) { return cs.sort != c.getSort() || cs.sortIndex != c.getSortIndex(); };\n if (getChangedColumns(sortChangePredicate).length > 0) {\n _this.sortController.dispatchSortChangedEvents(source);\n }\n // special handling for moved column events\n _this.raiseColumnMovedEvent(columnStateBefore, source);\n };\n };\n ColumnModel.prototype.raiseColumnPinnedEvent = function (changedColumns, source) {\n if (!changedColumns.length) {\n return;\n }\n // if just one column, we use this, otherwise we don't include the col\n var column = changedColumns.length === 1 ? changedColumns[0] : null;\n // only include visible if it's common in all columns\n var pinned = this.getCommonValue(changedColumns, function (col) { return col.getPinned(); });\n var event = {\n type: Events.EVENT_COLUMN_PINNED,\n // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned'\n pinned: pinned != null ? pinned : null,\n columns: changedColumns,\n column: column,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.getCommonValue = function (cols, valueGetter) {\n if (!cols || cols.length == 0) {\n return undefined;\n }\n // compare each value to the first value. if nothing differs, then value is common so return it.\n var firstValue = valueGetter(cols[0]);\n for (var i = 1; i < cols.length; i++) {\n if (firstValue !== valueGetter(cols[i])) {\n // values differ, no common value\n return undefined;\n }\n }\n return firstValue;\n };\n ColumnModel.prototype.raiseColumnVisibleEvent = function (changedColumns, source) {\n if (!changedColumns.length) {\n return;\n }\n // if just one column, we use this, otherwise we don't include the col\n var column = changedColumns.length === 1 ? changedColumns[0] : null;\n // only include visible if it's common in all columns\n var visible = this.getCommonValue(changedColumns, function (col) { return col.isVisible(); });\n var event = {\n type: Events.EVENT_COLUMN_VISIBLE,\n visible: visible,\n columns: changedColumns,\n column: column,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.raiseColumnMovedEvent = function (colStateBefore, source) {\n // we are only interested in columns that were both present and visible before and after\n var _this = this;\n var colStateAfter = this.getColumnState();\n var colStateAfterMapped = {};\n colStateAfter.forEach(function (s) { return colStateAfterMapped[s.colId] = s; });\n // get id's of cols in both before and after lists\n var colsIntersectIds = {};\n colStateBefore.forEach(function (s) {\n if (colStateAfterMapped[s.colId]) {\n colsIntersectIds[s.colId] = true;\n }\n });\n // filter state lists, so we only have cols that were present before and after\n var beforeFiltered = colStateBefore.filter(function (c) { return colsIntersectIds[c.colId]; });\n var afterFiltered = colStateAfter.filter(function (c) { return colsIntersectIds[c.colId]; });\n // see if any cols are in a different location\n var movedColumns = [];\n afterFiltered.forEach(function (csAfter, index) {\n var csBefore = beforeFiltered && beforeFiltered[index];\n if (csBefore && csBefore.colId !== csAfter.colId) {\n var gridCol = _this.getGridColumn(csBefore.colId);\n if (gridCol) {\n movedColumns.push(gridCol);\n }\n }\n });\n if (!movedColumns.length) {\n return;\n }\n var event = {\n type: Events.EVENT_COLUMN_MOVED,\n columns: movedColumns,\n column: null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.syncColumnWithStateItem = function (column, stateItem, defaultState, rowGroupIndexes, pivotIndexes, autoCol, source) {\n if (!column) {\n return;\n }\n var getValue = function (key1, key2) {\n var obj = { value1: undefined, value2: undefined };\n var calculated = false;\n if (stateItem) {\n if (stateItem[key1] !== undefined) {\n obj.value1 = stateItem[key1];\n calculated = true;\n }\n if (exists(key2) && stateItem[key2] !== undefined) {\n obj.value2 = stateItem[key2];\n calculated = true;\n }\n }\n if (!calculated && defaultState) {\n if (defaultState[key1] !== undefined) {\n obj.value1 = defaultState[key1];\n }\n if (exists(key2) && defaultState[key2] !== undefined) {\n obj.value2 = defaultState[key2];\n }\n }\n return obj;\n };\n // following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true\n var hide = getValue('hide').value1;\n if (hide !== undefined) {\n column.setVisible(!hide, source);\n }\n // sets pinned to 'left' or 'right'\n var pinned = getValue('pinned').value1;\n if (pinned !== undefined) {\n column.setPinned(pinned);\n }\n // if width provided and valid, use it, otherwise stick with the old width\n var minColWidth = this.columnUtils.calculateColMinWidth(column.getColDef());\n // flex\n var flex = getValue('flex').value1;\n if (flex !== undefined) {\n column.setFlex(flex);\n }\n // width - we only set width if column is not flexing\n var noFlexThisCol = column.getFlex() <= 0;\n if (noFlexThisCol) {\n // both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width)\n var width = getValue('width').value1;\n if (width != null) {\n if (minColWidth != null && width >= minColWidth) {\n column.setActualWidth(width, source);\n }\n }\n }\n var sort = getValue('sort').value1;\n if (sort !== undefined) {\n if (sort === Constants.SORT_DESC || sort === Constants.SORT_ASC) {\n column.setSort(sort, source);\n }\n else {\n column.setSort(undefined, source);\n }\n }\n var sortIndex = getValue('sortIndex').value1;\n if (sortIndex !== undefined) {\n column.setSortIndex(sortIndex);\n }\n // we do not do aggFunc, rowGroup or pivot for auto cols or secondary cols\n if (autoCol || !column.isPrimary()) {\n return;\n }\n var aggFunc = getValue('aggFunc').value1;\n if (aggFunc !== undefined) {\n if (typeof aggFunc === 'string') {\n column.setAggFunc(aggFunc);\n if (!column.isValueActive()) {\n column.setValueActive(true, source);\n this.valueColumns.push(column);\n }\n }\n else {\n if (exists(aggFunc)) {\n console.warn('AG Grid: stateItem.aggFunc must be a string. if using your own aggregation ' +\n 'functions, register the functions first before using them in get/set state. This is because it is ' +\n 'intended for the column state to be stored and retrieved as simple JSON.');\n }\n // Note: we do not call column.setAggFunc(null), so that next time we aggregate\n // by this column (eg drag the column to the agg section int he toolpanel) it will\n // default to the last aggregation function.\n if (column.isValueActive()) {\n column.setValueActive(false, source);\n removeFromArray(this.valueColumns, column);\n }\n }\n }\n var _a = getValue('rowGroup', 'rowGroupIndex'), rowGroup = _a.value1, rowGroupIndex = _a.value2;\n if (rowGroup !== undefined || rowGroupIndex !== undefined) {\n if (typeof rowGroupIndex === 'number' || rowGroup) {\n if (!column.isRowGroupActive()) {\n column.setRowGroupActive(true, source);\n this.rowGroupColumns.push(column);\n }\n if (rowGroupIndexes && typeof rowGroupIndex === 'number') {\n rowGroupIndexes[column.getId()] = rowGroupIndex;\n }\n }\n else {\n if (column.isRowGroupActive()) {\n column.setRowGroupActive(false, source);\n removeFromArray(this.rowGroupColumns, column);\n }\n }\n }\n var _b = getValue('pivot', 'pivotIndex'), pivot = _b.value1, pivotIndex = _b.value2;\n if (pivot !== undefined || pivotIndex !== undefined) {\n if (typeof pivotIndex === 'number' || pivot) {\n if (!column.isPivotActive()) {\n column.setPivotActive(true, source);\n this.pivotColumns.push(column);\n }\n if (pivotIndexes && typeof pivotIndex === 'number') {\n pivotIndexes[column.getId()] = pivotIndex;\n }\n }\n else {\n if (column.isPivotActive()) {\n column.setPivotActive(false, source);\n removeFromArray(this.pivotColumns, column);\n }\n }\n }\n };\n ColumnModel.prototype.getGridColumns = function (keys) {\n return this.getColumns(keys, this.getGridColumn.bind(this));\n };\n ColumnModel.prototype.getColumns = function (keys, columnLookupCallback) {\n var foundColumns = [];\n if (keys) {\n keys.forEach(function (key) {\n var column = columnLookupCallback(key);\n if (column) {\n foundColumns.push(column);\n }\n });\n }\n return foundColumns;\n };\n // used by growGroupPanel\n ColumnModel.prototype.getColumnWithValidation = function (key) {\n if (key == null) {\n return null;\n }\n var column = this.getGridColumn(key);\n if (!column) {\n console.warn('AG Grid: could not find column ' + key);\n }\n return column;\n };\n ColumnModel.prototype.getPrimaryColumn = function (key) {\n if (!this.primaryColumns) {\n return null;\n }\n return this.getColumn(key, this.primaryColumns, this.primaryColumnsMap);\n };\n ColumnModel.prototype.getGridColumn = function (key) {\n return this.getColumn(key, this.gridColumns, this.gridColumnsMap);\n };\n ColumnModel.prototype.getSecondaryColumn = function (key) {\n if (!this.secondaryColumns) {\n return null;\n }\n return this.getColumn(key, this.secondaryColumns, this.secondaryColumnsMap);\n };\n ColumnModel.prototype.getColumn = function (key, columnList, columnMap) {\n if (!key) {\n return null;\n }\n // most of the time this method gets called the key is a string, so we put this shortcut in\n // for performance reasons, to see if we can match for ID (it doesn't do auto columns, that's done below)\n if (typeof key == 'string' && columnMap[key]) {\n return columnMap[key];\n }\n for (var i = 0; i < columnList.length; i++) {\n if (this.columnsMatch(columnList[i], key)) {\n return columnList[i];\n }\n }\n return this.getAutoColumn(key);\n };\n ColumnModel.prototype.getSourceColumnsForGroupColumn = function (groupCol) {\n var sourceColumnId = groupCol.getColDef().showRowGroup;\n if (!sourceColumnId) {\n return null;\n }\n if (sourceColumnId === true) {\n return this.rowGroupColumns.slice(0);\n }\n var column = this.getPrimaryColumn(sourceColumnId);\n return column ? [column] : null;\n };\n ColumnModel.prototype.getAutoColumn = function (key) {\n var _this = this;\n if (!this.groupAutoColumns ||\n !exists(this.groupAutoColumns) ||\n missing(this.groupAutoColumns)) {\n return null;\n }\n return this.groupAutoColumns.find(function (groupCol) { return _this.columnsMatch(groupCol, key); }) || null;\n };\n ColumnModel.prototype.columnsMatch = function (column, key) {\n var columnMatches = column === key;\n var colDefMatches = column.getColDef() === key;\n var idMatches = column.getColId() == key;\n return columnMatches || colDefMatches || idMatches;\n };\n ColumnModel.prototype.getDisplayNameForColumn = function (column, location, includeAggFunc) {\n if (includeAggFunc === void 0) { includeAggFunc = false; }\n if (!column) {\n return null;\n }\n var headerName = this.getHeaderName(column.getColDef(), column, null, null, location);\n if (includeAggFunc) {\n return this.wrapHeaderNameWithAggFunc(column, headerName);\n }\n return headerName;\n };\n ColumnModel.prototype.getDisplayNameForProvidedColumnGroup = function (columnGroup, providedColumnGroup, location) {\n var colGroupDef = providedColumnGroup ? providedColumnGroup.getColGroupDef() : null;\n if (colGroupDef) {\n return this.getHeaderName(colGroupDef, null, columnGroup, providedColumnGroup, location);\n }\n return null;\n };\n ColumnModel.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) {\n return this.getDisplayNameForProvidedColumnGroup(columnGroup, columnGroup.getProvidedColumnGroup(), location);\n };\n // location is where the column is going to appear, ie who is calling us\n ColumnModel.prototype.getHeaderName = function (colDef, column, columnGroup, providedColumnGroup, location) {\n var headerValueGetter = colDef.headerValueGetter;\n if (headerValueGetter) {\n var params = {\n colDef: colDef,\n column: column,\n columnGroup: columnGroup,\n providedColumnGroup: providedColumnGroup,\n location: location,\n api: this.gridOptionsWrapper.getApi(),\n columnApi: this.gridOptionsWrapper.getColumnApi(),\n context: this.gridOptionsWrapper.getContext()\n };\n if (typeof headerValueGetter === 'function') {\n // valueGetter is a function, so just call it\n return headerValueGetter(params);\n }\n else if (typeof headerValueGetter === 'string') {\n // valueGetter is an expression, so execute the expression\n return this.expressionService.evaluate(headerValueGetter, params);\n }\n console.warn('ag-grid: headerValueGetter must be a function or a string');\n return '';\n }\n else if (colDef.headerName != null) {\n return colDef.headerName;\n }\n else if (colDef.field) {\n return camelCaseToHumanText(colDef.field);\n }\n return '';\n };\n ColumnModel.prototype.wrapHeaderNameWithAggFunc = function (column, headerName) {\n if (this.gridOptionsWrapper.isSuppressAggFuncInHeader()) {\n return headerName;\n }\n // only columns with aggregation active can have aggregations\n var pivotValueColumn = column.getColDef().pivotValueColumn;\n var pivotActiveOnThisColumn = exists(pivotValueColumn);\n var aggFunc = null;\n var aggFuncFound;\n // otherwise we have a measure that is active, and we are doing aggregation on it\n if (pivotActiveOnThisColumn) {\n var isCollapsedHeaderEnabled = this.gridOptionsWrapper.isRemovePivotHeaderRowWhenSingleValueColumn() && this.valueColumns.length === 1;\n var isTotalColumn = column.getColDef().pivotTotalColumnIds !== undefined;\n if (isCollapsedHeaderEnabled && !isTotalColumn) {\n return headerName; // Skip decorating the header - in this case the label is the pivot key, not the value col\n }\n aggFunc = pivotValueColumn ? pivotValueColumn.getAggFunc() : null;\n aggFuncFound = true;\n }\n else {\n var measureActive = column.isValueActive();\n var aggregationPresent = this.pivotMode || !this.isRowGroupEmpty();\n if (measureActive && aggregationPresent) {\n aggFunc = column.getAggFunc();\n aggFuncFound = true;\n }\n else {\n aggFuncFound = false;\n }\n }\n if (aggFuncFound) {\n var aggFuncString = (typeof aggFunc === 'string') ? aggFunc : 'func';\n var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();\n var aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString);\n return aggFuncStringTranslated + \"(\" + headerName + \")\";\n }\n return headerName;\n };\n // returns the group with matching colId and instanceId. If instanceId is missing,\n // matches only on the colId.\n ColumnModel.prototype.getColumnGroup = function (colId, instanceId) {\n if (!colId) {\n return null;\n }\n if (colId instanceof ColumnGroup) {\n return colId;\n }\n var allColumnGroups = this.getAllDisplayedTrees();\n var checkInstanceId = typeof instanceId === 'number';\n var result = null;\n this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {\n if (child instanceof ColumnGroup) {\n var columnGroup = child;\n var matched = void 0;\n if (checkInstanceId) {\n matched = colId === columnGroup.getGroupId() && instanceId === columnGroup.getInstanceId();\n }\n else {\n matched = colId === columnGroup.getGroupId();\n }\n if (matched) {\n result = columnGroup;\n }\n }\n });\n return result;\n };\n ColumnModel.prototype.isReady = function () {\n return this.ready;\n };\n ColumnModel.prototype.extractValueColumns = function (source, oldPrimaryColumns) {\n this.valueColumns = this.extractColumns(oldPrimaryColumns, this.valueColumns, function (col, flag) { return col.setValueActive(flag, source); }, \n // aggFunc doesn't have index variant, cos order of value cols doesn't matter, so always return null\n function () { return undefined; }, function () { return undefined; }, \n // aggFunc is a string, so return it's existence\n function (colDef) {\n var aggFunc = colDef.aggFunc;\n // null or empty string means clear\n if (aggFunc === null || aggFunc === '') {\n return null;\n }\n if (aggFunc === undefined) {\n return;\n }\n return !!aggFunc;\n }, function (colDef) {\n // return false if any of the following: null, undefined, empty string\n return colDef.initialAggFunc != null && colDef.initialAggFunc != '';\n });\n // all new columns added will have aggFunc missing, so set it to what is in the colDef\n this.valueColumns.forEach(function (col) {\n var colDef = col.getColDef();\n // if aggFunc provided, we always override, as reactive property\n if (colDef.aggFunc != null && colDef.aggFunc != '') {\n col.setAggFunc(colDef.aggFunc);\n }\n else {\n // otherwise we use initialAggFunc only if no agg func set - which happens when new column only\n if (!col.getAggFunc()) {\n col.setAggFunc(colDef.initialAggFunc);\n }\n }\n });\n };\n ColumnModel.prototype.extractRowGroupColumns = function (source, oldPrimaryColumns) {\n this.rowGroupColumns = this.extractColumns(oldPrimaryColumns, this.rowGroupColumns, function (col, flag) { return col.setRowGroupActive(flag, source); }, function (colDef) { return colDef.rowGroupIndex; }, function (colDef) { return colDef.initialRowGroupIndex; }, function (colDef) { return colDef.rowGroup; }, function (colDef) { return colDef.initialRowGroup; });\n };\n ColumnModel.prototype.extractColumns = function (oldPrimaryColumns, previousCols, setFlagFunc, getIndexFunc, getInitialIndexFunc, getValueFunc, getInitialValueFunc) {\n if (oldPrimaryColumns === void 0) { oldPrimaryColumns = []; }\n if (previousCols === void 0) { previousCols = []; }\n var colsWithIndex = [];\n var colsWithValue = [];\n // go though all cols.\n // if value, change\n // if default only, change only if new\n (this.primaryColumns || []).forEach(function (col) {\n var colIsNew = oldPrimaryColumns.indexOf(col) < 0;\n var colDef = col.getColDef();\n var value = attrToBoolean(getValueFunc(colDef));\n var initialValue = attrToBoolean(getInitialValueFunc(colDef));\n var index = attrToNumber(getIndexFunc(colDef));\n var initialIndex = attrToNumber(getInitialIndexFunc(colDef));\n var include;\n var valuePresent = value !== undefined;\n var indexPresent = index !== undefined;\n var initialValuePresent = initialValue !== undefined;\n var initialIndexPresent = initialIndex !== undefined;\n if (valuePresent) {\n include = value; // boolean value is guaranteed as attrToBoolean() is used above\n }\n else if (indexPresent) {\n if (index === null) {\n // if col is new we don't want to use the default / initial if index is set to null. Similarly,\n // we don't want to include the property for existing columns, i.e. we want to 'clear' it.\n include = false;\n }\n else {\n // note that 'null >= 0' evaluates to true which means 'rowGroupIndex = null' would enable row\n // grouping if the null check didn't exist above.\n include = index >= 0;\n }\n }\n else {\n if (colIsNew) {\n // as no value or index is 'present' we use the default / initial when col is new\n if (initialValuePresent) {\n include = initialValue;\n }\n else if (initialIndexPresent) {\n include = initialIndex != null && initialIndex >= 0;\n }\n else {\n include = false;\n }\n }\n else {\n // otherwise include it if included last time, e.g. if we are extracting row group cols and this col\n // is an existing row group col (i.e. it exists in 'previousCols') then we should include it.\n include = previousCols.indexOf(col) >= 0;\n }\n }\n if (include) {\n var useIndex = colIsNew ? (index != null || initialIndex != null) : index != null;\n useIndex ? colsWithIndex.push(col) : colsWithValue.push(col);\n }\n });\n var getIndexForCol = function (col) {\n var index = getIndexFunc(col.getColDef());\n var defaultIndex = getInitialIndexFunc(col.getColDef());\n return index != null ? index : defaultIndex;\n };\n // sort cols with index, and add these first\n colsWithIndex.sort(function (colA, colB) {\n var indexA = getIndexForCol(colA);\n var indexB = getIndexForCol(colB);\n if (indexA === indexB) {\n return 0;\n }\n if (indexA < indexB) {\n return -1;\n }\n return 1;\n });\n var res = [].concat(colsWithIndex);\n // second add columns that were there before and in the same order as they were before,\n // so we are preserving order of current grouping of columns that simply have rowGroup=true\n previousCols.forEach(function (col) {\n if (colsWithValue.indexOf(col) >= 0) {\n res.push(col);\n }\n });\n // lastly put in all remaining cols\n colsWithValue.forEach(function (col) {\n if (res.indexOf(col) < 0) {\n res.push(col);\n }\n });\n // set flag=false for removed cols\n previousCols.forEach(function (col) {\n if (res.indexOf(col) < 0) {\n setFlagFunc(col, false);\n }\n });\n // set flag=true for newly added cols\n res.forEach(function (col) {\n if (previousCols.indexOf(col) < 0) {\n setFlagFunc(col, true);\n }\n });\n return res;\n };\n ColumnModel.prototype.extractPivotColumns = function (source, oldPrimaryColumns) {\n this.pivotColumns = this.extractColumns(oldPrimaryColumns, this.pivotColumns, function (col, flag) { return col.setPivotActive(flag, source); }, function (colDef) { return colDef.pivotIndex; }, function (colDef) { return colDef.initialPivotIndex; }, function (colDef) { return colDef.pivot; }, function (colDef) { return colDef.initialPivot; });\n };\n ColumnModel.prototype.resetColumnGroupState = function (source) {\n if (source === void 0) { source = \"api\"; }\n var stateItems = [];\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.primaryColumnTree, function (child) {\n if (child instanceof ProvidedColumnGroup) {\n var colGroupDef = child.getColGroupDef();\n var groupState = {\n groupId: child.getGroupId(),\n open: !colGroupDef ? undefined : colGroupDef.openByDefault\n };\n stateItems.push(groupState);\n }\n });\n this.setColumnGroupState(stateItems, source);\n };\n ColumnModel.prototype.getColumnGroupState = function () {\n var columnGroupState = [];\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (node) {\n if (node instanceof ProvidedColumnGroup) {\n columnGroupState.push({\n groupId: node.getGroupId(),\n open: node.isExpanded()\n });\n }\n });\n return columnGroupState;\n };\n ColumnModel.prototype.setColumnGroupState = function (stateItems, source) {\n var _this = this;\n if (source === void 0) { source = \"api\"; }\n this.columnAnimationService.start();\n var impactedGroups = [];\n stateItems.forEach(function (stateItem) {\n var groupKey = stateItem.groupId;\n var newValue = stateItem.open;\n var providedColumnGroup = _this.getProvidedColumnGroup(groupKey);\n if (!providedColumnGroup) {\n return;\n }\n if (providedColumnGroup.isExpanded() === newValue) {\n return;\n }\n _this.logger.log('columnGroupOpened(' + providedColumnGroup.getGroupId() + ',' + newValue + ')');\n providedColumnGroup.setExpanded(newValue);\n impactedGroups.push(providedColumnGroup);\n });\n this.updateGroupsAndDisplayedColumns(source);\n this.setFirstRightAndLastLeftPinned(source);\n impactedGroups.forEach(function (providedColumnGroup) {\n var event = {\n type: Events.EVENT_COLUMN_GROUP_OPENED,\n columnGroup: providedColumnGroup\n };\n _this.eventService.dispatchEvent(event);\n });\n this.columnAnimationService.finish();\n };\n // called by headerRenderer - when a header is opened or closed\n ColumnModel.prototype.setColumnGroupOpened = function (key, newValue, source) {\n if (source === void 0) { source = \"api\"; }\n var keyAsString;\n if (key instanceof ProvidedColumnGroup) {\n keyAsString = key.getId();\n }\n else {\n keyAsString = key || '';\n }\n this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source);\n };\n ColumnModel.prototype.getProvidedColumnGroup = function (key) {\n // if (key instanceof ProvidedColumnGroup) { return key; }\n if (typeof key !== 'string') {\n console.error('AG Grid: group key must be a string');\n }\n // otherwise, search for the column group by id\n var res = null;\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (node) {\n if (node instanceof ProvidedColumnGroup) {\n if (node.getId() === key) {\n res = node;\n }\n }\n });\n return res;\n };\n ColumnModel.prototype.calculateColumnsForDisplay = function () {\n var _this = this;\n var columnsForDisplay;\n if (this.pivotMode && missing(this.secondaryColumns)) {\n // pivot mode is on, but we are not pivoting, so we only\n // show columns we are aggregating on\n columnsForDisplay = this.gridColumns.filter(function (column) {\n var isAutoGroupCol = _this.groupAutoColumns && includes(_this.groupAutoColumns, column);\n var isValueCol = _this.valueColumns && includes(_this.valueColumns, column);\n return isAutoGroupCol || isValueCol;\n });\n }\n else {\n // otherwise continue as normal. this can be working on the primary\n // or secondary columns, whatever the gridColumns are set to\n columnsForDisplay = this.gridColumns.filter(function (column) {\n // keep col if a) it's auto-group or b) it's visible\n var isAutoGroupCol = _this.groupAutoColumns && includes(_this.groupAutoColumns, column);\n return isAutoGroupCol || column.isVisible();\n });\n }\n return columnsForDisplay;\n };\n ColumnModel.prototype.checkColSpanActiveInCols = function (columns) {\n var result = false;\n columns.forEach(function (col) {\n if (exists(col.getColDef().colSpan)) {\n result = true;\n }\n });\n return result;\n };\n ColumnModel.prototype.calculateColumnsForGroupDisplay = function () {\n var _this = this;\n this.groupDisplayColumns = [];\n this.groupDisplayColumnsMap = {};\n var checkFunc = function (col) {\n var colDef = col.getColDef();\n var underlyingColumn = colDef.showRowGroup;\n if (colDef && exists(underlyingColumn)) {\n _this.groupDisplayColumns.push(col);\n if (typeof underlyingColumn === 'string') {\n _this.groupDisplayColumnsMap[underlyingColumn] = col;\n }\n else if (underlyingColumn === true) {\n _this.getRowGroupColumns().forEach(function (rowGroupCol) {\n _this.groupDisplayColumnsMap[rowGroupCol.getId()] = col;\n });\n }\n }\n };\n this.gridColumns.forEach(checkFunc);\n if (this.groupAutoColumns) {\n this.groupAutoColumns.forEach(checkFunc);\n }\n };\n ColumnModel.prototype.getGroupDisplayColumns = function () {\n return this.groupDisplayColumns;\n };\n ColumnModel.prototype.getGroupDisplayColumnForGroup = function (rowGroupColumnId) {\n return this.groupDisplayColumnsMap[rowGroupColumnId];\n };\n ColumnModel.prototype.updateDisplayedColumns = function (source) {\n var columnsForDisplay = this.calculateColumnsForDisplay();\n this.buildDisplayedTrees(columnsForDisplay);\n this.calculateColumnsForGroupDisplay();\n // also called when group opened/closed\n this.updateGroupsAndDisplayedColumns(source);\n // also called when group opened/closed\n this.setFirstRightAndLastLeftPinned(source);\n };\n ColumnModel.prototype.isSecondaryColumnsPresent = function () {\n return exists(this.secondaryColumns);\n };\n ColumnModel.prototype.setSecondaryColumns = function (colDefs, source) {\n var _this = this;\n if (source === void 0) { source = \"api\"; }\n var newColsPresent = colDefs && colDefs.length > 0;\n // if not cols passed, and we had no cols anyway, then do nothing\n if (!newColsPresent && missing(this.secondaryColumns)) {\n return;\n }\n if (newColsPresent) {\n this.processSecondaryColumnDefinitions(colDefs);\n var balancedTreeResult = this.columnFactory.createColumnTree(colDefs, false, this.secondaryBalancedTree || this.previousSecondaryColumns || undefined);\n this.secondaryBalancedTree = balancedTreeResult.columnTree;\n this.secondaryHeaderRowCount = balancedTreeResult.treeDept + 1;\n this.secondaryColumns = this.getColumnsFromTree(this.secondaryBalancedTree);\n this.secondaryColumnsMap = {};\n this.secondaryColumns.forEach(function (col) { return _this.secondaryColumnsMap[col.getId()] = col; });\n this.previousSecondaryColumns = null;\n }\n else {\n this.previousSecondaryColumns = this.secondaryBalancedTree;\n this.secondaryBalancedTree = null;\n this.secondaryHeaderRowCount = -1;\n this.secondaryColumns = null;\n this.secondaryColumnsMap = {};\n }\n this.updateGridColumns();\n this.updateDisplayedColumns(source);\n };\n ColumnModel.prototype.processSecondaryColumnDefinitions = function (colDefs) {\n var columnCallback = this.gridOptionsWrapper.getProcessPivotResultColDefFunc();\n var groupCallback = this.gridOptionsWrapper.getProcessPivotResultColGroupDefFunc();\n if (!columnCallback && !groupCallback) {\n return undefined;\n }\n var searchForColDefs = function (colDefs2) {\n colDefs2.forEach(function (abstractColDef) {\n var isGroup = exists(abstractColDef.children);\n if (isGroup) {\n var colGroupDef = abstractColDef;\n if (groupCallback) {\n groupCallback(colGroupDef);\n }\n searchForColDefs(colGroupDef.children);\n }\n else {\n var colDef = abstractColDef;\n if (columnCallback) {\n columnCallback(colDef);\n }\n }\n });\n };\n if (colDefs) {\n searchForColDefs(colDefs);\n }\n };\n // called from: setColumnState, setColumnDefs, setSecondaryColumns\n ColumnModel.prototype.updateGridColumns = function () {\n var _this = this;\n var prevGridCols = this.gridBalancedTree;\n if (this.gridColsArePrimary) {\n this.lastPrimaryOrder = this.gridColumns;\n }\n else {\n this.lastSecondaryOrder = this.gridColumns;\n }\n var sortOrderToRecover = undefined;\n if (this.secondaryColumns && this.secondaryBalancedTree) {\n var hasSameColumns = this.secondaryColumns.every(function (col) {\n return _this.gridColumnsMap[col.getColId()] !== undefined;\n });\n this.gridBalancedTree = this.secondaryBalancedTree.slice();\n this.gridHeaderRowCount = this.secondaryHeaderRowCount;\n this.gridColumns = this.secondaryColumns.slice();\n this.gridColsArePrimary = false;\n // If the current columns are the same or a subset of the previous\n // we keep the previous order, otherwise we go back to the order the pivot\n // cols are generated in\n if (hasSameColumns) {\n sortOrderToRecover = this.lastSecondaryOrder;\n }\n }\n else if (this.primaryColumns) {\n this.gridBalancedTree = this.primaryColumnTree.slice();\n this.gridHeaderRowCount = this.primaryHeaderRowCount;\n this.gridColumns = this.primaryColumns.slice();\n this.gridColsArePrimary = true;\n // updateGridColumns gets called after user adds a row group. we want to maintain the order of the columns\n // when this happens (eg if user moved a column) rather than revert back to the original column order.\n // likewise if changing in/out of pivot mode, we want to maintain the order of the cols\n sortOrderToRecover = this.lastPrimaryOrder;\n }\n // create the new auto columns\n var areAutoColsChanged = this.createGroupAutoColumnsIfNeeded();\n // if auto group cols have changed, and we have a sort order, we need to move auto cols to the start\n if (areAutoColsChanged && sortOrderToRecover) {\n var groupAutoColsMap_1 = convertToMap(this.groupAutoColumns.map(function (col) { return [col, true]; }));\n // if group columns has changed, we don't preserve the group column order, so remove them from the old order\n sortOrderToRecover = sortOrderToRecover.filter(function (col) { return !groupAutoColsMap_1.has(col); });\n // and add them to the start of the order\n sortOrderToRecover = __spread(this.groupAutoColumns, sortOrderToRecover);\n }\n this.addAutoGroupToGridColumns();\n this.orderGridColsLike(sortOrderToRecover);\n this.gridColumns = this.placeLockedColumns(this.gridColumns);\n this.setupQuickFilterColumns();\n this.clearDisplayedAndViewportColumns();\n this.colSpanActive = this.checkColSpanActiveInCols(this.gridColumns);\n this.gridColumnsMap = {};\n this.gridColumns.forEach(function (col) { return _this.gridColumnsMap[col.getId()] = col; });\n this.setAutoHeightActive();\n if (!areEqual(prevGridCols, this.gridBalancedTree)) {\n var event_4 = {\n type: Events.EVENT_GRID_COLUMNS_CHANGED\n };\n this.eventService.dispatchEvent(event_4);\n }\n };\n ColumnModel.prototype.setAutoHeightActive = function () {\n this.autoHeightActive = this.gridColumns.filter(function (col) { return col.isAutoHeight(); }).length > 0;\n if (this.autoHeightActive) {\n this.autoHeightActiveAtLeastOnce = true;\n var rowModelType = this.rowModel.getType();\n var supportedRowModel = rowModelType === Constants.ROW_MODEL_TYPE_CLIENT_SIDE || rowModelType === Constants.ROW_MODEL_TYPE_SERVER_SIDE;\n if (!supportedRowModel) {\n var message_1 = 'AG Grid - autoHeight columns only work with Client Side Row Model and Server Side Row Model.';\n doOnce(function () { return console.warn(message_1); }, 'autoHeightActive.wrongRowModel');\n }\n }\n };\n ColumnModel.prototype.orderGridColsLike = function (colsOrder) {\n if (missing(colsOrder)) {\n return;\n }\n var lastOrderMapped = convertToMap(colsOrder.map(function (col, index) { return [col, index]; }));\n // only do the sort if at least one column is accounted for. columns will be not accounted for\n // if changing from secondary to primary columns\n var noColsFound = true;\n this.gridColumns.forEach(function (col) {\n if (lastOrderMapped.has(col)) {\n noColsFound = false;\n }\n });\n if (noColsFound) {\n return;\n }\n // order cols in the same order as before. we need to make sure that all\n // cols still exists, so filter out any that no longer exist.\n var gridColsMap = convertToMap(this.gridColumns.map(function (col) { return [col, true]; }));\n var oldColsOrdered = colsOrder.filter(function (col) { return gridColsMap.has(col); });\n var oldColsMap = convertToMap(oldColsOrdered.map(function (col) { return [col, true]; }));\n var newColsOrdered = this.gridColumns.filter(function (col) { return !oldColsMap.has(col); });\n // add in the new columns, at the end (if no group), or at the end of the group (if a group)\n var newGridColumns = oldColsOrdered.slice();\n newColsOrdered.forEach(function (newCol) {\n var parent = newCol.getOriginalParent();\n // if no parent, means we are not grouping, so just add the column to the end\n if (!parent) {\n newGridColumns.push(newCol);\n return;\n }\n // find the group the column belongs to. if no siblings at the current level (eg col in group on it's\n // own) then go up one level and look for siblings there.\n var siblings = [];\n while (!siblings.length && parent) {\n var leafCols = parent.getLeafColumns();\n leafCols.forEach(function (leafCol) {\n var presentInNewGriColumns = newGridColumns.indexOf(leafCol) >= 0;\n var noYetInSiblings = siblings.indexOf(leafCol) < 0;\n if (presentInNewGriColumns && noYetInSiblings) {\n siblings.push(leafCol);\n }\n });\n parent = parent.getOriginalParent();\n }\n // if no siblings exist at any level, this means the col is in a group (or parent groups) on it's own\n if (!siblings.length) {\n newGridColumns.push(newCol);\n return;\n }\n // find index of last column in the group\n var indexes = siblings.map(function (col) { return newGridColumns.indexOf(col); });\n var lastIndex = Math.max.apply(Math, __spread(indexes));\n insertIntoArray(newGridColumns, newCol, lastIndex + 1);\n });\n this.gridColumns = newGridColumns;\n };\n ColumnModel.prototype.isPrimaryColumnGroupsPresent = function () {\n return this.primaryHeaderRowCount > 1;\n };\n // if we are using autoGroupCols, then they should be included for quick filter. this covers the\n // following scenarios:\n // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on\n // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this\n // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping)\n ColumnModel.prototype.setupQuickFilterColumns = function () {\n if (this.groupAutoColumns) {\n this.columnsForQuickFilter = (this.primaryColumns || []).concat(this.groupAutoColumns);\n }\n else if (this.primaryColumns) {\n this.columnsForQuickFilter = this.primaryColumns;\n }\n };\n ColumnModel.prototype.placeLockedColumns = function (cols) {\n var left = [];\n var normal = [];\n var right = [];\n cols.forEach(function (col) {\n var position = col.getColDef().lockPosition;\n if (position === 'right') {\n right.push(col);\n }\n else if (position === 'left' || position === true) {\n left.push(col);\n }\n else {\n normal.push(col);\n }\n });\n return __spread(left, normal, right);\n };\n ColumnModel.prototype.addAutoGroupToGridColumns = function () {\n if (missing(this.groupAutoColumns)) {\n return;\n }\n this.gridColumns = this.groupAutoColumns ? this.groupAutoColumns.concat(this.gridColumns) : this.gridColumns;\n var autoColBalancedTree = this.columnFactory.createForAutoGroups(this.groupAutoColumns, this.gridBalancedTree);\n this.gridBalancedTree = autoColBalancedTree.concat(this.gridBalancedTree);\n };\n // gets called after we copy down grid columns, to make sure any part of the gui\n // that tries to draw, eg the header, it will get empty lists of columns rather\n // than stale columns. for example, the header will received gridColumnsChanged\n // event, so will try and draw, but it will draw successfully when it acts on the\n // virtualColumnsChanged event\n ColumnModel.prototype.clearDisplayedAndViewportColumns = function () {\n this.viewportRowLeft = {};\n this.viewportRowRight = {};\n this.viewportRowCenter = {};\n this.displayedColumnsLeft = [];\n this.displayedColumnsRight = [];\n this.displayedColumnsCenter = [];\n this.displayedColumns = [];\n this.viewportColumns = [];\n this.headerViewportColumns = [];\n this.viewportColumnsHash = '';\n };\n ColumnModel.prototype.updateGroupsAndDisplayedColumns = function (source) {\n this.updateOpenClosedVisibilityInColumnGroups();\n this.deriveDisplayedColumns(source);\n this.refreshFlexedColumns();\n this.extractViewport();\n this.updateBodyWidths();\n // this event is picked up by the gui, headerRenderer and rowRenderer, to recalculate what columns to display\n var event = {\n type: Events.EVENT_DISPLAYED_COLUMNS_CHANGED\n };\n this.eventService.dispatchEvent(event);\n };\n ColumnModel.prototype.deriveDisplayedColumns = function (source) {\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft, this.displayedColumnsLeft);\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre, this.displayedColumnsCenter);\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight, this.displayedColumnsRight);\n this.joinDisplayedColumns();\n this.setLeftValues(source);\n this.displayedAutoHeightCols = this.displayedColumns.filter(function (col) { return col.isAutoHeight(); });\n };\n ColumnModel.prototype.isAutoRowHeightActive = function () {\n return this.autoHeightActive;\n };\n ColumnModel.prototype.wasAutoRowHeightEverActive = function () {\n return this.autoHeightActiveAtLeastOnce;\n };\n ColumnModel.prototype.joinDisplayedColumns = function () {\n if (this.gridOptionsWrapper.isEnableRtl()) {\n this.displayedColumns = this.displayedColumnsRight\n .concat(this.displayedColumnsCenter)\n .concat(this.displayedColumnsLeft);\n }\n else {\n this.displayedColumns = this.displayedColumnsLeft\n .concat(this.displayedColumnsCenter)\n .concat(this.displayedColumnsRight);\n }\n };\n // sets the left pixel position of each column\n ColumnModel.prototype.setLeftValues = function (source) {\n this.setLeftValuesOfColumns(source);\n this.setLeftValuesOfGroups();\n };\n ColumnModel.prototype.setLeftValuesOfColumns = function (source) {\n var _this = this;\n if (!this.primaryColumns) {\n return;\n }\n // go through each list of displayed columns\n var allColumns = this.primaryColumns.slice(0);\n // let totalColumnWidth = this.getWidthOfColsInList()\n var doingRtl = this.gridOptionsWrapper.isEnableRtl();\n [\n this.displayedColumnsLeft,\n this.displayedColumnsRight,\n this.displayedColumnsCenter\n ].forEach(function (columns) {\n if (doingRtl) {\n // when doing RTL, we start at the top most pixel (ie RHS) and work backwards\n var left_1 = _this.getWidthOfColsInList(columns);\n columns.forEach(function (column) {\n left_1 -= column.getActualWidth();\n column.setLeft(left_1, source);\n });\n }\n else {\n // otherwise normal LTR, we start at zero\n var left_2 = 0;\n columns.forEach(function (column) {\n column.setLeft(left_2, source);\n left_2 += column.getActualWidth();\n });\n }\n removeAllFromArray(allColumns, columns);\n });\n // items left in allColumns are columns not displayed, so remove the left position. this is\n // important for the rows, as if a col is made visible, then taken out, then made visible again,\n // we don't want the animation of the cell floating in from the old position, whatever that was.\n allColumns.forEach(function (column) {\n column.setLeft(null, source);\n });\n };\n ColumnModel.prototype.setLeftValuesOfGroups = function () {\n // a groups left value is the lest left value of it's children\n [\n this.displayedTreeLeft,\n this.displayedTreeRight,\n this.displayedTreeCentre\n ].forEach(function (columns) {\n columns.forEach(function (column) {\n if (column instanceof ColumnGroup) {\n var columnGroup = column;\n columnGroup.checkLeft();\n }\n });\n });\n };\n ColumnModel.prototype.derivedDisplayedColumnsFromDisplayedTree = function (tree, columns) {\n columns.length = 0;\n this.columnUtils.depthFirstDisplayedColumnTreeSearch(tree, function (child) {\n if (child instanceof Column) {\n columns.push(child);\n }\n });\n };\n ColumnModel.prototype.extractViewportColumns = function () {\n if (this.suppressColumnVirtualisation) {\n // no virtualisation, so don't filter\n this.viewportColumnsCenter = this.displayedColumnsCenter;\n this.headerViewportColumnsCenter = this.displayedColumnsCenter;\n }\n else {\n // filter out what should be visible\n this.viewportColumnsCenter = this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this));\n this.headerViewportColumnsCenter = this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this));\n }\n this.viewportColumns = this.viewportColumnsCenter\n .concat(this.displayedColumnsLeft)\n .concat(this.displayedColumnsRight);\n this.headerViewportColumns = this.headerViewportColumnsCenter\n .concat(this.displayedColumnsLeft)\n .concat(this.displayedColumnsRight);\n };\n ColumnModel.prototype.getVirtualHeaderGroupRow = function (type, dept) {\n var result;\n switch (type) {\n case Constants.PINNED_LEFT:\n result = this.viewportRowLeft[dept];\n break;\n case Constants.PINNED_RIGHT:\n result = this.viewportRowRight[dept];\n break;\n default:\n result = this.viewportRowCenter[dept];\n break;\n }\n if (missing(result)) {\n result = [];\n }\n return result;\n };\n ColumnModel.prototype.calculateHeaderRows = function () {\n // go through each group, see if any of it's cols are displayed, and if yes,\n // then this group is included\n this.viewportRowLeft = {};\n this.viewportRowRight = {};\n this.viewportRowCenter = {};\n // for easy lookup when building the groups.\n var virtualColIds = {};\n this.headerViewportColumns.forEach(function (col) { return virtualColIds[col.getId()] = true; });\n var testGroup = function (children, result, dept) {\n var returnValue = false;\n for (var i = 0; i < children.length; i++) {\n // see if this item is within viewport\n var child = children[i];\n var addThisItem = false;\n if (child instanceof Column) {\n // for column, test if column is included\n addThisItem = virtualColIds[child.getId()] === true;\n }\n else {\n // if group, base decision on children\n var columnGroup = child;\n var displayedChildren = columnGroup.getDisplayedChildren();\n if (displayedChildren) {\n addThisItem = testGroup(displayedChildren, result, dept + 1);\n }\n }\n if (addThisItem) {\n returnValue = true;\n if (!result[dept]) {\n result[dept] = [];\n }\n result[dept].push(child);\n }\n }\n return returnValue;\n };\n testGroup(this.displayedTreeLeft, this.viewportRowLeft, 0);\n testGroup(this.displayedTreeRight, this.viewportRowRight, 0);\n testGroup(this.displayedTreeCentre, this.viewportRowCenter, 0);\n };\n ColumnModel.prototype.extractViewport = function () {\n var hashColumn = function (c) { return c.getId() + \"-\" + (c.getPinned() || 'normal'); };\n this.extractViewportColumns();\n var newHash = this.viewportColumns.map(hashColumn).join('#');\n var changed = this.viewportColumnsHash !== newHash;\n if (changed) {\n this.viewportColumnsHash = newHash;\n this.calculateHeaderRows();\n }\n return changed;\n };\n ColumnModel.prototype.refreshFlexedColumns = function (params) {\n var _this = this;\n if (params === void 0) { params = {}; }\n var source = params.source ? params.source : 'flex';\n if (params.viewportWidth != null) {\n this.flexViewportWidth = params.viewportWidth;\n }\n if (!this.flexViewportWidth) {\n return [];\n }\n // If the grid has left-over space, divide it between flexing columns in proportion to their flex value.\n // A \"flexing column\" is one that has a 'flex' value set and is not currently being constrained by its\n // minWidth or maxWidth rules.\n var flexAfterDisplayIndex = -1;\n if (params.resizingCols) {\n params.resizingCols.forEach(function (col) {\n var indexOfCol = _this.displayedColumnsCenter.indexOf(col);\n if (flexAfterDisplayIndex < indexOfCol) {\n flexAfterDisplayIndex = indexOfCol;\n }\n });\n }\n var isColFlex = function (col) {\n var afterResizingCols = _this.displayedColumnsCenter.indexOf(col) > flexAfterDisplayIndex;\n return col.getFlex() && afterResizingCols;\n };\n var knownWidthColumns = this.displayedColumnsCenter.filter(function (col) { return !isColFlex(col); });\n var flexingColumns = this.displayedColumnsCenter.filter(function (col) { return isColFlex(col); });\n var changedColumns = [];\n if (!flexingColumns.length) {\n return [];\n }\n var flexingColumnSizes = [];\n var spaceForFlexingColumns;\n outer: while (true) {\n var totalFlex = flexingColumns.reduce(function (count, col) { return count + col.getFlex(); }, 0);\n spaceForFlexingColumns = this.flexViewportWidth - this.getWidthOfColsInList(knownWidthColumns);\n for (var i = 0; i < flexingColumns.length; i++) {\n var col = flexingColumns[i];\n var widthByFlexRule = spaceForFlexingColumns * col.getFlex() / totalFlex;\n var constrainedWidth = 0;\n var minWidth = col.getMinWidth();\n var maxWidth = col.getMaxWidth();\n if (exists(minWidth) && widthByFlexRule < minWidth) {\n constrainedWidth = minWidth;\n }\n else if (exists(maxWidth) && widthByFlexRule > maxWidth) {\n constrainedWidth = maxWidth;\n }\n if (constrainedWidth) {\n // This column is not in fact flexing as it is being constrained to a specific size\n // so remove it from the list of flexing columns and start again\n col.setActualWidth(constrainedWidth, source);\n removeFromArray(flexingColumns, col);\n changedColumns.push(col);\n knownWidthColumns.push(col);\n continue outer;\n }\n flexingColumnSizes[i] = Math.round(widthByFlexRule);\n }\n break;\n }\n var remainingSpace = spaceForFlexingColumns;\n flexingColumns.forEach(function (col, i) {\n col.setActualWidth(Math.min(flexingColumnSizes[i], remainingSpace), source);\n changedColumns.push(col);\n remainingSpace -= flexingColumnSizes[i];\n });\n if (!params.skipSetLeft) {\n this.setLeftValues(source);\n }\n if (params.updateBodyWidths) {\n this.updateBodyWidths();\n }\n if (params.fireResizedEvent) {\n this.fireColumnResizedEvent(changedColumns, true, source, flexingColumns);\n }\n // if the user sets rowData directly into GridOptions, then the row data is set before\n // grid is attached to the DOM. this means the columns are not flexed, and then the rows\n // have the wrong height (as they depend on column widths). so once the columns have\n // been flexed for the first time (only happens once grid is attached to DOM, as dependency\n // on getting the grid width, which only happens after attached after ResizeObserver fires)\n // we get get rows to re-calc their heights.\n if (!this.flexColsCalculatedAtLestOnce) {\n if (this.gridOptionsWrapper.isRowModelDefault()) {\n this.rowModel.resetRowHeights();\n }\n this.flexColsCalculatedAtLestOnce = true;\n }\n return flexingColumns;\n };\n // called from api\n ColumnModel.prototype.sizeColumnsToFit = function (gridWidth, source, silent, params) {\n if (source === void 0) { source = \"sizeColumnsToFit\"; }\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n var limitsMap = {};\n if (params) {\n (_b = (_a = params) === null || _a === void 0 ? void 0 : _a.columnLimits) === null || _b === void 0 ? void 0 : _b.forEach(function (_a) {\n var key = _a.key, dimensions = __rest(_a, [\"key\"]);\n limitsMap[typeof key === 'string' ? key : key.getColId()] = dimensions;\n });\n }\n // avoid divide by zero\n var allDisplayedColumns = this.getAllDisplayedColumns();\n var doColumnsAlreadyFit = gridWidth === this.getWidthOfColsInList(allDisplayedColumns);\n if (gridWidth <= 0 || !allDisplayedColumns.length || doColumnsAlreadyFit) {\n return;\n }\n var colsToSpread = [];\n var colsToNotSpread = [];\n allDisplayedColumns.forEach(function (column) {\n if (column.getColDef().suppressSizeToFit === true) {\n colsToNotSpread.push(column);\n }\n else {\n colsToSpread.push(column);\n }\n });\n // make a copy of the cols that are going to be resized\n var colsToFireEventFor = colsToSpread.slice(0);\n var finishedResizing = false;\n var moveToNotSpread = function (column) {\n removeFromArray(colsToSpread, column);\n colsToNotSpread.push(column);\n };\n // resetting cols to their original width makes the sizeColumnsToFit more deterministic,\n // rather than depending on the current size of the columns. most users call sizeColumnsToFit\n // immediately after grid is created, so will make no difference. however if application is calling\n // sizeColumnsToFit repeatedly (eg after column group is opened / closed repeatedly) we don't want\n // the columns to start shrinking / growing over time.\n //\n // NOTE: the process below will assign values to `this.actualWidth` of each column without firing events\n // for this reason we need to manually fire resize events after the resize has been done for each column.\n colsToSpread.forEach(function (column) { return column.resetActualWidth(source); });\n while (!finishedResizing) {\n finishedResizing = true;\n var availablePixels = gridWidth - this.getWidthOfColsInList(colsToNotSpread);\n if (availablePixels <= 0) {\n // no width, set everything to minimum\n colsToSpread.forEach(function (column) {\n var _a, _b, _c, _d;\n var widthOverride = (_c = (_b = (_a = limitsMap) === null || _a === void 0 ? void 0 : _a[column.getId()]) === null || _b === void 0 ? void 0 : _b.minWidth, (_c !== null && _c !== void 0 ? _c : (_d = params) === null || _d === void 0 ? void 0 : _d.defaultMinWidth));\n if (typeof widthOverride === 'number') {\n column.setActualWidth(widthOverride);\n return;\n }\n column.setMinimum(source);\n });\n }\n else {\n var scale = availablePixels / this.getWidthOfColsInList(colsToSpread);\n // we set the pixels for the last col based on what's left, as otherwise\n // we could be a pixel or two short or extra because of rounding errors.\n var pixelsForLastCol = availablePixels;\n // backwards through loop, as we are removing items as we go\n for (var i = colsToSpread.length - 1; i >= 0; i--) {\n var column = colsToSpread[i];\n var widthOverride = (_c = limitsMap) === null || _c === void 0 ? void 0 : _c[column.getId()];\n var minOverride = (_e = (_d = widthOverride) === null || _d === void 0 ? void 0 : _d.minWidth, (_e !== null && _e !== void 0 ? _e : (_f = params) === null || _f === void 0 ? void 0 : _f.defaultMinWidth));\n var maxOverride = (_h = (_g = widthOverride) === null || _g === void 0 ? void 0 : _g.maxWidth, (_h !== null && _h !== void 0 ? _h : (_j = params) === null || _j === void 0 ? void 0 : _j.defaultMaxWidth));\n var colMinWidth = (_k = column.getMinWidth(), (_k !== null && _k !== void 0 ? _k : 0));\n var colMaxWidth = (_l = column.getMaxWidth(), (_l !== null && _l !== void 0 ? _l : Number.MAX_VALUE));\n var minWidth = typeof minOverride === 'number' && minOverride > colMinWidth ? minOverride : column.getMinWidth();\n var maxWidth = typeof maxOverride === 'number' && maxOverride < colMaxWidth ? maxOverride : column.getMaxWidth();\n var newWidth = Math.round(column.getActualWidth() * scale);\n if (exists(minWidth) && newWidth < minWidth) {\n newWidth = minWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n }\n else if (exists(maxWidth) && newWidth > maxWidth) {\n newWidth = maxWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n }\n else if (i === 0) { // if this is the last column\n newWidth = pixelsForLastCol;\n }\n column.setActualWidth(newWidth, source, true);\n pixelsForLastCol -= newWidth;\n }\n }\n }\n // see notes above\n colsToFireEventFor.forEach(function (col) {\n col.fireColumnWidthChangedEvent(source);\n });\n this.setLeftValues(source);\n this.updateBodyWidths();\n if (silent) {\n return;\n }\n this.fireColumnResizedEvent(colsToFireEventFor, true, source);\n };\n ColumnModel.prototype.buildDisplayedTrees = function (visibleColumns) {\n var leftVisibleColumns = [];\n var rightVisibleColumns = [];\n var centerVisibleColumns = [];\n visibleColumns.forEach(function (column) {\n switch (column.getPinned()) {\n case \"left\":\n leftVisibleColumns.push(column);\n break;\n case \"right\":\n rightVisibleColumns.push(column);\n break;\n default:\n centerVisibleColumns.push(column);\n break;\n }\n });\n var groupInstanceIdCreator = new GroupInstanceIdCreator();\n this.displayedTreeLeft = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, Constants.PINNED_LEFT, this.displayedTreeLeft);\n this.displayedTreeRight = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, Constants.PINNED_RIGHT, this.displayedTreeRight);\n this.displayedTreeCentre = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, null, this.displayedTreeCentre);\n this.updateDisplayedMap();\n };\n ColumnModel.prototype.updateDisplayedMap = function () {\n var _this = this;\n this.displayedColumnsAndGroupsMap = {};\n var func = function (child) {\n _this.displayedColumnsAndGroupsMap[child.getUniqueId()] = child;\n };\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre, func);\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft, func);\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight, func);\n };\n ColumnModel.prototype.isDisplayed = function (item) {\n var fromMap = this.displayedColumnsAndGroupsMap[item.getUniqueId()];\n // check for reference, in case new column / group with same id is now present\n return fromMap === item;\n };\n ColumnModel.prototype.updateOpenClosedVisibilityInColumnGroups = function () {\n var allColumnGroups = this.getAllDisplayedTrees();\n this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) {\n if (child instanceof ColumnGroup) {\n var columnGroup = child;\n columnGroup.calculateDisplayedColumns();\n }\n });\n };\n ColumnModel.prototype.getGroupAutoColumns = function () {\n return this.groupAutoColumns;\n };\n /**\n * Creates new auto group columns if required\n * @returns whether auto cols have changed\n */\n ColumnModel.prototype.createGroupAutoColumnsIfNeeded = function () {\n if (!this.autoGroupsNeedBuilding) {\n return false;\n }\n this.autoGroupsNeedBuilding = false;\n var groupFullWidthRow = this.gridOptionsWrapper.isGroupUseEntireRow(this.pivotMode);\n // we need to allow suppressing auto-column separately for group and pivot as the normal situation\n // is CSRM and user provides group column themselves for normal view, but when they go into pivot the\n // columns are generated by the grid so no opportunity for user to provide group column. so need a way\n // to suppress auto-col for grouping only, and not pivot.\n // however if using Viewport RM or SSRM and user is providing the columns, the user may wish full control\n // of the group column in this instance.\n var suppressAutoColumn = this.pivotMode ?\n this.gridOptionsWrapper.isPivotSuppressAutoColumn() : this.gridOptionsWrapper.isGroupSuppressAutoColumn();\n var groupingActive = this.rowGroupColumns.length > 0 || this.usingTreeData;\n var needAutoColumns = groupingActive && !suppressAutoColumn && !groupFullWidthRow;\n if (needAutoColumns) {\n var existingCols = this.groupAutoColumns || [];\n var newAutoGroupCols = this.autoGroupColService.createAutoGroupColumns(existingCols, this.rowGroupColumns);\n var autoColsDifferent = !this.autoColsEqual(newAutoGroupCols, this.groupAutoColumns);\n // we force recreate when suppressColumnStateEvents changes, so new group cols pick up the new\n // definitions. otherwise we could ignore the new cols because they appear to be the same.\n if (autoColsDifferent || this.forceRecreateAutoGroups) {\n this.groupAutoColumns = newAutoGroupCols;\n return true;\n }\n }\n else {\n this.groupAutoColumns = null;\n }\n return false;\n };\n ColumnModel.prototype.autoColsEqual = function (colsA, colsB) {\n return areEqual(colsA, colsB, function (a, b) { return a.getColId() === b.getColId(); });\n };\n ColumnModel.prototype.getWidthOfColsInList = function (columnList) {\n return columnList.reduce(function (width, col) { return width + col.getActualWidth(); }, 0);\n };\n ColumnModel.prototype.getGridBalancedTree = function () {\n return this.gridBalancedTree;\n };\n ColumnModel.prototype.hasFloatingFilters = function () {\n if (!this.gridColumns) {\n return false;\n }\n var res = this.gridColumns.some(function (col) { return col.getColDef().floatingFilter; });\n return res;\n };\n ColumnModel.prototype.getFirstDisplayedColumn = function () {\n var isRtl = this.gridOptionsWrapper.isEnableRtl();\n var queryOrder = [\n 'getDisplayedLeftColumns',\n 'getDisplayedCenterColumns',\n 'getDisplayedRightColumns'\n ];\n if (isRtl) {\n queryOrder.reverse();\n }\n for (var i = 0; i < queryOrder.length; i++) {\n var container = this[queryOrder[i]]();\n if (container.length) {\n return isRtl ? last(container) : container[0];\n }\n }\n return null;\n };\n ColumnModel.prototype.setColumnHeaderHeight = function (col, height) {\n var changed = col.setAutoHeaderHeight(height);\n if (changed) {\n var event_5 = {\n type: Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,\n column: col,\n columns: [col],\n source: 'autosizeColumnHeaderHeight',\n };\n this.eventService.dispatchEvent(event_5);\n }\n };\n ColumnModel.prototype.getColumnGroupHeaderRowHeight = function () {\n if (this.isPivotMode()) {\n return this.gridOptionsWrapper.getPivotGroupHeaderHeight();\n }\n else {\n return this.gridOptionsWrapper.getGroupHeaderHeight();\n }\n };\n ColumnModel.prototype.getColumnHeaderRowHeight = function () {\n var defaultHeight = (this.isPivotMode() ?\n this.gridOptionsWrapper.getPivotHeaderHeight() :\n this.gridOptionsWrapper.getHeaderHeight());\n var displayedHeights = this.getAllDisplayedColumns()\n .filter(function (col) { return col.isAutoHeaderHeight(); })\n .map(function (col) { return col.getAutoHeaderHeight() || 0; });\n return Math.max.apply(Math, __spread([defaultHeight], displayedHeights));\n };\n __decorate([\n Autowired('expressionService')\n ], ColumnModel.prototype, \"expressionService\", void 0);\n __decorate([\n Autowired('columnFactory')\n ], ColumnModel.prototype, \"columnFactory\", void 0);\n __decorate([\n Autowired('displayedGroupCreator')\n ], ColumnModel.prototype, \"displayedGroupCreator\", void 0);\n __decorate([\n Autowired('ctrlsService')\n ], ColumnModel.prototype, \"ctrlsService\", void 0);\n __decorate([\n Autowired('autoWidthCalculator')\n ], ColumnModel.prototype, \"autoWidthCalculator\", void 0);\n __decorate([\n Autowired('columnUtils')\n ], ColumnModel.prototype, \"columnUtils\", void 0);\n __decorate([\n Autowired('columnAnimationService')\n ], ColumnModel.prototype, \"columnAnimationService\", void 0);\n __decorate([\n Autowired('autoGroupColService')\n ], ColumnModel.prototype, \"autoGroupColService\", void 0);\n __decorate([\n Optional('aggFuncService')\n ], ColumnModel.prototype, \"aggFuncService\", void 0);\n __decorate([\n Optional('valueCache')\n ], ColumnModel.prototype, \"valueCache\", void 0);\n __decorate([\n Optional('animationFrameService')\n ], ColumnModel.prototype, \"animationFrameService\", void 0);\n __decorate([\n Autowired('rowModel')\n ], ColumnModel.prototype, \"rowModel\", void 0);\n __decorate([\n Autowired('sortController')\n ], ColumnModel.prototype, \"sortController\", void 0);\n __decorate([\n Autowired('columnDefFactory')\n ], ColumnModel.prototype, \"columnDefFactory\", void 0);\n __decorate([\n PostConstruct\n ], ColumnModel.prototype, \"init\", null);\n __decorate([\n __param(0, Qualifier('loggerFactory'))\n ], ColumnModel.prototype, \"setBeans\", null);\n ColumnModel = __decorate([\n Bean('columnModel')\n ], ColumnModel);\n return ColumnModel;\n}(BeanStub));\nexport { ColumnModel };\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ColumnGroup } from \"../entities/columnGroup\";\nimport { ProvidedColumnGroup } from \"../entities/providedColumnGroup\";\nimport { Bean } from \"../context/context\";\nimport { BeanStub } from \"../context/beanStub\";\nimport { attrToNumber } from \"../utils/generic\";\n// takes in a list of columns, as specified by the column definitions, and returns column groups\nvar ColumnUtils = /** @class */ (function (_super) {\n __extends(ColumnUtils, _super);\n function ColumnUtils() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ColumnUtils.prototype.calculateColMinWidth = function (colDef) {\n return colDef.minWidth != null ? colDef.minWidth : this.gridOptionsWrapper.getMinColWidth();\n };\n ColumnUtils.prototype.calculateColMaxWidth = function (colDef) {\n return colDef.maxWidth != null ? colDef.maxWidth : (this.gridOptionsWrapper.getMaxColWidth() || Number.MAX_SAFE_INTEGER);\n };\n ColumnUtils.prototype.calculateColInitialWidth = function (colDef) {\n var minColWidth = this.calculateColMinWidth(colDef);\n var maxColWidth = this.calculateColMaxWidth(colDef);\n var width;\n var colDefWidth = attrToNumber(colDef.width);\n var colDefInitialWidth = attrToNumber(colDef.initialWidth);\n if (colDefWidth != null) {\n width = colDefWidth;\n }\n else if (colDefInitialWidth != null) {\n width = colDefInitialWidth;\n }\n else {\n width = this.gridOptionsWrapper.getColWidth();\n }\n return Math.max(Math.min(width, maxColWidth), minColWidth);\n };\n ColumnUtils.prototype.getOriginalPathForColumn = function (column, originalBalancedTree) {\n var result = [];\n var found = false;\n var recursePath = function (balancedColumnTree, dept) {\n for (var i = 0; i < balancedColumnTree.length; i++) {\n if (found) {\n return;\n }\n // quit the search, so 'result' is kept with the found result\n var node = balancedColumnTree[i];\n if (node instanceof ProvidedColumnGroup) {\n var nextNode = node;\n recursePath(nextNode.getChildren(), dept + 1);\n result[dept] = node;\n }\n else if (node === column) {\n found = true;\n }\n }\n };\n recursePath(originalBalancedTree, 0);\n // we should always find the path, but in case there is a bug somewhere, returning null\n // will make it fail rather than provide a 'hard to track down' bug\n return found ? result : null;\n };\n ColumnUtils.prototype.depthFirstOriginalTreeSearch = function (parent, tree, callback) {\n var _this = this;\n if (!tree) {\n return;\n }\n tree.forEach(function (child) {\n if (child instanceof ProvidedColumnGroup) {\n _this.depthFirstOriginalTreeSearch(child, child.getChildren(), callback);\n }\n callback(child, parent);\n });\n };\n ColumnUtils.prototype.depthFirstAllColumnTreeSearch = function (tree, callback) {\n var _this = this;\n if (!tree) {\n return;\n }\n tree.forEach(function (child) {\n if (child instanceof ColumnGroup) {\n _this.depthFirstAllColumnTreeSearch(child.getChildren(), callback);\n }\n callback(child);\n });\n };\n ColumnUtils.prototype.depthFirstDisplayedColumnTreeSearch = function (tree, callback) {\n var _this = this;\n if (!tree) {\n return;\n }\n tree.forEach(function (child) {\n if (child instanceof ColumnGroup) {\n _this.depthFirstDisplayedColumnTreeSearch(child.getDisplayedChildren(), callback);\n }\n callback(child);\n });\n };\n ColumnUtils = __decorate([\n Bean('columnUtils')\n ], ColumnUtils);\n return ColumnUtils;\n}(BeanStub));\nexport { ColumnUtils };\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ColumnGroup } from \"../entities/columnGroup\";\nimport { ProvidedColumnGroup } from \"../entities/providedColumnGroup\";\nimport { Bean } from \"../context/context\";\nimport { BeanStub } from \"../context/beanStub\";\nimport { last } from \"../utils/array\";\nimport { exists } from \"../utils/generic\";\n// takes in a list of columns, as specified by the column definitions, and returns column groups\nvar DisplayedGroupCreator = /** @class */ (function (_super) {\n __extends(DisplayedGroupCreator, _super);\n function DisplayedGroupCreator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DisplayedGroupCreator.prototype.createDisplayedGroups = function (\n // all displayed columns sorted - this is the columns the grid should show\n sortedVisibleColumns, \n // the tree of columns, as provided by the users, used to know what groups columns roll up into\n balancedColumnTree, \n // creates unique id's for the group\n groupInstanceIdCreator, \n // whether it's left, right or center col\n pinned, \n // we try to reuse old groups if we can, to allow gui to do animation\n oldDisplayedGroups) {\n var _this = this;\n var result = [];\n var previousRealPath;\n var previousOriginalPath;\n var oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);\n // go through each column, then do a bottom up comparison to the previous column, and start\n // to share groups if they converge at any point.\n sortedVisibleColumns.forEach(function (currentColumn) {\n var currentOriginalPath = _this.getOriginalPathForColumn(balancedColumnTree, currentColumn);\n var currentRealPath = [];\n var firstColumn = !previousOriginalPath;\n for (var i = 0; i < currentOriginalPath.length; i++) {\n if (firstColumn || currentOriginalPath[i] !== previousOriginalPath[i]) {\n // new group needed\n var newGroup = _this.createColumnGroup(currentOriginalPath[i], groupInstanceIdCreator, oldColumnsMapped, pinned);\n currentRealPath[i] = newGroup;\n // if top level, add to result, otherwise add to parent\n if (i == 0) {\n result.push(newGroup);\n }\n else {\n currentRealPath[i - 1].addChild(newGroup);\n }\n }\n else {\n // reuse old group\n currentRealPath[i] = previousRealPath[i];\n }\n }\n var noColumnGroups = currentRealPath.length === 0;\n if (noColumnGroups) {\n // if we are not grouping, then the result of the above is an empty\n // path (no groups), and we just add the column to the root list.\n result.push(currentColumn);\n }\n else {\n var leafGroup = last(currentRealPath);\n leafGroup.addChild(currentColumn);\n }\n previousRealPath = currentRealPath;\n previousOriginalPath = currentOriginalPath;\n });\n this.setupParentsIntoColumns(result, null);\n return result;\n };\n DisplayedGroupCreator.prototype.createColumnGroup = function (providedGroup, groupInstanceIdCreator, oldColumnsMapped, pinned) {\n var groupId = providedGroup.getGroupId();\n var instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);\n var uniqueId = ColumnGroup.createUniqueId(groupId, instanceId);\n var columnGroup = oldColumnsMapped[uniqueId];\n // if the user is setting new colDefs, it is possible that the id's overlap, and we\n // would have a false match from above. so we double check we are talking about the\n // same original column group.\n if (columnGroup && columnGroup.getProvidedColumnGroup() !== providedGroup) {\n columnGroup = null;\n }\n if (exists(columnGroup)) {\n // clean out the old column group here, as we will be adding children into it again\n columnGroup.reset();\n }\n else {\n columnGroup = new ColumnGroup(providedGroup, groupId, instanceId, pinned);\n this.context.createBean(columnGroup);\n }\n return columnGroup;\n };\n // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup\n DisplayedGroupCreator.prototype.mapOldGroupsById = function (displayedGroups) {\n var result = {};\n var recursive = function (columnsOrGroups) {\n columnsOrGroups.forEach(function (columnOrGroup) {\n if (columnOrGroup instanceof ColumnGroup) {\n var columnGroup = columnOrGroup;\n result[columnOrGroup.getUniqueId()] = columnGroup;\n recursive(columnGroup.getChildren());\n }\n });\n };\n if (displayedGroups) {\n recursive(displayedGroups);\n }\n return result;\n };\n DisplayedGroupCreator.prototype.setupParentsIntoColumns = function (columnsOrGroups, parent) {\n var _this = this;\n columnsOrGroups.forEach(function (columnsOrGroup) {\n columnsOrGroup.setParent(parent);\n if (columnsOrGroup instanceof ColumnGroup) {\n var columnGroup = columnsOrGroup;\n _this.setupParentsIntoColumns(columnGroup.getChildren(), columnGroup);\n }\n });\n };\n DisplayedGroupCreator.prototype.getOriginalPathForColumn = function (balancedColumnTree, column) {\n var result = [];\n var found = false;\n var recursePath = function (columnTree, dept) {\n for (var i = 0; i < columnTree.length; i++) {\n // quit the search, so 'result' is kept with the found result\n if (found) {\n return;\n }\n var node = columnTree[i];\n if (node instanceof ProvidedColumnGroup) {\n recursePath(node.getChildren(), dept + 1);\n result[dept] = node;\n }\n else if (node === column) {\n found = true;\n }\n }\n };\n recursePath(balancedColumnTree, 0);\n // it's possible we didn't find a path. this happens if the column is generated\n // by the grid (auto-group), in that the definition didn't come from the client. in this case,\n // we create a fake original path.\n if (found) {\n return result;\n }\n console.warn('AG Grid: could not get path');\n return null;\n };\n DisplayedGroupCreator = __decorate([\n Bean('displayedGroupCreator')\n ], DisplayedGroupCreator);\n return DisplayedGroupCreator;\n}(BeanStub));\nexport { DisplayedGroupCreator };\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Bean } from \"../context/context\";\nimport { BeanStub } from \"../context/beanStub\";\nvar AgStackComponentsRegistry = /** @class */ (function (_super) {\n __extends(AgStackComponentsRegistry, _super);\n function AgStackComponentsRegistry() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.componentsMappedByName = {};\n return _this;\n }\n AgStackComponentsRegistry.prototype.setupComponents = function (components) {\n var _this = this;\n if (components) {\n components.forEach(function (componentMeta) { return _this.addComponent(componentMeta); });\n }\n };\n AgStackComponentsRegistry.prototype.addComponent = function (componentMeta) {\n // get name of the class as a string\n // let className = getNameOfClass(ComponentClass);\n // insert a dash after every capital letter\n // let classEscaped = className.replace(/([A-Z])/g, \"-$1\").toLowerCase();\n var classEscaped = componentMeta.componentName.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n // put all to upper case\n var classUpperCase = classEscaped.toUpperCase();\n // finally store\n this.componentsMappedByName[classUpperCase] = componentMeta.componentClass;\n };\n AgStackComponentsRegistry.prototype.getComponentClass = function (htmlTag) {\n return this.componentsMappedByName[htmlTag];\n };\n AgStackComponentsRegistry = __decorate([\n Bean('agStackComponentsRegistry')\n ], AgStackComponentsRegistry);\n return AgStackComponentsRegistry;\n}(BeanStub));\nexport { AgStackComponentsRegistry };\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nexport var AgPromiseStatus;\n(function (AgPromiseStatus) {\n AgPromiseStatus[AgPromiseStatus[\"IN_PROGRESS\"] = 0] = \"IN_PROGRESS\";\n AgPromiseStatus[AgPromiseStatus[\"RESOLVED\"] = 1] = \"RESOLVED\";\n})(AgPromiseStatus || (AgPromiseStatus = {}));\nvar AgPromise = /** @class */ (function () {\n function AgPromise(callback) {\n var _this = this;\n this.status = AgPromiseStatus.IN_PROGRESS;\n this.resolution = null;\n this.waiters = [];\n callback(function (value) { return _this.onDone(value); }, function (params) { return _this.onReject(params); });\n }\n AgPromise.all = function (promises) {\n return new AgPromise(function (resolve) {\n var remainingToResolve = promises.length;\n var combinedValues = new Array(remainingToResolve);\n promises.forEach(function (promise, index) {\n promise.then(function (value) {\n combinedValues[index] = value;\n remainingToResolve--;\n if (remainingToResolve === 0) {\n resolve(combinedValues);\n }\n });\n });\n });\n };\n AgPromise.resolve = function (value) {\n if (value === void 0) { value = null; }\n return new AgPromise(function (resolve) { return resolve(value); });\n };\n AgPromise.prototype.then = function (func) {\n var _this = this;\n return new AgPromise(function (resolve) {\n if (_this.status === AgPromiseStatus.RESOLVED) {\n resolve(func(_this.resolution));\n }\n else {\n _this.waiters.push(function (value) { return resolve(func(value)); });\n }\n });\n };\n AgPromise.prototype.resolveNow = function (ifNotResolvedValue, ifResolved) {\n return this.status === AgPromiseStatus.RESOLVED ? ifResolved(this.resolution) : ifNotResolvedValue;\n };\n AgPromise.prototype.onDone = function (value) {\n this.status = AgPromiseStatus.RESOLVED;\n this.resolution = value;\n this.waiters.forEach(function (waiter) { return waiter(value); });\n };\n AgPromise.prototype.onReject = function (params) {\n console.warn('TBI');\n };\n return AgPromise;\n}());\nexport { AgPromise };\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Autowired, PostConstruct } from \"../context/context\";\nimport { BeanStub } from \"../context/beanStub\";\nimport { exists } from \"../utils/generic\";\nimport { isIOSUserAgent } from \"../utils/browser\";\nvar TooltipStates;\n(function (TooltipStates) {\n TooltipStates[TooltipStates[\"NOTHING\"] = 0] = \"NOTHING\";\n TooltipStates[TooltipStates[\"WAITING_TO_SHOW\"] = 1] = \"WAITING_TO_SHOW\";\n TooltipStates[TooltipStates[\"SHOWING\"] = 2] = \"SHOWING\";\n})(TooltipStates || (TooltipStates = {}));\nvar CustomTooltipFeature = /** @class */ (function (_super) {\n __extends(CustomTooltipFeature, _super);\n function CustomTooltipFeature(parentComp) {\n var _this = _super.call(this) || this;\n _this.DEFAULT_SHOW_TOOLTIP_DELAY = 2000;\n _this.DEFAULT_HIDE_TOOLTIP_DELAY = 10000;\n _this.SHOW_QUICK_TOOLTIP_DIFF = 1000;\n _this.FADE_OUT_TOOLTIP_TIMEOUT = 1000;\n _this.state = TooltipStates.NOTHING;\n // when showing the tooltip, we need to make sure it's the most recent instance we request, as due to\n // async we could request two tooltips before the first instance returns, in which case we should\n // disregard the second instance.\n _this.tooltipInstanceCount = 0;\n _this.tooltipMouseTrack = false;\n _this.parentComp = parentComp;\n return _this;\n }\n CustomTooltipFeature.prototype.postConstruct = function () {\n this.tooltipShowDelay = this.gridOptionsWrapper.getTooltipDelay('show') || this.DEFAULT_SHOW_TOOLTIP_DELAY;\n this.tooltipHideDelay = this.gridOptionsWrapper.getTooltipDelay('hide') || this.DEFAULT_HIDE_TOOLTIP_DELAY;\n this.tooltipMouseTrack = this.gridOptionsWrapper.isTooltipMouseTrack();\n var el = this.parentComp.getGui();\n this.addManagedListener(el, 'mouseenter', this.onMouseEnter.bind(this));\n this.addManagedListener(el, 'mouseleave', this.onMouseLeave.bind(this));\n this.addManagedListener(el, 'mousemove', this.onMouseMove.bind(this));\n this.addManagedListener(el, 'mousedown', this.onMouseDown.bind(this));\n this.addManagedListener(el, 'keydown', this.onKeyDown.bind(this));\n };\n CustomTooltipFeature.prototype.destroy = function () {\n // if this component gets destroyed while tooltip is showing, need to make sure\n // we don't end with no mouseLeave event resulting in zombie tooltip\n this.setToDoNothing();\n _super.prototype.destroy.call(this);\n };\n CustomTooltipFeature.prototype.onMouseEnter = function (e) {\n if (isIOSUserAgent()) {\n return;\n }\n // every mouseenter should be following by a mouseleave, however for some unkonwn, it's possible for\n // mouseenter to be called twice in a row, which can happen if editing the cell. this was reported\n // in https://ag-grid.atlassian.net/browse/AG-4422. to get around this, we check the state, and if\n // state is !=nothing, then we know mouseenter was already received.\n if (this.state != TooltipStates.NOTHING) {\n return;\n }\n // if another tooltip was hidden very recently, we only wait 200ms to show, not the normal waiting time\n var delay = this.isLastTooltipHiddenRecently() ? 200 : this.tooltipShowDelay;\n this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay);\n this.lastMouseEvent = e;\n this.state = TooltipStates.WAITING_TO_SHOW;\n };\n CustomTooltipFeature.prototype.onMouseLeave = function () {\n this.setToDoNothing();\n };\n CustomTooltipFeature.prototype.onKeyDown = function () {\n this.setToDoNothing();\n };\n CustomTooltipFeature.prototype.setToDoNothing = function () {\n if (this.state === TooltipStates.SHOWING) {\n this.hideTooltip();\n }\n this.clearTimeouts();\n this.state = TooltipStates.NOTHING;\n };\n CustomTooltipFeature.prototype.onMouseMove = function (e) {\n // there is a delay from the time we mouseOver a component and the time the\n // tooltip is displayed, so we need to track mousemove to be able to correctly\n // position the tooltip when showTooltip is called.\n this.lastMouseEvent = e;\n if (this.tooltipMouseTrack &&\n this.state === TooltipStates.SHOWING &&\n this.tooltipComp) {\n this.positionTooltipUnderLastMouseEvent();\n }\n };\n CustomTooltipFeature.prototype.onMouseDown = function () {\n this.setToDoNothing();\n };\n CustomTooltipFeature.prototype.hideTooltip = function () {\n // check if comp exists - due to async, although we asked for\n // one, the instance may not be back yet\n if (this.tooltipComp) {\n this.destroyTooltipComp();\n CustomTooltipFeature.lastTooltipHideTime = new Date().getTime();\n }\n this.state = TooltipStates.NOTHING;\n };\n CustomTooltipFeature.prototype.destroyTooltipComp = function () {\n var _this = this;\n // add class to fade out the tooltip\n this.tooltipComp.getGui().classList.add('ag-tooltip-hiding');\n // make local copies of these variables, as we use them in the async function below,\n // and we clear then to 'undefined' later, so need to take a copy before they are undefined.\n var tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc;\n var tooltipComp = this.tooltipComp;\n window.setTimeout(function () {\n tooltipPopupDestroyFunc();\n _this.getContext().destroyBean(tooltipComp);\n }, this.FADE_OUT_TOOLTIP_TIMEOUT);\n this.tooltipPopupDestroyFunc = undefined;\n this.tooltipComp = undefined;\n };\n CustomTooltipFeature.prototype.isLastTooltipHiddenRecently = function () {\n // return true if <1000ms since last time we hid a tooltip\n var now = new Date().getTime();\n var then = CustomTooltipFeature.lastTooltipHideTime;\n return (now - then) < this.SHOW_QUICK_TOOLTIP_DIFF;\n };\n CustomTooltipFeature.prototype.showTooltip = function () {\n var params = __assign({}, this.parentComp.getTooltipParams());\n if (!exists(params.value)) {\n this.setToDoNothing();\n return;\n }\n this.state = TooltipStates.SHOWING;\n this.tooltipInstanceCount++;\n // we pass in tooltipInstanceCount so the callback knows what the count was when\n // we requested the tooltip, so if another tooltip was requested in the mean time\n // we disregard it\n var callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount);\n var userDetails = this.userComponentFactory.getTooltipCompDetails(params);\n userDetails.newAgStackInstance().then(callback);\n };\n CustomTooltipFeature.prototype.newTooltipComponentCallback = function (tooltipInstanceCopy, tooltipComp) {\n var compNoLongerNeeded = this.state !== TooltipStates.SHOWING || this.tooltipInstanceCount !== tooltipInstanceCopy;\n if (compNoLongerNeeded) {\n this.getContext().destroyBean(tooltipComp);\n return;\n }\n var eGui = tooltipComp.getGui();\n this.tooltipComp = tooltipComp;\n if (!eGui.classList.contains('ag-tooltip')) {\n eGui.classList.add('ag-tooltip-custom');\n }\n var translate = this.gridOptionsWrapper.getLocaleTextFunc();\n var addPopupRes = this.popupService.addPopup({\n eChild: eGui,\n ariaLabel: translate('ariaLabelTooltip', 'Tooltip')\n });\n if (addPopupRes) {\n this.tooltipPopupDestroyFunc = addPopupRes.hideFunc;\n }\n // this.tooltipPopupDestroyFunc = this.popupService.addPopup(false, eGui, false);\n this.positionTooltipUnderLastMouseEvent();\n this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.tooltipHideDelay);\n };\n CustomTooltipFeature.prototype.positionTooltipUnderLastMouseEvent = function () {\n this.popupService.positionPopupUnderMouseEvent({\n type: 'tooltip',\n mouseEvent: this.lastMouseEvent,\n ePopup: this.tooltipComp.getGui(),\n nudgeY: 18,\n skipObserver: this.tooltipMouseTrack\n });\n };\n CustomTooltipFeature.prototype.clearTimeouts = function () {\n if (this.showTooltipTimeoutId) {\n window.clearTimeout(this.showTooltipTimeoutId);\n this.showTooltipTimeoutId = undefined;\n }\n if (this.hideTooltipTimeoutId) {\n window.clearTimeout(this.hideTooltipTimeoutId);\n this.hideTooltipTimeoutId = undefined;\n }\n };\n __decorate([\n Autowired('popupService')\n ], CustomTooltipFeature.prototype, \"popupService\", void 0);\n __decorate([\n Autowired('userComponentFactory')\n ], CustomTooltipFeature.prototype, \"userComponentFactory\", void 0);\n __decorate([\n Autowired('columnApi')\n ], CustomTooltipFeature.prototype, \"columnApi\", void 0);\n __decorate([\n Autowired('gridApi')\n ], CustomTooltipFeature.prototype, \"gridApi\", void 0);\n __decorate([\n PostConstruct\n ], CustomTooltipFeature.prototype, \"postConstruct\", null);\n return CustomTooltipFeature;\n}(BeanStub));\nexport { CustomTooltipFeature };\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Autowired, PreConstruct } from \"../context/context\";\nimport { BeanStub } from \"../context/beanStub\";\nimport { NumberSequence } from \"../utils\";\nimport { isNodeOrElement, copyNodeList, iterateNamedNodeMap, loadTemplate, setVisible, setDisplayed } from '../utils/dom';\nimport { getFunctionName } from '../utils/function';\nimport { CustomTooltipFeature } from \"./customTooltipFeature\";\nimport { CssClassManager } from \"../rendering/cssClassManager\";\nvar compIdSequence = new NumberSequence();\nvar Component = /** @class */ (function (_super) {\n __extends(Component, _super);\n function Component(template) {\n var _this = _super.call(this) || this;\n // if false, then CSS class \"ag-hidden\" is applied, which sets \"display: none\"\n _this.displayed = true;\n // if false, then CSS class \"ag-invisible\" is applied, which sets \"visibility: hidden\"\n _this.visible = true;\n // unique id for this row component. this is used for getting a reference to the HTML dom.\n // we cannot use the RowNode id as this is not unique (due to animation, old rows can be lying\n // around as we create a new rowComp instance for the same row node).\n _this.compId = compIdSequence.next();\n _this.cssClassManager = new CssClassManager(function () { return _this.eGui; });\n if (template) {\n _this.setTemplate(template);\n }\n return _this;\n }\n Component.prototype.preConstructOnComponent = function () {\n this.usingBrowserTooltips = this.gridOptionsWrapper.isEnableBrowserTooltips();\n };\n Component.prototype.getCompId = function () {\n return this.compId;\n };\n Component.prototype.getTooltipParams = function () {\n return {\n value: this.tooltipText,\n location: 'UNKNOWN'\n };\n };\n Component.prototype.setTooltip = function (newTooltipText) {\n var _this = this;\n var removeTooltip = function () {\n if (_this.usingBrowserTooltips) {\n _this.getGui().removeAttribute('title');\n }\n else {\n _this.tooltipFeature = _this.destroyBean(_this.tooltipFeature);\n }\n };\n var addTooltip = function () {\n if (_this.usingBrowserTooltips) {\n _this.getGui().setAttribute('title', _this.tooltipText);\n }\n else {\n _this.tooltipFeature = _this.createBean(new CustomTooltipFeature(_this));\n }\n };\n if (this.tooltipText != newTooltipText) {\n if (this.tooltipText) {\n removeTooltip();\n }\n if (newTooltipText != null) {\n this.tooltipText = newTooltipText;\n if (this.tooltipText) {\n addTooltip();\n }\n }\n }\n };\n // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag\n Component.prototype.createChildComponentsFromTags = function (parentNode, paramsMap) {\n var _this = this;\n // we MUST take a copy of the list first, as the 'swapComponentForNode' adds comments into the DOM\n // which messes up the traversal order of the children.\n var childNodeList = copyNodeList(parentNode.childNodes);\n childNodeList.forEach(function (childNode) {\n if (!(childNode instanceof HTMLElement)) {\n return;\n }\n var childComp = _this.createComponentFromElement(childNode, function (childComp) {\n // copy over all attributes, including css classes, so any attributes user put on the tag\n // wll be carried across\n var childGui = childComp.getGui();\n if (childGui) {\n _this.copyAttributesFromNode(childNode, childComp.getGui());\n }\n }, paramsMap);\n if (childComp) {\n if (childComp.addItems && childNode.children.length) {\n _this.createChildComponentsFromTags(childNode, paramsMap);\n // converting from HTMLCollection to Array\n var items = Array.prototype.slice.call(childNode.children);\n childComp.addItems(items);\n }\n // replace the tag (eg ag-checkbox) with the proper HTMLElement (eg 'div') in the dom\n _this.swapComponentForNode(childComp, parentNode, childNode);\n }\n else if (childNode.childNodes) {\n _this.createChildComponentsFromTags(childNode, paramsMap);\n }\n });\n };\n Component.prototype.createComponentFromElement = function (element, afterPreCreateCallback, paramsMap) {\n var key = element.nodeName;\n var componentParams = paramsMap ? paramsMap[element.getAttribute('ref')] : undefined;\n var ComponentClass = this.agStackComponentsRegistry.getComponentClass(key);\n if (ComponentClass) {\n Component.elementGettingCreated = element;\n var newComponent = new ComponentClass(componentParams);\n newComponent.setParentComponent(this);\n this.createBean(newComponent, null, afterPreCreateCallback);\n return newComponent;\n }\n return null;\n };\n Component.prototype.copyAttributesFromNode = function (source, dest) {\n iterateNamedNodeMap(source.attributes, function (name, value) { return dest.setAttribute(name, value); });\n };\n Component.prototype.swapComponentForNode = function (newComponent, parentNode, childNode) {\n var eComponent = newComponent.getGui();\n parentNode.replaceChild(eComponent, childNode);\n parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent);\n this.addDestroyFunc(this.destroyBean.bind(this, newComponent));\n this.swapInComponentForQuerySelectors(newComponent, childNode);\n };\n Component.prototype.swapInComponentForQuerySelectors = function (newComponent, childNode) {\n var thisNoType = this;\n this.iterateOverQuerySelectors(function (querySelector) {\n if (thisNoType[querySelector.attributeName] === childNode) {\n thisNoType[querySelector.attributeName] = newComponent;\n }\n });\n };\n Component.prototype.iterateOverQuerySelectors = function (action) {\n var thisPrototype = Object.getPrototypeOf(this);\n while (thisPrototype != null) {\n var metaData = thisPrototype.__agComponentMetaData;\n var currentProtoName = getFunctionName(thisPrototype.constructor);\n if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) {\n metaData[currentProtoName].querySelectors.forEach(function (querySelector) { return action(querySelector); });\n }\n thisPrototype = Object.getPrototypeOf(thisPrototype);\n }\n };\n Component.prototype.setTemplate = function (template, paramsMap) {\n var eGui = loadTemplate(template);\n this.setTemplateFromElement(eGui, paramsMap);\n };\n Component.prototype.setTemplateFromElement = function (element, paramsMap) {\n this.eGui = element;\n this.eGui.__agComponent = this;\n this.wireQuerySelectors();\n // context will not be available when user sets template in constructor\n if (!!this.getContext()) {\n this.createChildComponentsFromTags(this.getGui(), paramsMap);\n }\n };\n Component.prototype.createChildComponentsPreConstruct = function () {\n // ui exists if user sets template in constructor. when this happens, we have to wait for the context\n // to be autoWired first before we can create child components.\n if (!!this.getGui()) {\n this.createChildComponentsFromTags(this.getGui());\n }\n };\n Component.prototype.wireQuerySelectors = function () {\n var _this = this;\n if (!this.eGui) {\n return;\n }\n var thisNoType = this;\n this.iterateOverQuerySelectors(function (querySelector) {\n var setResult = function (result) { return thisNoType[querySelector.attributeName] = result; };\n // if it's a ref selector, and match is on top level component, we return\n // the element. otherwise no way of components putting ref=xxx on the top\n // level element as querySelector only looks at children.\n var topLevelRefMatch = querySelector.refSelector\n && _this.eGui.getAttribute('ref') === querySelector.refSelector;\n if (topLevelRefMatch) {\n setResult(_this.eGui);\n }\n else {\n // otherwise use querySelector, which looks at children\n var resultOfQuery = _this.eGui.querySelector(querySelector.querySelector);\n if (resultOfQuery) {\n setResult(resultOfQuery.__agComponent || resultOfQuery);\n }\n }\n });\n };\n Component.prototype.getGui = function () {\n return this.eGui;\n };\n Component.prototype.getFocusableElement = function () {\n return this.eGui;\n };\n Component.prototype.setParentComponent = function (component) {\n this.parentComponent = component;\n };\n Component.prototype.getParentComponent = function () {\n return this.parentComponent;\n };\n // this method is for older code, that wants to provide the gui element,\n // it is not intended for this to be in ag-Stack\n Component.prototype.setGui = function (eGui) {\n this.eGui = eGui;\n };\n Component.prototype.queryForHtmlElement = function (cssSelector) {\n return this.eGui.querySelector(cssSelector);\n };\n Component.prototype.queryForHtmlInputElement = function (cssSelector) {\n return this.eGui.querySelector(cssSelector);\n };\n Component.prototype.appendChild = function (newChild, container) {\n if (newChild == null) {\n return;\n }\n if (!container) {\n container = this.eGui;\n }\n if (isNodeOrElement(newChild)) {\n container.appendChild(newChild);\n }\n else {\n var childComponent = newChild;\n container.appendChild(childComponent.getGui());\n }\n };\n Component.prototype.isDisplayed = function () {\n return this.displayed;\n };\n Component.prototype.setVisible = function (visible) {\n if (visible !== this.visible) {\n this.visible = visible;\n setVisible(this.eGui, visible);\n }\n };\n Component.prototype.setDisplayed = function (displayed) {\n if (displayed !== this.displayed) {\n this.displayed = displayed;\n setDisplayed(this.eGui, displayed);\n var event_1 = {\n type: Component.EVENT_DISPLAYED_CHANGED,\n visible: this.displayed\n };\n this.dispatchEvent(event_1);\n }\n };\n Component.prototype.destroy = function () {\n if (this.tooltipFeature) {\n this.tooltipFeature = this.destroyBean(this.tooltipFeature);\n }\n _super.prototype.destroy.call(this);\n };\n Component.prototype.addGuiEventListener = function (event, listener) {\n var _this = this;\n this.eGui.addEventListener(event, listener);\n this.addDestroyFunc(function () { return _this.eGui.removeEventListener(event, listener); });\n };\n Component.prototype.addCssClass = function (className) {\n this.cssClassManager.addCssClass(className);\n };\n Component.prototype.removeCssClass = function (className) {\n this.cssClassManager.removeCssClass(className);\n };\n Component.prototype.containsCssClass = function (className) {\n return this.cssClassManager.containsCssClass(className);\n };\n Component.prototype.addOrRemoveCssClass = function (className, addOrRemove) {\n this.cssClassManager.addOrRemoveCssClass(className, addOrRemove);\n };\n Component.prototype.getAttribute = function (key) {\n var eGui = this.eGui;\n return eGui ? eGui.getAttribute(key) : null;\n };\n Component.prototype.getRefElement = function (refName) {\n return this.queryForHtmlElement(\"[ref=\\\"\" + refName + \"\\\"]\");\n };\n Component.EVENT_DISPLAYED_CHANGED = 'displayedChanged';\n __decorate([\n Autowired('agStackComponentsRegistry')\n ], Component.prototype, \"agStackComponentsRegistry\", void 0);\n __decorate([\n PreConstruct\n ], Component.prototype, \"preConstructOnComponent\", null);\n __decorate([\n PreConstruct\n ], Component.prototype, \"createChildComponentsPreConstruct\", null);\n return Component;\n}(BeanStub));\nexport { Component };\n","/**\n * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue\n * @version v28.2.1\n * @link https://www.ag-grid.com/\n * @license MIT\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component } from '../../../widgets/component';\nimport { RefSelector } from '../../../widgets/componentAnnotations';\nimport { Autowired } from '../../../context/context';\n// optional floating filter for user provided filters - instead of providing a floating filter,\n// they can provide a getModelAsString() method on the filter instead. this class just displays\n// the string returned from getModelAsString()\nvar ReadOnlyFloatingFilter = /** @class */ (function (_super) {\n __extends(ReadOnlyFloatingFilter, _super);\n function ReadOnlyFloatingFilter() {\n return _super.call(this, /* html */ \"\\n