ag-grid-community 32.0.0 → 32.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.agGrid=t():e.agGrid=t()}(self,(function(){return function(){var e={886:function(e,t,i){var s,o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(a,{ClientSideRowModelModule:()=>M}),e.exports=(s=a,((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of r(t))l.call(e,a)||a===i||o(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s));var h=i(423),d=i(423),c=i(423),u=class{constructor(e,t,i,s,o,n){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=i,this.funcColsService=s,this.beans=n,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id="ROOT_NODE_ID",this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return(0,c._cloneObject)(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if("string"==typeof e)return void(0,c._warnOnce)("rowData must be an array.");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,i=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map((e=>this.createNode(e,this.rootNode,0))):(t.allLeafChildren=[],t.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=t.childrenAfterFilter,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenAfterAggFilter=t.childrenAfterAggFilter,i.childrenAfterSort=t.childrenAfterSort,i.childrenMapped=t.childrenMapped,i.allLeafChildren=t.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&(0,c._sortRowNodesByOrder)(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const e={type:"selectionChanged",source:t};this.eventService.dispatchEvent(e)}}executeAdd(e,t){const{add:i,addIndex:s}=e;if((0,c._missingOrEmpty)(i))return;const o=i.map((e=>this.createNode(e,this.rootNode,0))),n=this.rootNode.allLeafChildren;if("number"==typeof s&&s>=0){const e=n.length;let t=s;if(this.gos.get("treeData")&&s>0&&e>0)for(let i=0;i<e;i++)if(n[i]?.rowIndex==s-1){t=i+1;break}const i=n.slice(0,t),r=n.slice(t,n.length);this.rootNode.allLeafChildren=[...i,...o,...r]}else this.rootNode.allLeafChildren=[...n,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=n),t.add=o}executeRemove(e,t,i){const{remove:s}=e;if((0,c._missingOrEmpty)(s))return;const o={};s.forEach((e=>{const s=this.lookupRowNode(e);s&&(s.isSelected()&&i.push(s),s.clearRowTopAndRowIndex(),o[s.id]=!0,delete this.allNodesMap[s.id],t.remove.push(s))})),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren?.filter((e=>!o[e.id]))??null,this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,t,i){const{update:s}=e;(0,c._missingOrEmpty)(s)||s.forEach((e=>{const s=this.lookupRowNode(e);s&&(s.updateData(e),!s.selectable&&s.isSelected()&&i.push(s),this.setMasterForRow(s,e,0,!1),t.update.push(s))}))}lookupRowNode(e){const t=this.gos.getRowIdCallback();let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return(0,c._errorOnce)(`could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren?.find((t=>t.data===e)),!i)return(0,c._errorOnce)("could not find data item as object was not found",e),(0,c._errorOnce)("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new c.RowNode(this.beans);return s.group=!1,this.setMasterForRow(s,e,i,!0),t&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&(0,c._warnOnce)(`duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const i=this.gos.get("isRowMaster");i?e.setMaster(i(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const t=this.funcColsService.getRowGroupColumns(),s=i+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(s)}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return-1===t||e<t}},g=class extends d.BeanStub{constructor(){super(...arguments),this.beanName="rowModel",this.onRowHeightChanged_debounced=(0,d._debounce)(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}wireBeans(e){this.beans=e,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.selectionService=e.selectionService,this.valueCache=e.valueCache,this.environment=e.environment,this.filterStage=e.filterStage,this.sortStage=e.sortStage,this.flattenStage=e.flattenStage,this.groupStage=e.groupStage,this.aggregationStage=e.aggregationStage,this.pivotStage=e.pivotStage,this.filterAggregatesStage=e.filterAggregatesStage}postConstruct(){const e=this.refreshModel.bind(this,{step:d.ClientSideRowModelSteps.EVERYTHING}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:d.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedEventListeners({newColumnsLoaded:i,columnRowGroupChanged:e,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:d.ClientSideRowModelSteps.PIVOT}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:e,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this)}),this.addPropertyListeners(),this.rootNode=new d.RowNode(this.beans),this.nodeManager=new u(this.rootNode,this.gos,this.eventService,this.funcColsService,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),n=new Set(["postSortRows","groupDisplayType","accentedSort"]),r=new Set([]),l=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),a=[...e,...t,...i,...s,...s,...o,...n,...r,...l];this.addManagedPropertyListeners(a,(a=>{const h=a.changeSet?.properties;if(!h)return;const c=e=>h.some((t=>e.has(t)));c(e)?this.setRowData(this.rootNode.allLeafChildren.map((e=>e.data))):c(t)?this.refreshModel({step:d.ClientSideRowModelSteps.EVERYTHING}):c(i)?this.refreshModel({step:d.ClientSideRowModelSteps.FILTER}):c(s)?this.refreshModel({step:d.ClientSideRowModelSteps.PIVOT}):c(o)?this.refreshModel({step:d.ClientSideRowModelSteps.AGGREGATE}):c(n)?this.refreshModel({step:d.ClientSideRowModelSteps.SORT}):c(r)?this.refreshModel({step:d.ClientSideRowModelSteps.FILTER_AGGREGATES}):c(l)&&this.refreshModel({step:d.ClientSideRowModelSteps.MAP})})),this.addManagedPropertyListener("rowHeight",(()=>this.resetRowHeights()))}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let o,n=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),l=this.getRowIndexAtPixel(t),a=Math.max(r,i),h=Math.min(l,s);for(let e=a;e<=h;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gos.getRowHeightForNode(t);t.setRowHeight(e.height),o=!0,n=!0}}o&&this.setRowTopAndRowIndex()}while(o);return n}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gos.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const n=this.rowsToDisplay[o];if(null!=n.id&&i.add(n.id),null==n.rowHeight){const t=this.gos.getRowHeightForNode(n,s,e);n.setRowHeight(t.height,t.estimated)}n.setRowTop(t),n.setRowIndex(o),t+=n.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},o=e=>{if(s(e),s(e.detailNode),s(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;i&&!t&&!e.expanded||e.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),n=!this.gos.get("suppressAnimationFrame");return o!==e[0]&&(e.forEach((e=>{(0,d._removeFromArray)(this.rootNode.allLeafChildren,e)})),e.forEach(((e,t)=>{(0,d._insertIntoArray)(this.rootNode.allLeafChildren,e,Math.max(s+i,0)+t)})),this.refreshModel({step:d.ClientSideRowModelSteps.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:n}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,s=null!=i?this.getRow(i):null;if(!s||!e||s===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const o=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(o),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const i=this.getRowIndexAtPixel(e);if(!(t=this.getRow(i||0)))return d.RowHighlightPosition.Below}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?d.RowHighlightPosition.Above:d.RowHighlightPosition.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.sibling?1:0,t=this.rootNode.childrenAfterAggFilter;return(t?t.length:0)+e}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=e;if(this.rowsToDisplay[0].footer){if(0===e)return 0;t-=1}let i=this.rootNode.childrenAfterSort[t];if(this.gos.get("groupHideOpenParents"))for(;i.expanded&&i.childrenAfterSort&&i.childrenAfterSort.length>0;)i=i.childrenAfterSort[0];return i.rowIndex}getRowBounds(e){if((0,d._missing)(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:d.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),i=0===e.columns.length||e.columns.some((e=>e.isPrimary()))?d.ClientSideRowModelSteps.FILTER:d.ClientSideRowModelSteps.FILTER_AGGREGATES;this.refreshModel({step:i,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:d.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:d.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:d.ClientSideRowModelSteps.AGGREGATE})}createChangePath(e){const t=(0,d._missingOrEmpty)(e),i=new d.ChangedPath(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter((e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0));return null==t||0==t.length}buildRefreshModelParams(e){let t=d.ClientSideRowModelSteps.EVERYTHING;const i={everything:d.ClientSideRowModelSteps.EVERYTHING,group:d.ClientSideRowModelSteps.EVERYTHING,filter:d.ClientSideRowModelSteps.FILTER,map:d.ClientSideRowModelSteps.MAP,aggregate:d.ClientSideRowModelSteps.AGGREGATE,sort:d.ClientSideRowModelSteps.SORT,pivot:d.ClientSideRowModelSteps.PIVOT};if((0,d._exists)(e)&&(t=i[e]),(0,d._missing)(t))return void(0,d._errorOnce)(`invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gos.get("suppressAnimationFrame")}}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.isChangeEventsDispatching())return;const t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case d.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case d.ClientSideRowModelSteps.FILTER:this.doFilter(i);case d.ClientSideRowModelSteps.PIVOT:this.doPivot(i);case d.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(i);case d.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(i);case d.ClientSideRowModelSteps.SORT:this.doSort(t.rowNodeTransactions,i);case d.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1;const o={type:"modelUpdated",animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const e=(0,d._missing)(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return(0,d._missing)(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return(0,d._exists)(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!1,s=!1;const o=[],n=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort((r=>{if(s)return;if(i&&(r===t||r===e)&&(s=!0,r.group&&n))return void o.push(...r.allLeafChildren);if(!i){if(r!==t&&r!==e)return;i=!0}(!r.group||!n)&&o.push(r)})),o}setDatasource(e){(0,d._errorOnce)("should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if((0,d._last)(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let s=-1,o=-1;for(;;){const n=Math.floor((t+i)/2),r=this.rowsToDisplay[n];if(this.isRowInPixel(r,e))return n;r.rowTop<e?t=n+1:r.rowTop>e&&(i=n-1);if(s===t&&o===i)return n;s=t,o=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach(((t,i)=>e(t,i)))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:o}=e;let{index:n}=e;const r=e=>{const s=t[0]?.parent;if(!s)return;const r=o&&this.gos.getGrandTotalRow(),l=this.gos.getGroupTotalRowCallback(),a=o&&l({node:s});s===this.rootNode?r===e&&(s.createFooter(),i(s.sibling,n++)):a===e&&(s.createFooter(),i(s.sibling,n++))};r("top");for(let e=0;e<t.length;e++){const r=t[e];if(i(r,n++),r.hasChildren()&&!r.footer){let e=null;switch(s){case 0:e=r.childrenAfterGroup;break;case 1:e=r.childrenAfterAggFilter;break;case 2:e=r.childrenAfterSort;break;case 3:e=r.leafGroup?null:r.childrenAfterSort}e&&(n=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:i,recursionType:s,index:n,includeFooterNodes:o}))}}return r("bottom"),n}doAggregate(e){this.aggregationStage?.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=o=>{o&&o.forEach((o=>{const n=()=>{o.expanded=e,s(o.childrenAfterGroup)};if(t){return void((0,d._exists)(o.childrenAfterGroup)&&n())}if(i){return void(!o.leafGroup&&n())}o.group&&n()}))};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:d.ClientSideRowModelSteps.MAP});const o={type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"};this.eventService.dispatchEvent(o)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:s}),this.gos.get("groupSelectsChildren")){if(this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const e={type:"selectionChanged",source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){this.pivotStage?.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(d.RowNode.ID_PREFIX_ROW_GROUP)){let t;return this.forEachNode((i=>{i.id===e&&(t=i)})),t}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:d.ClientSideRowModelSteps.EVERYTHING,newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((()=>{this.executeBatchUpdateRowData()}),e)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((s=>{const o=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(o),s.callback&&e.push(s.callback.bind(null,o)),"number"==typeof s.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout((()=>{e.forEach((e=>e()))}),0),t.length>0){const e={type:"asyncTransactionsFlushed",results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s="number"==typeof e.addIndex;return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const s=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:d.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:d.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode((t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0})),e}onGridStylesChanges(e){if(e.rowHeightChanged){if(this.columnModel.isAutoRowHeightActive())return;this.resetRowHeights()}}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}},p=i(423);var m=i(423),C=class extends m.BeanStub{constructor(){super(...arguments),this.beanName="filterStage"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){const t=!!this.filterManager?.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(t,i)=>{t.hasChildren()?t.childrenAfterFilter=e&&!i?t.childrenAfterGroup.filter((e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,i=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||i})):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,s)=>{if(t.childrenAfterGroup)for(let o=0;o<t.childrenAfterGroup.length;o++){const n=t.childrenAfterGroup[o],r=s||this.filterManager.doesRowPassFilter({rowNode:n});n.childrenAfterGroup?e(t.childrenAfterGroup[o],r):i(n,r)}i(t,s)},s=t=>e(t,!1);t.executeFromRootNode(s)}else{const e=e=>i(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},f=i(423),v=class extends f.BeanStub{constructor(){super(...arguments),this.beanName="flattenStage"}wireBeans(e){this.beans=e,this.columnModel=e.columnModel}execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),o=s&&t.leafGroup,n=o?[t]:t.childrenAfterSort,r=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(r,n,i,s,0);if(!o&&i.length>0&&r.grandTotalRow){t.createFooter();const e="top"===r.grandTotalRow;this.addRowNodeToRowsToDisplay(r,t.sibling,i,0,e)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(!(0,f._missingOrEmpty)(t))for(let n=0;n<t.length;n++){const r=t[n],l=r.hasChildren(),a=s&&!l,h=e.groupRemoveSingleChildren&&l&&1===r.childrenAfterGroup.length,d=e.groupRemoveLowestSingleChildren&&l&&r.leafGroup&&1===r.childrenAfterGroup.length,c=s&&r.leafGroup,u=e.hideOpenParents&&r.expanded&&!r.master&&!c;if(!(a||u||h||d)&&this.addRowNodeToRowsToDisplay(e,r,i,o),!s||!r.leafGroup)if(l){const t=h||d;if(r.expanded||t){const n=e.groupTotalRow({node:r});n||r.destroyFooter();const l=t?o:o+1;"top"===n&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,l)),this.recursivelyAddToRowsToDisplay(e,r.childrenAfterSort,i,s,l),"bottom"===n&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,l))}}else if(r.master&&r.expanded){const t=this.createDetailNode(r);this.addRowNodeToRowsToDisplay(e,t,i,o)}}}addRowNodeToRowsToDisplay(e,t,i,s,o){o?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if((0,f._exists)(e.detailNode))return e.detailNode;const t=new f.RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,(0,f._exists)(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}},w=i(423),S=class extends w.BeanStub{constructor(){super(...arguments),this.beanName="immutableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",(()=>this.onRowDataUpdated())))}isActive(){const e=this.gos.exists("getRowId");return!this.gos.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if((0,w._missing)(this.clientSideRowModel))return void(0,w._errorOnce)("ImmutableService only works with ClientSideRowModel");const t=this.gos.getRowIdCallback();if(null==t)return void(0,w._errorOnce)("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),o=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return(0,w._exists)(e)&&e.forEach(((e,n)=>{const r=t({data:e,level:0}),l=s[r];if(o&&(o[r]=n),l){l.data!==e&&i.update.push(e),s[r]=void 0}else i.add.push(e)})),(0,w._iterateObject)(s,((e,t)=>{t&&i.remove.push(t.data)})),[i,o]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}},y=i(423),b=class extends y.BeanStub{constructor(){super(...arguments),this.beanName="sortService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowNodeSorter=e.rowNodeSorter,this.showRowGroupColsService=e.showRowGroupColsService}sort(e,t,i,s,o,n){const r=this.gos.get("groupMaintainOrder"),l=this.columnModel.getCols().some((e=>e.isRowGroupActive()));let a={};i&&s&&(a=this.calculateDirtyNodes(s));const h=this.columnModel.isPivotMode(),d=this.gos.getCallback("postSortRows"),c=s=>{this.pullDownGroupDataForHideOpenParents(s.childrenAfterAggFilter,!0);const c=h&&s.leafGroup;if(r&&l&&!s.leafGroup&&!n){const e=this.funcColsService.getRowGroupColumns()?.[s.level+1],t=null===e?.getSort(),i=s.childrenAfterAggFilter.slice(0);if(s.childrenAfterSort&&!t){const e={};s.childrenAfterSort.forEach(((t,i)=>{e[t.id]=i})),i.sort(((t,i)=>(e[t.id]??0)-(e[i.id]??0)))}s.childrenAfterSort=i}else s.childrenAfterSort=!t||c?s.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(s,a,o,e):this.rowNodeSorter.doFullSort(s.childrenAfterAggFilter,e);if(s.sibling&&(s.sibling.childrenAfterSort=s.childrenAfterSort),this.updateChildIndexes(s),d){const e={nodes:s.childrenAfterSort};d(e)}};o&&o.forEachChangedNodeDepthFirst(c),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},i=e=>{e&&e.forEach((e=>t[e.id]=!0))};return e&&e.forEach((e=>{i(e.add),i(e.update),i(e.remove)})),t}doDeltaSort(e,t,i,s){const o=e.childrenAfterAggFilter,n=e.childrenAfterSort;if(!n)return this.rowNodeSorter.doFullSort(o,s);const r={},l=[];o.forEach((e=>{t[e.id]||!i.canSkip(e)?l.push(e):r[e.id]=!0}));const a=n.filter((e=>r[e.id])),h=(e,t)=>({currentPos:t,rowNode:e}),d=l.map(h).sort(((e,t)=>this.rowNodeSorter.compareRowNodes(s,e,t)));return this.mergeSortedArrays(s,d,a.map(h)).map((({rowNode:e})=>e))}mergeSortedArrays(e,t,i){const s=[];let o=0,n=0;for(;o<t.length&&n<i.length;){this.rowNodeSorter.compareRowNodes(e,t[o],i[n])<0?s.push(t[o++]):s.push(i[n++])}for(;o<t.length;)s.push(t[o++]);for(;n<i.length;)s.push(i[n++]);return s}updateChildIndexes(e){if((0,y._missing)(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],o=0===i,n=i===e.childrenAfterSort.length-1;s.setFirstChild(o),s.setLastChild(n),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return(0,y._warnOnce)("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."),!1;const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((e=>{e.hasChildren()&&t(e)}))};e&&e.executeFromRootNode((e=>t(e)))}pullDownGroupDataForHideOpenParents(e,t){this.gos.get("groupHideOpenParents")&&!(0,y._missing)(e)&&e.forEach((e=>{(this.showRowGroupColsService?.getShowRowGroupCols()??[]).forEach((i=>{const s=i.getColDef().showRowGroup;if("string"!=typeof s)return void(0,y._errorOnce)("groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const o=s,n=this.columnModel.getColDefCol(o);if(!(n===e.rowGroupColumn))if(t)e.setGroupValue(i.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(n);t&&e.setGroupValue(i.getId(),t.key)}}))}))}},R=i(423),F=class extends R.BeanStub{constructor(){super(...arguments),this.beanName="sortStage"}wireBeans(e){this.sortService=e.sortService,this.sortController=e.sortController}execute(e){const t=this.sortController.getSortOptions(),i=(0,R._exists)(t)&&t.length>0,s=i&&(0,R._exists)(e.rowNodeTransactions)&&this.gos.get("deltaSort"),o=t.some((e=>this.gos.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup));this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}},P="32.0.0",E={version:P,moduleName:`${h.ModuleNames.ClientSideRowModelModule}-core`,rowModel:"clientSide",beans:[g,C,F,v,b,S]},D={version:P,moduleName:`${h.ModuleNames.ClientSideRowModelModule}-api`,beans:[h.RowModelHelperService],apiFunctions:{onGroupExpandedOrCollapsed:function(e){e.expansionService.onGroupExpandedOrCollapsed()},refreshClientSideRowModel:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.refreshModel(t)},forEachLeafNode:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachLeafNode(t)},forEachNodeAfterFilter:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilter(t)},forEachNodeAfterFilterAndSort:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilterAndSort(t)},resetRowHeights:function(e){e.columnModel.isAutoRowHeightActive()?(0,p._warnOnce)("calling gridApi.resetRowHeights() makes no sense when using Auto Row Height."):e.rowModelHelperService?.getClientSideRowModel()?.resetRowHeights()},applyTransaction:function(e,t){return e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.updateRowData(t)))},applyTransactionAsync:function(e,t,i){e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.batchUpdateRowData(t,i)))},flushAsyncTransactions:function(e){e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.flushAsyncTransactions()))},getBestCostNodeSelection:function(e){return e.selectionService.getBestCostNodeSelection()}},dependantModules:[E,h._CsrmSsrmSharedApiModule]},M={version:P,moduleName:h.ModuleNames.ClientSideRowModelModule,dependantModules:[E,D]}},423:function(e,t,i){var s,o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(a,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>Nh,AbstractHeaderCellCtrl:()=>ln,AgAbstractField:()=>ss,AgAbstractInputField:()=>os,AgAbstractLabel:()=>is,AgCheckbox:()=>ns,AgCheckboxSelector:()=>rs,AgColumn:()=>ie,AgColumnGroup:()=>je,AgInputDateField:()=>Ml,AgInputNumberField:()=>Mo,AgInputNumberFieldSelector:()=>To,AgInputTextArea:()=>vl,AgInputTextField:()=>Eo,AgInputTextFieldSelector:()=>Do,AgPickerField:()=>vo,AgPromise:()=>vs,AgProvidedColumnGroup:()=>oe,AgRadioButton:()=>Co,AgSelect:()=>wo,AgSelectSelector:()=>So,AgToggleButton:()=>sa,AgToggleButtonSelector:()=>oa,AnimateShowChangeCellRenderer:()=>Zi,AnimateSlideCellRenderer:()=>es,AnimationFrameService:()=>pl,AriaAnnouncementService:()=>qh,AutoScrollService:()=>qs,AutoWidthCalculator:()=>$l,BarColumnLabelPlacement:()=>Rd,BaseComponentWrapper:()=>Sd,BeanStub:()=>I,BodyDropPivotTarget:()=>Nn,BodyDropTarget:()=>_n,CellComp:()=>mr,CellCtrl:()=>Ar,CellNavigationService:()=>ga,CellPositionUtils:()=>xa,CellRangeType:()=>Er,ChangedPath:()=>td,ChartMappings:()=>bd,CheckboxCellEditor:()=>Ol,CheckboxCellRenderer:()=>ls,CheckboxSelectionComponent:()=>wr,ClientSideRowModelSteps:()=>ml,ColumnApplyStateService:()=>Oe,ColumnAutosizeService:()=>Ie,ColumnFactory:()=>De,ColumnKeyCreator:()=>Se,ColumnModel:()=>Te,ColumnMoveService:()=>Ge,ColumnNameService:()=>ze,ColumnSizeService:()=>Ue,CommunityFeaturesModule:()=>kh,Component:()=>Vi,ComponentUtil:()=>ot,Context:()=>zs,CssClassManager:()=>Ct,CtrlsService:()=>Ta,DataTypeService:()=>qa,DateCellEditor:()=>Al,DateFilter:()=>Jo,DateStringCellEditor:()=>Ll,DragAndDropService:()=>js,DragService:()=>Xs,DragSourceType:()=>$s,Environment:()=>Ga,EventService:()=>Ba,ExcelFactoryMode:()=>_s,ExpansionService:()=>Cl,ExpressionService:()=>ad,FakeHScrollComp:()=>lr,FakeVScrollComp:()=>dr,FilterManager:()=>oo,FilterWrapperComp:()=>no,FocusService:()=>Wa,FuncColsService:()=>Le,GROUP_AUTO_COLUMN_ID:()=>ye,Grid:()=>pd,GridBodyComp:()=>ol,GridBodyCtrl:()=>pr,GridComp:()=>Ua,GridCoreCreator:()=>Cd,GridCoreModule:()=>Lh,GridCtrl:()=>_a,GridHeaderComp:()=>er,GridHeaderCtrl:()=>kn,GridOptionsService:()=>zh,GroupInstanceIdCreator:()=>qe,HeaderCellCtrl:()=>$n,HeaderFilterCellComp:()=>Mn,HeaderFilterCellCtrl:()=>hn,HeaderGroupCellCtrl:()=>Yn,HeaderNavigationDirection:()=>Ln,HeaderNavigationService:()=>On,HeaderPositionUtils:()=>_h,HeaderRowComp:()=>In,HeaderRowContainerComp:()=>Zn,HeaderRowContainerCtrl:()=>Jn,HeaderRowCtrl:()=>Xn,HeaderRowType:()=>An,HorizontalDirection:()=>Ks,HorizontalResizeService:()=>cl,KeyCode:()=>ts,LargeTextCellEditor:()=>Sl,LayoutCssClasses:()=>ir,LocalEventService:()=>h,LocaleService:()=>Uh,ManagedFocusFeature:()=>co,MenuService:()=>fl,ModuleNames:()=>Qi,ModuleRegistry:()=>Ji,MouseEventService:()=>hl,MoveColumnFeature:()=>zn,NavigationService:()=>dl,NumberCellEditor:()=>Dl,NumberFilter:()=>Oo,NumberSequence:()=>Oi,OverlayWrapperComponent:()=>or,PinnedRowModel:()=>Ql,PivotResultColsService:()=>_e,PopupComponent:()=>gs,PopupEditorWrapper:()=>yl,PopupService:()=>da,PositionableFeature:()=>ao,PropertyKeys:()=>it,ProvidedFilter:()=>mo,RefPlaceholder:()=>Bi,ResizeObserverService:()=>gl,RowContainerComp:()=>el,RowContainerCtrl:()=>Zr,RowCtrl:()=>Or,RowDragComp:()=>Js,RowHighlightPosition:()=>Ys,RowModelHelperService:()=>fd,RowNode:()=>so,RowNodeBlock:()=>Jl,RowNodeBlockLoader:()=>Zl,RowNodeSorter:()=>ed,RowPositionUtils:()=>Ia,RowRenderer:()=>ql,ScalarFilter:()=>Ro,ScrollVisibleService:()=>rl,SelectCellEditor:()=>bl,SelectableService:()=>sd,SelectionHandleType:()=>Pr,ServerSideTransactionResultStatus:()=>Xl,SetLeftFeature:()=>Zo,SimpleFilter:()=>bo,SortController:()=>nd,SortIndicatorComp:()=>$i,SortIndicatorSelector:()=>ji,StandardMenuFactory:()=>ul,StylingService:()=>ia,TabGuardClassNames:()=>na,TabGuardComp:()=>aa,TabGuardCtrl:()=>ra,TabGuardFeature:()=>la,TextCellEditor:()=>Pl,TextFilter:()=>Ho,TextFloatingFilter:()=>Cn,TooltipFeature:()=>Ni,TooltipStateManager:()=>Gi,TouchListener:()=>Ki,UserComponentFactory:()=>Bs,UserComponentRegistry:()=>fs,ValueCache:()=>hd,ValueService:()=>dd,VanillaFrameworkOverrides:()=>ua,VerticalDirection:()=>Us,VisibleColsService:()=>Ye,_ColumnFilterModule:()=>wn,_CommunityMenuApiModule:()=>eh,_CsrmSsrmSharedApiModule:()=>vd,_EditCoreModule:()=>Vl,_FilterCoreModule:()=>fn,_FloatingFilterModule:()=>bn,_ReadOnlyFloatingFilterModule:()=>Rn,_RowNodeBlockModule:()=>ea,_SsrmInfiniteSharedApiModule:()=>wd,_addFocusableContainerListener:()=>oh,_areEqual:()=>u,_bindCellRendererToHtmlElement:()=>Li,_capitalise:()=>Ve,_clearElement:()=>vi,_cloneObject:()=>$,_combineAttributesAndGridOptions:()=>nt,_compose:()=>we,_createIcon:()=>zi,_createIconNoSpan:()=>_i,_debounce:()=>Ce,_defaultComparator:()=>_,_doOnce:()=>le,_errorOnce:()=>de,_escapeString:()=>We,_exists:()=>k,_existsAndNotEmpty:()=>d,_flatten:()=>y,_forEachReverse:()=>R,_formatNumberCommas:()=>_o,_formatNumberTwoDecimalPlacesAndCommas:()=>zo,_fuzzySuggestions:()=>ms,_getAbsoluteHeight:()=>ui,_getAbsoluteWidth:()=>gi,_getAllValuesInObject:()=>q,_getAriaPosInSet:()=>bt,_getCtrlForEventTarget:()=>x,_getHeaderClassesFromColDef:()=>en,_getInnerHeight:()=>di,_getInnerWidth:()=>ci,_getRowContainerOptions:()=>Ur,_getToolPanelClassesFromColDef:()=>tn,_includes:()=>S,_insertArrayIntoArray:()=>v,_insertIntoArray:()=>f,_isElementInEventPath:()=>A,_isEventFromPrintableCharacter:()=>Fo,_isIOSUserAgent:()=>Xt,_isNodeOrElement:()=>xi,_isStopPropagationForAgGrid:()=>M,_isVisible:()=>yi,_iterateObject:()=>K,_jsonEquals:()=>z,_last:()=>c,_loadTemplate:()=>bi,_log:()=>ae,_makeNull:()=>O,_mergeDeep:()=>Y,_missing:()=>G,_missingOrEmpty:()=>N,_parseDateTimeFromString:()=>jo,_processOnChange:()=>rt,_radioCssClass:()=>ii,_removeAriaExpanded:()=>It,_removeAriaSort:()=>Wt,_removeFromArray:()=>C,_removeFromParent:()=>wi,_removeRepeatsFromArray:()=>p,_serialiseDate:()=>Uo,_setAriaActiveDescendant:()=>xt,_setAriaChecked:()=>_t,_setAriaColCount:()=>Nt,_setAriaColIndex:()=>Ht,_setAriaColSpan:()=>Bt,_setAriaControls:()=>Ut,_setAriaDescribedBy:()=>Pt,_setAriaDisabled:()=>Mt,_setAriaExpanded:()=>At,_setAriaHidden:()=>Tt,_setAriaLabel:()=>Rt,_setAriaLabelledBy:()=>Ft,_setAriaLevel:()=>Dt,_setAriaPosInSet:()=>Ot,_setAriaRole:()=>yt,_setAriaRowCount:()=>kt,_setAriaRowIndex:()=>Gt,_setAriaSelected:()=>zt,_setAriaSetSize:()=>Lt,_setAriaSort:()=>Vt,_setDisabled:()=>li,_setDisplayed:()=>ni,_setFixedWidth:()=>Di,_setVisible:()=>ri,_shallowCompare:()=>g,_sortRowNodesByOrder:()=>yd,_stopPropagationForAgGrid:()=>D,_toStringOrNull:()=>H,_unwrapUserComp:()=>Vs,_utf8_encode:()=>Be,_values:()=>U,_waitUntil:()=>ve,_warnOnce:()=>he,createGrid:()=>gd,getDefaultFloatingFilterType:()=>cn,isColumn:()=>te,isColumnGroup:()=>$e,isProvidedColumnGroup:()=>se,isSelectionUIEvent:()=>Hh,provideGlobalGridOptions:()=>ud}),e.exports=(s=a,((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of r(t))l.call(e,a)||a===i||o(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s));var h=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);if(s&&(s.delete(t),0===s.size)){(i?this.allAsyncListeners:this.allSyncListeners).delete(e)}}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){const t=e;this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const i=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const s=(i,s)=>i.forEach((i=>{if(!s.has(i))return;const o=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming((()=>i(e))):()=>i(e);t?this.dispatchAsync(o):o()})),o=this.getListeners(i,t,!1)??new Set,n=new Set(o);n.size>0&&s(n,o);new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach((s=>{const o=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming((()=>s(i,e))):()=>s(i,e);t?this.dispatchAsync(o):o()}))}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const e=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(e):e(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach((e=>e()))}};function d(e){return null!=e&&e.length>0}function c(e){if(e&&e.length)return e[e.length-1]}function u(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every(((e,s)=>i?i(e,t[s]):t[s]===e))}function g(e,t){return u(e,t)}function p(e,t){if(e)for(let i=e.length-2;i>=0;i--){const s=e[i]===t,o=e[i+1]===t;s&&o&&e.splice(i+1,1)}}function m(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function C(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function f(e,t,i){e.splice(i,0,t)}function v(e,t,i){if(null!=e&&null!=t)for(let s=t.length-1;s>=0;s--){f(e,t[s],i)}}function w(e,t,i){!function(e,t){for(let i=0;i<t.length;i++)C(e,t[i])}(e,t),t.slice().reverse().forEach((t=>f(e,t,i)))}function S(e,t){return e.indexOf(t)>-1}function y(e){return[].concat.apply([],e)}function b(e,t){null!=t&&null!=e&&t.forEach((t=>e.push(t)))}function R(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}var F="__ag_Grid_Stop_Propagation",P=["touchstart","touchend","touchmove","touchcancel","scroll"],E={};function D(e){e[F]=!0}function M(e){return!0===e[F]}var T=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof E[t])return E[t];const i=document.createElement(e[t]||"div");return E[t="on"+t]=t in i}})();function x(e,t,i){let s=t;for(;s;){const t=e.getDomData(s,i);if(t)return t;s=s.parentElement}return null}function A(e,t){return!(!t||!e)&&function(e){const t=e;if(t.path)return t.path;if(t.composedPath)return t.composedPath();return function(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}(t)}(t).indexOf(e)>=0}var I=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.gridId=e.context.getGridId(),this.frameworkOverrides=e.frameworkOverrides,this.stubContext=e.context,this.eventService=e.eventService,this.gos=e.gos,this.localeService=e.localeService}getFrameworkOverrides(){return this.frameworkOverrides}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t){this.localEventService||(this.localEventService=new h),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchLocalEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventService,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const i=[];for(const s in t){const o=t[s];o&&i.push(this._setupListener(e,s,o))}return i}_setupListener(e,t,i){if(this.destroyed)return()=>null;e instanceof HTMLElement?function(e,t,i,s){const o=S(P,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,o)}(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter((e=>e!==s)),null)}setupGridOptionListener(e,t){this.gos.addPropertyEventListener(e,t);const i=()=>(this.gos.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter((e=>e!==i)),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const s={type:"gridPropertyChanged",changeSet:e.changeSet,source:e.source};t(s)};e.forEach((e=>this.setupGridOptionListener(e,s)))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.stubContext).createBean(e,i)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}},L=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=t=>{this.frameworkOverrides.wrapOutgoing((()=>e(t)))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(t,i)=>{this.frameworkOverrides.wrapOutgoing((()=>e(t,i)))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}};function O(e){return null==e||""===e?null:e}function k(e,t=!1){return null!=e&&(""!==e||t)}function G(e){return!k(e)}function N(e){return null==e||0===e.length}function H(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function B(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function V(e){if(void 0!==e)return null!==e&&""!==e&&W(e)}function W(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}function z(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function _(e,t,i=!1){const s=null==e,o=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function n(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return n(e,t);if(!i)return n(e,t);try{return e.localeCompare(t)}catch(i){return n(e,t)}}function U(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach((e=>t.push(e))),t}return Object.values(e)}function K(e,t){if(null!=e)if(Array.isArray(e))for(let i=0;i<e.length;i++)t(i.toString(),e[i]);else for(const[i,s]of Object.entries(e))t(i,s)}function $(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){const o=i[s],n=e[o];t[o]=n}return t}function j(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach((e=>{if(t&&t.indexOf(e)>=0)return;const o=i[e],n=X(o)&&o.constructor===Object;s[e]=n?j(o):o})),s}function q(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&i.push(e[t]);return i}function Y(e,t,i=!0,s=!1){k(t)&&K(t,((t,o)=>{let n=e[t];if(n!==o){if(s){if(null==n&&null!=o){"object"==typeof o&&o.constructor===Object&&(n={},e[t]=n)}}X(o)&&X(n)&&!Array.isArray(n)?Y(n,o,i,s):(i||void 0!==o)&&(e[t]=o)}}))}function Q(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let e=0;e<s.length;e++){if(null==o)return;o=o[s[e]]}return o}function X(e){return"object"==typeof e&&null!==e}var J={resizable:!0,sortable:!0},Z=0;function ee(){return Z++}function te(e){return e instanceof ie}var ie=class extends I{constructor(e,t,i,s){super(),this.isColumn=!0,this.instanceId=ee(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new h,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}wireBeans(e){this.columnHoverService=e.columnHoverService}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const s=e.hide,o=e.initialHide;this.visible=void 0!==s?!s:!o,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=e.flex,r=e.initialFlex;void 0!==n?this.flex=n:void 0!==r&&(this.flex=r)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}postConstruct(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=k(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=k(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??20,this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=k(this.colDef.tooltipField)||k(this.colDef.tooltipValueGetter)||k(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=B(e.width),s=B(e.initialWidth);return t=null!=i?i:null!=s?s:200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(G(this.colDef)||G(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new L(this.frameworkOverrides));const i=this.frameworkEventListenerService?.wrap(t)??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){const i=this.frameworkEventListenerService?.unwrap(t)??t;this.columnEventService.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gos.get("enableGroupEdit"))&&this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??J[e]}isColumnFunc(e,t){if("boolean"==typeof t)return t;if("function"==typeof t){return t(this.createColumnFunctionCallbackParams(e))}return!1}setMoving(e,t){this.moving=e,this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return G(this.sort)}isSorting(){return k(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&Y(s,i),this.columnEventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const i=!0===e;this.visible!==i&&(this.visible=i,this.columnEventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(G(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(G(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}};function se(e){return e instanceof oe}var oe=class extends I{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=ee(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some((e=>e.isVisible()))}isPadding(){return this.padding}setExpanded(e){this.expanded=void 0!==e&&e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach((t=>{te(t)?e.push(t):se(t)&&t.addLeafColumns(e)}))}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach((t=>t.addEventListener("visibleChanged",e))),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach((t=>t.removeEventListener("visibleChanged",e))),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const s=this.findChildrenRemovingPadding();for(let o=0,n=s.length;o<n;o++){const n=s[o];if(!n.isVisible())continue;const r=n.getColumnGroupShow();"open"===r?(e=!0,i=!0):"closed"===r?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach((i=>{se(i)&&i.isPadding()?t(i.children):e.push(i)}))};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},ne={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},re={};function le(e,t){re[t]||(e(),re[t]=!0)}function ae(e,...t){console.log("AG Grid: "+e,...t)}function he(e,...t){le((()=>console.warn("AG Grid: "+e,...t)),e)}function de(e,...t){le((()=>console.error("AG Grid: "+e,...t)),e)}function ce(e){return!!(e&&e.constructor&&e.call&&e.apply)}function ue(e){!function(e,t=0){e.length>0&&window.setTimeout((()=>e.forEach((e=>e()))),t)}(e,400)}var ge=[],pe=!1;function me(e){ge.push(e),pe||(pe=!0,window.setTimeout((()=>{const e=ge.slice();ge.length=0,pe=!1,e.forEach((e=>e()))}),0))}function Ce(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout((function(){e.apply(o,s)}),t)}}function fe(e,t){let i=0;return function(...s){const o=(new Date).getTime();o-i<t||(i=o,e.apply(this,s))}}function ve(e,t,i=100,s){const o=(new Date).getTime();let n=null,r=!1;const l=()=>{const l=(new Date).getTime()-o>i;(e()||l)&&(t(),r=!0,null!=n&&(window.clearInterval(n),n=null),l&&s&&he(s))};l(),r||(n=window.setInterval(l,10))}function we(...e){return t=>e.reduce(((e,t)=>t(e)),t)}var Se=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=H(e);let i=0;for(;;){let s;if(e?(s=e,0!==i&&(s+="_"+i)):t?(s=t,0!==i&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},ye="ag-Grid-AutoColumn";function be(e){const t=[],i=e=>{for(let s=0;s<e.length;s++){const o=e[s];te(o)?t.push(o):se(o)&&i(o.getChildren())}};return i(e),t}function Re(e){return e.reduce(((e,t)=>e+t.getActualWidth()),0)}function Fe(e,t,i){const s={};if(!t)return;Me(null,t,(e=>{s[e.getInstanceId()]=e})),i&&Me(null,i,(e=>{s[e.getInstanceId()]=null}));const o=Object.values(s).filter((e=>null!=e));e.destroyBeans(o)}function Pe(e){return e.getId().startsWith(ye)}function Ee(e){let t=[];if(e instanceof Array){e.some((e=>"string"!=typeof e))?he("if colDef.type is supplied an array it should be of type 'string[]'"):t=e}else"string"==typeof e?t=e.split(","):he("colDef.type should be of type 'string' | 'string[]'");return t}var De=class extends I{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,i,s){const o=new Se,{existingCols:n,existingGroups:r,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(e,0,t,n,o,r,s),h=this.findMaxDept(a,0),d=this.balanceColumnTree(a,0,h,o);return Me(null,d,((e,t)=>{se(e)&&e.setupExpandable(),e.setOriginalParent(t)})),{columnTree:d,treeDept:h}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&Me(null,e,(e=>{if(se(e)){const t=e;i.push(t)}else{const i=e;s.push(i.getId()),t.push(i)}})),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){const i=[],s=this.findDepth(t);return e.forEach((e=>{let t=e;for(let i=s-1;i>=0;i--){const s=new oe(null,`FAKE_PATH_${e.getId()}}_${i}`,!0,i);this.createBean(s),s.setChildren([t]),t.setOriginalParent(s),t=s}0===s&&e.setOriginalParent(null),i.push(t)})),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&se(i[0]);)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let n=0;n<e.length;n++){const r=e[n];if(se(r)){const e=r,n=this.balanceColumnTree(e.getChildren(),t+1,i,s);e.setChildren(n),o.push(e)}else{let n,l;for(let e=i-1;e>=t;e--){const e=s.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),o=new oe(i,e,!0,t);this.createBean(o),l&&l.setChildren([o]),l=o,n||(n=l)}if(n&&l){o.push(n);if(e.some((e=>se(e)))){l.setChildren([r]);continue}l.setChildren(e);break}o.push(r)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(se(o)){const e=o,s=this.findMaxDept(e.getChildren(),t+1);i<s&&(i=s)}}return i}recursivelyCreateColumns(e,t,i,s,o,n,r){if(!e)return[];const l=new Array(e.length);for(let a=0;a<l.length;a++){const h=e[a];this.isColumnGroup(h)?l[a]=this.createColumnGroup(i,h,t,s,o,n,r):l[a]=this.createColumn(i,h,s,o,r)}return l}createColumnGroup(e,t,i,s,o,n,r){const l=this.createMergedColGroupDef(t),a=o.getUniqueKey(l.groupId||null,null),h=new oe(l,a,!1,i);this.createBean(h);const d=this.findExistingGroup(t,n);d&&n.splice(d.idx,1);const c=d?.group;c&&h.setExpanded(c.isExpanded());const u=this.recursivelyCreateColumns(l.children,i+1,e,s,o,n,r);return h.setChildren(u),h}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,o){const n=this.findExistingColumn(t,i);n&&i?.splice(n.idx,1);let r=n?.column;if(r){const e=this.addColumnDefaultAndTypes(t,r.getColId());r.setColDef(e,t,o),this.applyColumnState(r,e,o)}else{const i=s.getUniqueKey(t.colId,t.field),o=this.addColumnDefaultAndTypes(t,i);r=new ie(o,t,i,e),this.createBean(r)}return this.dataTypeService?.addColumnListeners(r),r}applyColumnState(e,t,i){const s=B(t.flex);void 0!==s&&e.setFlex(s);if(e.getFlex()<=0){const s=B(t.width);if(null!=s)e.setActualWidth(s,i);else{const t=e.getActualWidth();e.setActualWidth(t,i)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort,i):e.setSort(void 0,i));const o=B(t.sortIndex);void 0!==o&&e.setSortIndex(o);const n=V(t.hide);void 0!==n&&e.setVisible(!n,i),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(!s)continue;if(null!=e.colId){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(null!=e.field){if(s.field===e.field)return{idx:i,column:t[i]}}else if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const s=t[i];if(s.getColGroupDef()&&s.getId()===e.groupId)return{idx:i,group:s}}}addColumnDefaultAndTypes(e,t){const i={};Y(i,this.gos.get("defaultColDef"),!1,!0);const s=this.updateColDefAndGetColumnType(i,e,t);s&&this.assignColumnTypes(s,i),Y(i,e,!1,!0);const o=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&o&&n&&Y(i,{sort:o.sort,initialSort:o.initialSort},!1,!0),this.dataTypeService?.validateColDef(i),i}updateColDefAndGetColumnType(e,t,i){const s=this.dataTypeService?.updateColDefAndGetColumnType(e,t,i),o=t.type??s??e.type;return e.type=o,o?Ee(o):void 0}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},ne);K(this.gos.get("columnTypes")||{},((e,t)=>{if(e in i)he(`the column type '${e}' is a default column type and cannot be overridden.`);else{t.type&&he("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[e]=t}})),e.forEach((e=>{const s=i[e.trim()];s?Y(t,s,!1,!0):he("colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")}))}isColumnGroup(e){return void 0!==e.children}};function Me(e,t,i){if(t)for(let s=0;s<t.length;s++){const o=t[s];se(o)&&Me(o,o.getChildren(),i),i(o,e)}}var Te=class extends I{constructor(){super(...arguments),this.beanName="columnModel",this.pivotMode=!1,this.autoHeightActiveAtLeastOnce=!1,this.ready=!1,this.changeEventsDispatching=!1,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}wireBeans(e){this.context=e.context,this.columnFactory=e.columnFactory,this.columnSizeService=e.columnSizeService,this.visibleColsService=e.visibleColsService,this.columnViewportService=e.columnViewportService,this.pivotResultColsService=e.pivotResultColsService,this.columnAnimationService=e.columnAnimationService,this.autoColService=e.autoColService,this.valueCache=e.valueCache,this.columnDefFactory=e.columnDefFactory,this.columnApplyStateService=e.columnApplyStateService,this.columnGroupStateService=e.columnGroupStateService,this.eventDispatcher=e.columnEventDispatcher,this.columnMoveService=e.columnMoveService,this.columnAutosizeService=e.columnAutosizeService,this.funcColsService=e.funcColsService,this.quickFilterService=e.quickFilterService,this.showRowGroupColsService=e.showRowGroupColsService,this.environment=e.environment}postConstruct(){const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],(e=>this.refreshAll(xe(e.source)))),this.addManagedPropertyListener("autoGroupColumnDef",(e=>this.onAutoGroupColumnDefChanged(xe(e.source)))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],(e=>this.recreateColumnDefs(xe(e.source)))),this.addManagedPropertyListener("pivotMode",(e=>this.setPivotMode(this.gos.get("pivotMode"),xe(e.source)))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e,t){const i=e?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire();const s=this.colDefCols&&this.colDefCols.list,o=this.colDefCols&&this.colDefCols.tree,n=this.columnFactory.createColumnTree(this.colDefs,!0,o,t);Fe(this.context,this.colDefCols?.tree,n.columnTree);const r=n.columnTree,l=n.treeDept,a=be(r),h={};a.forEach((e=>h[e.getId()]=e)),this.colDefCols={tree:r,treeDepth:l,list:a,map:h},this.funcColsService.extractCols(t,s),this.ready=!0,this.refreshCols();e&&!this.showingPivotResult&&!this.gos.get("maintainColumnOrder")&&this.orderColsLikeColDefCols(),this.visibleColsService.refresh(t),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(t),i&&(this.changeEventsDispatching=!0,i(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(t),"gridInitializing"===t&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(){if(!this.colDefCols)return;const e=this.cols?.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.restoreColOrder(),this.positionLockedCols(),this.showRowGroupColsService?.refresh(),this.quickFilterService?.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear();!u(e,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=null!=e,e){const{map:t,list:i,tree:s,treeDepth:o}=e;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o};e.list.some((e=>void 0!==this.cols?.map[e.getColId()]))||(this.lastPivotOrder=null)}else{const{map:e,list:t,tree:i,treeDepth:s}=this.colDefCols;this.cols={list:t.slice(),map:{...e},tree:i.slice(),treeDepth:s}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns();return this.cols.list.filter((i=>{const s=Pe(i);if(e){const e=t&&S(t,i);return s||e}return s||i.isVisible()}))}addAutoCols(){var e;null!=this.autoCols&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),(e=this.cols).map={},e.list.forEach((t=>e.map[t.getId()]=t)))}createAutoCols(){const e=this.gos.isGroupUseEntireRow(this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),i=this.funcColsService.getRowGroupColumns(),s=()=>{this.autoCols&&(Fe(this.context,this.autoCols.tree),this.autoCols=null)};if(!(i.length>0||this.gos.get("treeData"))||t||e||!this.autoColService)return void s();const o=this.autoColService.createAutoCols(i)??[],n=(r=o,l=this.autoCols?.list||null,u(r,l,((e,t)=>e.getColId()===t.getColId())));var r,l;const a=this.cols.treeDepth,h=this.autoCols?this.autoCols.treeDepth:-1;if(n&&h==a)return;s();const[d,c]=this.columnFactory.createForAutoGroups(o,this.cols?.tree);this.autoCols={list:o,tree:d,treeDepth:c,map:{}};const g=e=>{if(!e)return null;const t=e.filter((e=>!Pe(e)));return[...o,...t]};this.lastOrder=g(this.lastOrder),this.lastPivotOrder=g(this.lastPivotOrder)}refreshAll(e){this.isReady()&&(this.refreshCols(),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,i){this.columnApplyStateService.applyColumnState({state:e.map((e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t})))},i)}setColsPinned(e,t,i){if(!this.cols)return;if(N(e))return;if(this.gos.isDomLayout("print"))return void he("Changing the column pinning status is not allowed with domLayout='print'");let s;this.columnAnimationService.start(),s=!0===t||"left"===t?"left":"right"===t?"right":null;const o=[];e.forEach((e=>{if(!e)return;const t=this.getCol(e);t&&t.getPinned()!==s&&(t.setPinned(s),o.push(t))})),o.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(o,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;s=se(e)?e.getId():e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){let t=null;return Me(null,this.cols?.tree,(i=>{se(i)&&i.getId()===e&&(t=i)})),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||0===t)return!1;if(-1===t)return!0;return t>this.funcColsService.getRowGroupColumns().findIndex((t=>t.getColId()===e.getColId()))}isSuppressAutoCol(){if("custom"===this.gos.get("groupDisplayType"))return!0;return"custom"===this.gos.get("treeDataDisplayType")}setAutoHeightActive(){if(this.autoHeightActive=this.cols.list.some((e=>e.isAutoHeight())),this.autoHeightActive){this.autoHeightActiveAtLeastOnce=!0;this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||he("autoHeight columns only work with Client Side Row Model and Server Side Row Model.")}}restoreColOrder(){const e=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!e)return;const t=new Map(e.map(((e,t)=>[e,t])));if(!this.cols.list.some((e=>t.has(e))))return;const i=new Map(this.cols.list.map((e=>[e,!0]))),s=e.filter((e=>i.has(e))),o=new Map(s.map((e=>[e,!0]))),n=this.cols.list.filter((e=>!o.has(e))),r=s.slice();n.forEach((e=>{let t=e.getOriginalParent();if(!t)return void r.push(e);const i=[];for(;!i.length&&t;){t.getLeafColumns().forEach((e=>{const t=r.indexOf(e)>=0,s=i.indexOf(e)<0;t&&s&&i.push(e)})),t=t.getOriginalParent()}if(!i.length)return void r.push(e);const s=i.map((e=>r.indexOf(e))),o=Math.max(...s);f(r,e,o+1)})),this.cols.list=r}orderColsLikeColDefCols(){if(!this.colDefCols||!this.cols)return;const e=this.colDefCols.list.filter((e=>this.cols.list.indexOf(e)>=0)),t=this.cols.list.filter((t=>e.indexOf(t)<0));this.cols.list=[...t,...e],this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}sortColsLikeKeys(e){if(null==this.cols)return;let t=[];const i={};e.forEach((e=>{if(i[e])return;const s=this.cols.map[e];s&&(t.push(s),i[e]=!0)}));let s=0;this.cols.list.forEach((e=>{const o=e.getColId();if(null!=i[o])return;o.startsWith(ye)?f(t,e,s++):t.push(e)})),t=this.columnMoveService.placeLockedColumns(t),this.columnMoveService.doesMovePassMarryChildren(t)?this.cols.list=t:he("Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}sortColsLikeCols(e){if(!e||e.length<=1)return;e.filter((e=>this.cols.list.indexOf(e)<0)).length>0||e.sort(((e,t)=>this.cols.list.indexOf(e)-this.cols.list.indexOf(t)))}resetColDefIntoCol(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}queueResizeOperations(){this.shouldQueueResizeOperations=!0}isShouldQueueResizeOperations(){return this.shouldQueueResizeOperations}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach((e=>e())),this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}moveInCols(e,t,i){w(this.cols?.list,e,t),this.visibleColsService.refresh(i)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list:this.lastOrder=this.cols?.list}getColumnDefs(){if(!this.colDefCols)return;const e=this.colDefCols.list.slice();this.showingPivotResult?e.sort(((e,t)=>this.lastOrder.indexOf(e)-this.lastOrder.indexOf(t))):this.lastOrder&&e.sort(((e,t)=>this.cols.list.indexOf(e)-this.cols.list.indexOf(t)));const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns();return this.columnDefFactory.buildColumnDefs(e,t,i)}isShowingPivotResult(){return this.showingPivotResult}isChangeEventsDispatching(){return this.changeEventsDispatching}isColSpanActive(){return this.colSpanActive}isProvidedColGroupsPresent(){return this.colDefCols?.treeDepth>0}setColSpanActive(){this.colSpanActive=this.cols.list.some((e=>null!=e.getColDef().colSpan))}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}getHeaderRowCount(){return this.cols?this.cols.treeDepth+1:-1}isReady(){return this.ready}isPivotMode(){return this.pivotMode}setPivotMode(e,t){e!==this.pivotMode&&this.isPivotSettingAllowed(this.pivotMode)&&(this.pivotMode=e,this.ready&&(this.refreshCols(),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return!e||!this.gos.get("treeData")||(he("Pivot mode not available with treeData."),!1)}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!N(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(!0,e))}setColumnDefs(e,t){const i=!!this.colDefs;this.colDefs=e,this.createColsFromColDefs(i,t)}destroy(){Fe(this.context,this.colDefCols?.tree),Fe(this.context,this.autoCols?.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){return this.colDefCols?.list?this.colDefCols.list:null}getCols(){return this.cols?.list??[]}getAllCols(){const e=this.pivotResultColsService.getPivotResultCols(),t=e?.list;return[].concat(this.colDefCols?.list||[],this.autoCols?.list||[],t||[])}getColsForKeys(e){if(!e)return[];return e.map((e=>this.getCol(e))).filter((e=>null!=e))}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return null==e?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(null==t)return null;const{map:i,list:s}=t;if("string"==typeof e&&i[e])return i[e];for(let t=0;t<s.length;t++)if(Ae(s[t],e))return s[t];return this.getAutoCol(e)}getAutoCol(e){return null==this.autoCols?null:this.autoCols.list.find((t=>Ae(t,e)))||null}getAutoCols(){return this.autoCols?.list||null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&this.eventDispatcher.headerHeight(e)}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.visibleColsService.getAllCols().filter((e=>e.isAutoHeaderHeight())).map((e=>e.getAutoHeaderHeight()||0));return Math.max(e,...t)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if("fitCellContents"!==e?.type)return;const{colIds:t,skipHeader:i}=e;setTimeout((()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",i)}))}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}};function xe(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}function Ae(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}var Ie=class extends I{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,this.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.autoSizeCols(e)));const{colKeys:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:n="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered())return this.timesDelayed++,void setTimeout((()=>this.autoSizeCols(e)));this.timesDelayed=0;const r=[];let l=-1;const a=null!=i?i:this.gos.get("skipHeaderOnAutoSize"),h=null!=s?s:a;for(;0!==l;){l=0;const e=[];t.forEach((t=>{if(!t)return;const i=this.columnModel.getCol(t);if(!i)return;if(r.indexOf(i)>=0)return;const s=this.autoWidthCalculator.getPreferredWidthForColumn(i,a);if(s>0){const e=this.normaliseColumnWidth(i,s);i.setActualWidth(e,n),r.push(i),l++}e.push(i)})),e.length&&this.visibleColsService.refresh(n)}h||this.autoSizeColumnGroupsByColumns(t,n,o),this.eventDispatcher.columnResized(r,!0,"autosizeColumns")}autoSizeColumn(e,t,i){e&&this.autoSizeCols({colKeys:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;let o;this.columnModel.getColsForKeys(e).forEach((e=>{let t=e.getParent();for(;t&&t!=i;)t.isPadding()||s.add(t),t=t.getParent()}));for(const e of s){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(o=t.getHeaderCtrlForColumn(e),o)break;o&&o.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.autoSizeAllColumns(e,t)));const i=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:i,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const i=e.getMinWidth();t<i&&(t=i);const s=e.getMaxWidth();return e.isGreaterThanMax(t)&&(t=s),t}},Le=class extends I{constructor(){super(...arguments),this.beanName="funcColsService",this.rowGroupCols=[],this.valueCols=[],this.pivotCols=[]}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.aggFuncService=e.aggFuncService,this.visibleColsService=e.visibleColsService}getModifyColumnsNoEventsCallbacks(){return{addGroupCol:e=>this.rowGroupCols.push(e),removeGroupCol:e=>C(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>C(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>C(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupCols.slice(0);const i=this.columnModel.getColDefCol(t);return i?[i]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return N(this.rowGroupCols)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.columnModel.getColDefCol(e);s&&(s.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[s],i))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,((e,i)=>this.setRowGroupActive(e,i,t)),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,i),e||this.gos.get("suppressMakeColumnVisibleAfterUnGroup")||this.columnModel.setColsVisible([t],!0,i))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,(e=>this.setRowGroupActive(!0,e,t)),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,(e=>this.setRowGroupActive(!1,e,t)),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,(e=>e.setPivotActive(!0,t)),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"columnPivotChanged",!0,!1,((e,i)=>{i.setPivotActive(e,t)}),t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,(e=>e.setPivotActive(!1,t)),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,((e,i)=>this.setValueActive(e,i,t)),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,(e=>this.setValueActive(!0,e,t)),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,(e=>this.setValueActive(!1,e,t)),"columnValueChanged",t)}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupCols[e],o=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,s),this.eventDispatcher.rowGroupChanged(o,i)}setColList(e,t,i,s,o,n,r){if(N(this.columnModel.getCols()))return;const l=new Map;t.forEach(((e,t)=>l.set(e,t))),t.length=0,k(e)&&e.forEach((e=>{const i=this.columnModel.getColDefCol(e);i&&t.push(i)})),t.forEach(((e,t)=>{const i=l.get(e);void 0!==i?s&&i!==t||l.delete(e):l.set(e,0)}));(this.columnModel.getColDefCols()||[]).forEach((e=>{const i=t.indexOf(e)>=0;n(i,e)})),o&&this.columnModel.refreshCols(),this.visibleColsService.refresh(r),this.eventDispatcher.columnChanged(i,[...l.keys()],r)}updateColList(e,t,i,s,o,n,r){if(!e||N(e))return;let l=!1;e.forEach((e=>{if(!e)return;const s=this.columnModel.getColDefCol(e);if(s){if(i){if(t.indexOf(s)>=0)return;t.push(s)}else{if(t.indexOf(s)<0)return;C(t,s)}o(s),l=!0}})),l&&(s&&this.columnModel.refreshCols(),this.visibleColsService.refresh(r),this.eventDispatcher.genericColumnEvent(n,t,r))}extractCols(e,t){this.extractRowGroupCols(e,t),this.extractPivotCols(e,t),this.extractValueCols(e,t)}extractValueCols(e,t){this.valueCols=this.extractColsCommon(t,this.valueCols,((t,i)=>t.setValueActive(i,e)),(()=>{}),(()=>{}),(e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0}),(e=>null!=e.initialAggFunc&&""!=e.initialAggFunc)),this.valueCols.forEach((e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)}))}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,((t,i)=>t.setRowGroupActive(i,e)),(e=>e.rowGroupIndex),(e=>e.initialRowGroupIndex),(e=>e.rowGroup),(e=>e.initialRowGroup))}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,((t,i)=>t.setPivotActive(i,e)),(e=>e.pivotIndex),(e=>e.initialPivotIndex),(e=>e.pivot),(e=>e.initialPivot))}extractColsCommon(e=[],t=[],i,s,o,n,r){const l=[],a=[];(this.columnModel.getColDefCols()||[]).forEach((i=>{const h=e.indexOf(i)<0,d=i.getColDef(),c=V(n(d)),u=V(r(d)),g=B(s(d)),p=B(o(d));let m;if(m=void 0!==c?c:void 0!==g?null!==g&&g>=0:h?void 0!==u?u:!!(void 0!==p)&&(null!=p&&p>=0):t.indexOf(i)>=0,m){(h?null!=g||null!=p:null!=g)?l.push(i):a.push(i)}}));const h=e=>{const t=s(e.getColDef()),i=o(e.getColDef());return null!=t?t:i};l.sort(((e,t)=>{const i=h(e),s=h(t);return i===s?0:i<s?-1:1}));const d=[].concat(l);return t.forEach((e=>{a.indexOf(e)>=0&&d.push(e)})),a.forEach((e=>{d.indexOf(e)<0&&d.push(e)})),t.forEach((e=>{d.indexOf(e)<0&&i(e,!1)})),d.forEach((e=>{t.indexOf(e)<0&&i(e,!0)})),d}generateColumnStateForRowGroupAndPivotIndexes(e,t){const i={},s=(e,t,s,o,n,r)=>{const l=this.columnModel.getColDefCols();if(!t.length||!l)return[];const a=Object.keys(e),h=new Set(a),d=new Set(a),c=new Set(t.map((e=>{const t=e.getColId();return d.delete(t),t})).concat(a)),u=[],g={};let p=0;for(let e=0;e<l.length;e++){const t=l[e].getColId();c.has(t)&&(u.push(t),g[t]=p++)}let m=1e3,C=!1,f=0;const v=t=>{const i=g[t];for(let t=f;t<i;t++){const i=u[t];d.has(i)&&(e[i][n]=m++,d.delete(i))}f=i};t.forEach((t=>{const l=t.getColId();if(h.has(l))v(l),e[l][n]=m++;else{const a=t.getColDef();if(null===a[n]||void 0===a[n]&&null==a[r]){if(!C){a[s]||void 0===a[s]&&a[o]?v(l):(d.forEach((t=>{e[t][n]=m+g[t]})),m+=u.length,C=!0)}i[l]||(i[l]={colId:l}),i[l][n]=m++}}}))};return s(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}},Oe=class extends I{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const i=this.columnModel.getColDefCols()||[];if(N(i))return!1;if(e&&e.state&&!e.state.forEach)return he("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."),!1;const s=this.funcColsService.getModifyColumnsNoEventsCallbacks(),o=(i,o,n)=>{const r=this.compareColumnStatesAndDispatchEvents(t),l=o.slice(),a={},h={},d=[],c=[];let u=0;const g=this.funcColsService.getRowGroupColumns().slice(),p=this.funcColsService.getPivotColumns().slice();i.forEach((i=>{const o=i.colId||"";if(o.startsWith(ye))return d.push(i),void c.push(i);const r=n(o);r?(this.syncColumnWithStateItem(r,i,e.defaultState,a,h,!1,t,s),C(l,r)):(c.push(i),u+=1)}));const m=i=>this.syncColumnWithStateItem(i,null,e.defaultState,a,h,!1,t,s);l.forEach(m),this.funcColsService.sortRowGroupColumns(ke.bind(this,a,g)),this.funcColsService.sortPivotColumns(ke.bind(this,h,p)),this.columnModel.refreshCols();const f=(this.columnModel.getAutoCols()||[]).slice();return d.forEach((i=>{const o=this.columnModel.getAutoCol(i.colId);C(f,o),this.syncColumnWithStateItem(o,i,e.defaultState,null,null,!0,t,s)})),f.forEach(m),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),r(),{unmatchedAndAutoStates:c,unmatchedCount:u}};this.columnAnimationService.start();let{unmatchedAndAutoStates:n,unmatchedCount:r}=o(e.state||[],i,(e=>this.columnModel.getColDefCol(e)));if(n.length>0||k(e.defaultState)){const e=this.pivotResultColsService.getPivotResultCols(),t=e?.list;r=o(n,t||[],(e=>this.pivotResultColsService.getPivotResultCol(e))).unmatchedCount}return this.columnAnimationService.finish(),0===r}resetColumnState(e){if(N(this.columnModel.getColDefCols()))return;const t=be(this.columnModel.getColDefColTree()),i=[];let s=1e3,o=1e3,n=[];const r=this.columnModel.getAutoCols();r&&(n=n.concat(r)),t&&(n=n.concat(t)),n.forEach((e=>{const t=this.getColumnStateFromColDef(e);G(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=s++),G(t.pivotIndex)&&t.pivot&&(t.pivotIndex=o++),i.push(t)})),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),n=t(i.hide,i.initialHide),r=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),a=t(i.flex,i.initialFlex);let h=t(i.rowGroupIndex,i.initialRowGroupIndex),d=t(i.rowGroup,i.initialRowGroup);null!=h||null!=d&&0!=d||(h=null,d=null);let c=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);null!=c||null!=u&&0!=u||(c=null,u=null);const g=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:n,pinned:r,width:l,flex:a,rowGroup:d,rowGroupIndex:h,pivot:u,pivotIndex:c,aggFunc:g}}syncColumnWithStateItem(e,t,i,s,o,n,r,l){if(!e)return;const a=(e,s)=>{const o={value1:void 0,value2:void 0};let n=!1;return t&&(void 0!==t[e]&&(o.value1=t[e],n=!0),k(s)&&void 0!==t[s]&&(o.value2=t[s],n=!0)),!n&&i&&(void 0!==i[e]&&(o.value1=i[e]),k(s)&&void 0!==i[s]&&(o.value2=i[s])),o},h=a("hide").value1;void 0!==h&&e.setVisible(!h,r);const d=a("pinned").value1;void 0!==d&&e.setPinned(d);const c=e.getColDef().minWidth??20,u=a("flex").value1;if(void 0!==u&&e.setFlex(u),null==u){const t=a("width").value1;null!=t&&null!=c&&t>=c&&e.setActualWidth(t,r)}const g=a("sort").value1;void 0!==g&&("desc"===g||"asc"===g?e.setSort(g,r):e.setSort(void 0,r));const p=a("sortIndex").value1;if(void 0!==p&&e.setSortIndex(p),n||!e.isPrimary())return;const m=a("aggFunc").value1;void 0!==m&&("string"==typeof m?(e.setAggFunc(m),e.isValueActive()||(e.setValueActive(!0,r),l.addValueCol(e))):(k(m)&&he("stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,r),l.removeValueCol(e))));const{value1:C,value2:f}=a("rowGroup","rowGroupIndex");void 0===C&&void 0===f||("number"==typeof f||C?(e.isRowGroupActive()||(e.setRowGroupActive(!0,r),l.addGroupCol(e)),s&&"number"==typeof f&&(s[e.getId()]=f)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,r),l.removeGroupCol(e)));const{value1:v,value2:w}=a("pivot","pivotIndex");void 0===v&&void 0===w||("number"==typeof w||v?(e.isPivotActive()||(e.setPivotActive(!0,r),l.addPivotCol(e)),o&&"number"==typeof w&&(o[e.getId()]=w)):e.isPivotActive()&&(e.setPivotActive(!1,r),l.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach((e=>{null!=e.colId&&t.push(e.colId)})),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},i=this.columnGetStateService.getColumnState(),s={};return i.forEach((e=>{s[e.colId]=e})),()=>{const o=this.columnModel.getAllCols(),n=(t,i,s,o)=>{if(u(i.map(o),s.map(o)))return;const n=new Set(i);s.forEach((e=>{n.delete(e)||n.add(e)}));const r=[...n],l={type:t,columns:r,column:1===r.length?r[0]:null,source:e};this.eventService.dispatchEvent(l)},r=e=>{const t=[];return o.forEach((i=>{const o=s[i.getColId()];o&&e(o,i)&&t.push(i)})),t},l=e=>e.getColId();n("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),l),n("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),l);const a=r(((e,t)=>{const i=null!=e.aggFunc,s=i!=t.isValueActive(),o=i&&e.aggFunc!=t.getAggFunc();return s||o}));a.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",a,e);this.eventDispatcher.columnResized(r(((e,t)=>e.width!=t.getActualWidth())),!0,e);this.eventDispatcher.columnPinned(r(((e,t)=>e.pinned!=t.getPinned())),e);this.eventDispatcher.columnVisible(r(((e,t)=>e.hide==t.isVisible())),e);const h=r(((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex()));h.length>0&&this.sortController.dispatchSortChangedEvents(e,h),this.normaliseColumnMovedEventForColumnState(i,e)}}normaliseColumnMovedEventForColumnState(e,t){const i=this.columnGetStateService.getColumnState(),s={};i.forEach((e=>s[e.colId]=e));const o={};e.forEach((e=>{s[e.colId]&&(o[e.colId]=!0)}));const n=e.filter((e=>o[e.colId])),r=i.filter((e=>o[e.colId])),l=[];r.forEach(((e,t)=>{const i=n&&n[t];if(i&&i.colId!==e.colId){const e=this.columnModel.getCol(i.colId);e&&l.push(e)}})),l.length&&this.eventDispatcher.columnMoved({movedColumns:l,source:t,finished:!0})}},ke=(e,t,i,s)=>{const o=e[i.getId()],n=e[s.getId()],r=null!=o,l=null!=n;if(r&&l)return o-n;if(r)return-1;if(l)return 1;const a=t.indexOf(i),h=t.indexOf(s),d=a>=0;return d&&h>=0?a-h:d?-1:1},Ge=class extends I{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,i){const s=this.columnModel.getCols();if(!s)return;const o=s[e];this.moveColumns([o],t,i)}moveColumns(e,t,i,s=!0){const o=this.columnModel.getCols();if(!o)return;if(this.columnAnimationService.start(),t>o.length-e.length)return he("tried to insert columns in invalid location, toIndex = ",t),void he("remember that you should not count the moving columns when calculating the new index");const n=this.columnModel.getColsForKeys(e);!this.doesMovePassRules(n,t)||(this.columnModel.moveInCols(n,t,i),this.eventDispatcher.columnMoved({movedColumns:n,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const i=this.columnModel.getCols().slice();return w(i,e,t),i}doesMovePassLockedPositions(e){let t=0,i=!0;return e.forEach((e=>{const s=(o=e.getColDef().lockPosition)?!0===o||"left"===o?0:2:1;var o;s<t&&(i=!1),t=s})),i}doesMovePassMarryChildren(e){let t=!0;return Me(null,this.columnModel.getColTree(),(i=>{if(!se(i))return;const s=i,o=s.getColGroupDef();if(!(o&&o.marryChildren))return;const n=[];s.getLeafColumns().forEach((t=>{const i=e.indexOf(t);n.push(i)}));Math.max.apply(Math,n)-Math.min.apply(Math,n)>s.getLeafColumns().length-1&&(t=!1)})),t}placeLockedColumns(e){const t=[],i=[],s=[];e.forEach((e=>{const o=e.getColDef().lockPosition;"right"===o?s.push(e):"left"===o||!0===o?t.push(e):i.push(e)}));return this.gos.get("enableRtl")?[...s,...i,...t]:[...t,...i,...s]}},Ne=/[&<>"']/g,He={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Be(e){const t=String.fromCharCode;function i(e,i){return t(e>>i&63|128)}function s(e){if(!(4294967168&e))return t(e);let s="";return 4294965248&e?4294901760&e?4292870144&e||(s=t(e>>18&7|240),s+=i(e,12),s+=i(e,6)):(!function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),s=t(e>>12&15|224),s+=i(e,6)):s=t(e>>6&31|192),s+=t(63&e|128),s}const o=function(e){const t=[];if(!e)return[];const i=e.length;let s,o,n=0;for(;n<i;)s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<i?(o=e.charCodeAt(n++),56320==(64512&o)?t.push(((1023&s)<<10)+(1023&o)+65536):(t.push(s),n--)):t.push(s);return t}(e),n=o.length;let r,l=-1,a="";for(;++l<n;)r=o[l],a+=s(r);return a}function Ve(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function We(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(Ne,(e=>He[e]))}var ze=class extends I{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const n=e.headerValueGetter;if(n){const r=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o});return"function"==typeof n?n(r):"string"==typeof n?this.expressionService.evaluate(n,r):(he("headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?(r=e.field)&&null!=r?r.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map((e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):""))).join(" "):null:"";var r}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn;let s,o=null;if(k(i)){const n=this.funcColsService.getValueColumns(),r=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===n.length,l=void 0!==e.getColDef().pivotTotalColumnIds;if(r&&!l)return t;o=i?i.getAggFunc():null,s=!0}else{const t=e.isValueActive(),i=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();t&&i?(o=e.getAggFunc(),s=!0):s=!1}if(s){const e="string"==typeof o?o:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${t})`}return t}},_e=class extends I{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){Fe(this.context,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return null!=this.pivotResultCols}lookupPivotResultCol(e,t){if(null==this.pivotResultCols)return null;const i=this.columnModel.getColDefCol(t);let s=null;return this.pivotResultCols.list.forEach((t=>{const o=t.getColDef().pivotKeys,n=t.getColDef().pivotValueColumn;u(o,e)&&n===i&&(s=t)})),s}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.columnModel.isReady()&&(null!=e||null!=this.pivotResultCols)){if(e){this.processPivotResultColDef(e);const i=this.columnFactory.createColumnTree(e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);Fe(this.context,this.pivotResultCols?.tree,i.columnTree);const s=i.columnTree,o=i.treeDept,n=be(s),r={};this.pivotResultCols={tree:s,treeDepth:o,list:n,map:r},this.pivotResultCols.list.forEach((e=>this.pivotResultCols.map[e.getId()]=e)),this.previousPivotResultCols=null}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null;this.columnModel.refreshCols(),this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=e=>{e.forEach((e=>{if(k(e.children)){const t=e;i&&i(t),s(t.children)}else{t&&t(e)}}))};e&&s(e)}},Ue=class extends I{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,i,s){const o=[];e.forEach((e=>{const i=this.columnModel.getColDefCol(e.key)||this.columnModel.getCol(e.key);if(!i)return;o.push({width:e.newWidth,ratios:[1],columns:[i]});if("shift"===this.gos.get("colResizeDefault")&&(t=!t),t){const t=this.visibleColsService.getColAfter(i);if(!t)return;const s=i.getActualWidth()-e.newWidth,n=t.getActualWidth()+s;o.push({width:n,ratios:[1],columns:[t]})}})),0!==o.length&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(!(!t||t.every((e=>this.checkMinAndMaxWidthsForSet(e))))){if(i){const e=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(e,i,s)}return}const o=[],n=[];t.forEach((e=>{const{width:t,columns:i,ratios:r}=e,l={},a={};i.forEach((e=>n.push(e)));let h=!0,d=0;for(;h;){if(d++,d>1e3){de("infinite loop in resizeColumnSets");break}h=!1;const e=[];let s=0,o=t;i.forEach(((t,i)=>{if(a[t.getId()])o-=l[t.getId()];else{e.push(t);const o=r[i];s+=o}}));const n=1/s;e.forEach(((i,s)=>{let d;s===e.length-1?d=o:(d=Math.round(r[s]*t*n),o-=d);const c=i.getMinWidth(),u=i.getMaxWidth();d<c?(d=c,a[i.getId()]=!0,h=!0):u>0&&d>u&&(d=u,a[i.getId()]=!0,h=!0),l[i.getId()]=d}))}i.forEach((e=>{const t=l[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,s),o.push(e))}))}));const r=o.length>0;let l=[];r&&(l=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.visibleColsService.setLeftValues(s),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const a=n.concat(l);(r||i)&&this.eventDispatcher.columnResized(a,i,s,l)}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,n=!0;t.forEach((e=>{const t=e.getMinWidth();s+=t||0;const i=e.getMaxWidth();i>0?o+=i:n=!1}));return i>=s&&(!n||i<=o)}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const i=this.visibleColsService.getCenterCols();let s=-1;if(e.resizingCols){const t=new Set(e.resizingCols);for(let e=i.length-1;e>=0;e--)if(t.has(i[e])){s=e;break}}let o=0,n=[],r=0,l=0;for(let e=0;e<i.length;e++){i[e].getFlex()&&e>s?(n.push(i[e]),l+=i[e].getFlex(),r+=i[e].getMinWidth()):o+=i[e].getActualWidth()}if(!n.length)return[];let a=[];o+r>this.flexViewportWidth&&(n.forEach((e=>e.setActualWidth(e.getMinWidth(),t))),a=n,n=[]);const h=[];let d;e:for(;;){d=this.flexViewportWidth-o;const e=d/l;for(let i=0;i<n.length;i++){const s=n[i],r=e*s.getFlex();let d=0;const c=s.getMinWidth(),u=s.getMaxWidth();if(r<c?d=c:r>u&&(d=u),d){s.setActualWidth(d,t),m(n,s),l-=s.getFlex(),a.push(s),o+=s.getActualWidth();continue e}h[i]=Math.round(r)}break}let c=d;return n.forEach(((e,i)=>{e.setActualWidth(Math.min(h[i],c),t),a.push(e),c-=h[i]})),e.skipSetLeft||this.visibleColsService.setLeftValues(t),e.updateBodyWidths&&this.visibleColsService.updateBodyWidths(),e.fireResizedEvent&&this.eventDispatcher.columnResized(a,!0,t,n),n}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.sizeColumnsToFit(e,t,i,s)));const o={};s&&s?.columnLimits?.forEach((({key:e,...t})=>{o["string"==typeof e?e:e.getColId()]=t}));const n=this.visibleColsService.getAllCols(),r=e===Re(n);if(e<=0||!n.length||r)return;const l=[],a=[];n.forEach((e=>{!0===e.getColDef().suppressSizeToFit?a.push(e):l.push(e)}));const h=l.slice(0);let d=!1;const c=e=>{C(l,e),a.push(e)};for(l.forEach((e=>{e.resetActualWidth(t);const i=o?.[e.getId()],n=i?.minWidth??s?.defaultMinWidth,r=i?.maxWidth??s?.defaultMaxWidth,l=e.getActualWidth();"number"==typeof n&&l<n?e.setActualWidth(n,t,!0):"number"==typeof r&&l>r&&e.setActualWidth(r,t,!0)}));!d;){d=!0;const i=e-Re(a);if(i<=0)l.forEach((e=>{const i=o?.[e.getId()]?.minWidth??s?.defaultMinWidth;"number"!=typeof i?e.setMinimum(t):e.setActualWidth(i,t,!0)}));else{const e=i/Re(l);let n=i;for(let i=l.length-1;i>=0;i--){const r=l[i],a=o?.[r.getId()],h=a?.minWidth??s?.defaultMinWidth,u=a?.maxWidth??s?.defaultMaxWidth,g=r.getMinWidth(),p=r.getMaxWidth(),m="number"==typeof h&&h>g?h:g,C="number"==typeof u&&u<p?u:p;let f=Math.round(r.getActualWidth()*e);f<m?(f=m,c(r),d=!1):f>C?(f=C,c(r),d=!1):0===i&&(f=n),r.setActualWidth(f,t,!0),n-=f}}}h.forEach((e=>{e.fireColumnWidthChangedEvent(t)})),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),i||this.eventDispatcher.columnResized(h,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout((()=>{if("fitGridWidth"===t){const{columnLimits:t,defaultMinWidth:i,defaultMaxWidth:s}=e,o=t?.map((({colId:e,minWidth:t,maxWidth:i})=>({key:e,minWidth:t,maxWidth:i})));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:i,defaultMaxWidth:s,columnLimits:o})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")}))}};function Ke(e,t){return e+"_"+t}function $e(e){return e instanceof je}var je=class extends I{constructor(e,t,i,s){super(),this.isColumn=!1,this.displayedChildren=[],this.parent=null,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return Ke(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every((e=>e.isMoving()))}checkLeft(){if(this.displayedChildren.forEach((e=>{$e(e)&&e.checkLeft()})),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const e=c(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach((t=>{e+=t.getActualWidth()})),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach((t=>{t.isResizable()&&(e=!0)})),e}getMinWidth(){let e=0;return this.displayedChildren.forEach((t=>{e+=t.getMinWidth()})),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach((t=>{te(t)?e.push(t):$e(t)&&t.addDisplayedLeafColumns(e)}))}addLeafColumns(e){this.children.forEach((t=>{te(t)?e.push(t):$e(t)&&t.addLeafColumns(e)}))}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;null!=e&&e.isPadding();)e=e.getParent();if(!(!!e&&e.getProvidedColumnGroup().isExpandable()))return this.displayedChildren=this.children,void this.dispatchLocalEvent({type:"displayedChildrenChanged"});this.children.forEach((t=>{if($e(t)&&(!t.displayedChildren||!t.displayedChildren.length))return;switch(t.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(t);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(t);break;default:this.displayedChildren.push(t)}})),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},qe=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}},Ye=class extends I{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=Xe(this.treeLeft),this.columnsCenter=Xe(this.treeCenter),this.columnsRight=Xe(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter((e=>e.isAutoHeight())),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols()}updateBodyWidths(){const e=Re(this.columnsCenter),t=Re(this.columnsLeft),i=Re(this.columnsRight);this.bodyWidthDirty=this.bodyWidth!==e;if(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const s={type:"columnContainerWidthChanged"};this.eventService.dispatchEvent(s);const o={type:"displayedColumnsWidthChanged"};this.eventService.dispatchEvent(o)}}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,i=this.columnsRight?c(this.columnsRight):null):(t=this.columnsLeft?c(this.columnsLeft):null,i=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach((s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)}))}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter((e=>"left"==e.getPinned())),i=e.filter((e=>"right"==e.getPinned())),s=e.filter((e=>"left"!=e.getPinned()&&"right"!=e.getPinned())),o=new qe;this.treeLeft=this.createGroups({columns:t,idCreator:o,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:i,idCreator:o,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:s,idCreator:o,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],i=[],s=[];for(const o of e){const e=o.getPinned();e?!0===e||"left"===e?t.push(o):s.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(s)}getAriaColIndex(e){let t;return t=$e(e)?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach((e=>{e.forEach((e=>{if($e(e)){e.checkLeft()}}))}))}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const t=this.columnModel.getCols().slice(0),i=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach((s=>{if(i){let t=Re(s);s.forEach((i=>{t-=i.getActualWidth(),i.setLeft(t,e)}))}else{let t=0;s.forEach((i=>{i.setLeft(t,e),t+=i.getActualWidth()}))}!function(e,t){for(let i=0;i<t.length;i++)m(e,t[i])}(t,s)})),t.forEach((t=>{t.setLeft(null,e)}))}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,i,s){const o=[];let n=null;for(let r=0;r<t.length;r++){const l=t[r],a=t.length-r,h=Math.min(l.getColSpan(e),a),d=[l];if(h>1){const e=h-1;for(let i=1;i<=e;i++)d.push(t[r+i]);r+=e}let c;if(i?(c=!1,d.forEach((e=>{i(e)&&(c=!0)}))):c=!0,c){if(0===o.length&&n){!!s&&s(l)&&o.push(n)}o.push(l)}n=l}return o}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),i=t.indexOf(e);return i>0?t[i-1]:null}getGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o="After"===t?c(s):s[0],n=`getCol${t}`;for(;;){const t=this[n](o);if(!t)return null;const s=this.getColGroupAtLevel(t,i);if(s!==e)return s}}getColGroupAtLevel(e,t){let i,s,o=e.getParent();for(;;){if(i=o.getProvidedColumnGroup().getLevel(),s=o.getPaddingLevel(),i+s<=t)break;o=o.getParent()}return o}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=e=>{this.colsAndGroupsMap[e.getUniqueId()]=e};Qe(this.treeCenter,!1,e),Qe(this.treeLeft,!1,e),Qe(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){Qe(this.getAllTrees(),!1,(e=>{$e(e)&&e.calculateDisplayedColumns()}))}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?c(s):s[0]}return null}getColumnGroup(e,t){if(!e)return null;if($e(e))return e;const i=this.getAllTrees(),s="number"==typeof t;let o=null;return Qe(i,!1,(i=>{if($e(i)){const n=i;let r;r=s?e===n.getGroupId()&&t===n.getPartId():e===n.getGroupId(),r&&(o=n)}})),o}getColAfter(e){const t=this.getAllCols(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}isBodyWidthDirty(){return this.bodyWidthDirty}setBodyWidthDirty(){this.bodyWidthDirty=!0}getColsLeftWidth(){return Re(this.columnsLeft)}getDisplayedColumnsRightWidth(){return Re(this.columnsRight)}isColAtEdge(e,t){const i=this.getAllCols();if(!i.length)return!1;const s="first"===t;let o;if($e(e)){const t=e.getDisplayedLeafColumns();if(!t.length)return!1;o=s?t[0]:c(t)}else o=e;return(s?i[0]:c(i))===o}createGroups(e){const{columns:t,idCreator:i,pinned:s,oldDisplayedGroups:o,isStandaloneStructure:n}=e,r=this.mapOldGroupsById(o),l=[];let a=t;for(;a.length;){const e=a;a=[];let t=0;const o=o=>{const h=t;t=o;const d=e[h],c=($e(d)?d.getProvidedColumnGroup():d).getOriginalParent();if(null==c){for(let t=h;t<o;t++)l.push(e[t]);return}const u=this.createColGroup(c,i,r,s,n);for(let t=h;t<o;t++)u.addChild(e[t]);a.push(u)};for(let i=1;i<e.length;i++){const s=e[i],n=($e(s)?s.getProvidedColumnGroup():s).getOriginalParent(),r=e[t];n!==($e(r)?r.getProvidedColumnGroup():r).getOriginalParent()&&o(i)}t<e.length&&o(e.length)}return n||this.setupParentsIntoCols(l,null),l}createColGroup(e,t,i,s,o){const n=e.getGroupId(),r=t.getInstanceIdForKey(n);let l=i[Ke(n,r)];return l&&l.getProvidedColumnGroup()!==e&&(l=null),k(l)?l.reset():(l=new je(e,n,r,s),o||this.createBean(l)),l}mapOldGroupsById(e){const t={},i=e=>{e.forEach((e=>{if($e(e)){const s=e;t[e.getUniqueId()]=s,i(s.getChildren())}}))};return e&&i(e),t}setupParentsIntoCols(e,t){e.forEach((e=>{if(e.setParent(t),$e(e)){const t=e;this.setupParentsIntoCols(t.getChildren(),t)}}))}};function Qe(e,t,i){if(e)for(let s=0;s<e.length;s++){const o=e[s];if($e(o)){Qe(t?o.getDisplayedChildren():o.getChildren(),t,i)}i(o)}}function Xe(e){const t=[];return Qe(e,!0,(e=>{te(e)&&t.push(e)})),t}var Je=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","rangeSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterOpened","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd"],Ze=[...Je,"scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged"],et={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},tt=class{};tt.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],tt.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"],tt.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],tt.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],tt.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading"],tt.OTHER_PROPERTIES=["suppressStickyTotalRow"],tt.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],tt.ALL_PROPERTIES=[...tt.ARRAY_PROPERTIES,...tt.OBJECT_PROPERTIES,...tt.STRING_PROPERTIES,...tt.NUMBER_PROPERTIES,...tt.FUNCTION_PROPERTIES,...tt.BOOLEAN_PROPERTIES,...tt.OTHER_PROPERTIES];var it=tt,st=class{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}};st.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",st.PUBLIC_EVENTS=Je,st.EVENT_CALLBACKS=Ze.map((e=>st.getCallbackForEvent(e))),st.BOOLEAN_PROPERTIES=it.BOOLEAN_PROPERTIES,st.ALL_PROPERTIES=it.ALL_PROPERTIES,st.ALL_PROPERTIES_AND_CALLBACKS=[...st.ALL_PROPERTIES,...st.EVENT_CALLBACKS],st.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(st.ALL_PROPERTIES_AND_CALLBACKS);var ot=st;function nt(e,t){"object"!=typeof e&&(e={});const i={...e};return ot.ALL_PROPERTIES_AND_CALLBACKS.forEach((e=>{const s=t[e];void 0!==s&&s!==ot.VUE_OMITTED_PROPERTY&&(i[e]=s)})),i}function rt(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).filter((e=>ot.ALL_PROPERTIES_AND_CALLBACKS_SET.has(e))).forEach((t=>{i[t]=e[t],s=!0})),!s)return;const o={type:"gridOptionsChanged",options:i};t.dispatchEvent(o);const n={type:"componentStateChanged"};K(i,((e,t)=>{n[e]=t})),t.dispatchEvent(n)}var lt,at,ht,dt,ct,ut,gt,pt,mt,Ct=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)return void t.forEach((e=>this.addCssClass(e)));if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)return void t.forEach((e=>this.removeCssClass(e)));if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1)return void i.forEach((e=>this.addOrRemoveCssClass(e,t)))}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}};function ft(e,t,i){null==i||"string"==typeof i&&""==i?wt(e,t):vt(e,t,i)}function vt(e,t,i){e.setAttribute(St(t),i.toString())}function wt(e,t){e.removeAttribute(St(t))}function St(e){return`aria-${e}`}function yt(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function bt(e){return parseInt(e.getAttribute("aria-posinset"),10)}function Rt(e,t){ft(e,"label",t)}function Ft(e,t){ft(e,"labelledby",t)}function Pt(e,t){ft(e,"describedby",t)}function Et(e,t){ft(e,"live",t)}function Dt(e,t){ft(e,"level",t)}function Mt(e,t){ft(e,"disabled",t)}function Tt(e,t){ft(e,"hidden",t)}function xt(e,t){ft(e,"activedescendant",t)}function At(e,t){vt(e,"expanded",t)}function It(e){wt(e,"expanded")}function Lt(e,t){vt(e,"setsize",t)}function Ot(e,t){vt(e,"posinset",t)}function kt(e,t){vt(e,"rowcount",t)}function Gt(e,t){vt(e,"rowindex",t)}function Nt(e,t){vt(e,"colcount",t)}function Ht(e,t){vt(e,"colindex",t)}function Bt(e,t){vt(e,"colspan",t)}function Vt(e,t){vt(e,"sort",t)}function Wt(e){wt(e,"sort")}function zt(e,t){ft(e,"selected",t)}function _t(e,t){vt(e,"checked",void 0===t?"mixed":t)}function Ut(e,t){ft(e,"controls",t.id),Ft(t,e.id)}function Kt(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function $t(){return void 0===lt&&(lt=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),lt}function jt(){if(void 0===at)if($t()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(at=null!=e[1]?parseFloat(e[1]):0)}else at=0;return at}function qt(){if(void 0===ht){const e=window;ht=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return ht}function Yt(){return void 0===dt&&(dt=/(firefox)/i.test(navigator.userAgent)),dt}function Qt(){return void 0===ct&&(ct=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),ct}function Xt(){return void 0===ut&&(ut=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),ut}function Jt(){return!$t()||jt()>=15}function Zt(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||Yt())?t.toString():null}function ei(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(pt=i,gt=0===i)}function ti(){return null==gt&&ei(),gt}function ii(e,t,i){const s=e.parentElement;let o=s&&s.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),i&&o.classList.toggle(i,o!==e),o=o.nextSibling}var si="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function oi(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),s=t.call(e,si),o=yi(e);return i&&!s&&o}function ni(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Tt(e,!t)}function ri(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Tt(e,!t)}function li(e,t){const i="disabled",s=t?e=>e.setAttribute(i,""):e=>e.removeAttribute(i);s(e),Ii(e.querySelectorAll("input"),(e=>s(e)))}function ai(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++s>i)break}else if(e===i)break}return!1}function hi(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:n,borderLeftWidth:r,paddingTop:l,paddingRight:a,paddingBottom:h,paddingLeft:d,marginTop:c,marginRight:u,marginBottom:g,marginLeft:p,boxSizing:m}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(n||"0"),borderLeftWidth:parseFloat(r||"0"),paddingTop:parseFloat(l||"0"),paddingRight:parseFloat(a||"0"),paddingBottom:parseFloat(h||"0"),paddingLeft:parseFloat(d||"0"),marginTop:parseFloat(c||"0"),marginRight:parseFloat(u||"0"),marginBottom:parseFloat(g||"0"),marginLeft:parseFloat(p||"0"),boxSizing:m}}function di(e){const t=hi(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function ci(e){const t=hi(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function ui(e){const{height:t,marginBottom:i,marginTop:s}=hi(e);return Math.floor(t+i+s)}function gi(e){const{width:t,marginLeft:i,marginRight:s}=hi(e);return Math.floor(t+i+s)}function pi(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:n}=hi(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(n||0)}}function mi(){if("boolean"==typeof mt)return mt;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n <span style="display: inline-block; width: 1px"></span>\n <span style="display: inline-block; width: 1px"></span>\n </div>',document.body.appendChild(e),e.scrollLeft=1,mt=0===Math.floor(e.scrollLeft),document.body.removeChild(e),mt}function Ci(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),qt()&&!mi()&&(i=e.scrollWidth-e.clientWidth-i)),i}function fi(e,t,i){i&&(mi()?t*=-1:($t()||qt())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function vi(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function wi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Si(e){return!!e.offsetParent}function yi(e){const t=e;if(t.checkVisibility)return t.checkVisibility({checkVisibilityCSS:!0});return!(!Si(e)||"visible"!==window.getComputedStyle(e).visibility)}function bi(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function Ri(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Fi(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function Pi(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||null==s)continue;const t=i.replace(/[A-Z]/g,(e=>`-${e.toLocaleLowerCase()}`)),o=s.toString(),n=o.replace(/\s*!important/g,""),r=n.length!=o.length?"important":void 0;e.style.setProperty(t,n,r)}}function Ei(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Di(e,t)}function Di(e,t){t=Ti(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function Mi(e,t){t=Ti(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Ti(e){return"number"==typeof e?`${e}px`:e}function xi(e){return e instanceof Node||e instanceof HTMLElement}function Ai(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function Ii(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function Li(e,t){e.then((e=>{const i=e.getGui();null!=i&&("object"==typeof i?t.appendChild(i):t.innerHTML=i)}))}var Oi=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},ki=class e extends I{constructor(e,t,i,s){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.shouldDisplayTooltip=s,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(e){this.popupService=e.popupService,this.userComponentFactory=e.userComponentFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.parentComp.getGui();0===this.tooltipTrigger&&this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),1===this.tooltipTrigger&&this.addManagedListeners(e,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(e,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(e,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return t<0&&he(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){return"show"===e?this.tooltipShowDelayOverride??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipHideDelayOverride??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),Xt()||(e.isLocked?this.showTooltipTimeoutId=window.setTimeout((()=>{this.prepareToShowTooltip(t)}),100):this.prepareToShowTooltip(t))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,i=this.parentComp.getGui(),s=this.tooltipComp?.getGui();this.isInteractingWithTooltip||i.contains(t)||this.interactionEnabled&&s?.contains(t)||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||e.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-e.lastTooltipHideTime<1e3}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e={...this.parentComp.getTooltipParams()};if(!k(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),e.lastTooltipHideTime=(new Date).getTime());const i={type:"tooltipHide",parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),t&&(this.isInteractingWithTooltip=!1),this.state=0}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.destroyBean(t);const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const s=this.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({eChild:i,ariaLabel:s("ariaLabelTooltip","Tooltip")});if(o&&(this.tooltipPopupDestroyFunc=o.hideFunc),this.positionTooltip(),1===this.tooltipTrigger){const e=this.setToDoNothing.bind(this);[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:e,columnMoved:e})}this.interactionEnabled&&(0===this.tooltipTrigger?[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(i,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}):[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(i,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}));const n={type:"tooltipShow",tooltipGui:i,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(n),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){const t=this.parentComp.getGui(),i=this.tooltipComp?.getGui(),s=e.relatedTarget;i?.contains(s)||(this.isInteractingWithTooltip=!1,t.contains(s)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...e,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...e,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,i=0===this.tooltipTrigger?1e3:0;window.setTimeout((()=>{e(),this.destroyBean(t)}),i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach((e=>{e&&e()})),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){e.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout((()=>{this.unlockService(),this.setToDoNothing()}),100)}unlockService(){e.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};ki.isLocked=!1;var Gi=ki,Ni=class extends I{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(null!=e&&""!=e?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){if(null!=this.tooltipManager)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new Gi(e,this.ctrl.getTooltipShowDelayOverride?.(),this.ctrl.getTooltipHideDelayOverride?.(),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>this.tooltipManager?.hideTooltip(!0)}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},Hi=new Oi,Bi=null,Vi=class e extends I{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Hi.next(),this.cssClassManager=new Ct((()=>this.eGui)),this.componentSelectors=new Map((t??[]).map((e=>[e.selector,e]))),e&&this.setTemplate(e)}preWireBeans(e){super.preWireBeans(e)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const{newTooltipText:t,showDelayOverride:i,hideDelayOverride:s,location:o,shouldDisplayTooltip:n}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);const r=()=>this.tooltipText;null!=t&&(this.tooltipFeature=this.createBean(new Ni({getTooltipValue:r,getGui:()=>this.getGui(),getLocation:()=>o??"UNKNOWN",getColDef:e?.getColDef,getColumn:e?.getColumn,getTooltipShowDelayOverride:null!=i?()=>i:void 0,getTooltipHideDelayOverride:null!=s?()=>s:void 0,shouldDisplayTooltip:n})))}applyElementsToComponent(e,t,i,s=null){if(void 0===t&&(t=e.getAttribute("data-ref")),t){const o=this[t];if(o===Bi)this[t]=s??e;else{const e=i&&i[t];this.suppressDataRefValidation||e||he(`Issue with data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){(function(e){if(null==e)return[];const t=[];return Ii(e,(e=>t.push(e))),t})(e.childNodes).forEach((i=>{if(!(i instanceof HTMLElement))return;const s=this.createComponentFromElement(i,(e=>{e.getGui()&&this.copyAttributesFromNode(i,e.getGui())}),t);if(s){if(s.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);s.addItems(e)}this.swapComponentForNode(s,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)}))}createComponentFromElement(t,i,s){const o=t.nodeName,n=t.getAttribute("data-ref"),r=0===o.indexOf("AG-"),l=r?this.componentSelectors.get(o):null;let a=null;if(l){e.elementGettingCreated=t;const o=s&&n?s[n]:void 0;a=new l.component(o),a.setParentComponent(this),this.createBean(a,null,i)}else r&&he(`Missing selector: ${o}`);return this.applyElementsToComponent(t,n,s,a),a}copyAttributesFromNode(e,t){!function(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}(e.attributes,((e,i)=>t.setAttribute(e,i)))}swapComponentForNode(e,t,i){const s=e.getGui();t.replaceChild(s,i),t.insertBefore(document.createComment(i.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach((e=>e.setAttribute("tabindex",t.toString())))}setTemplate(e,t,i){const s=bi(e);this.setTemplateFromElement(s,t,i)}setTemplateFromElement(e,t,i,s=!1){if(this.eGui=e,this.suppressDataRefValidation=s,t)for(let e=0;e<t.length;e++){const i=t[e];this.componentSelectors.set(i.selector,i)}this.wireTemplate(e,i)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let i=t;return null==e?null:(i||(i=this.eGui),xi(e)?{element:e,parent:i}:{element:e.getGui(),parent:i})}prependChild(e,t){const{element:i,parent:s}=this.getContainerAndElement(e,t)||{};i&&s&&s.insertAdjacentElement("afterbegin",i)}appendChild(e,t){const{element:i,parent:s}=this.getContainerAndElement(e,t)||{};i&&s&&s.appendChild(i)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;ri(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:i}=t;ni(this.eGui,e,{skipAriaHidden:i});const s={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(s)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}addGuiEventListener(e,t,i){this.eGui.addEventListener(e,t,i),this.addDestroyFunc((()=>this.eGui.removeEventListener(e,t)))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}},Wi={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"};function zi(e,t,i){const s=_i(e,t,i);if(s){const{className:e}=s;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function _i(e,t,i,s){let o=null;const n=i&&i.getColDef().icons;if(n&&(o=n[e]),t&&!o){const i=t.get("icons");i&&(o=i[e])}if(!o){const t=document.createElement("span");let i=Wi[e];return i||(s?i=e:(he(`Did not find icon ${e}`),i="")),t.setAttribute("class",`ag-icon ag-icon-${i}`),t.setAttribute("unselectable","on"),yt(t,"presentation"),t}{let e;if("function"==typeof o)e=o();else{if("string"!=typeof o)throw new Error("icon from grid options needs to be a string or a function");e=o}if("string"==typeof e)return bi(e);if(xi(e))return e;he("iconRenderer should return back a string or a dom object")}}function Ui(e,t,i){if(0===i)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}var Ki=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new h,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push((()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})}))}getActiveTouch(e){for(let t=0;t<e.length;t++){if(e[t].identifier===this.touchStart.identifier)return e[t]}return null}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout((()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const t={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(t)}}),500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!Ui(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const e={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(e),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0){if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const e={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(e),this.lastTapTime=null}else this.lastTapTime=e}else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach((e=>e()))}},$i=class extends Vi{constructor(e){super(),this.eSortOrder=Bi,this.eSortAsc=Bi,this.eSortDesc=Bi,this.eSortMixed=Bi,this.eSortNone=Bi,e||this.setTemplate('<span class="ag-sort-indicator-container">\n <span data-ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n <span data-ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n <span data-ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n <span data-ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n <span data-ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n </span>')}wireBeans(e){this.sortController=e.sortController}attachCustomElements(e,t,i,s,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=o}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),(this.column.isSortable()||this.column.getColDef().showRowGroup)&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",(()=>this.updateIcons())),this.addManagedEventListeners({newColumnsLoaded:this.updateIcons.bind(this),sortChanged:this.onSortChanged.bind(this),columnRowGroupChanged:this.onSortChanged.bind(this)}),this.onSortChanged())}addInIcon(e,t,i){if(null==t)return;const s=_i(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;ni(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;ni(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=null==e;ni(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);ni(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){if(!this.eSortOrder)return;const e=this.sortController.getColumnsWithSortingOrdered(),t=this.sortController.getDisplaySortIndexForColumn(this.column)??-1,i=e.some((e=>this.sortController.getDisplaySortIndexForColumn(e)??!1)),s=t>=0&&i;ni(this.eSortOrder,s,{skipAriaHidden:!0}),t>=0?this.eSortOrder.textContent=(t+1).toString():vi(this.eSortOrder)}},ji={selector:"AG-SORT-INDICATOR",component:$i},qi=class extends Vi{constructor(){super(...arguments),this.eFilter=Bi,this.eFilterButton=Bi,this.eSortIndicator=Bi,this.eMenu=Bi,this.eLabel=Bi,this.eText=Bi,this.eSortOrder=Bi,this.eSortAsc=Bi,this.eSortDesc=Bi,this.eSortMixed=Bi,this.eSortNone=Bi,this.lastMovingChanged=0}wireBeans(e){this.sortController=e.sortController,this.menuService=e.menuService,this.funcColsService=e.funcColsService}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()==this.currentTemplate&&this.workOutShowMenu()==this.currentShowMenu&&this.workOutSort()==this.currentSort&&this.shouldSuppressMenuHide()==this.currentSuppressMenuHide&&t.enableFilterButton==e.enableFilterButton&&t.enableFilterIcon==e.enableFilterIcon&&(this.setDisplayName(e),!0)}workOutTemplate(){let e=this.params.template??'<div class="ag-cell-label-container" role="presentation">\n <span data-ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n <span data-ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\n <div data-ref="eLabel" class="ag-header-cell-label" role="presentation">\n <span data-ref="eText" class="ag-header-cell-text"></span>\n <span data-ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>\n </div>\n </div>';return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate,[ji]),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=We(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(null==t)return;const s=_i(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new Ki(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&k(this.eMenu),o=s?new Ki(this.eMenu,!0):t;if(this.params.enableMenu){const e=s?"tap":"longTap",t=e=>this.params.showColumnMenuAfterMouseClick(e.touchStart);this.addManagedListeners(o,{[e]:t})}if(this.params.enableSorting){const e=e=>{const t=e.touchStart.target;i&&(this.eMenu?.contains(t)||this.eFilterButton?.contains(t))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListeners(t,{tap:e})}if(this.params.enableFilterButton){const e=new Ki(this.eFilterButton,!0);this.addManagedListeners(e,{tap:()=>this.params.showFilter(this.eFilterButton)}),this.addDestroyFunc((()=>e.destroy()))}this.addDestroyFunc((()=>t.destroy())),s&&this.addDestroyFunc((()=>o.destroy()))}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return wi(this.eMenu),void(this.eMenu=void 0);const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedElementListeners(this.eMenu,{click:()=>this.params.showColumnMenu(this.eMenu)}),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){const t=this.params.column,i=this.menuService.isLegacyMenuEnabled();if(e&&!i){if(this.menuService.isFilterMenuInHeaderEnabled(t))return this.params.showFilter(this.eFilterButton??this.eMenu??this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(this.eMenu??this.eFilterButton??this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.createBean(new $i(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListeners(this.params.column,{movingChanged:()=>{this.lastMovingChanged=(new Date).getTime()}}),this.eLabel&&this.addManagedElementListeners(this.eLabel,{click:e=>{const t=this.params.column.isMoving(),i=(new Date).getTime()-this.lastMovingChanged<50;if(!(t||i)){const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.params.progressSort(t)}}});const e=()=>{const e=this.params.column.getSort();if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc","asc"===e),this.addOrRemoveCssClass("ag-header-cell-sorted-desc","desc"===e),this.addOrRemoveCssClass("ag-header-cell-sorted-none",!e),this.params.column.getColDef().showRowGroup){const e=this.funcColsService.getSourceColumnsForGroupColumn(this.params.column),t=e?.every((e=>this.params.column.getSort()==e.getSort())),i=!t;this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",i)}};this.addManagedEventListeners({sortChanged:e,columnRowGroupChanged:e})}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedElementListeners(this.eFilterButton,{click:()=>this.params.showFilter(this.eFilterButton)}):this.eFilterButton=void 0}configureFilter(e,t,i){if(!e)return wi(t),!1;const s=this.params.column;return this.addInIcon("filter",t,s),this.addManagedListeners(s,{filterChanged:i}),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();ni(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){return e?this.eFilterButton??this.eMenu??this.getGui():this.eMenu??this.eFilterButton??this.getGui()}},Yi=class extends Vi{constructor(){super('<div class="ag-header-group-cell-label" role="presentation">\n <span data-ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n <span data-ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n <span data-ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n </div>'),this.agOpened=Bi,this.agClosed=Bi,this.agLabel=Bi}wireBeans(e){this.columnModel=e.columnModel}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&he("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened",this.agOpened),this.addInIcon("columnGroupClosed",this.agClosed);const e=e=>{if(M(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.agClosed,e),this.addTouchAndClickListeners(this.agOpened,e);const t=e=>{D(e)};this.addManagedElementListeners(this.agClosed,{dblclick:t}),this.addManagedElementListeners(this.agOpened,{dblclick:t}),this.addManagedElementListeners(this.getGui(),{dblclick:e}),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup(),s=this.updateIconVisibility.bind(this);this.addManagedListeners(i,{expandedChanged:s,expandableChanged:s})}addTouchAndClickListeners(e,t){const i=new Ki(e,!0);this.addManagedListeners(i,{tap:t}),this.addDestroyFunc((()=>i.destroy())),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();ni(this.agOpened,e),ni(this.agClosed,!e)}else ni(this.agOpened,!1),ni(this.agClosed,!1)}addInIcon(e,t){const i=_i(e,this.gos,null);i&&t.appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return ni(this.agOpened,!1),void ni(this.agClosed,!1)}setupLabel(){const{displayName:e,columnGroup:t}=this.params;if(k(e)){const t=We(e,!0);this.agLabel.textContent=t}this.addOrRemoveCssClass("ag-sticky-label",!t.getColGroupDef()?.suppressStickyLabel)}},Qi=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(Qi||{}),Xi=class e{static register(t){e.__register(t,!0,void 0)}static registerModules(t){e.__registerModules(t,!0,void 0)}static __register(t,i,s){e.runVersionChecks(t),void 0!==s?(e.areGridScopedModules=!0,void 0===e.gridModulesMap[s]&&(e.gridModulesMap[s]={}),e.gridModulesMap[s][t.moduleName]=t):e.globalModulesMap[t.moduleName]=t,e.setModuleBased(i)}static __unRegisterGridModules(t){delete e.gridModulesMap[t]}static __registerModules(t,i,s){e.setModuleBased(i),t&&t.forEach((t=>e.__register(t,i,s)))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[o,n]=e.currentModuleVersion.split(".")||[];return i===o&&s===n}static runVersionChecks(t){e.currentModuleVersion||(e.currentModuleVersion=t.version);const i=e=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${e} Please update all modules to the same version.`;if(t.version?e.isValidModuleVersion(t)||de(i(`'${t.moduleName}' is version ${t.version} but the other modules are version ${e.currentModuleVersion}.`)):de(i(`'${t.moduleName}' is incompatible.`)),t.validate){const e=t.validate();if(!e.isValid){de(`${e.message}`)}}}static setModuleBased(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&(de("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),de("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information."))}static __setIsBundled(){e.isBundled=!0}static __assertRegistered(t,i,s){if(this.__isRegistered(t,s))return!0;let o;if(e.isBundled)o=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(e.moduleBased||void 0===e.moduleBased){const n=Object.entries(Qi).find((([e,i])=>i===t))?.[0];o=`AG Grid: unable to use ${i} as the ${n} is not registered${e.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:\n \n import { ModuleRegistry } from '@ag-grid-community/core';\n import { ${n} } from '${t}';\n \n ModuleRegistry.registerModules([ ${n} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n \n import 'ag-grid-enterprise';`;return de(o),!1}static __isRegistered(t,i){return!!e.globalModulesMap[t]||!!e.gridModulesMap[i]?.[t]}static __getRegisteredModules(t){return[...U(e.globalModulesMap),...U(e.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){return U(e.gridModulesMap[t]??{})||[]}static __isPackageBased(){return!e.moduleBased}};Xi.globalModulesMap={},Xi.gridModulesMap={},Xi.areGridScopedModules=!1;var Ji=Xi,Zi=class extends Vi{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}wireBeans(e){this.filterManager=e.filterManager}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),o=k(s)?s:i,n=t>=0;this.eDelta.textContent=n?"↑"+o:"↓"+o,this.eDelta.classList.toggle("ag-value-change-delta-up",n),this.eDelta.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.hideDeltaValue()}),2e3)}))}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),vi(this.eDelta)}refresh(e,t=!1){const i=e.value;if(i===this.lastValue)return!1;if(k(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:k(e.value)?this.eValue.textContent=i:vi(this.eValue),this.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof i&&"number"==typeof this.lastValue){const t=i-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}},es=class extends Vi{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}wireBeans(e){this.filterManager=e.filterManager}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")}),50),window.setTimeout((()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)}),3e3)}))}refresh(e,t=!1){let i=e.value;return G(i)&&(i=""),i!==this.lastValue&&(!this.filterManager?.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=i,k(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:k(e.value)?this.eCurrent.textContent=i:vi(this.eCurrent),!0))}},ts=class{};ts.BACKSPACE="Backspace",ts.TAB="Tab",ts.ENTER="Enter",ts.ESCAPE="Escape",ts.SPACE=" ",ts.LEFT="ArrowLeft",ts.UP="ArrowUp",ts.RIGHT="ArrowRight",ts.DOWN="ArrowDown",ts.DELETE="Delete",ts.F2="F2",ts.PAGE_UP="PageUp",ts.PAGE_DOWN="PageDown",ts.PAGE_HOME="Home",ts.PAGE_END="End",ts.A="KeyA",ts.C="KeyC",ts.D="KeyD",ts.V="KeyV",ts.X="KeyX",ts.Y="KeyY",ts.Z="KeyZ";var is=class extends Vi{constructor(e,t,i){super(t,i),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:o}=this.config;null!=o&&this.setDisabled(o),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){vi(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(ni(this.eLabel,!1),yt(this.eLabel,"presentation")):(ni(this.eLabel,!0),yt(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||Ei(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return li(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},ss=class extends is{constructor(e,t,i,s){super(e,t,i),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=i&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),i=this.getLabel();null==i||""==i||null!==e.getAttribute("aria-label")?Ft(e,""):Ft(e,t??"")}setAriaLabel(e){return Rt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Di(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}},os=class extends ss{constructor(e,t,i="text",s="input"){super(e,e?.template??`\n <div role="presentation">\n <div data-ref="eLabel" class="ag-input-field-label"></div>\n <div data-ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n <${s} data-ref="eInput" class="ag-input-field-input"></${s}>\n </div>\n </div>`,[],t),this.inputType=i,this.displayFieldTag=s,this.eLabel=Bi,this.eWrapper=Bi,this.eInput=Bi}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return Ei(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return Ai(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Rt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return li(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)Ai(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";Ai(this.eInput,"autocomplete",t)}return this}},ns=class extends os{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:i});const s=this.getInputElement(),o={type:"checkboxChanged",id:s.id,name:s.name,selected:e,previousValue:t};this.eventService.dispatchEvent(o)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},rs={selector:"AG-CHECKBOX",component:ns},ls=class extends Vi{constructor(){super('\n <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\n </div>',[rs]),this.eCheckbox=Bi}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),Et(t,"polite"),this.addManagedListeners(t,{click:e=>{if(D(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)},dblclick:e=>{D(e)}}),this.addManagedElementListeners(this.params.eGridCell,{keydown:e=>{if(e.key===ts.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const t=this.eCheckbox.getValue();this.onCheckboxChanged(t),e.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,i=!0;if(e.node.group&&e.column){const s=e.column.getColId();s.startsWith(ye)?t=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[s]?t=e.value??void 0:i=!1}else t=e.value??void 0;if(!i)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(t);const s=null!=e.disabled?e.disabled:!e.column?.isCellEditable(e.node);this.eCheckbox.setDisabled(s);const o=this.localeService.getLocaleTextFunc(),n=Kt(o,t),r=s?n:`${o("ariaToggleCellValue","Press SPACE to toggle cell value")} (${n})`;this.eCheckbox.setInputAriaLabel(r)}onCheckboxChanged(e){const{column:t,node:i,value:s}=this.params,o={type:"cellEditingStarted",column:t,colDef:t?.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s};this.eventService.dispatchEvent(o);const n=this.params.node.setDataValue(this.params.column,e,"edit"),r={type:"cellEditingStopped",column:t,colDef:t?.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:n};this.eventService.dispatchEvent(r)}},as=class extends Vi{constructor(){super('<div class="ag-loading">\n <span class="ag-loading-icon" data-ref="eLoadingIcon"></span>\n <span class="ag-loading-text" data-ref="eLoadingText"></span>\n </div>'),this.eLoadingIcon=Bi,this.eLoadingText=Bi}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=_i("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},hs=class extends Vi{constructor(){super('<div class="ag-skeleton-container"></div>')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc((()=>Ft(e.eParentOfValue))),Ft(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Rt(this.getGui(),t)}setupLoading(e){const t=this.gos.getDocument().createElement("div");t.classList.add("ag-skeleton-effect");const i=e.node.rowIndex;if(null!=i){const e=75+25*(i%2==0?Math.sin(i):Math.cos(i));t.style.width=`${e}%`}this.getGui().appendChild(t);const s=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");Rt(this.getGui(),s)}refresh(e){return!1}destroy(){super.destroy()}},ds=class extends Vi{constructor(){super()}destroy(){super.destroy()}},cs=class extends ds{init(){const e=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(e??'<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>'),!e){const e=this.localeService.getLocaleTextFunc();setTimeout((()=>{this.getGui().textContent=e("loadingOoo","Loading...")}))}}},us=class extends ds{init(){const e=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(e??'<span class="ag-overlay-no-rows-center"></span>'),!e){const e=this.localeService.getLocaleTextFunc();setTimeout((()=>{this.getGui().textContent=e("noRowsToShow","No Rows To Show")}))}}},gs=class extends Vi{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},ps=class extends gs{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=We(t,!0)}};function ms(e,t,i,s){let o=t.map(((t,i)=>({value:t,relevance:Cs(e.toLowerCase(),t.toLocaleLowerCase()),idx:i})));if(o.sort(((e,t)=>t.relevance-e.relevance)),i&&(o=o.filter((e=>0!==e.relevance))),o.length>0&&s&&s>0){const e=o[0].relevance*s;o=o.filter((t=>e-t.relevance<0))}const n=[],r=[];for(const e of o)n.push(e.value),r.push(e.idx);return{values:n,indices:r}}function Cs(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let o=0,n=-1;for(let e=0;e<i.length;e++){const t=s.indexOf(i[e],n+1);-1!==t&&(n=t,o+=100-100*n/1e4*100)}return o}var fs=class extends I{constructor(){super(...arguments),this.beanName="userComponentRegistry",this.agGridDefaults={agColumnHeader:qi,agColumnGroupHeader:Yi,agSortIndicator:$i,agAnimateShowChangeCellRenderer:Zi,agAnimateSlideCellRenderer:es,agLoadingCellRenderer:as,agSkeletonCellRenderer:hs,agCheckboxCellRenderer:ls,agLoadingOverlay:cs,agNoRowsOverlay:us,agTooltipComponent:ps},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agGroupCellRenderer:"@ag-grid-enterprise/row-grouping",agGroupRowRenderer:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}postConstruct(){const e=this.gos.get("components");null!=e&&K(e,((e,t)=>this.registerJsComponent(e,t)))}registerDefaultComponent(e,t){this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(e,t)=>({componentFromFramework:t,component:e}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(null!=s)return i(s,!0);const o=this.jsComps[t];if(o){return i(o,this.getFrameworkOverrides().isFrameworkComponent(o))}const n=this.agGridDefaults[t];if(n)return i(n,!1);const r=this.enterpriseAgDefaultCompsModule[t];return r?Ji.__assertRegistered(r,`AG Grid '${e}' component: ${t}`,this.gridId):le((()=>{this.warnAboutMissingComponent(e,t)}),"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=ms(t,[...Object.keys(this.agGridDefaults).filter((e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e))),...Object.keys(this.jsComps)],!0,.8).values;he(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),i.length>0&&he(` Did you mean: [${i.slice(0,3)}]?`),he(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},vs=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e((e=>this.onDone(e)),(e=>this.onReject(e)))}static all(t){return t.length?new e((e=>{let i=t.length;const s=new Array(i);t.forEach(((t,o)=>{t.then((t=>{s[o]=t,i--,0===i&&e(s)}))}))})):e.resolve()}static resolve(t=null){return new e((e=>e(t)))}then(t){return new e((e=>{1===this.status?e(t(this.resolution)):this.waiters.push((i=>e(t(i))))}))}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach((t=>t(e)))}onReject(e){}},ws={propertyName:"dateComponent",cellRenderer:!1},Ss={propertyName:"headerComponent",cellRenderer:!1},ys={propertyName:"headerGroupComponent",cellRenderer:!1},bs={propertyName:"cellRenderer",cellRenderer:!0},Rs={propertyName:"cellRenderer",cellRenderer:!1},Fs={propertyName:"loadingCellRenderer",cellRenderer:!0},Ps={propertyName:"cellEditor",cellRenderer:!1},Es={propertyName:"innerRenderer",cellRenderer:!0},Ds={propertyName:"loadingOverlayComponent",cellRenderer:!1},Ms={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Ts={propertyName:"tooltipComponent",cellRenderer:!1},xs={propertyName:"filter",cellRenderer:!1},As={propertyName:"floatingFilterComponent",cellRenderer:!1},Is={propertyName:"toolPanel",cellRenderer:!1},Ls={propertyName:"statusPanel",cellRenderer:!1},Os={propertyName:"fullWidthCellRenderer",cellRenderer:!0},ks={propertyName:"loadingCellRenderer",cellRenderer:!0},Gs={propertyName:"groupRowRenderer",cellRenderer:!0},Ns={propertyName:"detailCellRenderer",cellRenderer:!0},Hs={propertyName:"menuItem",cellRenderer:!1},Bs=class e extends I{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(e){this.agComponentUtils=e.agComponentUtils,this.componentMetadataProvider=e.componentMetadataProvider,this.userComponentRegistry=e.userComponentRegistry,this.frameworkComponentWrapper=e.frameworkComponentWrapper,this.gridOptions=e.gridOptions}getHeaderCompDetails(e,t){return this.getCompDetails(e,Ss,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,ys,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Os,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,ks,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Gs,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Ns,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,Es,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,Es,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,bs,null,t)}getEditorRendererDetails(e,t){return this.getCompDetails(e,Rs,null,t)}getLoadingCellRendererDetails(e,t){return this.getCompDetails(e,Fs,"agSkeletonCellRenderer",t,!0)}getCellEditorDetails(e,t){return this.getCompDetails(e,Ps,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,xs,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,ws,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,Ds,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,Ms,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,Ts,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,bs,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,As,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,Is,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,Ls,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,Hs,"agMenuItem",t,!0)}getCompDetails(t,i,s,o,n=!1){const{propertyName:r,cellRenderer:l}=i;let{compName:a,jsComp:h,fwComp:d,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:g}=e.getCompKeys(this.frameworkOverrides,t,i,o);const p=e=>{const t=this.userComponentRegistry.retrieve(r,e);t&&(h=t.componentFromFramework?void 0:t.component,d=t.componentFromFramework?t.component:void 0)};if(null!=a&&p(a),null==h&&null==d&&null!=s&&p(s),h&&l&&!this.agComponentUtils.doesImplementIComponent(h)&&(h=this.agComponentUtils.adaptFunction(r,h)),!h&&!d)return void(n&&de(`Could not find component ${a}, did you forget to configure this component?`));const m=this.mergeParamsWithApplicationProvidedParams(t,i,o,c),C=null==h,f=h||d;return{componentFromFramework:C,componentClass:f,params:m,type:i,popupFromSelector:u,popupPositionFromSelector:g,newAgStackInstance:()=>this.newAgStackInstance(f,C,m,i)}}static getCompKeys(e,t,i,s){const{propertyName:o}=i;let n,r,l,a,h,d;if(t){const i=t,c=i[o+"Selector"],u=c?c(s):null,g=t=>{if("string"==typeof t)n=t;else if(null!=t&&!0!==t){e.isFrameworkComponent(t)?l=t:r=t}};u?(g(u.component),a=u.params,h=u.popup,d=u.popupPosition):g(i[o])}return{compName:n,jsComp:r,fwComp:l,paramsFromSelector:a,popupFromSelector:h,popupPositionFromSelector:d}}newAgStackInstance(e,t,i,s){const o=s.propertyName;let n;if(!t)n=new e;else{const t=this.componentMetadataProvider.retrieve(o);n=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,s)}const r=this.initComponent(n,i);return null==r?vs.resolve(n):r.then((()=>n))}mergeParamsWithApplicationProvidedParams(e,t,i,s=null){const o=this.gos.getGridCommonParams();Y(o,i);const n=e&&e[t.propertyName+"Params"];if("function"==typeof n){Y(o,n(i))}else"object"==typeof n&&Y(o,n);return Y(o,s),o}initComponent(e,t){if(this.createBean(e),null!=e.init)return e.init(t)}};function Vs(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}var Ws=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,e&&e.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){Object.entries(e.providedBeanInstances).forEach((([e,t])=>{this.beans[e]=t})),e.beanClasses.forEach((e=>{const t=new e;t.beanName?this.beans[t.beanName]=t:console.error(`Bean ${e.name} is missing beanName`),this.createdBeans.push(t)})),e.derivedBeans?.forEach((e=>{const{beanName:t,bean:i}=e(this);this.beans[t]=i,this.createdBeans.push(i)})),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.initBeans([e],t),e}initBeans(e,t){e.forEach((e=>{e.preWireBeans?.(this.beans),e.wireBeans?.(this.beans)})),e.forEach((e=>e.preConstruct?.())),t&&e.forEach(t),e.forEach((e=>e.postConstruct?.()))}getBeans(){return this.beans}getBean(e){return this.beans[e]}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[]}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},zs=class extends Ws{init(e){this.gridId=e.gridId,this.beans.context=this,super.init(e)}destroy(){super.destroy(),Ji.__unRegisterGridModules(this.gridId)}getGridId(){return this.gridId}},_s=(e=>(e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET",e))(_s||{}),Us=(e=>(e[e.Up=0]="Up",e[e.Down=1]="Down",e))(Us||{}),Ks=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(Ks||{}),$s=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))($s||{}),js=class extends I{constructor(){super(...arguments),this.beanName="dragAndDropService",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.dragService=e.dragService,this.mouseEventService=e.mouseEventService,this.environment=e.environment}postConstruct(){this.dropIconMap={pinned:zi("columnMovePin",this.gos,null),hide:zi("columnMoveHide",this.gos,null),move:zi("columnMoveMove",this.gos,null),left:zi("columnMoveLeft",this.gos,null),right:zi("columnMoveRight",this.gos,null),group:zi("columnMoveGroup",this.gos,null),aggregate:zi("columnMoveValue",this.gos,null),pivot:zi("columnMovePivot",this.gos,null),notAllowed:zi("dropNotAllowed",this.gos,null)}}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find((t=>t.dragSource===e));t&&(this.dragService.removeDragSource(t.params),C(this.dragSourceAndParamsList,t))}destroy(){this.dragSourceAndParamsList.forEach((e=>this.dragService.removeDragSource(e.params))),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0,super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=void 0,this.dragItem=null,this.removeGhost()}onDragging(e,t){const i=this.getHorizontalDirection(e),s=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const o=this.dropTargets.filter((t=>this.isMouseOnDropTarget(e,t))),n=this.findCurrentDropTarget(e,o);if(n!==this.lastDropTarget)this.leaveLastTargetIfExists(e,i,s,t),null!==this.lastDropTarget&&null===n&&this.dragSource.onGridExit?.(this.dragItem),null===this.lastDropTarget&&null!==n&&this.dragSource.onGridEnter?.(this.dragItem),this.enterDragTargetIfExists(n,e,i,s,t),this.lastDropTarget=n;else if(n&&n.onDragging){const o=this.createDropTargetEvent(n,e,i,s,t);n.onDragging(o)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const t=i.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const s=e.clientX>=t.left&&e.clientX<t.right,o=e.clientY>=t.top&&e.clientY<t.bottom;if(!s||!o)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const t of i)if(this.allContainersIntersect(e,t)){s=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&(s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement))}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const s=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of s)for(const i of t){if(-1!==y(this.getAllContainersFromDropTarget(i)).indexOf(e))return i}return null}enterDragTargetIfExists(e,t,i,s,o){if(e){if(e.onDragEnter){const n=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(n)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter((t=>t.getContainer()!==e.getContainer()))}hasExternalDropZones(){return this.dropTargets.some((e=>e.external))}findExternalZone(e){return this.dropTargets.filter((e=>e.external)).find((t=>t.getContainer()===e.getContainer()))||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,o){const n=e.getContainer(),r=n.getBoundingClientRect(),{dragItem:l,dragSource:a}=this,h=t.clientX-r.left,d=t.clientY-r.top;return this.gos.addGridCommonParams({event:t,x:h,y:d,vDirection:s,hDirection:i,dragSource:a,fromNudge:o,dragItem:l,dropZoneTarget:n})}positionGhost(e){const t=this.eGhost;if(!t)return;const i=t.getBoundingClientRect().height,s=(document.body?.clientWidth??(window.innerHeight||document.documentElement?.clientWidth||-1))-2,o=(document.body?.clientHeight??(window.innerHeight||document.documentElement?.clientHeight||-1))-2,n=pi(t.offsetParent),{clientY:r,clientX:l}=e;let a=r-n.top-i/2,h=l-n.left-10;const d=this.gos.getDocument(),c=d.defaultView||window,u=c.pageYOffset||d.documentElement.scrollTop,g=c.pageXOffset||d.documentElement.scrollLeft;s>0&&h+t.clientWidth>s+g&&(h=s+g-t.clientWidth),h<0&&(h=0),o>0&&a+t.clientHeight>o+u&&(a=o+u-t.clientHeight),a<0&&(a=0),t.style.left=`${h}px`,t.style.top=`${a}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=bi('<div class="ag-dnd-ghost ag-unselectable">\n<span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n<div class="ag-dnd-ghost-label"></div>\n</div>'),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost),this.environment.applyThemeClasses(this.eGhost),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const e=this.eGhost.querySelector(".ag-dnd-ghost-label");let t=this.dragSource.dragItemName;ce(t)&&(t=t()),e.innerHTML=We(t)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const i=this.gos.getDocument();let s=null,o=null;try{s=i.fullscreenElement}catch(e){}finally{s||(s=this.gos.getRootNode());const e=s.querySelector("body");o=e||(s instanceof ShadowRoot?s:s instanceof Document?s?.documentElement:s)}this.eGhostParent=o,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):he("Could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){vi(this.eGhostIcon);let i=null;e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():"notAllowed"),i=this.dropIconMap[e],this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),i===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns")||i&&this.eGhostIcon.appendChild(i)}},qs=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<s.left+o,this.tickRight=e.clientX>s.right-o,this.tickUp=e.clientY<s.top+o&&!i,this.tickDown=e.clientY>s.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Ys=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(Ys||{}),Qs=class extends I{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.sortController=e.sortController,this.filterManager=e.filterManager,this.selectionService=e.selectionService,this.mouseEventService=e.mouseEventService,this.ctrlsService=e.ctrlsService,this.funcColsService=e.funcColsService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady((e=>{const t=e.gridBodyCtrl;this.autoScrollService=new qs({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})}))}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?"notAllowed":"move"}shouldPreventRowMove(){if(this.funcColsService.getRowGroupColumns().length)return!0;const e=this.filterManager?.isAnyFilterPresent();if(e)return!0;return!!this.sortController.isSortActive()}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const e=[...this.selectionService.getSelectedNodes()].sort(((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t)));if(-1!==e.indexOf(t))return e}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach((e=>{e.setDragging(!0)})),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=e;return!t.contains(i)}onEnterOrDragging(e){this.dispatchGridEvent("rowDragMove",e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(c(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&1===t.highlighted,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let n=i?1:0;if(this.isFromThisGrid(e))o.forEach((e=>{e.rowTop<s&&(n-=1)})),this.moveRows(o,s,n);else{const e=this.gos.getRowIdCallback();let t=this.clientSideRowModel.getRowIndexAtPixel(s)+1;0===this.clientSideRowModel.getHighlightPosition(s)&&t--,this.clientSideRowModel.updateRowData({add:o.map((e=>e.data)).filter((t=>!this.clientSideRowModel.getRowNode(e?.({data:t,level:0})??t.id))),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),this.rangeService?.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void he("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void he("addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",t))}),e.onDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",t))})),this.dragAndDropService.addDropTarget({isInterestedIn:e=>2===e,getIconName:()=>"move",external:!0,...t})}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),n=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{i(t),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",t))}:i,onDragLeave:e.onDragLeave?t=>{s(t),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",t))}:s,onDragging:e.onDragging?t=>{o(t),e.onDragging(this.draggingToRowDragEvent("rowDragMove",t))}:o,onDragStop:e.onDragStop?t=>{n(t),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",t))}:n,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:n,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let s,o,n=-1;switch(i>this.pageBoundsService.getCurrentPageHeight()||(n=this.rowModel.getRowIndexAtPixel(i),s=this.rowModel.getRow(n)),t.vDirection){case 1:o="down";break;case 0:o="up";break;default:o=null}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:n,overNode:s,y:i,vDirection:o})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e),!this.gos.get("rowDragManaged")||!this.gos.get("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach((e=>{e.setDragging(!1)}))}},Xs=class extends I{constructor(){super(...arguments),this.beanName="dragService",this.dragEndFunctions=[],this.dragSources=[]}wireBeans(e){this.mouseEventService=e.mouseEventService}destroy(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find((t=>t.dragSource===e));t&&(this.removeListener(t),C(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let n=null;const r=this.gos.get("suppressTouch");s&&!r&&(n=t=>{oi(t.target)||(t.cancelable&&(t.preventDefault(),o&&t.stopPropagation()),this.onTouchStart(e,t))},i.addEventListener("touchstart",n,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:n,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=t=>this.onTouchUp(t,e.eElement),o=t.target,n=[{target:this.gos.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:o,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:o,type:"touchend",listener:s,options:{passive:!0}},{target:o,type:"touchcancel",listener:s,options:{passive:!0}}];this.addTemporaryEvents(n),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(i._alreadyProcessedByDragService)return;if(i._alreadyProcessedByDragService=!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=this.gos.getRootNode(),o=[{target:s,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:s,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:s,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(o),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach((e=>{const{target:t,type:i,listener:s,options:o}=e;t.addEventListener(i,s,o)})),this.dragEndFunctions.push((()=>{e.forEach((e=>{const{target:t,type:i,listener:s,options:o}=e;t.removeEventListener(i,s,o)}))}))}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams;return Ui(e,t,k(i)?i:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:"dragStarted",target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){if($t()){const e=this.gos.getDocument();e.getSelection()?.removeAllRanges()}this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i="mousemove"===e.type;return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=t?.tagName.toLocaleLowerCase();return!!i?.match("^a$|textarea|input|select|button")}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:"dragStopped",target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach((e=>e())),this.dragEndFunctions.length=0}},Js=class extends Vi{constructor(e,t,i,s,o,n){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=n,this.dragSource=null}wireBeans(e){this.beans=e}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(_i("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new to(this,this.beans,this.rowNode,this.column):new eo(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&he("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{const e=this.getDragItem(),i=e.rowNodes?.length||1,s=this.getRowDragText(this.column);return s?s(e,i):1===i?this.cellValueFn():`${i} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}destroy(){this.removeDragSource(),super.destroy()}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}},Zs=class extends I{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,i=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=ce(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}},eo=class extends Zs{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this));const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:e}),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}},to=class extends Zs{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.beans.eventService,{sortChanged:e,filterChanged:e,columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),t=e&&e.shouldPreventRowMove(),i=this.gos.get("suppressRowDrag"),s=this.beans.dragAndDropService.hasExternalDropZones(),o=t&&!s||i;this.setDisplayedOrVisible(o)}},io=class e{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=e.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const s=this.createDataChangedEvent(e,i,t);this.localEventService?.dispatchEvent(s)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,t,i){return{type:"dataChanged",node:this,oldData:t,newData:e,update:i}}getRowIndexString(){return null==this.rowIndex?(de("Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."),null):"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new e(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(e,t){const i=k(this.id)?this.createDaemonNode():null,s=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const o=this.createDataChangedEvent(e,s,!1);this.localEventService?.dispatchEvent(o)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(e,t){if(this.selectable!==e){if(this.selectable=e,this.dispatchRowEvent("selectableChanged"),t)return;if(this.beans.gos.get("groupSelectsChildren")){const e=this.calculateSelectedFromChildren();return void this.setSelectedParams({newValue:e??!1,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getRowIdCallback();if(i)if(this.data){const t=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:t.length>0?t:void 0,level:this.level}),this.id.startsWith(e.ID_PREFIX_ROW_GROUP)&&de(`Row IDs cannot start with ${e.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`)}else this.id=void 0;else this.id=t}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!(!k(this.rowTop)||!k(this.rowHeight))&&(e>=this.rowTop&&e<this.rowTop+this.rowHeight)}updateIfDifferent(e,t,i){this[e]!==t&&(this[e]=t,this.dispatchRowEvent(i))}setFirstChild(e){this.updateIfDifferent("firstChild",e,"firstChildChanged")}setLastChild(e){this.updateIfDifferent("lastChild",e,"lastChildChanged")}setChildIndex(e){this.updateIfDifferent("childIndex",e,"childIndexChanged")}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.dispatchRowEvent("topChanged"),this.setDisplayed(null!==e))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(e){this.updateIfDifferent("displayed",e,"displayedChanged")}setDragging(e){this.updateIfDifferent("dragging",e,"draggingChanged")}setHighlighted(e){this.updateIfDifferent("highlighted",e,"rowHighlightChanged")}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(e){this.updateIfDifferent("allChildrenCount",e,"allChildrenCountChanged")}setMaster(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.dispatchRowEvent("masterChanged"))}setGroup(e){this.group!==e&&(this.group&&!e&&(this.expanded=!1),this.group=e,this.updateHasChildren(),this.checkRowSelectable(),this.dispatchRowEvent("groupChanged"))}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=Ce(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const s=this.__autoHeights;if(null==s)return;if(this.beans.visibleColsService.getAllAutoHeightCols().forEach((o=>{let n=s[o.getId()];if(null==n){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(o.getPinned()){case"left":t=this.beans.visibleColsService.getLeftColsForRow(this);break;case"right":t=this.beans.visibleColsService.getRightColsForRow(this);break;case null:t=this.beans.columnViewportService.getColsWithinViewport(this)}if(t.includes(o))return void(e=!0);n=-1}}else t=!1;n>i&&(i=n)})),e)return;if((t||i<10)&&(i=this.beans.gos.getRowHeightForNode(this).height),i==this.rowHeight)return;this.setRowHeight(i);const o=this.beans.rowModel;o.onRowHeightChangedDebounced&&o.onRowHeightChangedDebounced()}setRowIndex(e){this.updateIfDifferent("rowIndex",e,"rowIndexChanged")}setUiLevel(e){this.updateIfDifferent("uiLevel",e,"uiLevelChanged")}setExpanded(e,t,i){if(this.expanded===e)return;this.expanded=e,this.dispatchRowEvent("expandedChanged");const s={...this.createGlobalRowEvent("rowGroupOpened"),expanded:e,event:t||null};this.beans.rowNodeEventThrottle.dispatchExpanded(s,i),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gos.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}setDataValue(e,t,i){const s=(()=>"string"!=typeof e?e:this.beans.columnModel.getCol(e)??this.beans.columnModel.getColDefCol(e))(),o=this.getValueFromValueService(s);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(s,o,t,i),!1;const n=this.beans.valueService.setValue(this,s,t,i);return this.dispatchCellChangedEvent(s,t,o),this.checkRowSelectable(),n}getValueFromValueService(e){const t=this.leafGroup&&this.beans.columnModel.isPivotMode(),i=this.group&&this.expanded&&!this.footer&&!t;let s=!1;const o=this.beans.gos.get("groupTotalRow")??this.beans.gos.get("groupIncludeFooter");if("function"!=typeof o)s=!!o;else{s=!!(this.beans.gos.getCallback("groupTotalRow")??this.beans.gos.getCallback("groupIncludeFooter"))({node:this})}const n=this.beans.gos.get("groupSuppressBlankHeader"),r=i&&s&&!n;return this.beans.valueService.getValue(e,this,!1,r)}dispatchEventForSaveValueReadOnly(e,t,i,s){const o=this.beans.gos.addGridCommonParams({type:"cellEditRequest",event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:t,newValue:i,value:i,source:s});this.beans.eventService.dispatchEvent(o)}setGroupValue(e,t){const i=this.beans.columnModel.getCol(e);G(this.groupData)&&(this.groupData={});const s=i.getColId(),o=this.groupData[s];o!==t&&(this.groupData[s]=t,this.dispatchCellChangedEvent(i,t,o))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.localEventService){const i=e=>{const i=this.aggData?this.aggData[e]:void 0,s=t?t[e]:void 0;if(i===s)return;const o=this.beans.columnModel.getCol(e);o&&this.dispatchCellChangedEvent(o,i,s)};for(const e in this.aggData)i(e);for(const t in e)t in this.aggData||i(t)}}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const t=this.beans.gos.get("treeData"),i=this.beans.gos.get("isServerSideGroup");e=!this.stub&&!this.footer&&(t?!!i&&i(this.data):!!this.group)}e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return(this.group&&N(this.childrenAfterGroup))??!1}dispatchCellChangedEvent(e,t,i){const s={type:"cellChanged",node:this,column:e,newValue:t,oldValue:i};this.localEventService?.dispatchEvent(s)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach((t=>t.depthFirstSearch(e))),e(this)}calculateSelectedFromChildren(){let e=!1,t=!1,i=!1;if(!this.childrenAfterGroup?.length)return this.selectable?this.selected:null;for(let s=0;s<this.childrenAfterGroup.length;s++){const o=this.childrenAfterGroup[s];let n=o.isSelected();if(!o.selectable){const e=o.calculateSelectedFromChildren();if(null===e)continue;n=e}switch(n){case!0:e=!0;break;case!1:t=!0;break;default:i=!0}}return i||e&&t?void 0:!!e||!t&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}dispatchRowEvent(e){const t={type:e,node:this};this.localEventService?.dispatchEvent(t)}selectThisNode(e,t,i="api"){const s=!this.selectable&&e,o=this.selected===e;if(s||o)return!1;this.selected=e,this.dispatchRowEvent("rowSelected");const n=this.sibling;n&&n.footer&&n.localEventService&&n.dispatchRowEvent("rowSelected");const r={...this.createGlobalRowEvent("rowSelected"),event:t||null,source:i};return this.beans.eventService.dispatchEvent(r),!0}setSelected(e,t=!1,i="api"){"boolean"!=typeof i?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i}):he("since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(he("cannot select pinned rows"),0):void 0===this.id?(he("cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected({...e,nodes:[this.footer?this.sibling:this]})}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){this.localEventService||(this.localEventService=new h),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new L(this.beans.frameworkOverrides));const i=this.frameworkEventListenerService?.wrap(t)??t;this.localEventService.addEventListener(e,i)}removeEventListener(e,t){if(!this.localEventService)return;const i=this.frameworkEventListenerService?.unwrap(t)??t;this.localEventService.removeEventListener(e,i),this.localEventService.noRegisteredListenersExist()&&(this.localEventService=null)}onMouseEnter(){this.dispatchRowEvent("mouseEnter")}onMouseLeave(){this.dispatchRowEvent("mouseLeave")}getFirstChildOfFirstChild(e){let t=this,i=!0,s=!1,o=null;for(;i&&!s;){const n=t.parent;k(n)&&t.firstChild?n.rowGroupColumn===e&&(s=!0,o=n):i=!1,t=n}return s?o:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;t&&null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new e(this.beans);Object.keys(this).forEach((e=>{t.has(e)||(i[e]=this[e])})),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};io.ID_PREFIX_ROW_GROUP="row-group-",io.ID_PREFIX_TOP_PINNED="t-",io.ID_PREFIX_BOTTOM_PINNED="b-",io.OBJECT_ID_SEQUENCE=0;var so=io,oo=class extends I{constructor(){super(...arguments),this.beanName="filterManager",this.advancedFilterModelUpdateQueue=[]}wireBeans(e){this.columnModel=e.columnModel,this.dataTypeService=e.dataTypeService,this.quickFilterService=e.quickFilterService,this.advancedFilterService=e.advancedFilterService,this.columnFilterService=e.columnFilterService}postConstruct(){this.addManagedEventListeners({columnValueChanged:this.refreshFiltersForAggregations.bind(this),columnPivotChanged:this.refreshFiltersForAggregations.bind(this),columnPivotModeChanged:this.refreshFiltersForAggregations.bind(this),newColumnsLoaded:this.updateAdvancedFilterColumns.bind(this),columnVisible:this.updateAdvancedFilterColumns.bind(this),advancedFilterEnabledChanged:({enabled:e})=>this.onAdvancedFilterEnabledChanged(e),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],(()=>{this.onFilterChanged({source:"api"})})),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",(()=>{this.updateAggFiltering(),this.onFilterChanged()})),this.addManagedPropertyListener("advancedFilterModel",(e=>this.setAdvancedFilterModel(e.currentValue))),this.quickFilterService&&this.addManagedListeners(this.quickFilterService,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){this.isAdvancedFilterEnabled()?this.warnAdvancedFilters():this.columnFilterService?.setFilterModel(e,t)}getFilterModel(){return this.columnFilterService?.getFilterModel()??{}}isColumnFilterPresent(){return!!this.columnFilterService?.isColumnFilterPresent()}isAggregateFilterPresent(){return!!this.columnFilterService?.isAggregateFilterPresent()}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){e?this.columnFilterService?.disableColumnFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilterService?.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){return!!this.advancedFilterService?.isEnabled()}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}resetQuickFilterCache(){this.quickFilterService?.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:i,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.columnFilterService?this.columnFilterService.updateBeforeFilterChanged(e):vs.resolve()).then((()=>{const e={source:t,type:"filterChanged",columns:s};i&&Y(e,i),this.eventService.dispatchEvent(e),this.columnFilterService?.updateAfterFilterChanged()}))}isSuppressFlashingCellsBecauseFiltering(){return!!this.columnFilterService?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilterService?.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode))&&!(this.isAggregateFilterPresent()&&!this.columnFilterService.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode))&&(!(this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode))&&(!(this.isColumnFilterPresent()&&!this.columnFilterService.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip))&&!(this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))))}isFilterActive(e){return!!this.columnFilterService?.isFilterActive(e)}getOrCreateFilterWrapper(e){return this.columnFilterService?.getOrCreateFilterWrapper(e)??null}getDefaultFloatingFilter(e){return this.columnFilterService.getDefaultFloatingFilter(e)}createFilterParams(e,t){return this.columnFilterService.createFilterParams(e,t)}isFilterAllowed(e){return!this.isAdvancedFilterEnabled()&&!!this.columnFilterService?.isFilterAllowed(e)}getFloatingFilterCompDetails(e,t){return this.columnFilterService?.getFloatingFilterCompDetails(e,t)}getCurrentFloatingFilterParentModel(e){return this.columnFilterService?.getCurrentFloatingFilterParentModel(e)}destroyFilter(e,t="api"){this.columnFilterService?.destroyFilter(e,t)}areFilterCompsDifferent(e,t){return!!this.columnFilterService?.areFilterCompsDifferent(e,t)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.dataTypeService?.isPendingInference()?this.advancedFilterModelUpdateQueue.push(e):(this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})))}toggleAdvancedFilterBuilder(e,t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(t,e)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&!!this.columnFilterService?.hasFloatingFilters()}getFilterInstance(e,t){if(!this.isAdvancedFilterEnabled())return this.columnFilterService?.getFilterInstance(e,t);this.warnAdvancedFilters()}getColumnFilterInstance(e){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve(void 0)):this.columnFilterService?.getColumnFilterInstance(e)??Promise.resolve(void 0)}warnAdvancedFilters(){he("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){this.advancedFilterService?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.advancedFilterModelUpdateQueue.forEach((e=>this.setAdvancedFilterModel(e))),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){return this.columnFilterService?.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve()):this.columnFilterService?.setColumnFilterModel(e,t)??Promise.resolve()}},no=class extends Vi{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}wireBeans(e){this.filterManager=e.filterManager,this.columnModel=e.columnModel}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){return this.filterWrapper?.filterPromise??null}afterInit(){return this.filterWrapper?.filterPromise?.then((()=>{}))??vs.resolve()}afterGuiAttached(e){this.filterWrapper?.filterPromise?.then((t=>{t?.afterGuiAttached?.(e)}))}afterGuiDetached(){this.filterWrapper?.filterPromise?.then((e=>{e?.afterGuiDetached?.()}))}createFilter(e){const{column:t,source:i}=this;this.filterWrapper=this.filterManager?.getOrCreateFilterWrapper(t)??null,this.filterWrapper?.filterPromise&&this.filterWrapper.filterPromise.then((s=>{const o=s.getGui();if(k(o)||he(`getGui method from filter returned ${o}; it should be a DOM element.`),this.appendChild(o),e){const e={type:"filterOpened",column:t,source:i,eGui:this.getGui()};this.eventService.dispatchEvent(e)}}))}onFilterDestroyed(e){"api"!==e.source&&"paramsUpdated"!==e.source||e.column.getId()!==this.column.getId()||!this.columnModel.getColDefCol(this.column)||(vi(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},ro="ag-resizer-wrapper",lo=`<div class="${ro}">\n <div data-ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n <div data-ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n <div data-ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n <div data-ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n <div data-ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n <div data-ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n <div data-ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n <div data-ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n </div>`,ao=class extends I{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}wireBeans(e){this.popupService=e.popupService,this.resizeObserverService=e.resizeObserverService,this.dragService=e.dragService}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:n,x:r,y:l}=this.config;this.offsetParent||this.setOffsetParent();let a=0,h=0;const d=yi(this.element);if(d){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const i=e.offsetWidth-this.element.offsetWidth;h=parseInt(t.minWidth,10)-i}if(null!=t.minHeight){const i=e.offsetHeight-this.element.offsetHeight;a=parseInt(t.minHeight,10)-i}}if(this.minHeight=o||a,this.minWidth=i||h,s&&this.setWidth(s),n&&this.setHeight(n),s&&n||this.refreshSize(),e)this.center();else if(r||l)this.offsetElement(r,l);else if(d&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const i=parseFloat(e.style.top),s=parseFloat(e.style.left);t?this.offsetElement(isNaN(s)?0:s,isNaN(i)?0:i):this.setPosition(s,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach((t=>{const i=!!e[t],s=this.getResizerElement(t),o={dragStartPixels:0,eElement:s,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(o),this.resizeListeners.push(o),s.style.pointerEvents="all"):s.style.pointerEvents="none",this.resizable[t]=i)}))}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Mi(i,e),e=ui(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?Mi(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:s.top,r=e?0:o.top;let l=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();l=t-s.bottom}}return i+r-n-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Di(t,e),e=gi(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,s=i?this.position.x:this.element.getBoundingClientRect().left;t&&e+s>t&&(e=t-s)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Di(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),t):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:o,topBuffer:n}=e,r=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!o,r)?0:r,movementY:this.shouldSkipY(t,!!s,n,l)?0:l}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let a=l<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=r.right;return!!a||(a=t?s<0&&e.clientX>l+n.left||s>0&&e.clientX<l+n.left:i?s<0&&e.clientX>r.right||s>0&&e.clientX<l+n.left:s<0&&e.clientX>r.right||s>0&&e.clientX<r.right,a)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let a=l<=0&&n.top>=e.clientY||n.bottom<=e.clientY&&n.bottom<=r.bottom;return!!a||(a=t?s<0&&e.clientY>l+n.top+i||s>0&&e.clientY<l+n.top:s<0&&e.clientY>r.bottom||s>0&&e.clientY<r.bottom,a)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[data-ref=eTopLeftResizer]")},top:{element:e.querySelector("[data-ref=eTopResizer]")},topRight:{element:e.querySelector("[data-ref=eTopRightResizer]")},right:{element:e.querySelector("[data-ref=eRightResizer]")},bottomRight:{element:e.querySelector("[data-ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[data-ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[data-ref=eBottomLeftResizer]")},left:{element:e.querySelector("[data-ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString(lo,"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${ro}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;i||s||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter((e=>!e.classList.contains("ag-hidden"))):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const o=e[s],n=!!o.style.flex&&"0 0 auto"!==o.style.flex;if(o===this.element)continue;let r=this.minHeight||0,l=this.minWidth||0;if(n){const e=window.getComputedStyle(o);e.minHeight&&(r=parseInt(e.minHeight,10)),e.minWidth&&(l=parseInt(e.minWidth,10))}else r=o.offsetHeight,l=o.offsetWidth;t+=r,i+=l}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some((e=>e))}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:n,isLeft:r}=this.currentResizer,l=o||r,a=n||s,{movementX:h,movementY:d}=this.calculateMouseMovement({e:e,isLeft:r,isTop:s}),c=this.position.x,u=this.position.y;let g=0,p=0;if(l&&h){const e=r?-1:1,t=this.getWidth(),i=t+h*e;let s=!1;r&&(g=t-i,(c+g<=0||i<=this.minWidth)&&(s=!0,g=0)),s||this.setWidth(i)}if(a&&d){const e=s?-1:1,t=this.getHeight(),i=t+d*e;let o=!1;s?(p=t-i,(u+p<=0||i<=this.minHeight)&&(o=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<i&&this.getMinSizeOfSiblings().height+i>this.element.parentElement.offsetHeight&&(o=!0),o||this.setHeight(i)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&g||p)&&this.offsetElement(c+g,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:n}=this.calculateMouseMovement({e:e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+n),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},ho=class e extends I{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())},...t}}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.eFocusableElement.classList.add(e.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedElementListeners(this.eFocusableElement,{focusin:this.callbacks.onFocusIn}),this.callbacks.onFocusOut&&this.addManagedElementListeners(this.eFocusableElement,{focusout:this.callbacks.onFocusOut})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:e=>{e.defaultPrevented||M(e)||(this.callbacks.shouldStopEventPropagation(e)?D(e):e.key===ts.TAB?this.callbacks.onTabKeyDown(e):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))}})}};ho.FOCUS_MANAGED_CLASS="ag-focus-managed";var co=ho,uo={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};function go(e,t){return po(e)?(null!=e.debounceMs&&he("debounceMs is ignored when apply button is present"),0):null!=e.debounceMs?e.debounceMs:t}function po(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}var mo=class extends Vi{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=Bi,this.buttonListeners=[]}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.resetTemplate(),this.createManagedBean(new co(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new ao(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`\n <form class="ag-filter-wrapper">\n <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody">\n ${this.createBodyTemplate()}\n </div>\n </form>`;this.setTemplate(i,this.getAgComponents(),e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then((()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()}))}setParams(e){this.providedFilterParams=e,this.applyActive=po(e),this.resetButtonsPanel()}updateParams(e){this.providedFilterParams=e,this.applyActive=po(e),this.resetUiToActiveModel(this.getModel(),(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()}))}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(vi(this.eButtonsPanel),this.buttonListeners.forEach((e=>e())),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t)return void(this.eButtonsPanel&&wi(this.eButtonsPanel));const i=document.createDocumentFragment(),s=e=>{let t,s;switch(e){case"apply":t=this.translate("applyFilter"),s=e=>this.onBtApply(!1,!1,e);break;case"clear":t=this.translate("clearFilter"),s=()=>this.onBtClear();break;case"reset":t=this.translate("resetFilter"),s=()=>this.onBtReset();break;case"cancel":t=this.translate("cancelFilter"),s=e=>{this.onBtCancel(e)};break;default:return void he("Unknown button type specified")}const o=bi(`<button\n type="${"apply"===e?"submit":"button"}"\n data-ref="${e}FilterButton"\n class="ag-button ag-standard-button ag-filter-apply-panel-button"\n >${t}\n </button>`);this.buttonListeners.push(...this.addManagedElementListeners(o,{click:s})),i.append(o)};e.forEach((e=>s(e))),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=go(this.providedFilterParams,this.getDefaultDebounceMs()),t=Ce(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?this.setModelIntoUi(e):this.resetUiToDefaults()).then((()=>{this.updateUiVisibility(),this.applyModel("api")}))}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),(()=>{this.handleCancelEnd(e)}))}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),t?.()};null!=e?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then((()=>this.onUiChanged()))}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const i="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:i})}const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;"Enter"!==i&&"Space"!==i||(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi()),t=this.queryForHtmlElement('[data-ref="applyFilterButton"]');t&&li(t,!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="floatingFilter"===e||"columnFilter"===e,{positionableFeature:i,gos:s}=this;t?(i.restoreLastSize(),i.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,uo[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}},Co=class extends ns{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},fo=class extends Vi{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.activeClass="ag-active-item",this.options=[],this.itemEls=[]}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()}),this.unFocusable||this.addManagedElementListeners(e,{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){const t=e.key;switch(t){case ts.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case ts.DOWN:case ts.UP:e.preventDefault(),this.navigate(t);break;case ts.PAGE_DOWN:case ts.PAGE_UP:case ts.PAGE_HOME:case ts.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}navigate(e){const t=e===ts.DOWN;let i;if(this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),i=this.itemEls[e]}else i=this.itemEls[t?0:this.itemEls.length-1];this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||0===this.itemEls.length)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,s=this.itemEls[0].clientHeight,o=Math.floor(this.getGui().clientHeight/s);let n=-1;e===ts.PAGE_HOME?n=0:e===ts.PAGE_END?n=i:e===ts.PAGE_DOWN?n=Math.min(t+o,i):e===ts.PAGE_UP&&(n=Math.max(t-o,0)),-1!==n&&this.highlightItem(this.itemEls[n])}addOptions(e){return e.forEach((e=>this.addOption(e))),this}addOption(e){const{value:t,text:i}=e,s=i||t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach((e=>{wi(e)})),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach(((t,i)=>{Ot(t,i+1),Lt(t,e.length)}))}renderOption(e,t){const i=this.gos.getDocument(),s=i.createElement("div");yt(s,"option"),s.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const o=i.createElement("span");s.appendChild(o),o.textContent=t,this.unFocusable||(s.tabIndex=-1),this.itemEls.push(s),this.addManagedListeners(s,{mouseover:()=>this.highlightItem(s),mousedown:t=>{t.preventDefault(),t.stopPropagation(),this.setValue(e)}}),this.createManagedBean(new Ni({getTooltipValue:()=>t,getGui:()=>s,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})),this.getGui().appendChild(s)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const i=this.options.findIndex((t=>t.value===e));if(-1!==i){const e=this.options[i];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex((e=>e.value===this.value));-1!==e&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(e){if(!yi(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(this.activeClass),zt(this.highlightedEl,!0);const t=this.getGui(),{scrollTop:i,clientHeight:s}=t,{offsetTop:o,offsetHeight:n}=e;(o+n>i+s||o<i)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){this.highlightedEl&&yi(this.highlightedEl)&&(this.highlightedEl.classList.remove(this.activeClass),zt(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},vo=class extends ss{constructor(e){if(super(e,e?.template||'\n <div class="ag-picker-field" role="presentation">\n <div data-ref="eLabel"></div>\n <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n <div data-ref="eDisplayField" class="ag-picker-field-display"></div>\n <div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n </div>\n </div>',e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=Bi,this.eWrapper=Bi,this.eDisplayField=Bi,this.eIcon=Bi,this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:o,maxPickerWidth:n}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!s,null!=i&&this.setPickerMaxHeight(i),null!=o&&this.setPickerMinWidth(o),null!=n&&this.setPickerMaxWidth(n)}wireBeans(e){this.popupService=e.popupService}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:i,inputWidth:s}=this.config;if(i){const e=_i(i,this.gos);e&&this.eIcon.appendChild(e)}null!=s&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),At(e,!1),this.ariaRole&&yt(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case ts.UP:case ts.DOWN:case ts.ENTER:case ts.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case ts.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:o,modalPicker:n=!0}=this.config,r={modal:n,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=this.gos.getActiveDomElement(),i=!t||t===e.body;this.beforeHidePicker(),i&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(s,o)},l=this.popupService.addPopup(r),{maxPickerHeight:a,minPickerWidth:h,maxPickerWidth:d,variableWidth:c}=this;c?(h&&(t.style.minWidth=h),t.style.width=Ti(gi(this.eWrapper)),d&&(t.style.maxWidth=d)):Ei(t,d??gi(this.eWrapper));const u=a??`${di(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",u),t.style.position="absolute",this.alignPickerToComponent(),l.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;At(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return Ei(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}},wo=class extends vo{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox",...e})}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),i&&null==t&&(this.eDisplayField.textContent=i),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new fo("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),Ut(this.getAriaElement(),e),this.listComponent.addManagedListeners(this.listComponent,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})}}),this.listComponent.addManagedListeners(this.listComponent,{fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){const{key:t}=e;switch(t===ts.TAB&&this.hidePicker(),t){case ts.ENTER:case ts.UP:case ts.DOWN:case ts.PAGE_UP:case ts.PAGE_DOWN:case ts.PAGE_HOME:case ts.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case ts.ESCAPE:super.onKeyDown(e)}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach((e=>this.addOption(e))),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;i||this.listComponent.setValue(e,!0);if(this.listComponent.getValue()===this.getValue())return this;let s=this.listComponent.getDisplayValue();return null==s&&this.config.placeholder&&(s=this.config.placeholder),this.eDisplayField.textContent=s,this.setTooltip({newTooltipText:s??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),super.destroy()}},So={selector:"AG-SELECT",component:wo},yo=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach((e=>{if("string"==typeof e)return;[["displayKey"],["displayName"],["predicate","test"]].every((t=>!!t.some((t=>null!=e[t]))||(he(`ignoring FilterOptionDef as it doesn't contain one of '${t}'`),!1)))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter((t=>t===e))||[]}))}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:he("invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else he("no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},bo=class extends mo{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:e}=t;return null!=e?e:1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:"inRange"===e?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach(((t,i)=>{0===i?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)}))}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map((e=>e.getValue()))}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let o;if(i){const i=e,s=t;o=this.areSimpleModelsEqual(i,s)}else{const i=e,s=t;o=i.operator===s.operator&&u(i.conditions,s.conditions,((e,t)=>this.areSimpleModelsEqual(e,t)))}return o}shouldRefresh(e){const t=this.getModel(),i=t?t.conditions??[t]:null,s=e.filterOptions?.map((e=>"string"==typeof e?e:e.displayKey))??this.getDefaultFilterOptions();return!(i&&!i.every((e=>void 0!==s.find((t=>t===e.type)))))&&!("number"==typeof e.maxNumConditions&&i&&i.length>e.maxNumConditions)}refresh(e){if(!this.shouldRefresh(e))return!1;return!!super.refresh(e)&&(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){const t=e;let i=t.conditions;null==i&&(i=[],he("Filter model is missing 'conditions'"));const s=this.validateAndUpdateConditions(i),o=this.getNumConditions();if(s<o)this.removeConditionsAndOperators(s);else if(s>o)for(let e=o;e<s;e++)this.createJoinOperatorPanel(),this.createOption();const n="OR"===t.operator;this.eJoinOperatorsAnd.forEach((e=>e.setValue(!n,!0))),this.eJoinOperatorsOr.forEach((e=>e.setValue(n,!0))),i.forEach(((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)}))}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),vs.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),he('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){const t=this.getModel();if(null==t)return!0;const{operator:i}=t,s=[];if(i){const e=t;s.push(...e.conditions??[])}else s.push(t);return s[i&&"OR"===i?"some":"every"]((t=>this.individualConditionPasses(e,t)))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new yo,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){this.maxNumConditions=e.maxNumConditions??2,this.maxNumConditions<1&&(he('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=e.numAlwaysVisibleConditions??1,this.numAlwaysVisibleConditions<1&&(he('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(he('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new wo);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,(e=>this.resetInput(e))),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(i,s,o),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new Co);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map((e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e)))}putOptionsIntoDropdown(e){this.filterListOptions.forEach((t=>{e.addOption(t)})),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}createBodyTemplate(){return""}getAgComponents(){return[]}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let i=0;i<this.getNumConditions();i++)this.isConditionUiComplete(i)?e=i:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const t=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<t){this.removeConditionsAndOperators(t+1);const i=e+1,s=t-i;s>0&&this.removeConditionsAndOperators(i,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach(((t,i)=>{const s=this.isConditionDisabled(i,e);t.setDisabled(s||this.filterListOptions.length<=1),1===i&&(li(this.eJoinOperatorPanels[0],s),this.eJoinOperatorsAnd[0].setDisabled(s),this.eJoinOperatorsOr[0].setDisabled(s))})),this.eConditionBodies.forEach(((e,t)=>{ni(e,this.isConditionBodyVisible(t))}));const i="OR"===(t??this.getJoinOperator());this.eJoinOperatorsAnd.forEach((e=>{e.setValue(!i,!0)})),this.eJoinOperatorsOr.forEach((e=>{e.setValue(i,!0)})),this.forEachInput(((t,i,s,o)=>{this.setElementDisplayed(t,i<o),this.setElementDisabled(t,this.isConditionDisabled(s,e))})),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach((e=>wi(e)))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach((e=>{wi(e.getGui()),this.destroyBean(e)}))}removeItems(e,t,i){return null==i?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus)if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof os&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const o=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,i=e);else{const o=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||o)&&(this.removeConditionsAndOperators(e,1),s=!0,o&&i--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(i,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(ce(this.filterPlaceholder)){const e=this.filterPlaceholder,s=this.eTypes[t].getValue();i=e({filterOptionKey:s,filterOption:this.translate(s),placeholder:i})}else"string"==typeof this.filterPlaceholder&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput(((t,i,s,o)=>{if(!(t instanceof os))return;const n=0===i&&o>1?"inRangeStart":0===i?"filterOoo":"inRangeEnd",r=0===i&&o>1?e("ariaFilterFromValue","Filter from value"):0===i?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,s)),t.setInputAriaLabel(r)}))}setElementValue(e,t,i){e instanceof os&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Vi&&ni(e.getGui(),t)}setElementDisabled(e,t){e instanceof Vi&&li(e.getGui(),t)}attachElementOnChange(e,t){e instanceof os&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach(((t,i)=>{this.forEachPositionTypeInput(i,t,e)}))}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),o=this.getInputs(e);for(let t=0;t<o.length;t++){const n=o[t];null!=n&&i(n,t,e,s)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){if(e>=this.getNumConditions())return!1;return"empty"!==this.getConditionType(e)&&!this.getValues(e).some((e=>null==e))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach((e=>this.resetType(e))),this.eJoinOperatorsAnd.forEach(((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t))),this.eJoinOperatorsOr.forEach(((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t))),this.joinOperatorId++,this.forEachInput((e=>this.resetInput(e))),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),vs.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,o){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach(((e,t)=>this.updateJoinOperatorDisabled(e,t))),this.eJoinOperatorsOr.forEach(((e,t)=>this.updateJoinOperatorDisabled(e,t)))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput(((e,s,o)=>{o===t&&this.setElementValue(e,null!=i[s]?i[s]:null)}))}setValueFromFloatingFilter(e){this.forEachInput(((t,i,s)=>{this.setElementValue(t,0===i&&0===s?e:null,!0)}))}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,(e=>{this.attachElementOnChange(e,this.listener)})))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),n=this.evaluateCustomFilter(o,s,i);return null!=n?n:null==i?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e)}evaluateCustomFilter(e,t,i){if(null==e)return;const{predicate:s}=e;return null==s||t.some((e=>null==e))?void 0:s(t,i)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}},Ro=class extends bo{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case"equals":case"notEqual":if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case"lessThan":case"lessThanOrEqual":if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case"inRange":if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,i){const s=this.comparator(),o=null!=e[0]?s(e[0],t):0;switch(i.type){case"equals":return 0===o;case"notEqual":return 0!==o;case"greaterThan":return o>0;case"greaterThanOrEqual":return o>=0;case"lessThan":return o<0;case"lessThanOrEqual":return o<=0;case"inRange":{const i=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&i<=0:o>0&&i<0}case"blank":return this.isBlank(t);case"notBlank":return!this.isBlank(t);default:return he('Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}};function Fo(e){if(e.altKey||e.ctrlKey||e.metaKey)return!1;return 1===e.key.length}function Po(e,t,i,s,o){const n=s?s.getColDef().suppressKeyboardEvent:void 0;if(!n)return!1;const r=e.addGridCommonParams({event:t,editing:o,column:s,node:i,data:i.data,colDef:s.getColDef()});if(n){if(n(r))return!0}return!1}var Eo=class extends os{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=k(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListeners(this.eInput,{keydown:t=>{Fo(t)&&t.key&&!e.test(t.key)&&t.preventDefault()},paste:t=>{const i=t.clipboardData?.getData("text");i&&i.split("").some((t=>!e.test(t)))&&t.preventDefault()}})}},Do={selector:"AG-INPUT-TEXT-FIELD",component:Eo},Mo=class extends Eo{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListeners(this.eInput,{blur:()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)},wheel:this.onWheel.bind(this)}),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof i&&this.setMax(i),"number"==typeof s&&this.setStep(s)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,Ai(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,Ai(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,Ai(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue((e=>super.setValue(e,t)),(()=>this),e)}setStartValue(e){return this.setValueOrInputValue((e=>super.setValue(e,!0)),(e=>{this.eInput.value=e}),e)}setValueOrInputValue(e,t,i){if(k(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(!s){s=(i=this.adjustPrecision(i))!=this.normalizeValue(i)}if(s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},To={selector:"AG-INPUT-NUMBER-FIELD",component:Mo},xo=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],Ao=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const t=e,s=(t.conditions??[]).map((e=>this.getModelAsString(e))),o="AND"===t.operator?"andCondition":"orCondition";return s.join(` ${i(o,uo[o])} `)}if("blank"===e.type||"notBlank"===e.type)return i(e.type,e.type);{const t=e,s=this.optionsFactory.getCustomOption(t.type),{displayKey:o,displayName:n,numberOfInputs:r}=s||{};return o&&n&&0===r?(i(o,n),n):this.conditionToString(t,s)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){return this.valueFormatter?this.valueFormatter(e??null)??"":String(e)}},Io=class extends Ao{conditionToString(e,t){const{numberOfInputs:i}=t||{};return"inRange"==e.type||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function Lo(e){const{allowedCharPattern:t}=e??{};return t??null}var Oo=class extends Ro{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern===e.allowedCharPattern&&super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new Io(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return xo}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,s)}createValueElement(){const e=Lo(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),yt(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const o=this.createManagedBean(s?new Eo({allowedCharPattern:s}):new Mo);o.addCssClass(`ag-filter-${i}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,((e,i,s,o)=>{i<o&&t.push(this.processValue(this.stringToFloat(e.getValue())))})),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(e){if("number"==typeof e)return e;let t=O(e);return null!=t&&""===t.trim()&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):null==t||"-"===t.trim()?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}hasInvalidInputs(){let e=!1;return this.forEachInput((t=>{t.getInputElement().validity.valid||(e=!0)})),e}},ko=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Go=class extends Ao{conditionToString(e,t){const{numberOfInputs:i}=t||{};return"inRange"==e.type||2===i?`${e.filter}-${e.filterTo}`:null!=e.filter?`${e.filter}`:`${e.type}`}};function No(e){const t=e&&e.trim();return""===t?e:t}var Ho=class extends bo{constructor(){super("textFilter"),this.defaultFormatter=e=>e,this.defaultLowercaseFormatter=e=>null==e?null:e.toString().toLowerCase(),this.defaultMatcher=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case"contains":return t.indexOf(i)>=0;case"notContains":return t.indexOf(i)<0;case"equals":return t===i;case"notEqual":return t!=i;case"startsWith":return 0===t.indexOf(i);case"endsWith":{const e=t.lastIndexOf(i);return e>=0&&e===t.length-i.length}default:return!1}},this.eValuesFrom=[],this.eValuesTo=[]}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?this.defaultFormatter:this.defaultLowercaseFormatter),this.filterModelFormatter=new Go(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(he("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||this.defaultMatcher}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const i=[];return this.forEachPositionInput(e,((e,s,o,n)=>{if(s<n){let s=O(e.getValue());t&&this.textFilterParams.trimInput&&(s=No(s)??null,e.setValue(s,!0)),i.push(s)}})),i}getDefaultFilterOptions(){return ko}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),yt(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new Eo);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){return!!e&&["notEqual","notContains","blank"].indexOf(e)>=0}evaluateNonNullValue(e,t,i,s){const o=e.map((e=>this.formatter(e)))||[],n=this.formatter(t),{api:r,colDef:l,column:a,context:h,textFormatter:d}=this.textFilterParams;if("blank"===i.type)return this.isBlank(t);if("notBlank"===i.type)return!this.isBlank(t);const c={api:r,colDef:l,column:a,context:h,node:s.node,data:s.data,filterOption:i.type,value:n,textFormatter:d};return o.some((e=>this.matcher({...c,filterText:e})))}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}};function Bo(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);if(isNaN(t))return;return t}}function Vo(e,t=Number.MAX_VALUE){return i=>{const s=Bo(i);if(!(null==s||s<e||s>t))return s}}function Wo(e,t){return e.toString().padStart(t,"0")}function zo(e,t,i){return"number"!=typeof e?"":_o(Math.round(100*e)/100,t,i)}function _o(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function Uo(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map((e=>Wo(e,2))).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map((e=>Wo(e,2))).join(":")),s}var Ko=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function $o(e,t="YYYY-MM-DD"){const i=Wo(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>Wo(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Ko(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${Ko(e.getDate())}`,DD:()=>Wo(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>o[e.getDay()],ddd:()=>o[e.getDay()].slice(0,3),dd:()=>o[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Ko(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(n).join("|"),"g");return t.replace(r,(e=>e in n?n[e]():e))}function jo(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map((e=>parseInt(e,10)));if(3!==s.filter((e=>!isNaN(e))).length)return null;const[o,n,r]=s,l=new Date(o,n-1,r);if(l.getFullYear()!==o||l.getMonth()!==n-1||l.getDate()!==r)return null;if(!i||"00:00:00"===i)return l;const[a,h,d]=i.split(":").map((e=>parseInt(e,10)));return a>=0&&a<24&&l.setHours(a),h>=0&&h<60&&l.setMinutes(h),d>=0&&d<60&&l.setSeconds(d),l}var qo=class{constructor(e,t,i,s,o){this.alive=!0,this.context=e,this.eParent=s;t.getDateCompDetails(i).newAgStackInstance().then((t=>{this.alive?(this.dateComp=t,t&&(s.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled),o?.(this))):e.destroyBean(t)}))}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){ni(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){let t=!1;if(this.dateComp?.refresh&&"function"==typeof this.dateComp.refresh){null!==this.dateComp.refresh(e)&&(t=!0)}if(!t&&this.dateComp?.onParamsUpdated&&"function"==typeof this.dateComp.onParamsUpdated){null!==this.dateComp.onParamsUpdated(e)&&he("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},Yo=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],Qo=class extends Ao{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o="inRange"==i||2===s,n=jo(e.dateFrom),r=jo(e.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){return`${null!==n?$o(n,l):"null"}-${null!==r?$o(r,l):"null"}`}return null!=n?$o(n,l):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Xo=1/0,Jo=class extends Ro{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=Xo,this.minValidDate=null,this.maxValidDate=null}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&jo(t)||null,i&&jo(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,i)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?i:Number(e[t]);he(`DateFilter ${t} is not a number`)}return i};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",Xo),this.minValidYear>this.maxValidYear&&he("DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:jo(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:jo(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&he("DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Qo(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new qo(this.context,this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc((()=>t.destroy())),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return Yo}createValueElement(){const e=this.gos.getDocument().createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,s){const o=this.gos.getDocument().createElement("div");o.classList.add(`ag-filter-${s}`),o.classList.add(`ag-filter-date-${s}`),t.push(o),e.appendChild(o),i.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach((e=>e.destroy()))}isValidDateValue(e){if(null===e)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput(((i,s,o,n)=>{o!==e||!t||s>=n||(t=t&&this.isValidDateValue(i.getDate()))})),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=Uo(s[0])),s.length>1&&(i.dateTo=Uo(s[1])),{dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t,...i}}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput((e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(i)}))}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,((e,i,s,o)=>{i<o&&t.push(e.getDate())})),t}translate(e){return"lessThan"===e?super.translate("before"):"greaterThan"===e?super.translate("after"):super.translate(e)}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}},Zo=class extends I{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?c(this.colsSpanning):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=k(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn((()=>{this.actualLeft===o&&this.setLeft(o)}))}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const i=this.beans.visibleColsService.getColsLeftWidth();if("right"===e.getPinned()){return i+this.beans.visibleColsService.getBodyContainerWidth()+t}return i+t}setLeft(e){if(k(e)&&(this.eCell.style.left=`${e}px`),$e(this.columnOrGroup)){const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&Bt(this.ariaEl,e.length)}}};function en(e,t,i,s){return G(e)?[]:on(e.headerClass,e,t,i,s)}function tn(e,t,i,s){return G(e)?[]:on(e.toolPanelClass,e,t,i,s)}function sn(e,t,i){e.addOrRemoveCssClass("ag-column-first",i.isColAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",i.isColAtEdge(t,"last"))}function on(e,t,i,s,o){if(G(e))return[];let n;if("function"==typeof e){const r=function(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}(t,i,s,o);n=e(r)}else n=e;return"string"==typeof n?[n]:Array.isArray(n)?[...n]:[]}var nn=0,rn=class e extends I{constructor(e,t,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=t,this.instanceId=e.getUniqueId()+"-"+nn++}wireBeans(e){this.pinnedWidthService=e.pinnedWidthService,this.focusService=e.focusService,this.userComponentFactory=e.userComponentFactory,this.ctrlsService=e.ctrlsService,this.dragAndDropService=e.dragAndDropService,this.menuService=e.menuService}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],(()=>this.refreshTabIndex()))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return function(e,t,i,s){const o=s.getDefinition(),n=o&&o.suppressHeaderKeyboardEvent;return!!k(n)&&!!n(e.addGridCommonParams({colDef:o,column:s,headerRowIndex:i,event:t}))}(this.gos,e,t,i)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onGuiFocus(){const e={type:"headerFocused",column:this.column};this.eventService.dispatchEvent(e)}onDisplayedColumnsChanged(){this.comp&&this.column&&(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:i}=this;sn(e,t,i.visibleColsService)}refreshAriaColIndex(){const{beans:e,column:t}=this,i=e.visibleColsService.getAriaColIndex(t);Ht(this.eGui,i)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&this.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){const t=this.gos.getActiveDomElement(),i=e.key===ts.LEFT||e.key===ts.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey)return;if((this.isResizing||i)&&(e.preventDefault(),e.stopImmediatePropagation()),!i)return;const s=e.key===ts.LEFT!==this.gos.get("enableRtl"),o=Ks[s?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const t=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(t,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(o)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const e=this.pinnedWidthService.getPinnedLeftWidth(),i=this.pinnedWidthService.getPinnedRightWidth(),s=ci(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(e+i+t>s){if(!(s>e+i))return 0;t=s-e-i}}return t}getResizeDiff(e){let t=e.key===ts.LEFT!==this.gos.get("enableRtl");const i=this.column.getPinned(),s=this.gos.get("enableRtl");return i&&s!==("right"===i)&&(t=!t),(t?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout((()=>{this.resizeFeature?.toggleColumnResizing(!1)}),150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case ts.PAGE_DOWN:case ts.PAGE_UP:case ts.PAGE_HOME:case ts.PAGE_END:t&&e.preventDefault()}}addDomData(){const t=e.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc((()=>this.gos.setDomData(this.eGui,t,null)))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,i){const s=e??t;this.gos.get("preventDefaultOnContextMenu")&&s.preventDefault();const o=te(i)?i:void 0;this.menuService.isHeaderContextMenuEnabled(o)&&this.menuService.showHeaderContextMenu(o,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",i)}dispatchColumnMouseEvent(e,t){const i={type:e,column:t};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};rn.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";var ln=rn,an=class extends I{wireBeans(e){this.columnHoverService=e.columnHoverService}constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListeners(this.element,{mouseout:this.onMouseOut.bind(this),mouseover:this.onMouseOver.bind(this)})}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}},hn=class extends ln{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(),this.addManagedListeners(this.column,{colDefChanged:this.onColDefChanged.bind(this)})}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=_i("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new co(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();Rt(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleColsService;let i=this.column;do{if(i=e?t.getColBefore(i):t.getColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case ts.UP:case ts.DOWN:t||e.preventDefault();case ts.LEFT:case ts.RIGHT:if(t)return;e.stopPropagation();case ts.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case ts.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&ai(e.relatedTarget,"ag-floating-filter");if(t&&i&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==ts.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const s=this.getRowIndex();this.beans.focusService.setFocusedHeader(s,this.column)}setupHover(){this.createManagedBean(new an([this.column],this.eGui));const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedEventListeners({columnHoverChanged:e}),e()}setupLeft(){const e=new Zo(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager?.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter()));e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=t=>{if("filterDestroyed"===t?.source&&!this.isAlive())return;const i=this.comp.getFloatingFilterComp();i&&i.then((i=>{if(i){const s=e?.getCurrentFloatingFilterParentModel(this.column),o=t?{...t,columns:t.columns??[],source:"api"===t.source?"api":"columnFilter"}:null;i.onParentModelChanged(s,o)}}))};[this.destroySyncListener]=this.addManagedListeners(this.column,{filterChanged:t}),e?.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupFilterChangedListener(){this.active&&([this.destroyFilterChangedListener]=this.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){const e=this.active;this.setupActive();const t=!e&&this.active;e&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const i=this.active?this.beans.filterManager?.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter())):null,s=this.comp.getFloatingFilterComp();s&&i?s.then((e=>{!e||this.beans.filterManager?.areFilterCompsDifferent(this.userCompDetails??null,i)?this.updateCompDetails(i,t):this.updateFloatingFilterParams(i)})):this.updateCompDetails(i,t)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){if(!e)return;const t=e.params;this.comp.getFloatingFilterComp()?.then((e=>{let i=!1;if(e?.refresh&&"function"==typeof e.refresh){null!==e.refresh(t)&&(i=!0)}if(!i&&e?.onParamsUpdated&&"function"==typeof e.onParamsUpdated){null!==e.onParamsUpdated(t)&&he("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}}))}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},dn="32.0.0";function cn(e,t,i){if(null==t)return null;let s=null;const{compName:o,jsComp:n,fwComp:r}=Bs.getCompKeys(e,t,xs);if(o){s={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o]}else{null==n&&null==r&&!0===t.filter&&(s=i())}return s}var un=class extends Vi{wireBeans(e){this.columnNameService=e.columnNameService}getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e?.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;if(e.operator){t=e.conditions[0]}else t=e;this.lastType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new yo,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&["inRange","empty","blank","notBlank"].indexOf(e)<0}getAriaLabel(e){return`${this.columnNameService.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},gn=class extends I{constructor(e){super(),this.params=e,this.eFloatingFilterTextInput=Bi,this.valueChangedListener=()=>{}}setupGui(e){this.eFloatingFilterTextInput=this.createManagedBean(new Eo(this.params?.config));const t=this.eFloatingFilterTextInput.getGui();e.appendChild(t);const i=e=>this.valueChangedListener(e);this.addManagedListeners(t,{input:i,keydown:i})}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},pn=class extends un{constructor(){super(...arguments),this.eFloatingFilterInputContainer=Bi}postConstruct(){this.setTemplate('\n <div class="ag-floating-filter-input" role="presentation" data-ref="eFloatingFilterInputContainer"></div>\n ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){this.params=e;const t=e.browserAutoComplete??!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=po(this.params.filterParams),!this.isReadOnly()){const e=go(this.params.filterParams,this.getDefaultDebounceMs()),t=Ce(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();vi(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===ts.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=No(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance((e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,i||null)}))}setEditable(e){this.floatingFilterInputService.setEditable(e)}},mn=class extends I{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new Mo),this.eFloatingFilterTextInput=this.createManagedBean(new Eo),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,(e=>this.valueChangedListener(e))),this.setupListeners(i,(e=>this.valueChangedListener(e)))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},Cn=class extends pn{init(e){super.init(e),this.filterModelFormatter=new Go(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return ko}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new gn)}};var fn={version:dn,moduleName:"@ag-grid-community/filter-core",beans:[oo]},vn={version:dn,moduleName:"@ag-grid-community/filter-api",apiFunctions:{isAnyFilterPresent:function(e){return!!e.filterManager?.isAnyFilterPresent()},onFilterChanged:function(e,t="api"){e.filterManager?.onFilterChanged({source:t})}},dependantModules:[fn]},wn={version:dn,moduleName:"@ag-grid-community/column-filter",beans:[class extends I{constructor(){super(...arguments),this.beanName="columnFilterService",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[]}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.userComponentFactory=e.userComponentFactory,this.rowRenderer=e.rowRenderer,this.dataTypeService=e.dataTypeService,this.filterManager=e.filterManager}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),rowDataUpdated:()=>this.onNewRowsLoaded("rowDataUpdated"),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.initialFilterModel={...this.gos.get("initialState")?.filter?.filterModel??{}}}setFilterModel(e,t="api"){if(this.dataTypeService?.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const i=[],s=this.getFilterModel();if(e){const t=new Set(Object.keys(e));this.allColumnFilters.forEach(((s,o)=>{const n=e[o];i.push(this.setModelOnFilterWrapper(s.filterPromise,n)),t.delete(o)})),t.forEach((t=>{const s=this.columnModel.getColDefCol(t)||this.columnModel.getCol(t);if(!s)return void he("setFilterModel() - no column found for colId: "+t);if(!s.isFilterAllowed())return void he("setFilterModel() - unable to fully apply model, filtering disabled for colId: "+t);const o=this.getOrCreateFilterWrapper(s);o?i.push(this.setModelOnFilterWrapper(o.filterPromise,e[t])):he("setFilterModel() - unable to fully apply model, unable to create filter for colId: "+t)}))}else this.allColumnFilters.forEach((e=>{i.push(this.setModelOnFilterWrapper(e.filterPromise,null))}));vs.all(i).then((()=>{const e=this.getFilterModel(),i=[];this.allColumnFilters.forEach(((t,o)=>{z(s?s[o]:null,e?e[o]:null)||i.push(t.column)})),i.length>0&&this.filterManager?.onFilterChanged({columns:i,source:t})}))}setModelOnFilterWrapper(e,t){return new vs((i=>{e.then((e=>{"function"!=typeof e.setModel&&(he("filter missing setModel method, which is needed for setFilterModel"),i()),(e.setModel(t)||vs.resolve()).then((()=>i()))}))}))}getFilterModel(){const e={};return this.allColumnFilters.forEach(((t,i)=>{const s=this.getModelFromFilterWrapper(t);k(s)&&(e[i]=s)})),e}getModelFromFilterWrapper(e){const{filter:t}=e;return t?"function"!=typeof t.getModel?(he("filter API missing getModel method, which is needed for getFilterModel"),null):t.getModel():this.getModelFromInitialState(e.column)}getModelFromInitialState(e){return this.initialFilterModel[e.getColId()]??null}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}disableColumnFilters(){return!!this.allColumnFilters.size&&(this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"advancedFilterEnabled"))),!0)}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){const e=!!this.gos.getGroupAggFiltering(),t=t=>{if(!t.isPrimary())return!0;const i=!this.columnModel.isPivotActive();return!(!t.isValueActive()||!i)&&(!!this.columnModel.isPivotMode()||e)},i=[],s=[];return this.forEachColumnFilter(((e,o)=>{const n=(e=>!!e&&(e.isFilterActive?e.isFilterActive():(he("Filter is missing isFilterActive() method"),!1)))(e);n&&(t(o.column)?i.push(e):s.push(e))})).then((()=>{this.activeAggregateFilters=i,this.activeColumnFilters=s}))}updateFilterFlagInColumns(e,t){return this.forEachColumnFilter(((i,s)=>s.column.setFilterActive(i.isFilterActive(),e,t)))}forEachColumnFilter(e){return vs.all(Array.from(this.allColumnFilters.values()).map((t=>t.filterPromise.then((i=>e(i,t))))))}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,n=i?this.activeAggregateFilters:this.activeColumnFilters,r=i?o:s;for(let i=0;i<n.length;i++){const s=n[i];if(null!=s&&s!==t){if("function"!=typeof s.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!s.doesFilterPass({node:e,data:r}))return!1}}return!0}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.filterManager?.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}updateBeforeFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:i}=e;return this.updateDependentFilters(),this.updateActiveFilters().then((()=>this.updateFilterFlagInColumns("filterChanged",i).then((()=>{this.allColumnFilters.forEach((e=>{e.filterPromise&&e.filterPromise.then((e=>{e&&e!==t&&e.onAnyFilterChanged&&e.onAnyFilterChanged()}))})),this.processingFilterChange=!0}))))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){this.forEachColumnFilter((e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()})).then((()=>this.updateFilterFlagInColumns(e,{afterDataChange:!0}))).then((()=>this.updateActiveFilters()))}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getCol(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}isFilterActive(e){const{filter:t}=this.cachedFilter(e)??{};return t?t.isFilterActive():null!=this.getModelFromInitialState(e)}getOrCreateFilterWrapper(e){if(!e.isFilterAllowed())return null;let t=this.cachedFilter(e);return t||(t=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,t)),t}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(Ji.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFilter";else{const i=this.dataTypeService?.getBaseDataType(e);t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(Ji.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService?.getBaseDataType(e);t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e,t){const i=this.getDefaultFilter(e),s=e.getColDef();let o;const n={...this.createFilterParams(e,s),filterModifiedCallback:()=>this.filterModifiedCallbackFactory(o,e)(),filterChangedCallback:t=>this.filterChangedCallbackFactory(o,e)(t),doesRowPassOtherFilter:e=>!this.filterManager||this.filterManager.doesRowPassOtherFilters(o,e)},r=this.userComponentFactory.getFilterDetails(s,n,i);return r?{filterPromise:()=>{const e=r.newAgStackInstance();return null!=e&&e.then((e=>{o=e,t&&(t.filter=e)})),e},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:$(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e){const t={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:i,compDetails:s}=this.createFilterInstance(e,t);return t.filterPromise=i?.()??null,t.compDetails=s,t}onColumnsChanged(){const e=[];this.allColumnFilters.forEach(((t,i)=>{let s;s=t.column.isPrimary()?this.columnModel.getColDefCol(i):this.columnModel.getCol(i),s&&s===t.column||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))})),e.length>0?this.filterManager?.onFilterChanged({columns:e,source:"api"}):this.updateDependentFilters()}updateDependentFilters(){const e=this.columnModel.getAutoCols();e?.forEach((e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e)}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const{filter:t}=this.allColumnFilters.get(e.getColId())??{};return!t||("function"!=typeof t?.isFilterAllowed||t.isFilterAllowed())}getFloatingFilterCompDetails(e,t){const i=t=>{const i=this.getOrCreateFilterWrapper(e)?.filterPromise;null!=i&&i.then((e=>{t(Vs(e))}))},s=e.getColDef(),o={...this.createFilterParams(e,s),filterChangedCallback:()=>i((t=>this.filterChangedCallbackFactory(t,e)()))},n=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,xs,o);let r=cn(this.frameworkOverrides,s,(()=>this.getDefaultFloatingFilter(e)));null==r&&(r="agReadOnlyFloatingFilter");const l={column:e,filterParams:n,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,l,r)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),this.filterManager?.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then((i=>{this.destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:"filterDestroyed",source:t,column:e.column};this.eventService.dispatchEvent(s)}))}filterModifiedCallbackFactory(e,t){return()=>{const i={type:"filterModified",column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{const s={filter:e,additionalEventAttributes:i,columns:[t],source:i?.source??"columnFilter"};this.callOnFilterChangedOutsideRenderCycle(s)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s))return void this.destroyFilter(i,"paramsUpdated");const o=i.getColDef().filterParams;t.filterPromise?t.filterPromise.then((e=>{!1===(!e?.refresh||e.refresh({...this.createFilterParams(i,i.getColDef()),filterModifiedCallback:this.filterModifiedCallbackFactory(e,i),filterChangedCallback:this.filterChangedCallbackFactory(e,i),doesRowPassOtherFilter:t=>!this.filterManager||this.filterManager.doesRowPassOtherFilters(e,t),...o}))&&this.destroyFilter(i,"paramsUpdated")})):this.destroyFilter(i,"paramsUpdated")}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListeners(e,{colDefChanged:()=>this.checkDestroyFilter(i)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||i?.render&&s?.render&&i.render===s.render)}hasFloatingFilters(){return this.columnModel.getCols().some((e=>e.getColDef().floatingFilter))}getFilterInstance(e,t){t&&this.getFilterInstanceImpl(e).then((e=>{const i=Vs(e);t(i)}))}getColumnFilterInstance(e){return new Promise((t=>{this.getFilterInstanceImpl(e).then((e=>{t(Vs(e))}))}))}getFilterInstanceImpl(e){const t=this.columnModel.getColDefCol(e);if(!t)return vs.resolve(void 0);const i=this.getOrCreateFilterWrapper(t)?.filterPromise;return i??vs.resolve(null)}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach((({model:e,source:t})=>this.setFilterModel(e,t))),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach((({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then((()=>i()))})),this.columnFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.dataTypeService?.isPendingInference()){let i=()=>{};const s=new Promise((e=>{i=e}));return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:i}),s}const i=this.columnModel.getColDefCol(e),s=i?this.getOrCreateFilterWrapper(i):null;return s?(o=this.setModelOnFilterWrapper(s.filterPromise,t),new Promise((e=>{o.then((t=>e(t)))}))):Promise.resolve();var o}getFilterWrapper(e){const t=this.columnModel.getColDefCol(e);return t?this.cachedFilter(t)??null:null}destroy(){super.destroy(),this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"gridDestroyed"))),this.allColumnListeners.clear()}}],dependantModules:[fn]},Sn={version:dn,moduleName:"@ag-grid-community/column-filter-api",apiFunctions:{isColumnFilterPresent:function(e){return!!e.filterManager?.isColumnFilterPresent()||!!e.filterManager?.isAggregateFilterPresent()},getFilterInstance:function(e,t,i){return e.filterManager?.getFilterInstance(t,i)},getColumnFilterInstance:function(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)},destroyFilter:function(e,t){const i=e.columnModel.getColDefCol(t);if(i)return e.filterManager?.destroyFilter(i,"api")},setFilterModel:function(e,t){e.frameworkOverrides.wrapIncoming((()=>e.filterManager?.setFilterModel(t)))},getFilterModel:function(e){return e.filterManager?.getFilterModel()??{}},getColumnFilterModel:function(e,t){return e.filterManager?.getColumnFilterModel(t)??null},setColumnFilterModel:function(e,t,i){return e.filterManager?.setColumnFilterModel(t,i)??Promise.resolve()},showColumnFilter:function(e,t){const i=e.columnModel.getCol(t);i?e.menuService.showFilterMenu({column:i,containerType:"columnFilter",positionBy:"auto"}):de(`column '${t}' not found`)}},dependantModules:[wn,vn]},yn={version:dn,moduleName:"@ag-grid-community/floating-filter-core",controllers:[{name:"headerFilterCell",classImp:hn}],dependantModules:[wn]},bn={version:dn,moduleName:"@ag-grid-community/floating-filter",dependantModules:[yn,wn]},Rn={version:dn,moduleName:"@ag-grid-community/read-only-floating-filter",userComponents:[{name:"agReadOnlyFloatingFilter",classImp:class extends Vi{constructor(){super('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field>\n </div>',[Do]),this.eFloatingFilterText=Bi}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance((t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}}}],dependantModules:[yn]},Fn={version:dn,moduleName:"@ag-grid-community/simple-floating-filter",dependantModules:[{version:dn,moduleName:"@ag-grid-community/simple-filter",dependantModules:[wn],userComponents:[{name:"agTextColumnFilter",classImp:Ho},{name:"agNumberColumnFilter",classImp:Oo},{name:"agDateColumnFilter",classImp:Jo},{name:"agDateInput",classImp:class extends Vi{constructor(){super('\n <div class="ag-filter-filter">\n <ag-input-text-field class="ag-date-filter" data-ref="eDateInput"></ag-input-text-field>\n </div>',[Do]),this.eDateInput=Bi}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()},input:e=>{e.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())}})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&$t(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:o,minValidDate:n,maxValidDate:r}=e.filterParams||{};if(n&&s&&he("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),r&&o&&he("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),n&&r){const[e,t]=[n,r].map((e=>e instanceof Date?e:jo(e)));e&&t&&e.getTime()>t.getTime()&&he("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}n?n instanceof Date?t.min=$o(n):t.min=n:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=$o(r):t.max=r:o&&(t.max=`${o}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return jo(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(Uo(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:qt()||Yt()||$t()&&jt()>=14.1}}}]},yn],userComponents:[{name:"agTextColumnFloatingFilter",classImp:Cn},{name:"agNumberColumnFloatingFilter",classImp:class extends pn{init(e){super.init(e),this.filterModelFormatter=new Io(this.localeService,this.optionsFactory,e.filterParams?.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){Lo(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return xo}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=Lo(e.filterParams),this.allowedCharPattern?this.createManagedBean(new gn({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new mn)}}},{name:"agDateColumnFloatingFilter",classImp:class extends un{constructor(){super('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field data-ref="eReadOnlyText"></ag-input-text-field>\n <div data-ref="eDateWrapper" style="display: flex;"></div>\n </div>',[Do]),this.eReadOnlyText=Bi,this.eDateWrapper=Bi}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}getDefaultFilterOptions(){return Yo}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Qo(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const t=e;this.dateComp.setDate(jo(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){ni(this.eDateWrapper,e),ni(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=Uo(this.dateComp.getDate());this.params.parentFilterInstance((t=>{if(t){const i=jo(e);t.onFloatingFilterChanged(this.getLastType()||null,i)}}))}getDateComponentParams(){const e=go(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:Ce(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new qo(this.context,this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,(e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))})),this.addDestroyFunc((()=>this.dateComp.destroy()))}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}}}]},Pn={version:dn,moduleName:"@ag-grid-community/quick-filter-core",beans:[class extends I{constructor(){super(...arguments),this.beanName="quickFilterService",this.quickFilter=null,this.quickFilterParts=null}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.pivotResultColsService=e.pivotResultColsService}postConstruct(){const e=this.resetQuickFilterCache.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}}),this.addManagedPropertyListener("quickFilterText",(e=>this.setQuickFilter(e.currentValue))),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],(()=>this.onQuickFilterColumnConfigChanged())),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],(()=>this.setQuickFilterParserAndMatcher()))}refreshQuickFilterCols(){const e=this.columnModel.isPivotMode(),t=this.columnModel.getAutoCols(),i=this.columnModel.getColDefCols();let s=(e&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.pivotResultColsService.getPivotResultCols()?.list:i)??[];t&&(s=s.concat(t)),this.colsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?s:s.filter((e=>e.isVisible()||e.isRowGroupActive()))}isQuickFilterPresent(){return null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every((i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i)))}resetQuickFilterCache(){this.rowModel.forEachNode((e=>e.quickFilterAggregateText=null))}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return k(e)?this.gos.isRowModelType("clientSide")?e.toUpperCase():(he("Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void he("Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onQuickFilterColumnConfigChanged(){this.refreshQuickFilterCols(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassQuickFilterNoCache(e,t){return this.colsForQuickFilter.some((i=>{const s=this.getQuickFilterTextForColumn(i,e);return k(s)&&s.indexOf(t)>=0}))}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const o=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(o)}return k(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.colsForQuickFilter.forEach((i=>{const s=this.getQuickFilterTextForColumn(i,e);k(s)&&t.push(s)})),t.join("\n")}}],dependantModules:[fn]},En={version:dn,moduleName:"@ag-grid-community/filter",dependantModules:[Fn,Rn,{version:dn,moduleName:"@ag-grid-community/quick-filter",dependantModules:[Pn,{version:dn,moduleName:"@ag-grid-community/quick-filter-api",apiFunctions:{isQuickFilterPresent:function(e){return!!e.filterManager?.isQuickFilterPresent()},getQuickFilter:function(e){return e.gos.get("quickFilterText")},resetQuickFilter:function(e){e.filterManager?.resetQuickFilterCache()}},dependantModules:[Pn]}]},Sn]},Dn=class extends Vi{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},Mn=class extends Dn{constructor(e){super('<div class="ag-header-cell ag-floating-filter" role="gridcell">\n <div data-ref="eFloatingFilterBody" role="presentation"></div>\n <div class="ag-floating-filter-button ag-hidden" data-ref="eButtonWrapper" role="presentation">\n <button type="button" class="ag-button ag-floating-filter-button-button" data-ref="eButtonShowMainFilter" tabindex="-1"></button>\n </div>\n </div>',e),this.eFloatingFilterBody=Bi,this.eButtonWrapper=Bi,this.eButtonShowMainFilter=Bi}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>ni(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then((e=>this.afterCompCreated(e)))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}},Tn=class extends Dn{constructor(e){super('<div class="ag-header-cell" role="columnheader">\n <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n </div>',e),this.eResize=Bi,this.eHeaderCompWrapper=Bi,this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();var t,i;t="col-id",null!=(i=this.column.getColId())&&""!=i?e.setAttribute(t,i):e.removeAttribute(t);const s={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaSort:t=>t?Vt(e,t):Wt(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper);const o=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",o)}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then((e=>this.afterCompCreated(t,e)))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}},xn=class extends Dn{constructor(e){super('<div class="ag-header-group-cell" role="columnheader">\n <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n </div>',e),this.eResize=Bi}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>ni(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return i="aria-expanded",null!=(s=t)?e.setAttribute(i,s):e.removeAttribute(i);var i,s},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then((e=>this.afterHeaderCompCreated(e)))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const i=this.getGui(),s=e.getGui();i.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}},An=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(An||{}),In=class extends Vi{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}postConstruct(){Gt(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach((e=>{const t=e.getInstanceId();let s=i[t];delete i[t],null==s&&(s=this.createHeaderComp(e),this.getGui().appendChild(s.getGui())),this.headerComps[t]=s})),K(i,((e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)})),t){const e=q(this.headerComps);e.sort(((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft()));const t=e.map((e=>e.getGui()));Fi(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new xn(e);break;case"filter":t=new Mn(e);break;default:t=new Tn(e)}return this.createBean(t),t.setParentComponent(this),t}},Ln=(e=>(e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT",e))(Ln||{}),On=class extends I{constructor(){super(...arguments),this.beanName="headerNavigationService",this.currentHeaderRowWithoutSpan=-1}wireBeans(e){this.focusService=e.focusService,this.headerPositionUtils=e.headerPositionUtils,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.visibleColService=e.visibleColsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}));const e=this.gos.getDocument();this.addManagedElementListeners(e,{mousedown:()=>this.setCurrentHeaderRowWithoutSpan(-1)})}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}getHeaderPositionForColumn(e,t){let i;if("string"==typeof e?(i=this.columnModel.getCol(e),i||(i=this.visibleColService.getColumnGroup(e))):i=e,!i)return null;const s="filter"===c(this.ctrlsService.getHeaderRowContainerCtrl().getAllCtrls()).getType(),o=this.getHeaderRowCount()-1;let n=-1,r=i;for(;r;)n++,r=r.getParent();let l=n;return t&&s&&l===o-1&&l++,-1===l?null:{headerRowIndex:l,column:i}}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s}=t,o=t.column,n=this.getHeaderRowCount(),r=0===e;let{headerRowIndex:l,column:a,headerRowIndexWithoutSpan:h}=r?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),d=!1;return l<0&&(l=0,a=o,d=!0),l>=n?(l=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==h&&(this.currentHeaderRowWithoutSpan=h),!(!d&&!a)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:a},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),o=2===e,n=this.gos.get("enableRtl");let r,l;if(-1!==this.currentHeaderRowWithoutSpan?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,o!==n?(l="Before",r=this.headerPositionUtils.findHeader(s,l)):(l="After",r=this.headerPositionUtils.findHeader(s,l)),r||!t)return this.focusService.focusHeaderPosition({headerPosition:r,direction:l,fromTab:t,allowUserOverride:!0,event:i});if(t){const e=this.gos.getCallback("tabToNextHeader");if(e)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:e,headerPosition:r,direction:l})}return this.focusNextHeaderRow(s,l,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let o,n=null;if("Before"===t?s>0&&(o=s-1,this.currentHeaderRowWithoutSpan-=1,n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"end")):(o=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"start")),!n)return!1;const{column:r,headerRowIndex:l}=this.headerPositionUtils.getHeaderIndexToFocus(n.column,n?.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:r,headerRowIndex:l},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if($e(e)){const s=e.getDisplayedLeafColumns();i="Before"===t?c(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}},kn=class extends I{wireBeans(e){this.headerNavigationService=e.headerNavigationService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.menuService=e.menuService}setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new co(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:s}),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedEventListeners({displayedColumnsChanged:e,columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e})}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,i=0,s=e.getHeaderRowCount();const o=this.filterManager?.hasFloatingFilters();o&&(s++,i=1);const n=this.columnModel.getColumnGroupHeaderRowHeight(),r=this.columnModel.getColumnHeaderRowHeight(),l=s-(1+i);if(t=i*e.getFloatingFiltersHeight(),t+=l*n,t+=r,this.headerHeight===t)return;this.headerHeight=t;const a=`${t+1}px`;this.comp.setHeightAndMinHeight(a),this.eventService.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.visibleColsService.getAllCols().some((e=>e.isSpanHeaderHeight()));this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case ts.LEFT:t=2;case ts.RIGHT:k(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case ts.UP:t=0;case ts.DOWN:k(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=e??t;s!==this.eGui&&s!==this.ctrlsService.getHeaderRowContainerCtrl().getViewport()||this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!Xt())return;const t=new Ki(this.eGui);this.addManagedListeners(t,{longTap:t=>{e(void 0,t.touchStart,t.touchEvent)}}),this.addDestroyFunc((()=>t.destroy()))}},Gn=class extends I{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}wireBeans(e){this.visibleColsService=e.visibleColsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=this.gos.isDomLayout("print"),t=this.visibleColsService.getBodyContainerWidth(),i=this.visibleColsService.getColsLeftWidth(),s=this.visibleColsService.getDisplayedColumnsRightWidth();let o;if(e)o=t+i+s;else if(o=t,this.addSpacer){0===(this.gos.get("enableRtl")?i:s)&&this.scrollVisibleService.isVerticalScrollShowing()&&(o+=this.gos.getScrollbarWidth())}this.callback(o)}},Nn=class extends I{constructor(e){super(),this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}wireBeans(e){this.funcColsService=e.funcColsService}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach((e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))}))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.funcColsService.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.funcColsService.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.funcColsService.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};function Hn(e){const{isFromHeader:t,hDirection:i,xPosition:s,fromEnter:o,fakeEvent:n,pinned:r,gos:l,columnModel:a,columnMoveService:h,presentedColsService:d}=e,g=0===i,p=1===i;let{allMovingColumns:m}=e;if(t){const e=[];m.forEach((t=>{let i=null,s=t.getParent();for(;null!=s&&1===s.getDisplayedLeafColumns().length;)i=s,s=s.getParent();if(null!=i){(!!i.getColGroupDef()?.marryChildren?i.getProvidedColumnGroup().getLeafColumns():i.getLeafColumns()).forEach((t=>{e.includes(t)||e.push(t)}))}else e.includes(t)||e.push(t)})),m=e}const C=m.slice();a.sortColsLikeCols(C);const f=function(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:o,gos:n,columnModel:r,presentedColsService:l}=e,a=n.get("suppressMovableColumns")||t.some((e=>e.getColDef().suppressMovable));if(a)return[];const h=function(e,t){switch(t){case"left":return e.getLeftCols();case"right":return e.getRightCols();default:return e.getCenterCols()}}(l,o),d=r.getCols(),c=h.filter((e=>S(t,e))),u=h.filter((e=>!S(t,e))),g=d.filter((e=>!S(t,e)));let p,m=0,C=s;if(i){let e=0;c.forEach((t=>e+=t.getActualWidth())),C-=e}if(C>0){for(let e=0;e<u.length;e++){if(C-=u[e].getActualWidth(),C<0)break;m++}i&&m++}if(m>0){const e=u[m-1];p=g.indexOf(e)+1}else p=g.indexOf(u[0]),-1===p&&(p=0);const f=[p],v=(e,t)=>e-t;if(i){let e=p+1;const t=d.length-1;for(;e<=t;)f.push(e),e++;f.sort(v)}else{let e=p;const t=d.length-1;let i=d[e];for(;e<=t&&h.indexOf(i)<0;)e++,f.push(e),i=d[e];e=p-1;const s=0;for(;e>=s;)f.push(e),e--;f.sort(v).reverse()}return f}({movingCols:C,draggingRight:p,xPosition:s,pinned:r,gos:l,columnModel:a,presentedColsService:d}),v=function(e,t){const i=t.getCols(),s=(r=e.map((e=>i.indexOf(e))),r.sort(((e,t)=>e-t))),o=s[0],n=c(s);var r;return n-o!=s.length-1?null:o}(C,a);if(0===f.length)return;const w=f[0];let y=null!==v&&!o;if(t&&(y=null!==v),y&&!n){if(g&&w>=v)return;if(p&&w<=v)return}const b=d.getAllCols(),R=[];let F=null;for(let e=0;e<f.length;e++){const t=f[e],i=h.getProposedColumnOrder(C,t);if(!h.doesOrderPassRules(i))continue;const s=i.filter((e=>b.includes(e)));if(null===F)F=s;else if(!u(s,F))break;const o=Vn(i);R.push({move:t,fragCount:o})}return 0!==R.length?(R.sort(((e,t)=>e.fragCount-t.fragCount)),Bn(m,R[0].move,"uiColumnMoved",!1,h)):void 0}function Bn(e,t,i,s,o){return o.moveColumns(e,t,i,s),s?null:{columns:e,toIndex:t}}function Vn(e){function t(e){const t=[];let i=e.getOriginalParent();for(;null!=i;)t.push(i),i=i.getOriginalParent();return t}let i=0;for(let s=0;s<e.length-1;s++){let o=t(e[s]),n=t(e[s+1]);[o,n]=o.length>n.length?[o,n]:[n,o],o.forEach((e=>{-1===n.indexOf(e)&&i++}))}return i}function Wn(e,t,i,s,o){const n=o.getHeaderRowContainerCtrl(t).getViewport();if(i&&(e-=n.getBoundingClientRect().left),s.get("enableRtl")){e=n.clientWidth-e}return null==t&&(e+=o.get("center").getCenterViewportScrollLeft()),e}var zn=class extends I{constructor(e){super(),this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!k(e)}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnMoveService=e.columnMoveService,this.dragAndDropService=e.dragAndDropService,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}))}getIconName(){return this.pinned?"pinned":"move"}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const i=e.dragItem.visibleState,s=(t||[]).filter((e=>i[e.getId()]));this.setColumnsVisible(s,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const s=e.filter((e=>!e.getColDef().lockVisible));this.columnModel.setColsVisible(s,t,i)}}setColumnsPinned(e,t,i){if(e){const s=e.filter((e=>!e.getColDef().lockPinned));this.columnModel.setColsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>s-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>s-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){if(s){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;Bn(e,t,"uiColumnMoved",!0,this.columnMoveService)}return}if(this.lastDraggingEvent=e,G(e.hDirection))return;const o=Wn(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(o);const n=this.normaliseDirection(e.hDirection),r=e.dragSource.type,l=Hn({allMovingColumns:e.dragSource.getDragItem().columns?.filter((e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned))||[],isFromHeader:1===r,hDirection:n,xPosition:o,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel,columnMoveService:this.columnMoveService,presentedColsService:this.visibleColsService});l&&(this.lastMovedInfo=l)}normaliseDirection(e){if(!this.gos.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:de(`Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.dragAndDropService.setGhostIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon("move"))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter((e=>!e.getColDef().lockPinned));if(e.length>0&&(this.dragAndDropService.setGhostIcon("pinned"),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}},_n=class extends I{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady((e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]]}})),this.moveColumnFeature=this.createManagedBean(new zn(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new Nn(this.pinned)),this.dragAndDropService.addDropTarget(this)}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}},Un=class extends I{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.pinnedWidthService=e.pinnedWidthService,this.ctrlsService=e.ctrlsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=o}postConstruct(){const e=[];let t,i;const s=()=>{if(ni(this.eResize,t),!t)return;const s=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(s),i){const t=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.columnAutosizeService.autoSizeColumn(this.column,"uiColumnResized",t)};this.eResize.addEventListener("dblclick",i);const s=new Ki(this.eResize);s.addEventListener("doubleTap",i),e.push((()=>{this.eResize.removeEventListener("dblclick",i),s.removeEventListener("doubleTap",i),s.destroy()}))}},o=()=>{e.forEach((e=>e())),e.length=0},n=()=>{const e=this.column.isResizable(),n=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(e!==t||n!==i)&&(t=e,i=n,o(),s())};n(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(n)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:o}=this,n=this.normaliseResizeAmount(t),r=[{key:i,newWidth:o+n}];if(this.column.getPinned()){if(this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(n-s)>ci(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50)return}this.lastResizeAmount=n,this.columnSizeService.setColumnWidths(r,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,s="right"===this.pinned;return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}},Kn=class extends I{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new ns),this.cbSelectAll.addCssClass("ag-header-select-all"),yt(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:this.onNewColumnsLoaded.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedListeners(this.cbSelectAll,{fieldValueChanged:this.onCbSelectAll.bind(this)}),Tt(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),i=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gos.get("rowSelection"))||(he(`${e} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t)||(he(`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const o={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;if("function"==typeof e){e=e(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))}return!!e&&(this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"))}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}},$n=class extends ln{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new Un(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new an([this.column],t)),this.createManagedBean(new Zo(this.column,t,this.beans)),this.createManagedBean(new co(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListeners(this.column,{colDefChanged:this.refresh.bind(this)}),this.addManagedEventListeners({columnValueChanged:this.onColumnValueChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this),columnPivotChanged:this.onColumnPivotChanged.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}resizeHeader(e,t){if(!this.column.isResizable())return;const i=this.column.getActualWidth(),s=this.column.getMinWidth(),o=this.column.getMaxWidth(),n=Math.min(Math.max(i+e,s),o);this.beans.columnSizeService.setColumnWidths([{key:this.column,newWidth:n}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:s,ctrlsService:o}=this,n=this.getPinned(),r=t.getBoundingClientRect().left,l=i.getActualWidth();Hn({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:Wn(0===e!==s.get("enableRtl")?r-20:r+l+20,n,!0,s,o),pinned:n,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:this.beans.columnModel,columnMoveService:this.beans.columnMoveService,presentedColsService:this.beans.visibleColsService}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:e=>{this.menuService.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button"})},showColumnMenuAfterMouseClick:e=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse"})},showFilter:e=>{this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{this.beans.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{this.beans.sortController.setSortForColumn(this.column,e,!!t,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(e,t)=>{this.setupTooltip(e,t)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new Kn(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===ts.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===ts.ENTER&&this.onEnterKeyDown(e),e.key===ts.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();i&&i instanceof qi&&i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i="whenTruncated"===this.gos.get("tooltipShowMode"),s=this.eGui,o=this.column.getColDef();t||!i||o.headerComponent||(t=()=>{const e=s.querySelector(".ag-header-cell-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>{if(null!=e)return e;return this.column.getColDef().headerTooltip},shouldDisplayTooltip:t},r=this.createManagedBean(new Ni(n));this.refreshFunctions.push((()=>r.refreshToolTip()))}setupClassesFromColDef(){const e=()=>{const e=en(this.column.getColDef(),this.gos,this.column,null),t=this.userHeaderClasses;this.userHeaderClasses=new Set(e),e.forEach((e=>{t.has(e)?t.delete(e):this.comp.addOrRemoveCssClass(e,!0)})),t.forEach((e=>this.comp.addOrRemoveCssClass(e,!1)))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:o,gos:n}=this,{columnModel:r}=i;let l=!this.gos.get("suppressDragLeaveHidesColumns");const a=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{l=!n.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{if(l){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];r.setColsVisible(t,!0,"uiColumnMoved")}},onGridExit:e=>{if(l){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];r.setColsVisible(t,!1,"uiColumnMoved")}}};o.addDragSource(a,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach((e=>e()))}refreshHeaderComp(){const e=this.lookupUserCompDetails();!!(null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass)&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();if(!t)return!1;if(!t.refresh)return!1;return t.refresh(e)}calculateDisplayName(){return this.beans.columnNameService.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListeners(this.column,{movingChanged:e}),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListeners(this.column,{menuVisibleChanged:e}),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(){const e=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListeners(this.column,{filterActiveChanged:e}),e()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),void i.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:o,isSpanningTotal:n}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:r}=s,l=r.getColumnHeaderRowHeight();if(0===o)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${l}px`);i.addOrRemoveCssClass("ag-header-span-total",n);const a=o*(r.isPivotMode()?r.getPivotGroupHeaderHeight():r.getGroupHeaderHeight());e.style.setProperty("top",-a+"px"),e.style.setProperty("height",`${l+a}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,s=i=>{if(!this.isAlive())return;const{paddingTop:o,paddingBottom:n,borderBottomWidth:r,borderTopWidth:l}=hi(this.getGui()),a=o+n+r+l,h=e.offsetHeight+a;if(i<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==h)return void window.setTimeout((()=>s(i+1)),0)}t.setColHeaderHeight(this.column,h)};let o,n=!1;const r=()=>{const e=this.column.isAutoHeaderHeight();e&&!n&&l(),!e&&n&&a()},l=()=>{n=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),o=i.observeResize(e,(()=>s(0)))},a=()=>{n=!1,o&&o(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),o=void 0};r(),this.addDestroyFunc((()=>a())),this.addManagedListeners(this.column,{widthChanged:()=>n&&s(0)}),this.addManagedEventListeners({sortChanged:()=>{n&&window.setTimeout((()=>s(0)))}}),this.addRefreshFunction(r)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(function(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort(((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0))).map((e=>this.ariaDescriptionProperties.get(e))).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedEventListeners({columnHoverChanged:e}),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column)})}handleMouseOverChange(e){this.setActiveHeader(e);const t={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof qi?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},jn=class extends I{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.autoWidthCalculator=e.autoWidthCalculator,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",(()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach((e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())})),t.length>0&&this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")}))}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),o=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(o,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s={columnsToResize:t,resizeStartWidth:i,resizeRatios:this.getSizeRatiosOfColumns(t,i)};let o=null;if(e&&(o=this.visibleColsService.getGroupAtDirection(this.columnGroup,"After")),o){const e=o.getDisplayedLeafColumns(),t=s.groupAfterColumns=e.filter((e=>e.isResizable())),i=s.groupAfterStartWidth=this.getInitialSizeOfColumns(t);s.groupAfterRatios=this.getSizeRatiosOfColumns(t,i)}else s.groupAfterColumns=void 0,s.groupAfterStartWidth=void 0,s.groupAfterRatios=void 0;return s}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:o,groupAfterStartWidth:n,groupAfterRatios:r}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=n,this.resizeTakeFromRatios=r}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols??void 0,groupAfterStartWidth:this.resizeTakeFromStartWidth??void 0,groupAfterRatios:this.resizeTakeFromRatios??void 0};this.resizeColumns(s,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:o,resizeStartWidth:n,resizeRatios:r,groupAfterColumns:l,groupAfterStartWidth:a,groupAfterRatios:h}=e,d=[];if(d.push({columns:o,ratios:r,width:t}),l){const e=t-n;d.push({columns:l,ratios:h,width:a-e})}this.columnSizeService.resizeColumnSets({resizeSets:d,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter((e=>e.isResizable()))}getInitialSizeOfColumns(e){return e.reduce(((e,t)=>e+t.getActualWidth()),0)}getSizeRatiosOfColumns(e,t){return e.map((e=>e.getActualWidth()/t))}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}},qn=class extends I{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach((t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push((()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)}))}))}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach((e=>e())),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}},Yn=class extends ln{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const e=this.getGui();this.setDragSource(e)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnNameService.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc((()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))})),this.setupUserComp(),this.addHeaderMouseListeners();const s=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new an(o,t)),this.createManagedBean(new Zo(this.column,t,this.beans)),this.createManagedBean(new qn(e,this.column)),this.resizeFeature=this.createManagedBean(new jn(e,i,s,this.column)),this.createManagedBean(new co(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,gos:o,ctrlsService:n}=this,r=o.get("enableRtl"),l=0===e,a=this.getPinned(),h=i.getBoundingClientRect(),d=h.left,u=h.width,g=Wn(l!==r?d-20:d+u+20,a,!0,o,n),p=s.getGroupId(),m=this.focusService.getFocusedHeader();Hn({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:g,pinned:a,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:t.columnModel,columnMoveService:t.columnMoveService,presentedColsService:t.visibleColsService});const C=s.getDisplayedLeafColumns(),f=l?C[0]:c(C);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(f,"auto"),!this.isAlive()&&m&&this.restoreFocus(p,s,m)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const o=s[0].getParent();if(!o)return;const n=this.findGroupWidthId(o,e);n&&this.focusService.focusHeaderPosition({headerPosition:{...i,column:n}})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:e=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),e,"gridInitializing")},setTooltip:(e,t)=>{this.setupTooltip(e,t)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column.getProvidedColumnGroup()),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column.getProvidedColumnGroup())})}handleMouseOverChange(e){const t={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),s="whenTruncated"===this.gos.get("tooltipShowMode"),o=this.eGui;t||!s||i?.headerGroupComponent||(t=()=>{const e=o.querySelector(".ag-header-group-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>e??(i&&i.headerTooltip),shouldDisplayTooltip:t};i&&(n.getColDef=()=>i),this.createManagedBean(new Ni(n))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded();const t=this.refreshExpanded.bind(this);this.addManagedListeners(e,{expandedChanged:t,expandableChanged:t})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=en(this.column.getColGroupDef(),this.gos,null,this.column);if(this.column.isPadding()){e.push("ag-header-group-cell-no-group");this.column.getLeafColumns().every((e=>e.isSpanHeaderHeight()))&&e.push("ag-header-span-height")}else e.push("ag-header-group-cell-with-group");e.forEach((e=>this.comp.addOrRemoveCssClass(e,!0)))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach((e=>{this.addManagedListeners(e,{movingChanged:t})})),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===ts.ENTER){const e=this.column,t=!e.isExpanded();this.beans.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;const{beans:t,column:i,displayName:s,gos:o,dragAndDropService:n}=this,{columnModel:r}=t,l=i.getProvidedColumnGroup().getLeafColumns();let a=!o.get("suppressDragLeaveHidesColumns");const h=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?"hide":"notAllowed",dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),l.forEach((e=>e.setMoving(!0,"uiColumnDragged")))},onDragStopped:()=>l.forEach((e=>e.setMoving(!1,"uiColumnDragged"))),onGridEnter:e=>{if(a){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];r.setColsVisible(t,!0,"uiColumnMoved")}},onGridExit:e=>{if(a){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];r.setColsVisible(t,!1,"uiColumnMoved")}}};n.addDragSource(h,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach((e=>i[e.getId()]=e.isVisible()));const s=[];return this.beans.visibleColsService.getAllCols().forEach((e=>{t.indexOf(e)>=0&&(s.push(e),C(t,e))})),t.forEach((e=>s.push(e))),{columns:s,visibleState:i}}isSuppressMoving(){let e=!1;this.column.getLeafColumns().forEach((t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)}));return e||this.gos.get("suppressMovableColumns")}},Qn=0,Xn=class extends I{constructor(e,t,i){super(),this.instanceId=Qn++,this.rowIndex=e,this.pinned=t,this.type=i;const s="group"==i?"ag-header-row-column-group":"filter"==i?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}wireBeans(e){this.beans=e}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}areCellsRendered(){return!!this.comp&&this.getHeaderCellCtrls().every((e=>null!=e.getGui()))}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){const e=this.onRowHeightChanged.bind(this);this.addManagedEventListeners({columnResized:this.onColumnResized.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:e=>this.onVirtualColumnsChanged(e.afterScroll),columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e}),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",(e=>this.isEnsureDomOrder=e.currentValue)),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e)}getHeaderCellCtrl(e){if(this.headerCellCtrls)return U(this.headerCellCtrls).find((t=>t.getColumnGroupChild()===e))}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleColsService:e}=this.beans;if(this.isPrintLayout){return null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null)}return e.getContainerWidth(this.pinned)}onRowHeightChanged(){const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const s=[];let o=0;t?.hasFloatingFilters()&&(i++,o=1);const n=e.getColumnGroupHeaderRowHeight(),r=e.getColumnHeaderRowHeight(),l=i-(1+o);for(let e=0;e<l;e++)s.push(n);s.push(r);for(let t=0;t<o;t++)s.push(e.getFloatingFiltersHeight());let a=0;for(let e=0;e<this.rowIndex;e++)a+=s[e];return{topOffset:a,rowHeight:s[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const i of t)this.recycleAndCreateHeaderCtrls(i,e);const i=e=>{const{focusService:t,visibleColsService:i}=this.beans;if(!t.isHeaderWrapperFocused(e))return!1;return i.isVisible(e.getColumnGroupChild())};if(e)for(const[t,s]of e){i(s)?this.headerCellCtrls.set(t,s):this.destroyBean(s)}return this.getHeaderCellCtrls()}getHeaderCellCtrls(){return Array.from(this.headerCellCtrls?.values()??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls)return;if(e.isEmptyGroup())return;const i=e.getUniqueId();let s;t&&(s=t.get(i),t.delete(i));if(s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),null==s)switch(this.type){case"filter":s=this.createBean(this.beans.ctrlsFactory.getInstance("headerFilterCell",e,this.beans,this));break;case"group":s=this.createBean(new Yn(e,this.beans,this));break;default:s=this.createBean(new $n(e,this.beans,this))}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnViewportService:i}=this.beans;return["left",null,"right"].forEach((s=>{const o=i.getHeadersToRender(s,t);e=e.concat(o)})),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnViewportService.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){if(!this.headerCellCtrls)return;return this.getHeaderCellCtrls().find((t=>t.getColumnGroupChild()==e))}focusHeader(e,t){const i=this.findHeaderCellCtrl(e);if(!i)return!1;return i.focus(t)}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach((e=>{this.destroyBean(e)})),this.headerCellCtrls=void 0,super.destroy()}},Jn=class extends I{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}wireBeans(e){this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.focusService=e.focusService,this.filterManager=e.filterManager}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport);const i=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:i,advancedFilterEnabledChanged:i}),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const t=new Oi,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let i=0;i<e;i++){const e=this.createBean(new Xn(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(e)}})(),(()=>{const i=t.next(),s=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===i);(s||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),s&&(this.columnsRowCtrl=this.createBean(new Xn(i,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=!!this.filterManager?.hasFloatingFilters()&&!this.hidden;const i=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void i();const s=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==s;e&&!t||i()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Xn(s,this.pinned,"filter")))})();const s=this.getAllCtrls();this.comp.setCtrls(s),this.restoreFocusOnHeader(i)}getHeaderCtrlForColumn(e){if(te(e)){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,i){const s=this.getAllCtrls()[e];return!!s&&s.focusHeader(t,i)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}setupDragAndDrop(e){const t=new _n(this.pinned,e);this.createManagedBean(t)}restoreFocusOnHeader(e){if(!e)return;const{column:t}=e;t.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager?.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new Gn((e=>this.comp.setCenterWidth(`${e}px`)),!0))}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const i=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==i)return;const s=0==i,o=this.hidden!==s,n=this.gos.get("enableRtl"),r=this.gos.getScrollbarWidth(),l=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?i+r:i;this.comp.setPinnedContainerWidth(`${l}px`),this.comp.setDisplayed(!s),o&&(this.hidden=s,this.refresh())};this.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}},Zn=class extends Vi{constructor(e){super(),this.eCenterContainer=Bi,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new Jn(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e="left"==this.pinned,t="right"==this.pinned,i=e?'<div class="ag-pinned-left-header" role="rowgroup"></div>':t?'<div class="ag-pinned-right-header" role="rowgroup"></div>':'<div class="ag-header-viewport" role="presentation">\n <div class="ag-header-container" data-ref="eCenterContainer" role="rowgroup"></div>\n </div>';this.setTemplate(i),this.eRowContainer=this.eCenterContainer!==Bi?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;let i;this.headerRowComps={},this.rowCompsList=[];const s=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),i&&Ri(this.eRowContainer,t,i),i=t};e.forEach((e=>{const i=e.getInstanceId(),o=t[i];delete t[i];const n=o||this.createBean(new In(e));this.headerRowComps[i]=n,this.rowCompsList.push(n),s(n)})),q(t).forEach((e=>this.destroyRowComp(e)))}},er=class extends Vi{constructor(){super('<div class="ag-header" role="presentation"/>')}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new kn).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new Zn("left")),t(new Zn(null)),t(new Zn("right"))}},tr={selector:"AG-HEADER-ROOT",component:er},ir=(e=>(e.AUTO_HEIGHT="ag-layout-auto-height",e.NORMAL="ag-layout-normal",e.PRINT="ag-layout-print",e))(ir||{}),sr=class extends I{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){const e=this.gos.get("domLayout")??"normal";return-1===["normal","print","autoHeight"].indexOf(e)?(he(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):e}},or=class extends Vi{constructor(){super('\n <div class="ag-overlay" role="presentation">\n <div class="ag-overlay-panel" role="presentation">\n <div class="ag-overlay-wrapper" data-ref="eOverlayWrapper" role="presentation"></div>\n </div>\n </div>'),this.eOverlayWrapper=Bi,this.activePromise=null,this.activeOverlay=null,this.updateListenerDestroyFunc=null,this.activeOverlayWrapperCssClass=null}wireBeans(e){this.overlayService=e.overlayService}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new sr(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i){this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.activePromise=e,e?.then((t=>{if(this.activePromise===e){if(this.activePromise=null,t&&this.activeOverlay!=t&&(this.eOverlayWrapper.appendChild(t.getGui()),this.activeOverlay=t,i)){const e=t;this.updateListenerDestroyFunc=this.addManagedPropertyListener(i,(({currentValue:t})=>{e.refresh?.(this.gos.addGridCommonParams({...t??{}}))}))}}else this.activeOverlay!==t&&(this.destroyBean(t),t=null)})),this.setDisplayed(!0,{skipAriaHidden:!0})}destroyActiveOverlay(){this.activePromise=null;const e=this.activeOverlay;if(!e)return;this.activeOverlay=null;const t=this.updateListenerDestroyFunc;t&&(t(),this.updateListenerDestroyFunc=null),this.destroyBean(e),vi(this.eOverlayWrapper)}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}},nr={selector:"AG-OVERLAY-WRAPPER",component:or},rr=class extends Vi{constructor(e,t){super(),this.direction=t,this.eViewport=Bi,this.eContainer=Bi,this.hideTimeout=null,this.setTemplate(e)}wireBeans(e){this.animationFrameService=e.animationFrameService}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Qt()||Xt())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=ti(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0),i=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:i,touchend:i})}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame((()=>this.setScrollVisible()))}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout((()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null}),400)}})}attemptSettingScrollPosition(e){const t=this.getViewport();ve((()=>yi(t)),(()=>this.setScrollPosition(e)),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedElementListeners(this.getViewport(),{scroll:e})}},lr=class extends rr{constructor(){super('<div class="ag-body-horizontal-scroll" aria-hidden="true">\n <div class="ag-horizontal-left-spacer" data-ref="eLeftSpacer"></div>\n <div class="ag-body-horizontal-scroll-viewport" data-ref="eViewport">\n <div class="ag-body-horizontal-scroll-container" data-ref="eContainer"></div>\n </div>\n <div class="ag-horizontal-right-spacer" data-ref="eRightSpacer"></div>\n </div>',"horizontal"),this.eLeftSpacer=Bi,this.eRightSpacer=Bi}wireBeans(e){super.wireBeans(e),this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Gn((e=>this.eContainer.style.width=`${e}px`))),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.visibleColsService.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.gos.getScrollbarWidth();i&&(t+=s),Di(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let o=this.visibleColsService.getColsLeftWidth();this.enableRtl&&e&&(o+=s),Di(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),s=e&&this.gos.getScrollbarWidth()||0,o=i?0:0===s&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Mi(this.getGui(),o),Mi(this.eViewport,o),Mi(this.eContainer,o),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return Ci(this.getViewport(),this.enableRtl)}setScrollPosition(e){yi(this.getViewport())||this.attemptSettingScrollPosition(e),fi(this.getViewport(),e,this.enableRtl)}},ar={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:lr},hr=class extends I{wireBeans(e){this.maxDivHeightScaler=e.rowContainerHeightService}constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this)})}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}},dr=class extends rr{wireBeans(e){super.wireBeans(e),this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}constructor(){super('<div class="ag-body-vertical-scroll" aria-hidden="true">\n <div class="ag-body-vertical-scroll-viewport" data-ref="eViewport">\n <div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div>\n </div>\n </div>',"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new hr(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this)})}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,s=0===i&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Di(this.getGui(),s),Di(this.eViewport,s),Di(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,t=e.getGridBodyCtrl().getBodyViewportElement(),i=this.getScrollPosition(),s=t.scrollTop;i!=s&&this.setScrollPosition(s,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){t||yi(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}},cr={selector:"AG-FAKE-VERTICAL-SCROLL",component:dr},ur=class extends I{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=Ce((()=>this.lastScrollSource[1]=null),500),this.resetLastVScrollDebounced=Ce((()=>this.lastScrollSource[0]=null),500)}wireBeans(e){this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.rowModel=e.rowModel,this.heightScaler=e.rowContainerHeightService,this.rowRenderer=e.rowRenderer,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)}),this.ctrlsService.whenReady((e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()}))}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(),{scroll:this.onHScroll.bind(this)}),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),s=i?Ce(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?Ce(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedElementListeners(this.eBodyViewport,{scroll:s}),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowsCtrl)return;void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,{topCenter:i,stickyTopCenter:s,stickyBottomCenter:o,centerHeader:n,bottomCenter:r,fakeHScrollComp:l}=this.ctrlsService.getParams();n.setHorizontalScroll(-t),r.setContainerTranslateX(t),i.setContainerTranslateX(t),s.setContainerTranslateX(t),o.setContainerTranslateX(t);const a=this.centerRowsCtrl.getViewportElement(),h=0===this.lastScrollSource[1];e=Math.abs(e),h?l.setScrollPosition(e):fi(a,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let s;s=0===e?Ci(t,this.enableRtl):this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:"bodyScroll",direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout((()=>{const e={...t,type:"bodyScrollEnd"};this.eventService.dispatchEvent(e)}),100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!Xt())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=di(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&mi()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&mi()?e>0?0:i:Math.min(Math.max(e,0),i)),fi(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight;return{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let t=0;t<i;t++){const i=this.rowModel.getRow(t);if("function"==typeof e){if(i&&e(i)){s=t;break}}else if(e===i||e===i.data){s=t;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.rowModel.getRowCount();if("number"!=typeof e||e<0||e>=i)return void he("Invalid row index for ensureIndexVisible: "+e);const s=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming((()=>{s||this.paginationService?.goToPageWithIndex(e);const i=this.ctrlsService.getGridBodyCtrl(),o=i.getStickyTopHeight(),n=i.getStickyBottomHeight(),r=this.rowModel.getRow(e);let l;do{const e=r.rowTop,i=r.rowHeight,s=this.pageBoundsService.getPixelOffset(),a=r.rowTop-s,h=a+r.rowHeight,d=this.getVScrollPosition(),c=this.heightScaler.getDivStretchOffset(),u=d.top+c,g=d.bottom+c,p=g-u,m=this.heightScaler.getScrollPositionForPixel(a),C=this.heightScaler.getScrollPositionForPixel(h-p),f=Math.min((m+C)/2,a);let v=null;"top"===t?v=m:"bottom"===t?v=C:"middle"===t?v=f:u+o>a?v=m-o:g-n<h&&(v=C+n),null!==v&&(this.setVerticalScrollPosition(v),this.rowRenderer.redraw({afterScroll:!0})),l=e!==r.rowTop||i!==r.rowHeight}while(l);this.animationFrameService.flushAllFrames()}))}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getCol(e);if(!i)return;if(i.isPinned())return;if(!this.visibleColsService.isColDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming((()=>{null!==s&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()}))}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming((()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()}))}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),n=this.centerRowsCtrl.getCenterWidth(),r=this.enableRtl;let l=(r?i:s)||o,a=r?s:i;"auto"!==t&&(l="start"===t,a="end"===t);const h="middle"===t;if(l||a||h){const{colLeft:t,colMiddle:i,colRight:s}=this.getColumnBounds(e);return h?i-n/2:l?r?s:t:r?t-n:s-n}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),n=this.enableRtl;return{columnBeforeStart:n?t>o:i<o,columnAfterEnd:n?i<s:t>s}}getColumnBounds(e){const t=this.enableRtl,i=this.visibleColsService.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),n=t?-1:1,r=t?i-o:o;return{colLeft:r,colMiddle:r+s/2*n,colRight:r+s*n}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}},gr="ag-force-vertical-scroll",pr=class extends I{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.menuService=e.menuService,this.headerNavigationService=e.headerNavigationService,this.dragAndDropService=e.dragAndDropService,this.pinnedRowModel=e.pinnedRowModel,this.rowRenderer=e.rowRenderer,this.popupService=e.popupService,this.mouseEventService=e.mouseEventService,this.rowModel=e.rowModel,this.filterManager=e.filterManager,this.environment=e.environment}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,n,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=n,this.eStickyBottom=r,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(e=>this.setCellTextSelection(e.currentValue))),this.createManagedBean(new sr(this.comp)),this.bodyScrollFeature=this.createManagedBean(new ur(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,n,r]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager?.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),pinnedRowDataChanged:this.setFloatingHeights.bind(this),pinnedHeightChanged:this.setFloatingHeights.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}addFocusListeners(e){e.forEach((e=>{this.addManagedElementListeners(e,{focusin:t=>{const{target:i}=t,s=ai(i,"ag-root",e);e.classList.toggle("ag-has-focus",!s)},focusout:t=>{const{target:i,relatedTarget:s}=t,o=e.contains(s),n=ai(s,"ag-root",e);ai(i,"ag-root",e)||o&&!n||e.classList.remove("ag-has-focus")}})}))}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=`calc(100% + ${(e&&this.gos.getScrollbarWidth()||0)+(ti()?16:0)}px)`;this.animationFrameService.requestAnimationFrame((()=>this.comp.setBodyViewportWidth(t)))}onGridColumnsChanged(){const e=this.columnModel.getCols();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const i=e.relatedTarget;if(null===Zt(i))return void this.rowRenderer.stopEditing();let s=t.some((e=>e.contains(i)))&&this.mouseEventService.isElementInThisGrid(i);if(!s){const e=this.popupService;s=e.getActivePopups().some((e=>e.contains(i)))||e.isElementWithinCustomPopup(i)}s||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach((t=>this.addManagedElementListeners(t,{focusout:e})))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+(this.filterManager?.getHeaderRowCount()??0),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=-1===t?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?gr:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&(s=this.eBodyViewport).clientHeight<s.scrollHeight;var s}setupRowAnimationCssClass(){let e=this.environment.hasMeasuredSizes();const t=()=>{const t=e&&this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),i=t?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(i,t)};t(),this.addManagedEventListeners({heightScaleChanged:t}),this.addManagedPropertyListener("animateRows",t),this.addManagedEventListeners({gridStylesChanged:()=>{!e&&this.environment.hasMeasuredSizes()&&(e=!0,t())}})}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:e}),this.mockContextMenuForIPad(e),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this)}),this.addManagedElementListeners(this.eStickyTop,{wheel:this.onStickyWheel.bind(this)}),this.addManagedElementListeners(this.eStickyBottom,{wheel:this.onStickyWheel.bind(this)}),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedElementListeners(e,{wheel:e=>this.onFullWidthContainerWheel(e,t)})}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;if(this.gos.get("preventDefaultOnContextMenu")){(e||i).preventDefault()}const{target:s}=e||t;s!==this.eBodyViewport&&s!==this.ctrlsService.get("center").getViewportElement()||this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!Xt())return;const t=new Ki(this.eBodyViewport);this.addManagedListeners(t,{longTap:t=>{e(void 0,t.touchStart,t.touchEvent)}}),this.addDestroyFunc((()=>t.destroy()))}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Qs(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(e){const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+(this.filterManager?.getHeaderHeight()??0),t=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e),t>0&&(i+=t),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight()+(this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0);this.comp.setStickyBottomBottom(`${e}px`)}sizeColumnsToFit(e,t){const i=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,s=ci(this.eGridBody)-i;s>0?this.columnSizeService.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,100)}),0):100===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,500)}),100):500===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,-1)}),500):he("tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}},mr=class extends Vi{constructor(e,t,i,s,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(n);const r=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l=(e,t)=>{null!=t&&""!=t?r.setAttribute(e,t):r.removeAttribute(e)};yt(r,t.getCellAriaRole()),l("col-id",t.getColumnIdSanitised());const a=t.getTabIndex();void 0!==a&&l("tabindex",a.toString());const h={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Pi(r,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,i)=>this.setRenderDetails(e,t,i),setEditDetails:(e,t,i)=>this.setEditDetails(e,t,i),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(h,this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const s=this.refreshWrapper(!1);if(this.refreshEditStyles(!1),e){!(i||s)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e))}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&null==this.eCellWrapper;if(s){const e=document.createElement("div");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=e,this.getGui().appendChild(this.eCellWrapper)}const o=!i&&null!=this.eCellWrapper;o&&(wi(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const n=!e&&i,r=n&&null==this.eCellValue;if(r){const e=document.createElement("span");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-value"),this.eCellValue=e,this.eCellWrapper.appendChild(this.eCellValue)}const l=!n&&null!=this.eCellValue;l&&(wi(this.eCellValue),this.eCellValue=void 0);const a=s||o||r||l;return a&&this.removeControls(),e||t&&this.addControls(),a}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,o=e.newAgStackInstance();if(null==o)return;const{params:n}=e;o.then((e=>this.afterCellEditorCreated(s,e,n,t,i)));G(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();vi(t);const i=null!=e?We(e,!0):null;null!=i&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),wi(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),wi(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gos.get("suppressAnimationFrame"),i=this.rendererVersion,{componentClass:s}=e,o=()=>{if(this.rendererVersion!==i||!this.isAlive())return;const t=e.newAgStackInstance(),o=this.afterCellRendererCreated.bind(this,i,s);t&&t.then(o)};t&&this.firstRender?this.beans.animationFrameService.createTask(o,this.rowNode.rowIndex,"createTasksP2"):o()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion)this.beans.context.destroyBean(i);else if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();vi(e),e.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,s,o){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return he(`cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const n=s||void 0!==t.isPopup&&t.isPopup();n?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,n),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),this.rowCtrl?.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();if(e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui){this.getParentOfValue().appendChild(this.cellEditorGui)}}addPopupCellEditor(e,t){"fullRow"===this.beans.gos.get("editType")&&he("popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(this.beans.editService.createPopupEditorWrapper(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,n=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),r=null!=t?t:i.getPopupPosition?i.getPopupPosition():"over",l=this.beans.gos.get("enableRtl"),a={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:r,alignSide:l?"right":"left",keepWithinBounds:!0},h=o.positionPopupByComponent.bind(o,a),d=this.beans.localeService.getLocaleTextFunc(),c=o.addPopup({modal:n,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:h,ariaLabel:d("ariaLabelCellEditor","Cell Editor")});c&&(this.hideEditorPopup=c.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&Jt()&&e.focus({preventScroll:!0}),vi(this.getParentOfValue())}},Cr=class extends Vi{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const o=this.getGui(),n=o.style;this.domOrder=this.rowCtrl.getDomOrder(),yt(o,"row");const r=this.rowCtrl.getTabIndex();null!=r&&o.setAttribute("tabindex",r.toString());const l={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Pi(o,e),setTop:e=>n.top=e,setTransform:e=>n.transform=e,setRowIndex:e=>o.setAttribute("row-index",e),setRowId:e=>o.setAttribute("row-id",e),setRowBusinessKey:e=>o.setAttribute("row-business-key",e),refreshFullWidth:e=>this.refreshFullWidth(e)};e.setComp(l,this.getGui(),i),this.addDestroyFunc((()=>{e.unsetComp(i)}))}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then((e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)}))}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach((e=>{const i=e.getInstanceId();null==this.cellComps[i]?this.newCellComp(e):t[i]=null}));const i=q(t).filter((e=>null!=e));this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach((e=>{const i=this.cellComps[e.getInstanceId()];i&&t.push(i.getGui())})),Fi(this.getGui(),t)}newCellComp(e){const t=new mr(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=q(this.cellComps).filter((e=>null!=e));this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&de("should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc((()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)}))}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach((e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)}))}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},fr=class extends I{wireBeans(e){this.ctrlsService=e.ctrlsService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.columnViewportService=e.columnViewportService}constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()})),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],(()=>{this.checkViewportAndScrolls()}))}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnSizeService.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=ci(this.gridBodyCtrl.getBodyViewportElement());if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const i=this.gos.getCallback("processUnpinnedColumns");if(t.length){if(i){t=i({columns:t,viewportWidth:e})}this.columnModel.setColsPinned(t,null,"viewportSizeFeature")}}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(t<e)return[];const i=[...this.visibleColsService.getLeftCols()],s=[...this.visibleColsService.getRightCols()];let o=0,n=0;const r=[];let l=t-0-e;for(;(n<i.length||o<s.length)&&l>0;){if(o<s.length){const e=s[o++];l-=e.getActualWidth(),r.push(e)}if(n<i.length&&l>0){const e=i[n++];l-=e.getActualWidth(),r.push(e)}}return r}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=di(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:"bodyHeightChanged"};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnViewportService.setScrollPosition(e,t)}},vr=class extends I{wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",(e=>{e.currentValue?this.enableFeature():this.disableFeature()})),this.addDestroyFunc((()=>this.disableFeature()));this.gos.get("enableRangeSelection")&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}},wr=class extends Vi{constructor(){super('\n <div class="ag-selection-checkbox" role="presentation">\n <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\n </div>',[rs]),this.eCheckbox=Bi}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=Kt(e,t),[s,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],n=e(s,o);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement(),{dblclick:e=>D(e),click:e=>{D(e);const t=this.gos.get("groupSelectsFiltered"),i=this.eCheckbox.getValue();if(this.shouldHandleIndeterminateState(i,t)){0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e)}else i?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)});if(this.gos.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){let e=this.rowNode.selectable;const t=this.getIsVisible();if(e)if("function"==typeof t){const i=this.overrides?.callbackParams;if(this.column){const s=this.column.createColumnFunctionCallbackParams(this.rowNode);e=t({...i,...s})}else e=t({...i,node:this.rowNode,data:this.rowNode.data})}else e=t??!1;const i=this.column?.getColDef().showDisabledCheckboxes;if(i)return this.eCheckbox.setDisabled(!e),this.setVisible(!0),void this.setDisplayed(!0);this.overrides?.removeHidden?this.setDisplayed(e):this.setVisible(e)}getIsVisible(){return this.overrides?this.overrides.isVisible:this.column?.getColDef()?.checkboxSelection}},Sr=class extends Vi{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(_i("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",(e=>{e.stopPropagation()})),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}};if(t){t(this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e}))}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},yr=class extends I{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,(e=>this.cellComp.addOrRemoveCssClass(e,!0)),(e=>this.cellComp.addOrRemoveCssClass(e,!1))),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach((e=>this.cellComp.addOrRemoveCssClass(e,!1))),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach((e=>this.cellComp.addOrRemoveCssClass(e,!0)))}destroy(){super.destroy()}},br=class extends I{constructor(e,t,i,s,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case ts.ENTER:this.onEnterKeyDown(e);break;case ts.F2:this.onF2KeyDown(e);break;case ts.ESCAPE:this.onEscapeKeyDown(e);break;case ts.TAB:this.onTabKeyDown(e);break;case ts.BACKSPACE:case ts.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case ts.DOWN:case ts.UP:case ts.RIGHT:case ts.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:o}=this,{gos:n,rangeService:r,eventService:l}=s;if(!i.isEditing()){if(l.dispatchEvent({type:"keyShortcutChangedCellStart"}),function(e,t=!1){return e===ts.DELETE||!t&&e===ts.BACKSPACE&&Qt()}(e,n.get("enableCellEditingOnBackspace"))){if(r&&n.get("enableRangeSelection"))r.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const e=i.getColumn(),t=this.beans.valueService.parseValue(e,o,"",o.getValueFromValueService(e))??null;o.setDataValue(e,t,"cellClear")}}else i.startRowOrCellEdit(e,t);l.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?ts.UP:ts.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(ts.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(ts.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.get("suppressRowDeselection")){const t=this.beans.gos.get("groupSelectsFiltered"),o=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===i&&0===o&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},Rr=class extends I{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!M(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gos:s}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const n=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(n);const r=this.column.getColDef();r.onCellClicked&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{r.onCellClicked(n)}))}),0);!((s.get("singleClickEdit")||r.singleClickEdit)&&!s.get("suppressClickEdit"))||e.shiftKey&&0!=i?.getCellRanges().length||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Xt()||T("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,"cellDoubleClicked");this.beans.eventService.dispatchEvent(i),"function"==typeof t.onCellDoubleClicked&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{t.onCellDoubleClicked(i)}))}),0);!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{cellCtrl:n,beans:r}=this,{eventService:l,rangeService:a,focusService:h}=r;if(this.isRightClickInExistingRange(e))return;const d=a&&0!=a.getCellRanges().length;if(!s||!d){const e=$t()&&!n.isEditing()&&!oi(o);n.focusCell(e)}if(s&&d&&!h.isCellFocused(n.getCellPosition())){e.preventDefault();const t=h.getFocusedCell();if(t){const{column:e,rowIndex:i,rowPinned:s}=t,o=r.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s}),n=o?.getCellCtrl(e);n?.isEditing()&&n.stopEditing(),h.setFocusedCell({column:e,rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(a){const e=this.cellCtrl.getCellPosition();if(s)a.extendLatestRangeToCell(e);else{const s=t||i;a.setRangeToCell(e,s)}}l.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=2===e.button||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return ai(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOut");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOver");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){super.destroy()}},Fr=class extends I{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();u(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce(((e,t)=>e+t.getActualWidth()),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let o=0;i&&o<e&&(t.push(i),i=this.beans.visibleColsService.getColAfter(i),i&&!G(i))&&s===i.getPinned();o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gos.get("enableRtl")&&this.colsSpanning?c(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.visibleColsService.getColsLeftWidth();if("right"===this.column.getPinned()){return t+this.beans.visibleColsService.getBodyContainerWidth()+(e||0)}return t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},Pr=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(Pr||{}),Er=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(Er||{}),Dr="ag-cell-range-selected",Mr=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(Dr,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Dr}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Dr}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Dr}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Dr}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),zt(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,o=!t&&e.bottom,n=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",i),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",o),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",n)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every((e=>S([1,0],e.type)))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,o=!1;const n=this.cellCtrl.getCellPosition().column,r=this.beans.visibleColsService;let l,a;e?(l=r.getColAfter(n),a=r.getColBefore(n)):(l=r.getColBefore(n),a=r.getColAfter(n));const h=this.rangeService.getCellRanges().filter((e=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e)));l||(o=!0),a||(i=!0);for(let e=0;e<h.length&&!(t&&i&&s&&o);e++){const n=h[e],r=this.rangeService.getRangeStartRow(n),d=this.rangeService.getRangeEndRow(n);!t&&this.beans.rowPositionUtils.sameRow(r,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(d,this.cellCtrl.getCellPosition())&&(s=!0),!o&&l&&n.columns.indexOf(l)<0&&(o=!0),!i&&a&&n.columns.indexOf(a)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=c(t),o=this.cellCtrl.getCellPosition(),n=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),r=e.get("enableRangeHandle");let l=1===i&&!this.cellCtrl.isEditing()&&(n||r);if(this.hasChartRange){const e=1===t[0].type&&this.rangeService.isCellInSpecificRange(o,t[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),l=0===s.type}return l&&null!=s.endRow&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,o)}addSelectionHandle(){const e=this.beans.gos,t=c(this.rangeService.getCellRanges()).type,i=e.get("enableFillHandle")&&G(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},Tr=0,xr=class e extends I{constructor(e,t,i,s){super(),this.column=e,this.rowNode=t,this.beans=i,this.rowCtrl=s,this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.instanceId=e.getId()+"-"+Tr++,this.colIdSanitised=We(this.column.getId()),i.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new Fr(this,this.beans),this.addDestroyFunc((()=>{this.cellPositionFeature?.destroy(),this.cellPositionFeature=null})),this.cellCustomStyleFeature=new yr(this,this.beans),this.addDestroyFunc((()=>{this.cellCustomStyleFeature?.destroy(),this.cellCustomStyleFeature=null})),this.cellMouseListenerFeature=new Rr(this,this.beans,this.column),this.addDestroyFunc((()=>{this.cellMouseListenerFeature?.destroy(),this.cellMouseListenerFeature=null})),this.cellKeyboardListenerFeature=new br(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc((()=>{this.cellKeyboardListenerFeature?.destroy(),this.cellKeyboardListenerFeature=null})),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc((()=>{this.disableTooltipFeature()})));this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new Mr(this.beans,this),this.addDestroyFunc((()=>{this.cellRangeFeature?.destroy(),this.cellRangeFeature=null})))}enableTooltipFeature(e,t){const i="whenTruncated"===this.beans.gos.get("tooltipShowMode");t||!i||this.isCellRenderer()||(t=()=>{const e=this.getGui(),t=0===e.children.length?e:e.querySelector(".ag-cell-value");return!t||t.scrollWidth>t.clientWidth});const s={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=e?()=>e:()=>{const e=this.column.getColDef(),t=this.rowNode.data;if(e.tooltipField&&k(t))return Q(t,e.tooltipField,this.column.isTooltipFieldContainsDots());const i=e.tooltipValueGetter;return i?i(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new Ni(s,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,i,s,o){this.cellComp=e,this.eGui=t,this.printLayout=s,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),this.cellPositionFeature?.setComp(t),this.cellCustomStyleFeature?.setComp(e),this.tooltipFeature?.refreshToolTip(),this.cellKeyboardListenerFeature?.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach((e=>e())),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,i=this.beans.gos.getRowHeightForNode(this.rowNode).height,s=o=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:n,paddingBottom:r,borderBottomWidth:l,borderTopWidth:a}=hi(t),h=n+r+l+a,d=e.offsetHeight+h;if(o<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==d)return void window.setTimeout((()=>s(o+1)),0)}const c=Math.max(d,i);this.rowNode.setRowAutoHeight(c,this.column)},o=()=>s(0);o();const n=this.beans.resizeObserverService.observeResize(e,o);this.addDestroyFunc((()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)}))}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){return this.valueFormatted??this.value}showValue(e=!1){const t=this.getValueToDisplay();let i;if(this.rowNode.stub){const e=this.createCellRendererParams();i=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),e)}else if(this.isCellRenderer()){const e=this.createCellRendererParams();i=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(i,t,e),this.cellRangeFeature?.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return!(null!=this.rowNode.rowPinned)&&("function"==typeof e||!0===e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return t||i||s||o}startEditing(e=null,t=!1,i=null){const{editService:s}=this.beans;this.isCellEditable()&&!this.editing&&s&&(this.cellComp?s.startEditing(this,e,t,i):this.onCellCompAttachedFuncs.push((()=>{this.startEditing(e,t,i)})))}setEditing(e,t){this.editCompDetails=t,this.editing!==e&&(this.editing=e,this.cellRangeFeature?.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(e=!1){const{editService:t}=this.beans;return!(!this.editing||!t)&&t.stopEditing(this,e)}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(e,t,i,s)=>this.registerRowDragger(e,t,s),setTooltip:(e,t)=>{this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),this.tooltipFeature?.refreshToolTip()}})}setFocusOutOnEditor(){this.editing&&this.beans.editService?.setFocusOutOnEditor(this)}setFocusInOnEditor(){this.editing&&this.beans.editService?.setFocusInOnEditor(this)}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(e)}refreshCell(e){if(this.suppressRefreshCell||this.editing)return;const t=this.column.getColDef(),i=null!=e&&!!e.newData,s=null!=e&&!!e.suppressFlash||!!t.suppressCellFlash,o=null==t.field&&null==t.valueGetter&&null==t.showRowGroup,n=e&&e.forceRefresh||o||i,r=!!this.cellComp,l=this.updateAndFormatValue(r);if(r){if(n||l){this.showValue(i);const e=this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering();!s&&!e&&(this.beans.gos.get("enableCellChangeFlash")||t.enableCellChangeFlash)&&this.flashCell(),this.cellCustomStyleFeature?.applyUserStyles(),this.cellCustomStyleFeature?.applyClassesFromColDef()}this.tooltipFeature?.refreshToolTip(),this.cellCustomStyleFeature?.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.beans.editService?.stopEditingAndFocus(this,e,t)}flashCell(e){const t=e?.flashDuration??e?.flashDelay,i=e?.fadeDuration??e?.fadeDelay;this.animateCell("data-changed",t,i)}animateCell(e,t,i){if(!this.cellComp)return;const s=`ag-cell-${e}`,o=`ag-cell-${e}-animation`,{gos:n}=this.beans;t||(t=n.get("cellFlashDuration")),k(i)||(i=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(s,!0),this.cellComp.addOrRemoveCssClass(o,!1),this.beans.frameworkOverrides.wrapIncoming((()=>{window.setTimeout((()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(s,!1),this.cellComp.addOrRemoveCssClass(o,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout((()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.eGui.style.transition="")}),i))}),t)}))}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){return this.callValueFormatter(e)??e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!e||(!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i)}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc((()=>this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,null)))}createEvent(e,t){return this.beans.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){this.cellKeyboardListenerFeature?.processCharacter(e)}onKeyDown(e){this.cellKeyboardListenerFeature?.onKeyDown(e)}onMouseEvent(e,t){this.cellMouseListenerFeature?.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){this.cellComp&&this.cellPositionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:i}=this;sn(e,t,i.visibleColsService)}refreshAriaColIndex(){const e=this.beans.visibleColsService.getAriaColIndex(this.column);Ht(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){return this.cellPositionFeature?.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){this.cellComp?"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t):this.onCellCompAttachedFuncs.push((()=>{this.startRowOrCellEdit(e,t)}))}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return null!=this.cellRangeFeature}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&e?.forceBrowserFocus&&(this.focusEventToRestore=e));if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus){let t=this.cellComp.getFocusableElement();if(this.editing){const e=this.beans.focusService.findFocusableElements(t,null,!0);e.length&&(t=e[0])}t.focus({preventScroll:!!e.preventScrollOnBrowserFocus})}const i="fullRow"===this.beans.gos.get("editType");t||i||!this.editing||this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:O(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){if(!this.cellComp)return;this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?this.beans.editService?.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,"cellContextMenu");this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{t.onCellContextMenu(i)}))}),0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new wr;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new Sr(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const s=this.createRowDragComp(e,t,i);s&&(this.customRowDragComp=s,this.addDestroyFunc((()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null})))}createRowDragComp(e,t,i){const s=this.beans.gos.get("pagination"),o=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(o){if(!n)return void he("managed row dragging is only allowed in the Client Side Row Model");if(s)return void he("managed row dragging is not possible when doing pagination")}const r=new Js((()=>this.value),this.rowNode,this.column,e,t,i);return this.beans.context.createBean(r),r}setSuppressRefreshCell(e){this.suppressRefreshCell=e}getEditCompDetails(){return this.editCompDetails}};xr.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var Ar=xr,Ir=0,Lr=class e extends I{constructor(e,t,i,s,o){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=t,this.gos=t.gos,this.rowNode=e,this.paginationPage=t.paginationService?.getCurrentPage()??0,this.useAnimationFrameForCreate=s,this.printLayout=o,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+Ir++,this.rowId=We(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(i),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=We(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}updateGui(e,t){"left"===e?this.leftGui=t:"right"===e?this.rightGui=t:"fullWidth"===e?this.fullWidthGui=t:this.centerGui=t}setComp(e,t,i){const s={rowComp:e,element:t,containerType:i};this.allRowGuis.push(s),this.updateGui(i,s),this.initialiseRowComp(s),"FullWidthLoading"===this.rowType||this.rowNode.rowPinned||this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter((t=>t.containerType!==e)),this.updateGui(e,void 0)}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach((e=>e.element.style.display=t))}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach((e=>s.addOrRemoveCssClass(e,!0))),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&At(t.element,1==this.rowNode.expanded),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc((()=>i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,null))),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask((()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)})),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=We(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(me((()=>{this.onTopChanged()})),this.slideInAnimation[t]=!1);this.fadeInAnimation[t]&&(me((()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)})),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection"))return void he("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");const t=this.beans.localeService.getLocaleTextFunc(),i=new Js((()=>`1 ${t("rowDragRow","row")}`),this.rowNode,void 0,e.element,void 0,!0),s=this.createBean(i,this.beans.context);this.rowDragComps.push(s)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if("FullWidthDetail"==this.rowType&&!Ji.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const i=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(i)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map((e=>e?.rowComp?.getFullWidthCellRenderer())):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.visibleColsService.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.visibleColsService.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),i=this.gos.get("masterDetail")&&this.rowNode.detail,s=this.beans.columnModel.isPivotMode(),o=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(s);this.rowType=e?"FullWidthLoading":i?"FullWidthDetail":t?"FullWidth":o?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;e||this.gos.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask((()=>{this.active&&this.updateColumnListsImpl(!0)}),this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(e,t,i=null){const s={list:[],map:{}},o=(e,t)=>{s.list.push(t),s.map[e]=t};return t.forEach((t=>{const i=t.getInstanceId();let s=e.map[i];s||(s=new Ar(t,this.rowNode,this.beans,this)),o(i,s)})),e.list.forEach((e=>{if(null!=s.map[e.getColumn().getInstanceId()])return;this.isCellEligibleToBeRemoved(e,i)?e.destroy():o(e.getColumn().getInstanceId(),e)})),s}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach((t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,e)}))}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const e=this.beans.columnViewportService,t=this.beans.visibleColsService;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.getAllCols()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const i=e.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i);const s=t.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,s,"left");const o=t.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}isCellEligibleToBeRemoved(e,t){const i=!0;if(e.getColumn().getPinned()!=t)return i;const s=e.isEditing(),o=this.beans.focusService.isCellFocused(e.getCellPosition());if(s||o){const t=e.getColumn();return!(this.beans.visibleColsService.getAllCols().indexOf(t)>=0)&&i}return i}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=k(this.rowNode.oldRowTop),i=this.beans.visibleColsService.isPinningLeft(),s=this.beans.visibleColsService.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=s}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=s}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth((()=>this.createFullWidthCompDetails(e.element,t).params)),t=e(this.fullWidthGui,null),i=e(this.centerGui,null),s=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&i&&s&&o}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),expandedChanged:this.updateExpandedCss.bind(this),hasChildrenChanged:this.updateExpandedCss.bind(this)}),this.rowNode.detail&&this.addManagedListeners(this.rowNode.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(this.rowNode,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this)}),this.addManagedListeners(this.beans.eventService,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),this.addDestroyFunc((()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))})),this.addManagedPropertyListeners(["rowDragEntireRow"],(()=>{this.gos.get("rowDragEntireRow")?this.allRowGuis.forEach((e=>{this.addRowDraggerToRow(e)})):this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)})),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onRowIndexChanged()))},cellChanged:e=>{this.getAllCellCtrls().forEach((t=>t.onCellChanged(e)))}})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell())this.beans.rowRenderer.redrawRow(this.rowNode);else if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode)}else this.getAllCellCtrls().forEach((t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update}))),this.allRowGuis.forEach((e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp)})),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach((t=>{const i=0===e,s=1===e;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",s)}))}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e)))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach((i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),At(i.element,e&&t)}))}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:O(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find((t=>t.element.contains(e.target)));if(!((t?t.element:null)===e.target))return;const i=this.rowNode,s=this.beans.focusService.getFocusedCell(),o={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:s&&s.column};this.beans.navigationService.navigateToNextCell(e,e.key,o,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||M(e))return;const t=this.allRowGuis.find((t=>t.element.contains(e.target))),i=t?t.element:null,s=i===e.target;let o=null;s||(o=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&s||!o)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){const e=this.allRowGuis.find((e=>yi(e.element)))?.element;return e?e.getBoundingClientRect().top:0}onFullWidthRowFocused(e){const t=this.rowNode,i=!!e&&(this.isFullWidth()&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned),s=this.fullWidthGui?this.fullWidthGui.element:this.centerGui?.element;s&&(s.classList.toggle("ag-full-width-focus",i),i&&e?.forceBrowserFocus&&s.focus({preventScroll:!0}))}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const i={list:[],map:{}};return e.list.forEach((e=>{e!==t&&(i.list.push(e),i.map[e.getColumn().getInstanceId()]=e)})),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){return this.gos.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:t})}createRowEventWithSource(e,t){const i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(M(e))return;const t=this.createRowEventWithSource("rowDoubleClicked",e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=ai(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.visibleColsService;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges();const s=this.getFullWidthElement(),o=e.target;let n=!0;s&&s.contains(o)&&oi(o)&&(n=!1),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllCols()[0],rowPinned:t.rowPinned,forceBrowserFocus:n})}onRowClick(e){if(M(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource("rowClicked",e);this.beans.eventService.dispatchEvent(t);const i=e.ctrlKey||e.metaKey,s=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const o=this.gos.get("rowMultiSelectWithClick"),n=!this.gos.get("suppressRowDeselection"),r="rowClicked";if(this.rowNode.isSelected())o?this.rowNode.setSelectedParams({newValue:!1,event:e,source:r}):i?n&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:r}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!s,rangeSelect:s,event:e,source:r});else{const t=!o&&!i;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:s,event:e,source:r})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if("FullWidthDetail"!==this.rowType)return;if(!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),("clientSide"===this.beans.rowModel.getType()||"serverSide"===this.beans.rowModel.getType())&&this.beans.rowModel.onRowHeightChanged()};window.setTimeout(e,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthCompDetails(e,t){const{gos:i,rowNode:s}=this,o=i.addGridCommonParams({fullWidth:!0,data:s.data,node:s,value:s.key,valueFormatted:s.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,i,s)=>this.addFullWidthRowDragging(e,t,i,s),setTooltip:(e,t)=>this.refreshRowTooltip(e,t)}),n=this.beans.userComponentFactory;switch(this.rowType){case"FullWidthDetail":return n.getFullWidthDetailCellRendererDetails(o);case"FullWidthGroup":return n.getFullWidthGroupCellRendererDetails(o);case"FullWidthLoading":return n.getFullWidthLoadingCellRendererDetails(o);default:return n.getFullWidthCellRendererDetails(o)}}refreshRowTooltip(e,t){if(!this.fullWidthGui)return;const i={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new Ni(i,this.beans))}addFullWidthRowDragging(e,t,i="",s){if(!this.isFullWidth())return;const o=new Js((()=>i),this.rowNode,void 0,e,t,s);this.createBean(o,this.beans.context),this.addDestroyFunc((()=>{this.destroyBean(o,this.beans.context)}))}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach((e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(i,!1)}))}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e)))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach((e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t))))}stopEditing(e=!1){this.stoppingRowEdit||this.beans.rowEditService?.stopEditing(this,e)}setInlineEditingCss(e){this.allRowGuis.forEach((t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)}))}setEditingRow(e){this.editingRow=e}startRowEditing(e=null,t=null,i=null){this.editingRow||this.beans.rowEditService?.startEditing(this,e,t,i)}getAllCellCtrls(){if(0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length)return this.centerCellCtrls.list;return[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach((e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!0)))}))}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,(e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!0)))}),(e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!1)))}))}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,(e=>e.rowComp.setUserStyles(this.rowStyles)))}getPinnedForContainer(e){return"left"===e||"right"===e?e:null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2==0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&"function"==typeof e)return void he("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gos.getCallback("getRowStyle");let i;if(t){i=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})}return i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,(e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),zt(e.element,t);!e.element.contains(this.gos.getActiveDomElement())||e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()}))}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.gos.get("suppressRowDeselection"))return;const t=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(t)}addHoverFunctionality(e){if(!this.active)return;const{rowNode:t,beans:i,gos:s}=this;this.addManagedListeners(e,{mouseenter:()=>t.onMouseEnter(),mouseleave:()=>t.onMouseLeave()}),this.addManagedListeners(t,{mouseEnter:()=>{i.dragService.isDragging()||s.get("suppressRowHoverHighlight")||(e.classList.add("ag-row-hover"),t.setHovered(!0))},mouseLeave:()=>{e.classList.remove("ag-row-hover"),t.setHovered(!1)}})}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,s=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),s)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),s=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,o=s?Math.min(i,s)-2+"px":void 0;this.forEachGui(e,(e=>{e.element.style.height=`${t}px`,o&&e.element.style.setProperty("--ag-line-height",o)}))}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gos.isAnimateRows()&&!this.isSticky()){if(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach((e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0)))}this.rowNode.setHovered(!1);const t=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=e=>(e.list.forEach((e=>e.destroy())),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,(e=>{e.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),e.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)}))}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationService?.getCurrentPage()??0;this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;return e+this.beans.pageBoundsService.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&k(e)){const t=this.applyPaginationOffset(e),i=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(i)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";const t=this.rowNode;let i;if(this.isSticky())i=t.stickyRowTop;else{const s=this.slideInAnimation[e]?this.roundRowTopToBounds(t.oldRowTop):t.rowTop,o=this.applyPaginationOffset(s);i=t.isRowPinned()?o:this.beans.rowContainerHeightService.getRealPixelPosition(o)}return i+"px"}setRowTopStyle(e){this.allRowGuis.forEach((t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`)))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach((i=>{i.getColumn()==e&&(t=i)})),null!=t||this.getAllCellCtrls().forEach((i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)})),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString();if(null===t)return;const i=this.beans.headerNavigationService.getHeaderRowCount()+(this.beans.filterManager?.getHeaderRowCount()??0),s=this.rowNode.rowIndex%2==0,o=i+this.rowNode.rowIndex+1;this.forEachGui(e,(e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",s),e.rowComp.addOrRemoveCssClass("ag-row-odd",!s),Gt(e.element,o)}))}setStoppingRowEdit(e){this.stoppingRowEdit=e}};Lr.DOM_DATA_KEY_ROW_CTRL="renderedRow";var Or=Lr,kr=class extends I{wireBeans(e){this.mouseEventService=e.mouseEventService,this.valueService=e.valueService,this.menuService=e.menuService,this.ctrlsService=e.ctrlsService,this.navigationService=e.navigationService,this.focusService=e.focusService,this.undoRedoService=e.undoRedoService,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService,this.clipboardService=e.clipboardService}constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",T("touchstart")?"touchstart":"mousedown"].forEach((e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}))}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||M(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!Xt())return;const e=new Ki(this.element);this.addManagedListeners(e,{longTap:e=>{const t=this.getRowForEvent(e.touchEvent),i=this.mouseEventService.getRenderedCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(void 0,e.touchEvent,t,i)}}),this.addDestroyFunc((()=>e.destroy()))}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gos.getDomData(t,Or.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const o=i?i.getRowNode():null,n=s?s.getColumn():null;let r=null;if(n){const i=e||t;s.dispatchCellContextMenuEvent(i??null),r=this.valueService.getValue(n,o)}const l=this.ctrlsService.getGridBodyCtrl(),a=s?s.getGui():l.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:n,value:r,anchorToElement:a})}getControlsForEventTarget(e){return{cellCtrl:x(this.gos,e,Ar.DOM_DATA_KEY_CELL_CTRL),rowCtrl:x(this.gos,e,Or.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),n=e.isEditing();if(!Po(this.gos,i,s,o,n)&&"keydown"===t){!n&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Fo(i)&&e.processCharacter(i)}if("keydown"===t){const t=e.createEvent(i,"cellKeyDown");this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell(),n=o&&o.column;if(!Po(this.gos,i,s,n,!1)){const s=i.key;if("keydown"===t)switch(s){case ts.PAGE_HOME:case ts.PAGE_END:case ts.PAGE_UP:case ts.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case ts.UP:case ts.DOWN:e.onKeyboardNavigate(i);break;case ts.TAB:e.onTabKeyDown(i)}}if("keydown"===t){const t=e.createRowEvent("cellKeyDown",i);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const i=function(e){const{keyCode:t}=e;let i;switch(t){case 65:i=ts.A;break;case 67:i=ts.C;break;case 86:i=ts.V;break;case 68:i=ts.D;break;case 90:i=ts.Z;break;case 89:i=ts.Y;break;default:i=e.code}return i}(e);return i===ts.A?this.onCtrlAndA(e):i===ts.C?this.onCtrlAndC(e):i===ts.D?this.onCtrlAndD(e):i===ts.V?this.onCtrlAndV(e):i===ts.X?this.onCtrlAndX(e):i===ts.Y?this.onCtrlAndY():i===ts.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,rowModel:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[e,o]=[t.isEmpty("top"),t.isEmpty("bottom")],n=e?null:"top";let r,l;o?(r=null,l=i.getRowCount()-1):(r="bottom",l=t.getPinnedBottomRowNodes().length-1);const a=this.visibleColsService.getAllCols();if(N(a))return;s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:l,rowEndPinned:r,columnStart:a[0],columnEnd:c(a)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gos.get("undoRedoCellEditing")&&this.undoRedoService&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService?.redo("ui")}},Gr=class extends I{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({leftPinnedWidthChanged:this.onPinnedLeftWidthChanged.bind(this)})}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;ni(this.element,t),Di(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}},Nr=class extends I{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({rightPinnedWidthChanged:this.onPinnedRightWidthChanged.bind(this)})}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;ni(this.element,t),Di(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}},Hr=e=>e.getTopRowCtrls(),Br=e=>e.getStickyTopRowCtrls(),Vr=e=>e.getStickyBottomRowCtrls(),Wr=e=>e.getBottomRowCtrls(),zr=e=>e.getCentreRowCtrls(),_r={center:{type:"center",container:"ag-center-cols-container",viewport:"ag-center-cols-viewport",getRowCtrls:zr},left:{type:"left",container:"ag-pinned-left-cols-container",pinnedType:"left",getRowCtrls:zr},right:{type:"right",container:"ag-pinned-right-cols-container",pinnedType:"right",getRowCtrls:zr},fullWidth:{type:"fullWidth",container:"ag-full-width-container",fullWidth:!0,getRowCtrls:zr},topCenter:{type:"center",container:"ag-floating-top-container",viewport:"ag-floating-top-viewport",getRowCtrls:Hr},topLeft:{type:"left",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Hr},topRight:{type:"right",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Hr},topFullWidth:{type:"fullWidth",container:"ag-floating-top-full-width-container",fullWidth:!0,getRowCtrls:Hr},stickyTopCenter:{type:"center",container:"ag-sticky-top-container",viewport:"ag-sticky-top-viewport",getRowCtrls:Br},stickyTopLeft:{type:"left",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Br},stickyTopRight:{type:"right",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Br},stickyTopFullWidth:{type:"fullWidth",container:"ag-sticky-top-full-width-container",fullWidth:!0,getRowCtrls:Br},stickyBottomCenter:{type:"center",container:"ag-sticky-bottom-container",viewport:"ag-sticky-bottom-viewport",getRowCtrls:Vr},stickyBottomLeft:{type:"left",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Vr},stickyBottomRight:{type:"right",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Vr},stickyBottomFullWidth:{type:"fullWidth",container:"ag-sticky-bottom-full-width-container",fullWidth:!0,getRowCtrls:Vr},bottomCenter:{type:"center",container:"ag-floating-bottom-container",viewport:"ag-floating-bottom-viewport",getRowCtrls:Wr},bottomLeft:{type:"left",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:Wr},bottomRight:{type:"right",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:Wr},bottomFullWidth:{type:"fullWidth",container:"ag-floating-bottom-full-width-container",fullWidth:!0,getRowCtrls:Wr}};function Ur(e){return _r[e]}var Kr=["center","left","right","fullWidth"],$r=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],jr=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],qr=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Yr=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Qr=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],Xr=[...Yr,"stickyTopFullWidth",...Qr,"stickyBottomFullWidth"],Jr=["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right",...Yr,...Qr],Zr=class extends I{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.options=Ur(e)}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService,this.columnViewportService=e.columnViewportService,this.resizeObserverService=e.resizeObserverService,this.rowRenderer=e.rowRenderer}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],(()=>{this.viewportSizeFeature=this.createManagedBean(new fr(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})}))}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.ctrlsService.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new kr(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows(),this.forContainers(jr,(()=>{this.pinnedWidthFeature=this.createManagedBean(new Gr(this.eContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:()=>this.onPinnedWidthChanged()})})),this.forContainers(qr,(()=>{this.pinnedWidthFeature=this.createManagedBean(new Nr(this.eContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:()=>this.onPinnedWidthChanged()})})),this.forContainers(Kr,(()=>this.createManagedBean(new hr(this.eContainer,"center"===this.name?i:void 0)))),this.forContainers(Jr,(()=>this.createManagedBean(new vr(this.eContainer)))),this.forContainers($r,(()=>this.createManagedBean(new Gn((e=>this.comp.setContainerWidth(`${e}px`)))))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(Xr.indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=this.gos.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],(()=>{this.addManagedElementListeners(this.eViewport,{scroll:()=>this.eViewport.scrollLeft=0})}))}onDisplayedColumnsChanged(){this.forContainers(["center"],(()=>this.onHorizontalViewportChanged()))}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],(()=>this.onHorizontalViewportChanged()))}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc((()=>this.eContainer.removeEventListener("touchmove",e)))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnViewportService.setScrollPosition(t,i,e)}getCenterWidth(){return ci(this.eViewport)}getCenterViewportScrollLeft(){return Ci(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc((()=>t()))}isViewportInTheDOMTree(){return Si(this.eViewport)}getViewportScrollLeft(){return Ci(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||(e=this.eViewport).clientWidth<e.scrollWidth;var e}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){fi(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(null!=this.options.pinnedType)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.rowRenderer);if(!this.visible||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const i=this.gos.isDomLayout("print"),s=this.gos.get("embedFullWidthRows")||i,o=t.filter((e=>{const t=e.isFullWidth();return this.options.fullWidth?!s&&t:s||!t}));this.comp.setRowCtrls({rowCtrls:o,useFlushSync:e})}};var el=class extends Vi{constructor(){super(),this.eViewport=Bi,this.eContainer=Bi,this.rowComps={},this.name=Vi.elementGettingCreated.getAttribute("name"),this.options=Ur(this.name),this.setTemplate(function(e){let t;return t="center"===e.type?`<div class="${e.viewport}" data-ref="eViewport" role="presentation">\n <div class="${e.container}" data-ref="eContainer"></div>\n </div>`:`<div class="${e.container}" data-ref="eContainer"></div>`,t}(this.options))}wireBeans(e){this.beans=e}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e,setOffsetTop:e=>this.eContainer.style.transform=`translateY(${e})`};this.createManagedBean(new Zr(this.name)).setComp(e,this.eContainer,this.eViewport)}destroy(){this.setRowCtrls([]),super.destroy()}setRowCtrls(e){const t={...this.rowComps};this.rowComps={},this.lastPlacedElement=null;e.forEach((e=>{const i=e.getInstanceId(),s=t[i];if(s)this.rowComps[i]=s,delete t[i],this.ensureDomOrder(s.getGui());else{if(!e.getRowNode().displayed)return;const t=new Cr(e,this.beans,this.options.type);this.rowComps[i]=t,this.appendRow(t.getGui())}})),q(t).forEach((e=>{this.eContainer.removeChild(e.getGui()),e.destroy()})),yt(this.eContainer,"rowgroup")}appendRow(e){var t,i,s;this.domOrder?(t=this.eContainer,i=e,(s=this.lastPlacedElement)?s.insertAdjacentElement("afterend",i):t.firstChild?t.insertAdjacentElement("afterbegin",i):t.appendChild(i)):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(Ri(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}},tl={selector:"AG-ROW-CONTAINER",component:el};function il(e){return e.map((e=>`<ag-row-container name="${e}"></ag-row-container>`)).join("")}var sl=`<div class="ag-root ag-unselectable" role="treegrid">\n <ag-header-root></ag-header-root>\n <div class="ag-floating-top" data-ref="eTop" role="presentation">\n ${il(["topLeft","topCenter","topRight","topFullWidth"])}\n </div>\n <div class="ag-body" data-ref="eBody" role="presentation">\n <div class="ag-body-viewport" data-ref="eBodyViewport" role="presentation">\n ${il(["left","center","right","fullWidth"])}\n </div>\n <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n </div>\n <div class="ag-sticky-top" data-ref="eStickyTop" role="presentation">\n ${il(["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])}\n </div>\n <div class="ag-sticky-bottom" data-ref="eStickyBottom" role="presentation">\n ${il(["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])}\n </div>\n <div class="ag-floating-bottom" data-ref="eBottom" role="presentation">\n ${il(["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])}\n </div>\n <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n <ag-overlay-wrapper></ag-overlay-wrapper>\n </div>`,ol=class extends Vi{constructor(){super(sl,[nr,ar,cr,tr,tl]),this.eBodyViewport=Bi,this.eStickyTop=Bi,this.eStickyBottom=Bi,this.eTop=Bi,this.eBottom=Bi,this.eBody=Bi}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.rangeService=e.rangeService}postConstruct(){const e=(e,t)=>{const i=`${e}px`;t.style.minHeight=i,t.style.height=i},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>Nt(this.getGui(),e),setRowCount:e=>kt(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>this.eStickyBottom.style.height=e,setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach((e=>{e.toggle("ag-layout-auto-height",t.autoHeight),e.toggle("ag-layout-normal",t.normal),e.toggle("ag-layout-print",t.print)})),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(gr,t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc((()=>t()))},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach((i=>i.classList.toggle(e,t)))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new pr),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||"multiple"===this.gos.get("rowSelection"))&&vt(this.getGui(),"multiselectable",!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}},nl={selector:"AG-GRID-BODY",component:ol},rl=class extends I{constructor(){super(...arguments),this.beanName="scrollVisibleService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnAnimationService=e.columnAnimationService}postConstruct(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)})}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn((()=>{this.columnAnimationService.executeLaterVMTurn((()=>this.updateImpl()))})):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:"scrollVisibilityChanged"};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}},ll="__ag_grid_instance",al=class e extends I{constructor(){super(...arguments),this.beanName="mouseEventService",this.gridInstanceId=e.gridInstanceSequence.next()}wireBeans(e){this.ctrlsService=e.ctrlsService}stampTopLevelGridCompWithGridInstance(e){e[ll]=this.gridInstanceId}getRenderedCellForEvent(e){return x(this.gos,e.target,Ar.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const e=t[ll];if(k(e)){return e===this.gridInstanceId}t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gos.isDomLayout("normal"),i=e;let s,o;if(null!=i.clientX||null!=i.clientY?(s=i.clientX,o=i.clientY):(s=i.x,o=i.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();s+=e.getScrollFeature().getHScrollPosition().left,o+=t.top}return{x:s,y:o}}};al.gridInstanceSequence=new Oi;var hl=al,dl=class extends I{constructor(){super(),this.beanName="navigationService",this.onPageDown=fe(this.onPageDown,100),this.onPageUp=fe(this.onPageUp,100)}wireBeans(e){this.mouseEventService=e.mouseEventService,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.rowRenderer=e.rowRenderer,this.headerNavigationService=e.headerNavigationService,this.rowPositionUtils=e.rowPositionUtils,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}))}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,n=!!this.rangeService&&e.shiftKey,r=this.mouseEventService.getCellPositionForEvent(e);let l=!1;switch(i){case ts.PAGE_HOME:case ts.PAGE_END:o||s||(this.onHomeOrEndKey(i),l=!0);break;case ts.LEFT:case ts.RIGHT:case ts.UP:case ts.DOWN:if(!r)return!1;!o||s||n||(this.onCtrlUpDownLeftRight(i,r),l=!0);break;case ts.PAGE_DOWN:case ts.PAGE_UP:o||s||(l=this.handlePageUpDown(i,r,t))}return l&&e.preventDefault(),l}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===ts.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:o,focusColumn:n}=e;k(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),k(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:n,rowPinned:null,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:o,rowPinned:null,column:n})}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),s=this.pageBoundsService.getPixelOffset(),o=t.top+i,n=this.rowModel.getRowIndexAtPixel(o+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.pageBoundsService.getPixelOffset(),s=t.top,o=this.rowModel.getRowIndexAtPixel(s+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,o,!0):this.navigateToNextPage(e,o,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.pageBoundsService.getFirstRow(),n=this.pageBoundsService.getLastRow(),r=this.pageBoundsService.getPixelOffset(),l=this.rowModel.getRow(e.rowIndex),a=i?l?.rowHeight-s-r:s-r,h=l?.rowTop+a;let d,c=this.rowModel.getRowIndexAtPixel(h+r);if(c===e.rowIndex){const s=i?-1:1;t=c=e.rowIndex+s}i?(d="bottom",c<o&&(c=o),t<o&&(t=o)):(d="top",c>n&&(c=n),t>n&&(t=n)),this.isRowTallerThanView(c)&&(t=c,d="top"),this.navigateTo({scrollIndex:t,scrollType:d,scrollColumn:null,focusIndex:c,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout((()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})}),50)}getNextFocusIndexForAutoHeight(e,t=!1){const i=t?-1:1,s=this.getViewportHeight(),o=this.pageBoundsService.getLastRow();let n=0,r=e.rowIndex;for(;r>=0&&r<=o;){const e=this.rowModel.getRow(r);if(e){const t=e.rowHeight??0;if(n+t>s)break;n+=t}r+=i}return Math.max(0,Math.min(r,o))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),s=this.gos.getScrollbarWidth();let o=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(o-=s),o}isRowTallerThanView(e){const t=this.rowModel.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s}=i,o=i.column;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===ts.PAGE_HOME,i=this.visibleColsService.getAllCols(),s=t?i[0]:c(i),o=t?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(!1===s)if(i){const{rowIndex:i,rowPinned:s}=e.getRowPosition();(s?0===i:i===this.pageBoundsService.getFirstRow())&&(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof Ar&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault();else s&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!!(s||(s=this.rowRenderer.getRowByPosition(i),s&&s.isFullWidth()))&&!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s,o=e.isEditing();if(!o&&e instanceof Ar){const t=e.getRowCtrl();t&&(o=t.isEditing())}return s=o?"fullRow"===this.gos.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNextCellNotEditing(e,t),null===s?s:s||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(s,t,!0);return!1===o?null:null!=o&&(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),o=this.findNextCellToFocusOn(s,t,!0);if(!1===o)return null;if(null==o)return!1;const n=o.getCellPosition(),r=this.isCellEditable(s),l=this.isCellEditable(n),a=n&&s.rowIndex===n.rowIndex&&s.rowPinned===n.rowPinned;if(r&&e.setFocusOutOnEditor(),!a){e.getRowCtrl().stopEditing();o.getRowCtrl().startRowEditing(void 0,void 0,i)}return l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.visibleColsService.getAllCols();let s;s=e instanceof Or?{...e.getRowPosition(),column:t?i[0]:c(i)}:e.getCellPosition();const o=this.findNextCellToFocusOn(s,t,!1);if(!1===o)return null;if(o instanceof Ar)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return k(o)}findNextCellToFocusOn(e,t,i){let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const o=this.gos.getCallback("tabToNextCell");if(k(o)){const n=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(!0===n||null===n)null===n&&he("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(!1===n)return!1;s={rowIndex:n.rowIndex,column:n.column,rowPinned:n.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+s.rowIndex,column:s.column},fromCell:!0}),null}const n="fullRow"===this.gos.get("editType");if(i&&!n){if(!this.isCellEditable(s))continue}this.ensureCellVisible(s);const r=this.getCellByPosition(s);if(!r){const e=this.rowRenderer.getRowByPosition(s);if(!e||!e.isFullWidth()||i)continue;return e}if(!r.isSuppressNavigable())return this.rangeService?.setRangeToCell(s),r}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.rowModel.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let o=i,n=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gos.get("enableRtl")?t===ts.LEFT&&(o=this.getLastCellOfColSpan(o)):t===ts.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),n=G(o);if(n&&e&&e.key===ts.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),s){const s=this.gos.getCallback("navigateToNextCell");if(k(s)){const n=s({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});o=k(n)?{rowPinned:n.rowPinned,rowIndex:n.rowIndex,column:n.column}:null}}if(!o)return;if(o.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+o.rowIndex,column:i.column},event:e||void 0,fromCell:!0})}const r=this.getNormalisedPosition(o);r?this.focusPosition(r):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.visibleColsService.getAllCols(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),n={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?c(i):i[0])};this.focusPosition(n);const r=null!=o&&this.rowPositionUtils.before(n,o),l={type:"fullWidthRowFocused",rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column,isFullWidthCell:!0,fromBelow:r};return this.eventService.dispatchEvent(l),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:c(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&i?.sticky)&&G(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}},cl=class extends I{constructor(){super(...arguments),this.beanName="horizontalResizeService"}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};this.dragService.addDragSource(t);return()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},ul=class extends I{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.menuService=e.menuService}hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,(s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})}),i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,o="left";const n=this.menuService.isLegacyMenuEnabled();!n&&this.gos.get("enableRtl")&&(s=1,o="right");const r=n?void 0:4*s,l=n?void 0:4;this.showPopup(e,(s=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:s,nudgeX:r,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",column:e})}),i,t,n)}showPopup(e,t,i,s,o){const n=e?this.createBean(new no(e,"COLUMN_MENU")):void 0;if(this.activeMenu=n,!n?.hasFilter()||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const r=document.createElement("div");let l;yt(r,"presentation"),r.classList.add("ag-menu"),o||r.classList.add("ag-filter-menu"),[this.tabListener]=this.addManagedElementListeners(r,{keydown:e=>this.trapFocusWithin(e,r)}),r.appendChild(n?.getGui());const a=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,h=this.localeService.getLocaleTextFunc(),d=o&&"columnFilter"!==i?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),c=this.popupService.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const o=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),o&&s&&yi(s)){const e=this.focusService.findTabbableParent(s);e&&e.focus()}n?.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},positionCallback:()=>t(r),anchorToElement:a,ariaLabel:d});c&&(this.hidePopup=l=c.hideFunc),n.afterInit().then((()=>{t(r),n.afterGuiAttached({container:i,hidePopup:l})})),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==ts.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const s={type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:i??null};this.eventService.dispatchEvent(s)}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},gl=class extends I{constructor(){super(...arguments),this.beanName="resizeObserverService",this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),s=()=>{let i=e?.clientWidth??0,s=e?.clientHeight??0,o=!0;const n=()=>{if(o){const o=e?.clientWidth??0,r=e?.clientHeight??0;(o!==i||r!==s)&&(i=o,s=r,t()),this.doNextPolyfillTurn(n)}};return n(),()=>o=!1},o=this.gos.get("suppressBrowserResizeObserver");return!!i.ResizeObserver&&!o?(()=>{const s=new i.ResizeObserver(t);return s.observe(e),()=>s.disconnect()})():this.getFrameworkOverrides().wrapIncoming((()=>s()),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;this.polyfillScheduled=!0,window.setTimeout((()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach((e=>e()))}),50)}},pl=class extends I{constructor(){super(...arguments),this.beanName="animationFrameService",this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationService?.getCurrentPage()??0;e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&he(`AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort(((e,i)=>e.index!==i.index?t*(i.index-e.index):i.createOrder-e.createOrder)),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,o=s.list,n=this.destroyTasks,r=(new Date).getTime();let l=(new Date).getTime()-r;const a=e<=0,h=this.ctrlsService.getGridBodyCtrl();for(;a||l<e;){if(!h.getScrollFeature().scrollGridIfNeeded()){let e;if(i.length)this.sortTaskList(t),e=i.pop().task;else if(o.length)this.sortTaskList(s),e=o.pop().task;else{if(!n.length){this.cancelledTasks.clear();break}e=n.pop()}this.cancelledTasks.has(e)||e()}l=(new Date).getTime()-r}i.length||o.length||n.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask((()=>{t=!1,e()}))):window.setTimeout(e,0)}}},ml=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(ml||{}),Cl=class extends I{constructor(){super(...arguments),this.beanName="expansionService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode((e=>{e.id&&t.has(e.id)&&(e.expanded=!0)})),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode((({expanded:t,id:i})=>{t&&i&&e.push(i)})),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}},fl=class extends I{constructor(){super(...arguments),this.beanName="menuService"}wireBeans(e){this.filterMenuFactory=e.filterMenuFactory,this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.filterManager=e.filterManager,this.rowRenderer=e.rowRenderer,this.columnChooserFactory=e.columnChooserFactory,this.contextMenuFactory=e.contextMenuFactory,this.enterpriseMenuFactory=e.enterpriseMenuFactory}postConstruct(){this.activeMenuFactory=this.enterpriseMenuFactory??this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const o=s.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(e){const{rowNode:t}=e,i=e.column;let{anchorToElement:s,value:o}=e;t&&i&&null==o&&(o=t.getValueFromValueService(i)),null==s&&(s=this.getContextMenuAnchorElement(t,i)),this.contextMenuFactory?.onContextMenu(e.mouseEvent??null,e.touchEvent??null,t??null,i??null,o,s)}showColumnChooser(e){this.columnChooserFactory?.showColumnChooser(e)}hidePopupMenu(){this.contextMenuFactory?.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){this.columnChooserFactory?.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!e?.getColDef().suppressHeaderContextMenu&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Xt()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!(!this.filterManager?.isFilterAllowed(e)||this.isLegacyMenuEnabled()||this.isFilterMenuInHeaderEnabled(e)||this.isFloatingFilterButtonDisplayed(e))}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){const t=e.getColDef(),i=t.floatingFilterComponentParams?.suppressFilterButton;return null!=i&&he("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),null==t.suppressFloatingFilterButton?!i:!t.suppressFloatingFilterButton}getColumnMenuType(){return this.gos.get("columnMenu")}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?!!this.gos.exists("suppressMenuHide")&&e:e}showColumnMenuCommon(e,t,i,s){const{positionBy:o}=t,n=t.column;if("button"===o){const{buttonElement:o}=t;e.showMenuAfterButtonClick(n,o,i,s)}else if("mouse"===o){const{mouseEvent:o}=t;e.showMenuAfterMouseEvent(n,o,i,s)}else n&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(n,"auto"),this.animationFrameService.requestAnimationFrame((()=>{const t=this.ctrlsService.getHeaderRowContainerCtrl(n.getPinned()).getHeaderCtrlForColumn(n);e.showMenuAfterButtonClick(n,t.getAnchorElementForMenu(s),i,!0)})))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(null!=t)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return i?.getGui()||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;const o=this.getCellGui(s,t);return o||(s.isFullWidth()?s.getFullWidthElement():i)}},vl=class extends os{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},wl={selector:"AG-INPUT-TEXT-AREA",component:vl},Sl=class extends gs{constructor(){super('<div class="ag-large-text">\n <ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n </div>',[wl]),this.eTextArea=Bi}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),k(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===ts.LEFT||t===ts.UP||t===ts.RIGHT||t===ts.DOWN||e.shiftKey&&t===ts.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return k(e)||k(this.params.value)?this.params.parseValue(e):this.params.value}},yl=class extends gs{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedElementListeners(e,{keydown:e=>{Po(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)}})}},bl=class extends gs{constructor(){super('<div class="ag-cell-edit-wrapper">\n <ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select>\n </div>',[So]),this.eSelect=Bi,this.startedByEnter=!1}wireBeans(e){this.valueService=e.valueService}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:s}=this,{values:o,value:n,eventKey:r}=e;if(G(o))return void he("no values found for select cellEditor");this.startedByEnter=null!=r&&r===ts.ENTER;let l=!1;o.forEach((s=>{const o={value:s},r=i.formatValue(e.column,null,s),a=null!=r;o.text=a?r:s,t.addOption(o),l=l||n===s})),l?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:a,valueListMaxWidth:h,valueListMaxHeight:d}=e;null!=a&&t.setPickerGap(a),null!=d&&t.setPickerMaxHeight(d),null!=h&&t.setPickerMaxWidth(h),"fullRow"!==s.get("editType")&&this.addManagedListeners(this.eSelect,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout((()=>{this.isAlive()&&this.eSelect.showPicker()}))}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}},Rl=class extends gs{constructor(e){super(`\n <div class="ag-cell-edit-wrapper">\n ${e.getTemplate()}\n </div>`,e.getAgComponents()),this.cellEditorInput=e,this.eInput=Bi}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===ts.BACKSPACE||e.eventKey===ts.DELETE?i="":t&&1===t.length?i=t:(i=this.cellEditorInput.getStartValue(),t!==ts.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedElementListeners(t.getGui(),{keydown:e=>{const{key:t}=e;t!==ts.PAGE_UP&&t!==ts.PAGE_DOWN||e.preventDefault()}})}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc(),t=this.eInput;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;$t()||t.getFocusableElement().focus();const i=t.getInputElement();this.highlightAllOnFocus?i.select():this.cellEditorInput.setCaret?.()}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}},Fl=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>'}getAgComponents(){return[Do]}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return k(e)||k(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=k(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},Pl=class extends Rl{constructor(){super(new Fl)}},El=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-input-number-field>'}getAgComponents(){return[To]}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){e.key!==ts.UP&&e.key!==ts.DOWN||e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!k(e)&&!k(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},Dl=class extends Rl{constructor(){super(new El)}},Ml=class extends Eo{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=$t();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?Uo(e??null,!1)??void 0:e;return this.min===t||(this.min=t,Ai(this.eInput,"min",t)),this}setMax(e){const t=e instanceof Date?Uo(e??null,!1)??void 0:e;return this.max===t||(this.max=t,Ai(this.eInput,"max",t)),this}setStep(e){return this.step===e||(this.step=e,Ai(this.eInput,"step",e)),this}getDate(){if(this.eInput.validity.valid)return jo(this.getValue())??void 0}setDate(e,t){this.setValue(Uo(e??null,!1),t)}},Tl={selector:"AG-INPUT-DATE-FIELD",component:Ml},xl=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[Tl]}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return k(e)||k(this.params.value)?e??null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Uo(e,!1)}},Al=class extends Rl{constructor(){super(new xl)}},Il=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[Tl]}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return k(e)||k(this.params.value)?this.params.parseValue(e??""):this.params.value}getStartValue(){return Uo(this.parseDate(this.params.value??void 0)??null,!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):jo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Uo(e??null,!1)??void 0}},Ll=class extends Rl{wireBeans(e){this.dataTypeService=e.dataTypeService}constructor(){super(new Il((()=>this.dataTypeService)))}},Ol=class extends gs{constructor(){super('\n <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\n </div>',[rs]),this.eCheckbox=Bi}init(e){this.params=e;const t=e.value??void 0;this.eCheckbox.setValue(t);this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(this.eCheckbox,{fieldValueChanged:e=>this.setAriaLabel(e.selected)})}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=Kt(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}},kl=class{constructor(e){this.cellValueChanges=e}},Gl=class extends kl{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},Nl=class{constructor(e){this.actionStack=[],this.maxStackSize=e||10,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};function Hl(e,t,i="auto"){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,i)),"ensureVisible")}function Bl(e,t,i){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t,i)),"ensureVisible")}var Vl={version:dn,moduleName:"@ag-grid-community/edit-core",beans:[class extends I{constructor(){super(...arguments),this.beanName="editService"}wireBeans(e){this.navigationService=e.navigationService,this.userComponentFactory=e.userComponentFactory,this.valueService=e.valueService}startEditing(e,t=null,i=!1,s=null){const o=this.createCellEditorParams(e,t,i),n=e.getColumn().getColDef(),r=this.userComponentFactory.getCellEditorDetails(n,o),l=null!=r?.popupFromSelector?r.popupFromSelector:!!n.cellEditorPopup,a=null!=r?.popupPositionFromSelector?r.popupPositionFromSelector:n.cellEditorPopupPosition;e.setEditing(!0,r),e.getComp().setEditDetails(r,l,a,this.gos.get("reactiveCustomComponents"));const h=e.createEvent(s,"cellEditingStarted");this.eventService.dispatchEvent(h)}stopEditing(e,t){const i=e.getComp(),{newValue:s,newValueExists:o}=this.takeValueFromCellEditor(t,i),n=e.getRowNode(),r=e.getColumn(),l=n.getValueFromValueService(r);let a=!1;o&&(a=this.saveNewValue(e,l,s,n,r)),e.setEditing(!1,void 0),i.setEditDetails(),e.updateAndFormatValue(!1),e.refreshCell({forceRefresh:!0,suppressFlash:!0});const h={...e.createEvent(null,"cellEditingStopped"),oldValue:l,newValue:s,valueChanged:a};return this.eventService.dispatchEvent(h),a}handleColDefChanged(e){const t=e.getCellEditor();if(t?.refresh){const{eventKey:i,cellStartedEdit:s}=e.getEditCompDetails().params,o=this.createCellEditorParams(e,i,s),n=e.getColumn().getColDef(),r=this.userComponentFactory.getCellEditorDetails(n,o);t.refresh(r.params)}}setFocusOutOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusIn?t.focusIn():e.focusCell(!0)}stopEditingAndFocus(e,t=!1,i=!1){e.stopRowOrCellEdit(),e.focusCell(!0),t||this.navigateAfterEdit(i,e.getCellPosition())}createPopupEditorWrapper(e){return new yl(e)}takeValueFromCellEditor(e,t){const i={newValueExists:!1};if(e)return i;const s=t.getCellEditor();if(!s)return i;if(s.isCancelAfterEnd&&s.isCancelAfterEnd())return i;return{newValue:s.getValue(),newValueExists:!0}}saveNewValue(e,t,i,s,o){if(i===t)return!1;e.setSuppressRefreshCell(!0);const n=s.setDataValue(o,i,"edit");return e.setSuppressRefreshCell(!1),n}createCellEditorParams(e,t,i){const s=e.getColumn(),o=e.getRowNode();return this.gos.addGridCommonParams({value:o.getValueFromValueService(s),eventKey:t,column:s,colDef:s.getColDef(),rowIndex:e.getCellPosition().rowIndex,node:o,data:o.data,cellStartedEdit:i,onKeyDown:e.onKeyDown.bind(e),stopEditing:e.stopEditingAndFocus.bind(e),eGridCell:e.getGui(),parseValue:t=>this.valueService.parseValue(s,o,t,e.getValue()),formatValue:e.formatValue.bind(e)})}navigateAfterEdit(e,t){if(this.gos.get("enterNavigatesVerticallyAfterEdit")){const i=e?ts.UP:ts.DOWN;this.navigationService.navigateToNextCell(null,i,t,!1)}}}]},Wl={version:dn,moduleName:"@ag-grid-community/edit-api",apiFunctions:{undoCellEditing:function(e){e.undoRedoService?.undo("api")},redoCellEditing:function(e){e.undoRedoService?.redo("api")},getCellEditorInstances:function(e,t={}){return e.rowRenderer.getCellEditorInstances(t).map(Vs)},getEditingCells:function(e){return e.rowRenderer.getEditingCells()},stopEditing:function(e,t=!1){e.rowRenderer.stopEditing(t)},startEditingCell:function(e,t){const i=e.columnModel.getCol(t.colKey);if(!i)return void he(`no column found for ${t.colKey}`);const s={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:i};null==t.rowPinned&&Bl(e,t.rowIndex),Hl(e,t.colKey);const o=e.navigationService.getCellByPosition(s);o&&(e.focusService.isCellFocused(s)||e.focusService.setFocusedCell(s),o.startRowOrCellEdit(t.key))},getCurrentUndoSize:function(e){return e.undoRedoService?.getCurrentUndoStackSize()??0},getCurrentRedoSize:function(e){return e.undoRedoService?.getCurrentRedoStackSize()??0}},dependantModules:[Vl]},zl={version:dn,moduleName:"@ag-grid-community/undo-redo-edit",beans:[class extends I{constructor(){super(...arguments),this.beanName="undoRedoService",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:n,column:r,oldValue:l,value:a}=e,h={rowPinned:o,rowIndex:n,columnId:r.getColId(),newValue:a,oldValue:l};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}wireBeans(e){this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.columnModel=e.columnModel,this.rangeService=e.rangeService}postConstruct(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");if(e<=0)return;this.undoStack=new Nl(e),this.redoStack=new Nl(e),this.addListeners();const t=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:e=>{e.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:t,newColumnsLoaded:t,columnGroupOpened:t,columnRowGroupChanged:t,columnMoved:t,columnPinned:t,columnVisible:t,rowDragEnd:t}),this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:"undoStarted",source:e};this.eventService.dispatchEvent(t);const i={type:"undoEnded",source:e,operationPerformed:this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo")};this.eventService.dispatchEvent(i)}redo(e){const t={type:"redoStarted",source:e};this.eventService.dispatchEvent(t);const i={type:"redoEnded",source:e,operationPerformed:this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo")};this.eventService.dispatchEvent(i)}undoRedo(e,t,i,s,o){if(!e)return!1;const n=e.pop();return!(!n||!n.cellValueChanges)&&(this.processAction(n,(e=>e[s]),o),n instanceof Gl?this.processRange(this.rangeService,n.ranges||[n[i]]):this.processCell(n.cellValueChanges),t.push(n),!0)}processAction(e,t,i){e.cellValueChanges.forEach((e=>{const{rowIndex:s,rowPinned:o,columnId:n}=e,r={rowIndex:s,rowPinned:o},l=this.rowPositionUtils.getRowNode(r);l.displayed&&l.setDataValue(n,t(e),i)}))}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach(((s,o)=>{if(!s)return;const n=s.startRow,r=s.endRow;o===t.length-1&&(i={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const l={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(l)}))}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,o={rowIndex:i,rowPinned:s},n=this.rowPositionUtils.getRowNode(o),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,n=this.gridBodyCtrl.getScrollFeature(),r=this.columnModel.getCol(s);if(!r)return;n.ensureIndexVisible(i),n.ensureColumnVisible(r);const l={rowIndex:i,column:r,rowPinned:o};this.focusService.setFocusedCell({...l,forceBrowserFocus:!0}),t?.setRangeToCell(l)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new kl(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{this.activeCellEdit=null;if(e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new kl(this.cellValueChanges);this.pushActionsToUndoStack(e)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new kl(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new Gl(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;e=this.rangeService&&this.gos.get("enableRangeSelection")?new Gl(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new kl(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}}],dependantModules:[Vl]},_l={version:dn,moduleName:"@ag-grid-community/full-row-edit",beans:[class extends I{constructor(){super(...arguments),this.beanName="rowEditService"}startEditing(e,t=null,i=null,s=null){e.getAllCellCtrls().reduce(((e,o)=>{const n=o===i;return n?o.startEditing(t,n,s):o.startEditing(null,n,s),!!e||o.isEditing()}),!1)&&this.setEditing(e,!0)}stopEditing(e,t=!1){const i=e.getAllCellCtrls(),s=e.isEditing();e.setStoppingRowEdit(!0);let o=!1;for(const e of i){const i=e.stopEditing(t);s&&!t&&!o&&i&&(o=!0)}if(o){const t=e.createRowEvent("rowValueChanged");this.eventService.dispatchEvent(t)}s&&this.setEditing(e,!1),e.setStoppingRowEdit(!1)}setEditing(e,t){e.setEditingRow(t),e.forEachGui(void 0,(e=>e.rowComp.addOrRemoveCssClass("ag-row-editing",t)));const i=t?e.createRowEvent("rowEditingStarted"):e.createRowEvent("rowEditingStopped");this.eventService.dispatchEvent(i)}}],dependantModules:[Vl]},Ul={version:dn,moduleName:"@ag-grid-community/default-editor",userComponents:[{name:"agCellEditor",classImp:Pl}],dependantModules:[Vl]},Kl={version:dn,moduleName:"@ag-grid-community/editing",dependantModules:[Vl,zl,_l,{version:dn,moduleName:"@ag-grid-community/all-editors",dependantModules:[Ul,{version:dn,moduleName:"@ag-grid-community/data-type-editors",userComponents:[{name:"agTextCellEditor",classImp:Pl},{name:"agNumberCellEditor",classImp:Dl},{name:"agDateCellEditor",classImp:Al},{name:"agDateStringCellEditor",classImp:Ll},{name:"agCheckboxCellEditor",classImp:Ol}],dependantModules:[Ul]},{version:dn,moduleName:"@ag-grid-community/select-editor",userComponents:[{name:"agSelectCellEditor",classImp:bl}],dependantModules:[Vl]},{version:dn,moduleName:"@ag-grid-community/large-text-editor",userComponents:[{name:"agLargeTextCellEditor",classImp:Sl}],dependantModules:[Vl]}]},Wl]},$l=class extends I{constructor(){super(...arguments),this.beanName="autoWidthCalculator"}wireBeans(e){this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.centerRowContainerCtrl=e.center}))}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach((e=>this.cloneItemIntoDummy(e,t))),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);return s+this.getAutoSizePadding()}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach((i=>{const s=i.getHtmlElementForColumnHeader(e);null!=s&&(t=s)})),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),o=s.classList;["ag-header-cell","ag-header-group-cell"].some((e=>i.classList.contains(e)))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some((e=>n.classList.contains(e)))){for(let e=0;e<n.classList.length;e++){const t=n.classList[e];"ag-row-position-absolute"!=t&&o.add(t)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}},jl=class extends I{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0,this.extraTopHeight=0,this.extraBottomHeight=0}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}setOffsetTop(e){if(this.extraTopHeight===e)return;this.extraTopHeight=e;const t={type:"stickyTopOffsetChanged",offset:e};this.eventService.dispatchEvent(t)}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getExtraTopHeight(){return this.extraTopHeight}getExtraBottomHeight(){return this.extraBottomHeight}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let t=e.childStore?.getStoreBounds();return e.footer&&(t=e.sibling.childStore?.getStoreBounds()),(t?.heightPx??0)+(t?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){if(e.footer&&0===e.rowIndex)return Number.MAX_SAFE_INTEGER;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master)t=t.detailNode;else if(t.childrenAfterSort){if(0===t.childrenAfterSort.length)break;t=c(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t="top"===e;let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel()-this.extraTopHeight:this.rowRenderer.getLastVisibleVerticalPixel()-this.extraTopHeight,o=new Set,n=e=>{if(o.add(e),t){const t=this.getLastPixelOfGroup(e),o=s+i+e.rowHeight;e.stickyRowTop=t<o?i+(t-o):i}else{const t=this.getFirstPixelOfGroup(e),o=s-(i+e.rowHeight);e.stickyRowTop=t>o?i-(t-o):i}i=0,o.forEach((e=>{const t=e.stickyRowTop+e.rowHeight;i<t&&(i=t)}))},r=this.areFooterRowsStickySuppressed(),l=this.gos.get("suppressGroupRowsSticky"),a=e=>{if(!e.displayed)return!1;if(e.footer){if(!0===r)return!1;if("grand"===r&&-1===e.level)return!1;if("group"===r&&e.level>-1)return!1;return!o.has(e)}if(e.isExpandable()){if(!0===l)return!1;return!o.has(e)&&e.expanded}return!1};for(let e=0;e<100;e++){let e=s+i;t||(e=s-i);const o=this.rowModel.getRowIndexAtPixel(e),r=this.rowModel.getRow(o);if(null==r)break;const l=this.getStickyAncestors(r).find((e=>(t?e.rowIndex<o:e.rowIndex>o)&&a(e)));if(l){n(l);continue}if(!(t?r.rowTop<e:r.rowTop+r.rowHeight>e)||!a(r))break;n(r)}return t||o.forEach((e=>{e.stickyRowTop=i-(e.stickyRowTop+e.rowHeight)})),this.refreshNodesAndContainerHeight(e,o,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t=!!this.gos.get("groupIncludeFooter")||"group"===e,i=!!this.gos.get("groupIncludeTotalFooter")||"grand"===e;return!(!t||!i)||(i?"grand":!!t&&"group")}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some((t=>t.getRowNode()===e))){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows()}else{for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}}refreshNodesAndContainerHeight(e,t,i){const s="top"===e,o=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,n={},r=[];for(let e=0;e<o.length;e++){const i=o[e].getRowNode();!t.has(i)?(n[i.id]=o[e],i.sticky=!1):r.push(o[e])}const l=new Set;for(let e=0;e<r.length;e++)l.add(r[e].getRowNode());const a=[];t.forEach((e=>{l.has(e)||(e.sticky=!0,a.push(this.createRowCon(e,!1,!1)))}));let h=!!a.length||r.length!==o.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),h=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),h=!0),this.destroyRowCtrls(n,!1);const d=[...r,...a];d.sort(((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex)),s||d.reverse(),d.forEach((e=>e.setRowTop(e.getRowNode().stickyRowTop)));let c=0;return s?(t.forEach((e=>{e.rowIndex<this.pageBoundsService.getFirstRow()&&(c+=e.rowHeight)})),c>this.topContainerHeight&&(c=this.topContainerHeight),this.setOffsetTop(c)):(t.forEach((e=>{e.rowIndex>this.pageBoundsService.getLastRow()&&(c+=e.rowHeight)})),c>this.bottomContainerHeight&&(c=this.bottomContainerHeight),this.setOffsetBottom(c)),!!h&&(s?this.stickyTopRowCtrls=d:this.stickyBottomRowCtrls=d,!0)}ensureRowHeightsValid(){let e=!1;const t=t=>{const i=t.getRowNode();if(i.rowHeightEstimated){const t=this.gos.getRowHeightForNode(i);i.setRowHeight(t.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},ql=class extends I{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach((e=>e.onRangeSelectionChanged()))},t=()=>{this.getAllCellCtrls().forEach((e=>e.updateRangeBordersIfRangeCount()))},i=()=>{this.eventService.addEventListener("rangeSelectionChanged",e),this.eventService.addEventListener("columnMoved",t),this.eventService.addEventListener("columnPinned",t),this.eventService.addEventListener("columnVisible",t)},s=()=>{this.eventService.removeEventListener("rangeSelectionChanged",e),this.eventService.removeEventListener("columnMoved",t),this.eventService.removeEventListener("columnPinned",t),this.eventService.removeEventListener("columnVisible",t)};this.addDestroyFunc((()=>s())),this.addManagedPropertyListener("enableRangeSelection",(e=>{e.currentValue?i():s()}));this.gos.get("enableRangeSelection")&&i()}}wireBeans(e){this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusService=e.focusService,this.beans=e,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()}))}initialise(){if(this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this)}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],(()=>this.onDomLayoutChanged())),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],(()=>this.redraw())),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],(()=>this.redrawRows())),this.gos.isGroupRowsSticky()){const e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new jl(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new Yl(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=q(this.rowCtrlsByRowIndex),t=q(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach((t=>t.onCellFocused(e))),this.getFullWidthRowCtrls().forEach((t=>t.onFullWidthRowFocused(e)))}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>{this.onCellFocusChanged(e)},cellFocusCleared:()=>this.onCellFocusChanged(),flashCells:e=>{this.getAllCellCtrls().forEach((t=>t.onFlashCells(e)))},columnHoverChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onColumnHover()))},displayedColumnsChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onDisplayedColumnsChanged()))},displayedColumnsWidthChanged:()=>{this.printLayout&&this.getAllCellCtrls().forEach((e=>e.onLeftChanged()))}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach((e=>e())),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();this.columnModel.getCols().forEach((e=>{const t=t=>{this.getAllCellCtrls().forEach((i=>{i.getColumn()===e&&t(i)}))},i=()=>{t((e=>e.onLeftChanged()))},s=()=>{t((e=>e.onWidthChanged()))},o=()=>{t((e=>e.onFirstRightPinnedChanged()))},n=()=>{t((e=>e.onLastLeftPinnedChanged()))},r=()=>{t((e=>e.onColDefChanged()))};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",s),e.addEventListener("firstRightPinnedChanged",o),e.addEventListener("lastLeftPinnedChanged",n),e.addEventListener("colDefChanged",r),this.destroyFuncsForColumnListeners.push((()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",s),e.removeEventListener("firstRightPinnedChanged",o),e.removeEventListener("lastLeftPinnedChanged",n),e.removeEventListener("colDefChanged",r)}))}))}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach((i=>{const s=i.getCellElement(e);s&&t.push(s)})),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowNodes()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowNodes())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){const i=Object.fromEntries(t.map((e=>[e.id,e]))),s=Object.fromEntries(e.map((e=>[e.getRowNode().id,e])));for(let o=0;o<t.length;o++){const n=t[o],r=e[o];r&&void 0===i[r.getRowNode().id]&&(r.destroyFirstPass(),r.destroySecondPass()),n.id in s?(e[o]=s[n.id],delete s[n.id]):e[o]=new Or(n,this.beans,!1,!1,this.printLayout)}e.length=t.length}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(this.cachedRowCtrls?.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const i=t[e.rowIndex];i&&i.getRowNode()===e&&(i.destroyFirstPass(),i.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return e?.forEach((e=>this.redrawRow(e,!0))),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e?.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const i=this.gos.getActiveDomElement(),s=this.gos.getDomData(i,Ar.DOM_DATA_KEY_CELL_CTRL),o=this.gos.getDomData(i,Or.DOM_DATA_KEY_ROW_CTRL);return s||o?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gos.isAnimateRows(),o=i?this.getRowsToRecycle():null;if(i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature){this.stickyRowFeature.checkStickyRows();const e=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();e&&this.updateContainerHeights(e)}this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&(this.gridBodyCtrl.getScrollFeature().scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let t=this.pageBoundsService.getCurrentPageHeight();0===t&&(t=1),this.rowContainerHeightService.setModelHeight(t+e)}getLockOnRefresh(){if(this.refreshInProgress){const e=this.frameworkOverrides.getLockOnRefreshError?.()??"";throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace."+e)}this.refreshInProgress=!0,this.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&setTimeout((()=>{this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))}))}stopEditing(e=!1){this.getAllRowCtrls().forEach((t=>{t.stopEditing(e)}))}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const i=t[s].getAllCellCtrls(),o=i.length;for(let t=0;t<o;t++)e.push(i[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const e in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[e]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach((t=>t.flashCell(e)))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};for(const i of this.getCellCtrls(e.rowNodes,e.columns))i.refreshOrDestroyCell(t);this.refreshFullWidth(e.rowNodes)}refreshFullWidth(e){if(!e)return;let t=null;this.stickyRowFeature&&Jt()&&(t=this.getCellToRestoreFocusToAfterRefresh()||null);for(const t of this.getRowCtrls(e)){if(!t.isFullWidth())continue;t.refreshFullWidth()||this.redrawRow(t.getRowNode(),!0)}this.dispatchDisplayedRowsChanged(!1),t&&this.restoreFocusedCell(t)}getCellRendererInstances(e){const t=this.getCellCtrls(e.rowNodes,e.columns).map((e=>e.getCellRenderer())).filter((e=>null!=e));if(e.columns?.length)return t;const i=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach((e=>{if(s&&!this.isRowInMap(e.getRowNode(),s))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderers();for(let e=0;e<t.length;e++){const s=t[e];null!=s&&i.push(s)}})),[...i,...t]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach((e=>{const i=e.getCellEditor();i&&t.push(i)})),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach((t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}})),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach((e=>{const i=e.id;switch(e.rowPinned){case"top":t.top[i]=e;break;case"bottom":t.bottom[i]=e;break;default:t.normal[i]=e}})),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return null!=t.top[i];case"bottom":return null!=t.bottom[i];default:return null!=t.normal[i]}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter((e=>{const i=e.getRowNode();return this.isRowInMap(i,t)})):i}getCellCtrls(e,t){let i;k(t)&&(i={},t.forEach((e=>{const t=this.columnModel.getCol(e);k(t)&&(i[t.getId()]=!0)})));const s=[];return this.getRowCtrls(e).forEach((e=>{e.getAllCellCtrls().forEach((e=>{const t=e.getColumn().getId();i&&!i[t]||s.push(e)}))})),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];K(this.rowCtrlsByRowIndex,((t,i)=>{null==i.getRowNode().id&&e.push(t)})),this.removeRowCtrls(e);const t={};return K(this.rowCtrlsByRowIndex,((e,i)=>{const s=i.getRowNode();t[s.id]=i})),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach((e=>{const i=this.rowCtrlsByRowIndex[e];i&&(i.destroyFirstPass(t),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]}))}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&Jt()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let n=!1;if(this.stickyRowFeature){n=this.stickyRowFeature.checkStickyRows();const e=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();e&&this.updateContainerHeights(e)}const r=this.firstRenderedRow!==s||this.lastRenderedRow!==o;if((!t||n||r)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!n),null!=i)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach((e=>i[e]=!0));const s=Object.keys(this.rowCtrlsByRowIndex).filter((e=>!i[e]));this.removeRowCtrls(s,t)}calculateIndexesToDraw(e){const t=function(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}(this.firstRenderedRow,this.lastRenderedRow),i=(e,i)=>{const s=i.getRowNode().rowIndex;null!=s&&(s<this.firstRenderedRow||s>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(i)&&t.push(s)};K(this.rowCtrlsByRowIndex,i),K(e,i),t.sort(((e,t)=>e-t));const s=[];for(let e=0;e<t.length;e++){const i=t[e],o=this.rowModel.getRow(i);o&&!o.sticky&&s.push(i)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t);const o=[];if(s.forEach((s=>{const n=this.createOrUpdateRowCtrl(s,e,t,i);k(n)&&o.push(n)})),e){i&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask((()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})):this.destroyRowCtrls(e,t)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:"displayedRowsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.visibleColsService.isPinningLeft(),t=this.visibleColsService.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach((t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())})),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter((e=>{if(!e.isFullWidth())return!1;const i=e.getRowNode();return!(null!=t&&!this.isRowInMap(i,t))}))}createOrUpdateRowCtrl(e,t,i,s){let o,n=this.rowCtrlsByRowIndex[e];n||(o=this.rowModel.getRow(e),k(o)&&k(t)&&t[o.id]&&o.alreadyRendered&&(n=t[o.id],t[o.id]=null));if(!n){if(o||(o=this.rowModel.getRow(e)),!k(o))return;n=this.createRowCon(o,i,s)}return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n,n}destroyRowCtrls(e,t){const i=[];K(e,((e,s)=>{s&&(this.cachedRowCtrls&&s.isCacheable()?this.cachedRowCtrls.addRow(s):(s.destroyFirstPass(!t),t?(this.zombieRowCtrls[s.getInstanceId()]=s,i.push((()=>{s.destroySecondPass(),delete this.zombieRowCtrls[s.getInstanceId()]}))):s.destroySecondPass()))})),t&&(i.push((()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),ue(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gos.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.rowModel.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.pageBoundsService.getFirstRow(),t=this.pageBoundsService.getLastRow();else{const i=this.getRowBufferInPixels(),s=this.ctrlsService.getGridBodyCtrl(),o=this.gos.get("suppressRowVirtualisation");let n,r,l=!1;do{const e=this.pageBoundsService.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:a}=this.pageBoundsService.getCurrentPagePixelRange(),h=this.rowContainerHeightService.getDivStretchOffset(),d=s.getScrollFeature().getVScrollPosition(),c=d.top,u=d.bottom;o?(n=t+h,r=a+h):(n=Math.max(c+e-i,t)+h,r=Math.min(u+e+i,a)+h),this.firstVisibleVPixel=Math.max(c+e,t)+h,this.lastVisibleVPixel=Math.min(u+e,a)+h,l=this.ensureAllRowsInRangeHaveHeightsCalculated(n,r)}while(l);let a=this.rowModel.getRowIndexAtPixel(n),h=this.rowModel.getRowIndexAtPixel(r);const d=this.pageBoundsService.getFirstRow(),c=this.pageBoundsService.getLastRow();a<d&&(a=d),h>c&&(h=c),e=a,t=h}else e=0,t=-1;const i=this.gos.isDomLayout("normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o);const n=e!==this.firstRenderedRow,r=t!==this.lastRenderedRow;if(n||r){this.firstRenderedRow=e,this.lastRenderedRow=t;const i={type:"viewportChanged",firstRow:e,lastRow:t};this.eventService.dispatchEvent(i)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame((()=>{this.beans.eventService.dispatchEvent(e)}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.pinnedRowModel?.ensureRowHeightsValid(),s=this.stickyRowFeature?.ensureRowHeightsValid(),o=this.rowModel.ensureRowHeightsValid(e,t,this.pageBoundsService.getFirstRow(),this.pageBoundsService.getLastRow());return(o||s)&&this.eventService.dispatchEvent({type:"recalculateRowBounds"}),!!(s||o||i)&&(this.updateContainerHeights(),!0)}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=!1,i=e.getRowNode(),s=this.focusService.isRowNodeFocused(i),o=e.isEditing(),n=i.detail;if(!(s||o||n))return t;return!!this.isRowPresent(i)||t}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(!this.paginationService||this.paginationService.isRowPresent(e))}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gos.get("suppressAnimationFrame"),n=i&&!o&&!this.printLayout;return new Or(e,this.beans,t,n,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map((e=>e.getRowNode()))}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find((e=>e.getRowNode().rowIndex===i))||null,t||(t=this.getStickyBottomRowCtrls().find((e=>e.getRowNode().rowIndex===i))||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!i}},Yl=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];if(!t)return null;this.removeFromCache(t),t.setCached(!1);return t.getRowNode()!=e?null:t}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],C(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],C(this.entriesList,e)}getEntries(){return this.entriesList}},Ql=class extends I{constructor(){super(...arguments),this.beanName="pinnedRowModel"}wireBeans(e){this.beans=e}postConstruct(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",(()=>this.setPinnedTopRowData())),this.addManagedPropertyListener("pinnedBottomRowData",(()=>this.setPinnedBottomRowData())),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanges.bind(this)})}isEmpty(e){return N("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(N(i))return 0;for(let t=0;t<i.length;t++){const s=i[t];if(s.rowTop+s.rowHeight-1>=e)return t}return i.length-1}onGridStylesChanges(e){if(e.rowHeightChanged){const e=e=>{e.setRowHeight(e.rowHeight,!0)};this.pinnedBottomRows.forEach(e),this.pinnedTopRows.forEach(e)}}ensureRowHeightsValid(){let e=!1,t=0;const i=i=>{if(i.rowHeightEstimated){const s=this.gos.getRowHeightForNode(i);i.setRowTop(t),i.setRowHeight(s.height),t+=s.height,e=!0}};this.pinnedBottomRows?.forEach(i),t=0,this.pinnedTopRows?.forEach(i);return this.eventService.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}createNodesFromData(e,t){const i=[];if(e){const s=this.gos.getRowIdCallback(),o=t?so.ID_PREFIX_TOP_PINNED:so.ID_PREFIX_BOTTOM_PINNED;let n=0;e.forEach(((e,r)=>{const l=new so(this.beans);l.data=e,l.id=s?.({data:e,level:0})??o+r,l.rowPinned=t?"top":"bottom",l.setRowTop(n),l.setRowHeight(this.gos.getRowHeightForNode(l).height),l.setRowIndex(r),n+=l.rowHeight,i.push(l)}))}return i}getPinnedTopRowNodes(){return this.pinnedTopRows}getPinnedBottomRowNodes(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){N(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){N(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=c(e);return t.rowTop+t.rowHeight}},Xl=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(Xl||{}),Jl=class extends I{constructor(e){super(),this.state="needsLoading",this.version=0,this.id=e}getId(){return this.id}load(){this.state="loading",this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed",this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted();this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:"loadComplete",success:e,block:this};this.dispatchLocalEvent(t)}},Zl=class extends I{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Ce(this.performCheckBlocksToLoad.bind(this),e))}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){C(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchLocalEvent({type:"blockLoaded"}),0==this.activeBlockLoadsCount&&this.dispatchLocalEvent({type:"blockLoaderFinished"})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void(this.gos.get("debug")&&ae("RowNodeBlockLoader - checkBlockToLoad: max loads exceeded"));const e=this.getAvailableLoadingCount(),t=this.blocks.filter((e=>"needsLoading"===e.getState())).slice(0,e);this.registerLoads(t.length),t.forEach((e=>e.load())),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide")){return this.rowModel.getBlockStates()}const e={};return this.blocks.forEach((t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s})),e}printCacheStatus(){this.gos.get("debug")&&ae(`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}},ea={version:dn,moduleName:"@ag-grid-community/row-node-block",beans:[Zl]},ta=class{constructor(){this.root=null,this.end=null,this.cachedRange=[]}init(e){this.rowModel=e}reset(){this.root=null,this.end=null,this.cachedRange.length=0}setRoot(e){this.root=e,this.end=null,this.cachedRange.length=0}setEndRange(e){this.end=e,this.cachedRange.length=0}getRange(){if(0===this.cachedRange.length){const e=this.getRoot(),t=this.getEnd();if(null==e||null==t)return this.cachedRange;this.cachedRange=this.rowModel.getNodesInRangeForSelection(e,t)}return this.cachedRange}isInRange(e){return null!==this.root&&this.getRange().some((t=>t.id===e.id))}getRoot(){return this.root&&null===this.root?.key&&(this.root=this.rowModel.getRowNode(this.root.id)??null),this.root}getEnd(){return this.end&&null===this.end?.key&&(this.end=this.rowModel.getRowNode(this.end.id)??null),this.end}truncate(e){const t=this.getRange();if(0===t.length)return{keep:[],discard:[]};const i=t[0].id===this.root.id,s=t.findIndex((t=>t.id===e.id));if(s>-1){const o=t.slice(0,s),n=t.slice(s+1);return this.setEndRange(e),i?{keep:o,discard:n}:{keep:n,discard:o}}return{keep:t,discard:[]}}extend(e,t=!1){const i=this.getRoot();if(null==i){const i=this.getRange().slice();return t&&e.depthFirstSearch((e=>!e.group&&i.push(e))),i.push(e),this.setRoot(e),{keep:i,discard:[]}}if(this.rowModel.getNodesInRangeForSelection(i,e).find((e=>e.id===this.end?.id)))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const t=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:t}}}},ia=class extends I{constructor(){super(...arguments),this.beanName="stylingService"}wireBeans(e){this.expressionService=e.expressionService}processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,o){if(null==t&&null==e)return;const n={},r={},l=(e,t)=>{e.split(" ").forEach((e=>{""!=e.trim()&&t(e)}))};if(t){const e=Object.keys(t);for(let s=0;s<e.length;s++){const o=e[s],a=t[o];let h;"string"==typeof a?h=this.expressionService.evaluate(a,i):"function"==typeof a&&(h=a(i)),l(o,(e=>{h?n[e]=!0:r[e]=!0}))}}e&&o&&Object.keys(e).forEach((e=>l(e,(e=>{n[e]||(r[e]=!0)})))),o&&Object.keys(r).forEach(o),Object.keys(n).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;if("function"==typeof i){s=i(t)}else s=i;return"string"==typeof s&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach((e=>{i(e)}))}},sa=class extends ns{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},oa={selector:"AG-TOGGLE-BUTTON",component:sa},na=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(na||{}),ra=class extends I{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:n,isFocusableContainer:r,focusInnerElement:l,onFocusIn:a,onFocusOut:h,shouldStopEventPropagation:d,onTabKeyDown:c,handleKeyDown:u,eFocusableElement:g}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=l,this.eFocusableElement=g,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.isFocusableContainer=!!r,this.providedFocusIn=a,this.providedFocusOut=h,this.providedShouldStopEventPropagation=d,this.providedOnTabKeyDown=c,this.providedHandleKeyDown=u}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.createManagedBean(new co(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach((e=>this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty){if(0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===s)return;let o,n;e?(o=0,n=s):(o=s+1,n=i.length);const r=i.slice(o,n),l=this.gos.get("tabIndex");r.sort(((e,t)=>{const i=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return s===l?1:i===l?-1:0===i?1:0===s?-1:i-s})),r[e?r.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout((()=>this.activateTabGuards()),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout((()=>{this.forcingFocusOut=!1,this.activateTabGuards()}))}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},la=class extends I{constructor(e){super(),this.comp=e}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:i,eFocusableElement:s}=this,o=[t,i],n={setTabIndex:e=>{o.forEach((t=>null!=e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex")))}};this.addTabGuards(t,i);const{focusTrapActive:r=!1,onFocusIn:l,onFocusOut:a,focusInnerElement:h,handleKeyDown:d,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}=e;this.tabGuardCtrl=this.createManagedBean(new ra({comp:n,focusTrapActive:r,eTopGuard:t,eBottomGuard:i,eFocusableElement:s,onFocusIn:l,onFocusOut:a,focusInnerElement:h,handleKeyDown:d,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=this.gos.getDocument().createElement("div"),i="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),yt(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];vi(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,i){xi(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.insertAdjacentElement("beforebegin",t):e(t,i)}},aa=class extends Vi{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new la(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},ha=0,da=class extends I{constructor(){super(...arguments),this.beanName="popupService",this.popupList=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.resizeObserverService=e.resizeObserverService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridCtrl=e.gridCtrl})),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);if(-1!==s){this.popupList[s].alignedToElement=t}const o=t.getBoundingClientRect(),n=this.getParentRect(),r=this.keepXYWithinBounds(i,o.top-n.top,0),l=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${l}px`;const a=n.right-n.left-l;let h;function d(){return o.right-n.left-2}function c(){return o.left-n.left-l}this.gos.get("enableRtl")?(h=c(),h<0&&(h=d(),this.setAlignedStyles(i,"left")),h>a&&(h=0,this.setAlignedStyles(i,"right"))):(h=d(),h>a&&(h=c(),this.setAlignedStyles(i,"right")),h<0&&(h=0,this.setAlignedStyles(i,"left"))),i.style.left=`${h}px`,i.style.top=`${r}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,eventSource:n,alignSide:r="left",position:l="over",column:a,rowNode:h,type:d}=e,c=n.getBoundingClientRect(),u=this.getParentRect(),g=this.getPopupIndex(t);if(-1!==g){this.popupList[g].alignedToElement=n}this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,updatePosition:()=>{let i,o=c.left-u.left;if("right"===r&&(o-=t.offsetWidth-c.width),"over"===l)i=c.top-u.top,this.setAlignedStyles(t,"over");else{this.setAlignedStyles(t,"under");i="under"===this.shouldRenderUnderOrAbove(t,c,u,e.nudgeY||0)?c.top-u.top+c.height:c.top-t.offsetHeight-2*(s||0)-u.top}return{x:o,y:i}},postProcessCallback:()=>this.callPostProcessPopup(d,t,n,null,a,h)})}shouldRenderUnderOrAbove(e,t,i,s){const o=i.bottom-t.bottom,n=t.top-i.top,r=e.offsetHeight+s;return o>r?"under":n>r||n>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i],{alignedToElement:o}=s;if(!o)return;["right","left","over","above","under"].forEach((t=>{o.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`)})),t&&(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,s,o,n){const r=this.gos.getCallback("postProcessPopup");if(r){r({column:o,rowNode:n,ePopup:t,type:e,eventSource:i,mouseEvent:s})}}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:n,updatePosition:r}=e,l={width:0,height:0},a=(n=!1)=>{let{x:a,y:h}=r();n&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,s&&(a+=s),o&&(h+=o),i&&(a=this.keepXYWithinBounds(t,a,1),h=this.keepXYWithinBounds(t,h,0)),t.style.left=`${a}px`,t.style.top=`${h}px`,e.postProcessCallback&&e.postProcessCallback())};if(a(),!n){const e=this.resizeObserverService.observeResize(t,(()=>a(!0)));setTimeout((()=>e()),200)}}getActivePopups(){return this.popupList.map((e=>e.element))}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),pi(t)}keepXYWithinBounds(e,t,i){const s=0===i,o=s?"clientHeight":"clientWidth",n=s?"top":"left",r=s?"height":"width",l=s?"scrollTop":"scrollLeft",a=this.gos.getDocument(),h=a.documentElement,d=this.getPopupParent(),c=e.getBoundingClientRect(),u=d.getBoundingClientRect(),g=a.documentElement.getBoundingClientRect(),p=d===a.body,m=Math.ceil(c[r]);let C=p?(s?ui:gi)(h)+h[l]:d[o];p&&(C-=Math.abs(g[n]-u[n]));const f=C-m;return Math.min(Math.max(t,0),Math.abs(f))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:n,anchorToElement:r}=e;if(!t)return he("could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(i);if(-1!==l){return{hideFunc:this.popupList[l].hideFunc}}this.initialisePopupPosition(i);const a=this.createPopupWrapper(i,s,!!o),h=this.addEventListenersToPopup({...e,wrapperEl:a});return n&&n(),this.addPopupToPopupList(i,a,h,r),{hideFunc:h}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();k(e.style.top)||(e.style.top=-1*t.top+"px"),k(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div");return this.environment.applyThemeClasses(o),o.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||yt(e,"dialog"),Rt(e,t),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(e){if(e.themeChanged)for(const e of this.popupList)this.environment.applyThemeClasses(e.wrapper)}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:o,closedCallback:n,afterGuiAttached:r,closeOnEsc:l,modal:a}=e;let h=!1;const d=e=>{if(!s.contains(this.gos.getActiveDomElement()))return;e.key!==ts.ESCAPE||M(e)||g({keyboardEvent:e})},c=e=>g({mouseEvent:e}),u=e=>g({touchEvent:e}),g=(e={})=>{const{mouseEvent:r,touchEvent:l,keyboardEvent:a,forceHide:g}=e;(g||!this.isEventFromCurrentPopup({mouseEvent:r,touchEvent:l},o)&&!h)&&(h=!0,i.removeChild(s),t.removeEventListener("keydown",d),t.removeEventListener("mousedown",c),t.removeEventListener("touchstart",u),t.removeEventListener("contextmenu",c),this.eventService.removeEventListener("dragStarted",c),n&&n(r||l||a),this.removePopupFromPopupList(o))};return r&&r({hidePopup:g}),window.setTimeout((()=>{l&&t.addEventListener("keydown",d),a&&(t.addEventListener("mousedown",c),this.eventService.addEventListener("dragStarted",c),t.addEventListener("touchstart",u),t.addEventListener("contextmenu",c))}),0),g}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:ha++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex((t=>t.element===e))}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then((e=>e&&e())),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=o,s.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter((t=>t.element!==e))}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,n=s.getBoundingClientRect(),r=i.top-n.top,l=i.left-n.left;let a=r,h=l;const d=o.style.top,c=parseInt(d.substring(0,d.length-1),10),u=o.style.left,g=parseInt(u.substring(0,u.length-1),10),p=this.getFrameworkOverrides();return new vs((i=>{p.wrapIncoming((()=>{p.setInterval((()=>{const i=t.getBoundingClientRect(),n=s.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)return void e.hidePopup();const d=i.top-n.top;if(d!=a){const e=this.keepXYWithinBounds(o,c+r-d,0);o.style.top=`${e}px`}a=d;const u=i.left-n.left;if(u!=h){const e=this.keepXYWithinBounds(o,g+l-u,1);o.style.left=`${e}px`}h=u}),200).then((e=>{i((()=>{null!=e&&window.clearInterval(e)}))}))}),"popupPositioning")}))}hasAnchoredPopup(){return this.popupList.some((e=>e.isAnchored))}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const n=this.getPopupIndex(t);if(-1===n)return!1;for(let e=n;e<this.popupList.length;e++){if(A(this.popupList[e].element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),n=o.length,r=this.getWrapper(e);if(!r||s<=1||!t.contains(e))return!1;const l=i.indexOf(r),a=r.querySelectorAll("div"),h=[];a.forEach((e=>{0!==e.scrollTop&&h.push([e,e.scrollTop])}));let d=!1;if(n){r.classList.contains("ag-always-on-top")?l!==s-1&&(c(o).insertAdjacentElement("afterend",r),d=!0):l!==s-n-1&&(o[0].insertAdjacentElement("beforebegin",r),d=!0)}else l!==s-1&&(c(i).insertAdjacentElement("afterend",r),d=!0);for(;h.length;){const e=h.pop();e[0].scrollTop=e[1]}return d}},ca=["touchstart","touchend","touchmove","touchcancel"],ua=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(e,t){return new vs((i=>{i(window.setInterval(e,t))}))}addEventListener(e,t,i,s){const o=S(ca,t);e.addEventListener(t,i,{capture:!!s,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},ga=class extends I{constructor(){super(...arguments),this.beanName="cellNavigationService"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.pinnedRowModel=e.pinnedRowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===ts.UP,s=e===ts.DOWN,o=e===ts.LEFT;let n,r;if(i||s)r=i?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow(),n=t.column;else{const e=this.visibleColsService.getAllCols(),i=this.gos.get("enableRtl");r=t.rowIndex,n=o!==i?e[0]:c(e)}return{rowIndex:r,rowPinned:null,column:n}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case ts.UP:i=this.getCellAbove(i);break;case ts.DOWN:i=this.getCellBelow(i);break;case ts.RIGHT:i=this.gos.get("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case ts.LEFT:i=this.gos.get("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,he("unknown key for navigation ",e)}s=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}if(!i)return!1;return!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.visibleColsService.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.visibleColsService.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.pageBoundsService.getFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;let i=[];i=this.rowRenderer.getStickyTopRowCtrls().some((t=>t.getRowNode().rowIndex===e.rowIndex))?[...this.rowRenderer.getStickyTopRowCtrls()].sort(((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex)):[...this.rowRenderer.getStickyBottomRowCtrls()].sort(((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex));const s=t?-1:1,o=i.findIndex((t=>t.getRowNode().rowIndex===e.rowIndex)),n=i[o+s];return n?{rowIndex:n.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;if("top"===t){return this.pinnedRowModel.getPinnedTopRowNodes().length-1<=i}if("bottom"===t){return this.pinnedRowModel.getPinnedBottomRowNodes().length-1<=i}return this.pageBoundsService.getLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.pageBoundsService.getFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s,!0);return o||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.pageBoundsService.getLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowNodes().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColAfter(e.column);if(!o){o=t[0];const n=this.getRowBelow(e);if(G(n))return null;if(!n.rowPinned&&!(this.paginationService?.isRowInPage(n)??1))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColBefore(e.column);if(!o){o=c(t);const n=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(G(n))return null;if(!n.rowPinned&&!(this.paginationService?.isRowInPage(n)??1))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}};function pa(e,t){e.eventService.dispatchEvent(t)}var ma=class extends I{constructor(){super(...arguments),this.beanName="apiFunctionService",this.functions={dispatchEvent:pa},this.isDestroyed=!1}wireBeans(e){this.beans=e}postConstruct(){this.preDestroyLink=this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}callFunction(e,t){const i=this.functions[e];return i?i.apply(i,[this.beans,...t]):this.isDestroyed?this.destroyedHandler(e):void(this.isFrameworkMethod(e)||this.beans.validationService?.warnMissingApiFunction(e))}addFunction(e,t){const{validationService:i}=this.beans;i&&(t=i.validateApiFunction(e,t)),this.functions[e]=t}destroy(){this.functions={},this.isDestroyed=!0,super.destroy()}destroyedHandler(e){if("isDestroyed"===e)return!0;"destroy"!==e&&he(`Grid API function ${e}() cannot be called as the grid has been destroyed.\nEither clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\nTo run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${this.preDestroyLink}`)}isFrameworkMethod(e){return["preWireBeans","wireBeans","preConstruct","postConstruct"].includes(e)}};function Ca(e){const t=e.getBean("apiFunctionService");return new Proxy(t,{get(e,t){return(...i)=>e.callFunction(t,i)}})}function fa(e){return{beanName:"gridApi",bean:Ca(e)}}var va=class extends I{constructor(){super(...arguments),this.beanName="columnDefFactory"}buildColumnDefs(e,t,i){const s=[],o={};return e.forEach((e=>{let n=!0,r=this.createDefFromColumn(e,t,i),l=e.getOriginalParent(),a=null;for(;l;){let e=null;if(l.isPadding()){l=l.getOriginalParent();continue}const t=o[l.getGroupId()];if(t){t.children.push(r),n=!1;break}if(e=this.createDefFromGroup(l),e&&(e.children=[r],o[e.groupId]=e,r=e,l=l.getOriginalParent()),null!=l&&a===l){n=!1;break}a=l}n&&s.push(r)})),s}createDefFromGroup(e){const t=j(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=j(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=!e.isVisible()||void 0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,s}},wa=class extends I{constructor(){super(...arguments),this.beanName="columnEventDispatcher"}visibleCols(){this.eventService.dispatchEvent({type:"displayedColumnsChanged"})}gridColumns(){this.eventService.dispatchEvent({type:"gridColumnsChanged"})}headerHeight(e){const t={type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}groupOpened(e){const t={type:"columnGroupOpened",columnGroup:1===e.length?e[0]:void 0,columnGroups:e};this.eventService.dispatchEvent(t)}rowGroupChanged(e,t){const i={type:"columnRowGroupChanged",columns:e,column:1===e.length?e[0]:null,source:t};this.eventService.dispatchEvent(i)}genericColumnEvent(e,t,i){const s={type:e,columns:t,column:1===t.length?t[0]:null,source:i};this.eventService.dispatchEvent(s)}pivotModeChanged(){this.eventService.dispatchEvent({type:"columnPivotModeChanged"})}virtualColumnsChanged(e){const t={type:"virtualColumnsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}newColumnsLoaded(e){const t={type:"newColumnsLoaded",source:e};this.eventService.dispatchEvent(t)}everythingChanged(e){const t={type:"columnEverythingChanged",source:e};this.eventService.dispatchEvent(t)}columnMoved(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e,n={type:"columnMoved",columns:t,column:t&&1===t.length?t[0]:null,toIndex:s,finished:o,source:i};this.eventService.dispatchEvent(n)}columnPinned(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,(e=>e.getPinned())),o={type:"columnPinned",pinned:null!=s?s:null,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}columnVisible(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s={type:"columnVisible",visible:this.getCommonValue(e,(e=>e.isVisible())),columns:e,column:i,source:t};this.eventService.dispatchEvent(s)}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}columnChanged(e,t,i){const s={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i};this.eventService.dispatchEvent(s)}columnResized(e,t,i,s=null){if(e&&e.length){const o={type:"columnResized",columns:e,column:1===e.length?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(o)}}},Sa=class extends I{constructor(){super(...arguments),this.beanName="columnGetStateService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService}getColumnState(){if(G(this.columnModel.getColDefCols())||!this.columnModel.isAlive())return[];const e=this.columnModel.getAllCols().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}createStateItemFromColumn(e){const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns(),s=e.isRowGroupActive()?t.indexOf(e):null,o=e.isPivotActive()?i.indexOf(e):null,n=e.isValueActive()?e.getAggFunc():null,r=null!=e.getSort()?e.getSort():null,l=null!=e.getSortIndex()?e.getSortIndex():null,a=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:r,sortIndex:l,aggFunc:n,rowGroup:e.isRowGroupActive(),rowGroupIndex:s,pivot:e.isPivotActive(),pivotIndex:o,flex:a}}orderColumnStateList(e){const t=this.columnModel.getCols(),i=new Map(t.map(((e,t)=>[e.getColId(),t])));e.sort(((e,t)=>(i.has(e.colId)?i.get(e.colId):-1)-(i.has(t.colId)?i.get(t.colId):-1)))}},ya=class extends I{constructor(){super(...arguments),this.beanName="columnGroupStateService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService}getColumnGroupState(){const e=[];return Me(null,this.columnModel.getColTree(),(t=>{se(t)&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})})),e}resetColumnGroupState(e){const t=this.columnModel.getColDefColTree();if(!t)return;const i=[];Me(null,t,(e=>{if(se(e)){const t=e.getColGroupDef(),s={groupId:e.getGroupId(),open:t?t.openByDefault:void 0};i.push(s)}})),this.setColumnGroupState(i,e)}setColumnGroupState(e,t){if(!this.columnModel.getColTree())return;this.columnAnimationService.start();const i=[];e.forEach((e=>{const t=e.groupId,s=e.open,o=this.columnModel.getProvidedColGroup(t);o&&o.isExpanded()!==s&&(o.setExpanded(s),i.push(o))})),this.visibleColsService.refresh(t,!0),i.length&&this.eventDispatcher.groupOpened(i),this.columnAnimationService.finish()}},ba=class extends I{constructor(){super(...arguments),this.beanName="columnViewportService",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={}}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}setScrollPosition(e,t,i=!1){const s=this.visibleColsService.isBodyWidthDirty();if(!(e===this.scrollWidth&&t===this.scrollPosition&&!s)){if(this.scrollWidth=e,this.scrollPosition=t,this.visibleColsService.setBodyWidthDirty(),this.gos.get("enableRtl")){const e=this.visibleColsService.getBodyContainerWidth();this.viewportLeft=e-this.scrollPosition-this.scrollWidth,this.viewportRight=e-this.scrollPosition}else this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition;this.columnModel.isReady()&&this.checkViewportColumns(i)}}getHeadersToRender(e,t){let i;switch(e){case"left":i=this.rowsOfHeadersToRenderLeft[t];break;case"right":i=this.rowsOfHeadersToRenderRight[t];break;default:i=this.rowsOfHeadersToRenderCenter[t]}return i||[]}extractViewportColumns(){const e=this.visibleColsService.getCenterCols();this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200;return!(t<s&&i<s)&&!(t>o&&i>o)}getViewportColumns(){const e=this.visibleColsService.getLeftCols(),t=this.visibleColsService.getRightCols();return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.columnModel.isColSpanActive())return this.colsWithinViewport;const t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this),i=this.visibleColsService.getColsCenter();return this.visibleColsService.getColsForRow(e,i,t,(e=>{const t=e.getLeft();return k(t)&&t>this.viewportLeft}))}checkViewportColumns(e=!1){this.extractViewport()&&this.eventDispatcher.virtualColumnsChanged(e)}calculateHeaderRows(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={};const e={},t=this.visibleColsService.getLeftCols(),i=this.visibleColsService.getRightCols();this.headerColsWithinViewport.concat(t).concat(i).forEach((t=>e[t.getId()]=!0));const s=(t,i,o)=>{let n=!1;for(let r=0;r<t.length;r++){const l=t[r];let a=!1;if(te(l))a=!0===e[l.getId()];else{const e=l.getDisplayedChildren();e&&(a=s(e,i,o+1))}a&&(n=!0,i[o]||(i[o]=[]),i[o].push(l))}return n};s(this.visibleColsService.getTreeLeft(),this.rowsOfHeadersToRenderLeft,0),s(this.visibleColsService.getTreeRight(),this.rowsOfHeadersToRenderRight,0),s(this.visibleColsService.getTreeCenter(),this.rowsOfHeadersToRenderCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.getViewportColumns().map((e=>`${e.getId()}-${e.getPinned()||"normal"}`)).join("#"),t=this.colsWithinViewportHash!==e;return t&&(this.colsWithinViewportHash=e,this.calculateHeaderRows()),t}},Ra=class extends I{constructor(){super(...arguments),this.beanName="agComponentUtils"}wireBeans(e){this.componentMetadataProvider=e.componentMetadataProvider}adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(){return!1}getGui(){return this.eGui}init(t){const i=e(t),s=typeof i;this.eGui="string"!==s&&"number"!==s&&"boolean"!==s?null!=i?i:bi("<span></span>"):bi("<span>"+i+"</span>")}}}doesImplementIComponent(e){return!!e&&(e.prototype&&"getGui"in e.prototype)}},Fa=class extends I{constructor(){super(...arguments),this.beanName="componentMetadataProvider"}wireBeans(e){this.agComponentUtils=e.agComponentUtils}postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}},Pa=Object.fromEntries(["rowPositionUtils","cellPositionUtils","headerPositionUtils","paginationAutoPageSizeService","apiFunctionService","gridApi","userComponentRegistry","agComponentUtils","componentMetadataProvider","resizeObserverService","userComponentFactory","rowContainerHeightService","horizontalResizeService","localeService","validationService","pinnedRowModel","dragService","visibleColsService","eventService","gos","popupService","selectionService","columnFilterService","quickFilterService","filterManager","columnModel","headerNavigationService","pageBoundsService","paginationService","pageBoundsListener","rowRenderer","expressionService","columnFactory","alignedGridsService","navigationService","valueCache","valueService","loggerFactory","autoWidthCalculator","filterMenuFactory","dragAndDropService","focusService","mouseEventService","environment","cellNavigationService","stylingService","scrollVisibleService","sortController","columnHoverService","columnAnimationService","selectableService","autoColService","changeDetectionService","animationFrameService","undoRedoService","columnDefFactory","rowCssClassCalculator","rowNodeBlockLoader","rowNodeSorter","ctrlsService","pinnedWidthService","rowNodeEventThrottle","ctrlsFactory","dataTypeService","syncService","overlayService","stateService","expansionService","apiEventService","ariaAnnouncementService","menuService","columnApplyStateService","columnEventDispatcher","columnMoveService","columnAutosizeService","columnGetStateService","columnGroupStateService","columnSizeService","funcColsService","columnNameService","columnViewportService","pivotResultColsService","showRowGroupColsService"].map(((e,t)=>[e,t])));function Ea(e,t){return((e.beanName?Pa[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER)-((t.beanName?Pa[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER)}function Da(e,t){return"gridDestroyService"===e?.beanName?-1:0}var Ma=class extends I{constructor(){super(...arguments),this.beanName="ctrlsFactory",this.registry={}}register(e){this.registry[e.name]=e.classImp}getInstance(e,...t){const i=this.registry[e];if(null!=i)return new i(...t)}},Ta=class extends I{constructor(){super(...arguments),this.beanName="ctrlsService",this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=null!=e.gridCtrl&&null!=e.gridBodyCtrl&&null!=e.center&&null!=e.left&&null!=e.right&&null!=e.bottomCenter&&null!=e.bottomLeft&&null!=e.bottomRight&&null!=e.topCenter&&null!=e.topLeft&&null!=e.topRight&&null!=e.stickyTopCenter&&null!=e.stickyTopLeft&&null!=e.stickyTopRight&&null!=e.stickyBottomCenter&&null!=e.stickyBottomLeft&&null!=e.stickyBottomRight&&null!=e.centerHeader&&null!=e.leftHeader&&null!=e.rightHeader&&null!=e.fakeHScrollComp&&null!=e.fakeVScrollComp&&null!=e.gridHeaderCtrl,this.ready&&(this.readyCallbacks.forEach((t=>t(e))),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){const i=this.params;switch(t){case"left":i.leftHeader=e;break;case"right":i.rightHeader=e;break;default:i.centerHeader=e}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:i}=this.params;return[e,i,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}},xa=class extends I{constructor(){super(...arguments),this.beanName="cellPositionUtils"}createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${null==i?"null":i}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return i&&s&&o}},Aa=class extends I{constructor(){super(...arguments),this.beanName="rowNodeEventThrottle",this.events=[]}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowModel=e.rowModel}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach((e=>this.eventService.dispatchEvent(e))),this.events=[]};t?i():(null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}},Ia=class extends I{constructor(){super(...arguments),this.beanName="rowPositionUtils"}wireBeans(e){this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.pageBoundsService=e.pageBoundsService}getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.pageBoundsService.getFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getLastRow()):s&&(t="top",e=s-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowNodes()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowNodes()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&(e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned)}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(k(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}},La={cssName:"--ag-row-height",changeKey:"rowHeightChanged",defaultValue:42},Oa={cssName:"--ag-header-height",changeKey:"headerHeightChanged",defaultValue:48},ka={cssName:"--ag-list-item-height",changeKey:"listItemHeightChanged",defaultValue:24},Ga=class extends I{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.themeClasses=[],this.eThemeAncestor=null,this.eMeasurementContainer=null,this.sizesMeasured=!1}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.eGridDiv=e.eGridDiv}postConstruct(){this.addManagedPropertyListener("rowHeight",(()=>this.refreshRowHeightVariable())),this.themeClasses=this.getAncestorThemeClasses(),this.setUpThemeClassObservers(),this.getSizeEl(La),this.getSizeEl(Oa),this.getSizeEl(ka)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(La)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(Oa)}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(ka)}hasMeasuredSizes(){return this.sizesMeasured}getThemeClasses(){return this.themeClasses}applyThemeClasses(e){for(const t of Array.from(e.classList))t.startsWith("ag-theme-")&&!this.themeClasses.includes(t)&&e.classList.remove(t);for(const t of this.themeClasses)e.classList.contains(t)||e.classList.add(t)}getThemeAncestorElement(){return this.eThemeAncestor}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(null!=t)return t;const i=this.measureSizeEl(e);return"detached"===i||"no-styles"===i?e.defaultValue:(this.lastKnownValues.set(e,i),i)}measureSizeEl(e){const t=this.getSizeEl(e);if(null==t.offsetParent)return"detached";const i=t.offsetWidth;return i===Ha?"no-styles":(this.sizesMeasured=!0,i)}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let i=this.eMeasurementContainer;i||(i=this.eMeasurementContainer=document.createElement("div"),i.className="ag-measurement-container",this.eGridDiv.appendChild(i)),t=document.createElement("div"),t.style.width=`var(${e.cssName}, ${Ha}px)`,i.appendChild(t),this.sizeEls.set(e,t);let s=this.measureSizeEl(e);"no-styles"===s&&he(`no value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`);const o=this.resizeObserverService.observeResize(t,(()=>{const t=this.measureSizeEl(e);"detached"!==t&&"no-styles"!==t&&(this.lastKnownValues.set(e,t),t!==s&&(s=t,this.fireGridStylesChangedEvent(e.changeKey)))}));return this.addDestroyFunc((()=>o())),t}fireGridStylesChangedEvent(e){const t={type:"gridStylesChanged",[e]:!0};this.eventService.dispatchEvent(t)}setUpThemeClassObservers(){const e=new MutationObserver((()=>{const e=this.getAncestorThemeClasses();Na(e,this.themeClasses)||(this.themeClasses=e,this.fireGridStylesChangedEvent("themeChanged"))}));let t=this.eGridDiv;for(;t;)e.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement}getAncestorThemeClasses(){let e=this.eGridDiv;const t=[];for(this.eThemeAncestor=null;e;){const i=Array.from(e.classList).filter((e=>e.startsWith("ag-theme-")));for(const s of i)this.eThemeAncestor=e,t.includes(s)||t.unshift(s);e=e.parentElement}return Object.freeze(t)}},Na=(e,t)=>e.length===t.length&&-1===e.findIndex(((i,s)=>e[s]!==t[s])),Ha=15538,Ba=class extends I{constructor(){super(...arguments),this.beanName="eventService",this.globalEventService=new h}wireBeans(e){this.globalEventListener=e.globalEventListener,this.globalSyncEventListener=e.globalSyncEventListener}postConstruct(){if(this.globalEventListener){const e=this.gos.useAsyncEvents();this.addGlobalListener(this.globalEventListener,e)}this.globalSyncEventListener&&this.addGlobalListener(this.globalSyncEventListener,!1)}addEventListener(e,t,i){this.globalEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.globalEventService.removeEventListener(e,t,i)}addGlobalListener(e,t=!1){this.globalEventService.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalEventService.removeGlobalListener(e,t)}dispatchLocalEvent(){}dispatchEvent(e){this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e))}dispatchEventOnce(e){this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e))}},Va=class e extends I{constructor(){super(...arguments),this.beanName="focusService"}wireBeans(e){this.eGridDiv=e.eGridDiv,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.headerNavigationService=e.headerNavigationService,this.headerPositionUtils=e.headerPositionUtils,this.rowRenderer=e.rowRenderer,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.navigationService=e.navigationService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.rangeService=e.rangeService,this.advancedFilterService=e.advancedFilterService}static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",e.toggleKeyboardMode),t.addEventListener("mousedown",e.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",e.toggleKeyboardMode),t.addEventListener("mousedown",e.toggleKeyboardMode))}static toggleKeyboardMode(t){const i=e.keyboardModeActive,s="keydown"===t.type;s&&(t.ctrlKey||t.metaKey||t.altKey)||i!==s&&(e.keyboardModeActive=s)}static unregisterGridCompController(t){e.removeKeyboardModeEvents(t)}postConstruct(){const e=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:e,columnRowGroupChanged:e}),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady((e=>{this.gridCtrl=e.gridCtrl}))}registerKeyboardFocusEvents(){const t=this.gos.getDocument();e.addKeyboardModeEvents(t),e.instanceCount++,this.addDestroyFunc((()=>{e.instanceCount--,e.unregisterGridCompController(t)}))}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getCol(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return e.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),Or.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),ln.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gos.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout((()=>{this.restoredFocusedCellPosition=null}),0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,s={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return o&&(s.isFullWidthCell=o.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e={type:"cellFocusCleared",...this.getFocusEventParams()};this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:s,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:n=!1}=e,r=this.columnModel.getCol(t);if(!r)return void(this.focusedCellPosition=null);this.focusedCellPosition=r?{rowIndex:i,rowPinned:O(s),column:r}:null;const l={type:"cellFocused",...this.getFocusEventParams(),forceBrowserFocus:o,preventScrollOnBrowserFocus:n};this.eventService.dispatchEvent(l)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),s=e.getPinned(),{column:o,headerRowIndex:n}=this.focusedHeaderPosition;return t===o&&i===n&&s==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:s,event:o,fromCell:n,rowWithoutSpanValue:r}=e;let{headerPosition:l}=e;if(n&&this.filterManager?.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(l);if(s){const e=this.getFocusedHeader(),s=this.headerNavigationService.getHeaderRowCount();if(i){const i=this.gos.getCallback("tabToNextHeader");i&&(l=this.getHeaderPositionFromUserFunc({userFunc:i,direction:t,currentPosition:e,headerPosition:l,headerRowCount:s}))}else{const t=this.gos.getCallback("navigateToNextHeader");if(t&&o){l=t({key:o.key,previousHeaderPosition:e,nextHeaderPosition:l,headerRowCount:s,event:o})}}}return!!l&&this.focusProvidedHeaderPosition({headerPosition:l,direction:t,event:o,fromCell:n,rowWithoutSpanValue:r})}focusHeaderPositionFromUserFunc(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:t,headerPosition:i,direction:s,event:o}=e,n=this.getFocusedHeader(),r=this.headerNavigationService.getHeaderRowCount(),l=this.getHeaderPositionFromUserFunc({userFunc:t,direction:s,currentPosition:n,headerPosition:i,headerRowCount:r});return!!l&&this.focusProvidedHeaderPosition({headerPosition:l,direction:s,event:o})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:i,currentPosition:s,headerPosition:o,headerRowCount:n}=e,r=t({backwards:"Before"===i,previousHeaderPosition:s,nextHeaderPosition:o,headerRowCount:n});return!0===r||null===r?(null===r&&he("Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),s):!1===r?null:r}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:i,fromCell:s,rowWithoutSpanValue:o,event:n}=e,{column:r,headerRowIndex:l}=t;if(-1===l)return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView(r);this.headerNavigationService.scrollToColumn(r,i);const a=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()).focusHeader(t.headerRowIndex,r,n);return a&&(null!=o||s)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(o??-1),a}focusFirstHeader(){let e=this.visibleColsService.getAllCols()[0];if(!e)return!1;e.getParent()&&(e=this.visibleColsService.getColGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=c(this.visibleColsService.getAllCols());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&(this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===O(t))}findFocusableElements(e,t,i=!1){let s=si;t&&(s+=", "+t),i&&(s+=', [tabindex="-1"]');const o=Array.prototype.slice.apply(e.querySelectorAll("[tabindex], input, select, button, textarea, [href]")).filter((e=>yi(e))),n=Array.prototype.slice.apply(e.querySelectorAll(s));if(!n.length)return o;return r=n,o.filter((e=>-1===r.indexOf(e)));var r}focusInto(e,t=!1,i=!1){const s=this.findFocusableElements(e,null,i),o=t?c(s):s[0];return!!o&&(o.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),s=i.indexOf(t);if(-1===s)return null;let o=-1;for(let e=s-1;e>=0;e--)if(i[e].classList.contains("ag-tab-guard-top")){o=e;break}return o<=0?null:i[o-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const s=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),o=this.gos.getActiveDomElement();let n;n=t?s.findIndex((e=>e.contains(o))):s.indexOf(o);const r=n+(i?-1:1);return r<0||r>=s.length?null:s[r]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${co.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let e=0;e<i.length;e++)if(i[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===Zt(e)&&++i<=t;)e=e.parentElement;return null===Zt(e)?null:e}focusGridView(e,t){if(this.gos.get("suppressCellFocus"))return t?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const i=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!i)return!1;const{rowIndex:s,rowPinned:o}=i,n=this.getFocusedHeader();return!e&&n&&(e=n.column),!(null==s||!e)&&(this.navigationService.ensureCellVisible({rowIndex:s,column:e,rowPinned:o}),this.setFocusedCell({rowIndex:s,column:e,rowPinned:O(o),forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:s,rowPinned:o,column:e}),!0)}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){return this.advancedFilterFocusColumn=e?.column,this.advancedFilterService?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(e,t){const i=(t?void 0:this.advancedFilterFocusColumn)??this.visibleColsService.getAllCols()?.[0];return e?this.focusHeaderPosition({headerPosition:{column:i,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(i)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}addFocusableContainer(e){this.gridCtrl.addFocusableContainer(e)}removeFocusableContainer(e){this.gridCtrl.removeFocusableContainer(e)}focusGridInnerElement(e){return this.gridCtrl.focusInnerElement(e)}};Va.keyboardModeActive=!1,Va.instanceCount=0;var Wa=Va,za=class extends I{constructor(){super(...arguments),this.beanName="pinnedWidthService"}wireBeans(e){this.visibleColsService=e.visibleColsService}postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.visibleColsService.getColsLeftWidth(),i=e?0:this.visibleColsService.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:"leftPinnedWidthChanged"})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:"rightPinnedWidthChanged"}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}},_a=class extends I{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}wireBeans(e){this.beans=e,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.gridId);const{dragAndDropService:s,mouseEventService:o,ctrlsService:n,resizeObserverService:r}=this.beans;s.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>1===e||0===e,getIconName:()=>"notAllowed"}),o.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new sr(this.view)),this.addRtlSupport();const l=r.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc((()=>l())),n.register("gridCtrl",this)}isDetailGrid(){const e=this.focusService.findTabbableParent(this.getGui());return e?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.paginationService?.getPaginationSelector(),gridHeaderDropZonesSelector:e.columnDropZonesService?.getDropZoneSelector(),sideBarSelector:e.sideBarService?.getSideBarSelector(),statusBarSelector:e.statusBarService?.getStatusPanelSelector(),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){const e={type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),i=this.gos.getActiveDomElement(),s=t.findIndex((e=>e.getGui().contains(i))),o=s+(e?-1:1);if(o<0||o>=t.length)return!1;if(0===o){if(s>0){const e=c(this.visibleColsService.getAllCols());if(this.focusService.focusGridView(e,!0))return!0}return!1}return this.focusContainer(t[o],e)}focusInnerElement(e){const t=this.getFocusableContainers(),i=this.visibleColsService.getAllCols(),s=this.gos.getCallback("focusGridInnerElement");if(s&&s({fromBottom:!!e}))return!0;if(e){if(t.length>1)return this.focusContainer(c(t),!0);const e=c(i);if(this.focusService.focusGridView(e,!0))return!0}if(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let e=1;e<t.length;e++)if(this.focusService.focusInto(t[e].getGui()))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}focusContainer(e,t){e?.setAllowFocus?.(!0);const i=this.focusService.focusInto(e.getGui(),t);return e?.setAllowFocus?.(!1),i}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers.values()]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},Ua=class extends aa{constructor(e){super(),this.gridBody=Bi,this.sideBar=Bi,this.pagination=Bi,this.rootWrapperBody=Bi,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}},t=this.createManagedBean(new _a),i=t.getOptionalSelectors(),s=this.createTemplate(i),o=[nl,...Object.values(i).filter((e=>!!e))];this.setTemplate(s,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>t.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc((()=>{this.eGridDiv.removeChild(e),this.gos.get("debug")&&ae("Grid removed from DOM")}))}updateLayoutClasses(e,t){const i=this.rootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",i=e.sideBarSelector?'<ag-side-bar data-ref="sideBar"></ag-side-bar>':"",s=e.statusBarSelector?"<ag-status-bar></ag-status-bar>":"",o=e.watermarkSelector?"<ag-watermark></ag-watermark>":"";return`<div class="ag-root-wrapper" role="presentation">\n ${t}\n <div class="ag-root-wrapper-body" data-ref="rootWrapperBody" role="presentation">\n <ag-grid-body data-ref="gridBody"></ag-grid-body>\n ${i}\n </div>\n ${s}\n ${e.paginationSelector?'<ag-pagination data-ref="pagination"></ag-pagination>':""}\n ${o}\n </div>`}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){e||!this.pagination?.isDisplayed()?super.forceFocusOutOfContainer(e):this.pagination.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[this.gridBody];return[this.sideBar,this.pagination].forEach((t=>{t&&e.push(t)})),e.filter((e=>yi(e.getGui())))}},Ka={version:dn,moduleName:"@ag-grid-community/aligned-grid",beans:[class extends I{constructor(){super(...arguments),this.beanName="alignedGridsService",this.consuming=!1}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.ctrlsService=e.ctrlsService,this.columnApplyStateService=e.columnApplyStateService}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t="function"==typeof e;"function"==typeof e&&(e=e());const i=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map((e=>{if(!e)return de("alignedGrids contains an undefined option."),t||de('You may want to configure via a callback to avoid setup race conditions:\n "alignedGrids: () => [linkedGrid]"'),void de(i());if(this.isGridApi(e))return e;const s=e;return"current"in s?s.current?.api:(s.api||de(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),s.api)})).filter((e=>!!e&&!e.isDestroyed()))}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:e})=>this.onColumnEvent(e),alignedGridScroll:({event:e})=>this.onScrollEvent(e)})}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach((t=>{t.isDestroyed()||t.dispatchEvent(e)}))}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){const t={type:"alignedGridColumn",event:e};this.fireEvent(t)}fireScrollEvent(e){if("horizontal"!==e.direction)return;const t={type:"alignedGridScroll",event:e};this.fireEvent(t)}onScrollEvent(e){this.onEvent((()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)}))}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach((e=>{t.push(e)})):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach((e=>{t.push(e.getColId())})):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent((()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{const t=e;this.processColumnEvent(t);break}case"columnGroupOpened":{const t=e;this.processGroupOpenedEvent(t);break}case"columnPivotChanged":he("pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}}))}processGroupOpenedEvent(e){e.columnGroups.forEach((e=>{let t=null;if(e){const i=e.getGroupId();t=this.columnModel.getProvidedColGroup(i)}e&&!t||this.columnModel.setColumnGroupOpened(t,e.isExpanded(),"alignedGridChanged")}))}processColumnEvent(e){const t=e.column;let i=null;if(t&&(i=this.columnModel.getColDefCol(t.getColId())),t&&!i)return;const s=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const t=e.api.getColumnState().map((e=>({colId:e.colId})));this.columnApplyStateService.applyColumnState({state:t,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const t=e.api.getColumnState().map((e=>({colId:e.colId,hide:e.hide})));this.columnApplyStateService.applyColumnState({state:t},"alignedGridChanged")}break;case"columnPinned":{const t=e.api.getColumnState().map((e=>({colId:e.colId,pinned:e.pinned})));this.columnApplyStateService.applyColumnState({state:t},"alignedGridChanged")}break;case"columnResized":{const t=e,i={};s.forEach((e=>{i[e.getId()]={key:e.getColId(),newWidth:e.getActualWidth()}})),t.flexColumns?.forEach((e=>{i[e.getId()]&&delete i[e.getId()]})),this.columnSizeService.setColumnWidths(Object.values(i),!1,t.finished,"alignedGridChanged");break}}const o=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach((e=>{e.setGridOption("alwaysShowVerticalScroll",o)}))}}]};var $a={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},ja=["january","february","march","april","may","june","july","august","september","october","november","december"],qa=class extends I{constructor(){super(...arguments),this.beanName="dataTypeService",this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}wireBeans(e){this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.columnApplyStateService=e.columnApplyStateService}postConstruct(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",(()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")})),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",(e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(xe(e.source))}))}processDataTypeDefinitions(){const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},this.formatValueFuncs={};const t=e=>t=>{const{column:i,node:s,value:o}=t;let n=i.getColDef().valueFormatter;return n===e.groupSafeValueFormatter&&(n=e.valueFormatter),this.valueService.formatValue(i,s,o,n)};Object.entries(e).forEach((([e,i])=>{const s={...i,groupSafeValueFormatter:this.createGroupSafeValueFormatter(i)};this.dataTypeDefinitions[e]=s,this.formatValueFuncs[e]=t(s)}));const i=this.gos.get("dataTypeDefinitions")??{};this.dataTypeMatchers={},Object.entries(i).forEach((([s,o])=>{const n=this.processDataTypeDefinition(o,i,[s],e);n&&(this.dataTypeDefinitions[s]=n,o.dataTypeMatcher&&(this.dataTypeMatchers[s]=o.dataTypeMatcher),this.formatValueFuncs[s]=t(n))})),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach((t=>{const i=this.dataTypeMatchers[t];i&&delete this.dataTypeMatchers[t],this.dataTypeMatchers[t]=i??e[t].dataTypeMatcher}))}mergeDataTypeDefinitions(e,t){const i={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...Ee(e.columnTypes),...Ee(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=s[n];const r=t[n];if(i&&r&&(i=r),!this.validateDataTypeDefinition(e,i,n))return;o=this.mergeDataTypeDefinitions(i,e)}else{if(i.includes(n))return void he('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');const r=t[n];if(!this.validateDataTypeDefinition(e,r,n))return;const l=this.processDataTypeDefinition(r,t,[...i,n],s);if(!l)return;o=this.mergeDataTypeDefinitions(l,e)}return{...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)}}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(he('The "baseDataType" property of a data type definition must match that of its parent.'),!1):(he(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{if(t.node?.group){const i=t.column.getAggFunc();if(i){if("first"===i||"last"===i)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==i){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter({...t,value:t.value.toNumber()});if("value"in t.value)return e.valueFormatter({...t,value:t.value.value})}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||e.dataTypeMatcher?.(t.value))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetColumnType(e,t,i){let{cellDataType:s}=t;const{field:o}=t;if(void 0===s&&(s=e.cellDataType),null!=s&&!0!==s||(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(o,i)),!s)return void(e.cellDataType=!1);const n=this.dataTypeDefinitions[s];if(n)return e.cellDataType=s,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,n,i),n.columnTypes;he(`Missing data type definition - "${s}"`)}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=e=>{t.add(e.key)};e.addEventListener("columnStateUpdated",i),this.columnStateUpdateListenerDestroyFuncs.push((()=>e.removeEventListener("columnStateUpdated",i)))}canInferCellDataType(e,t){if("clientSide"!==this.rowModel.getType())return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,i))return!1;const s=null===t.type?e.type:t.type;if(s){const e=this.gos.get("columnTypes")??{};if(Ee(s).some((t=>{const s=e[t.trim()];return s&&this.doColDefPropsPreventInference(s,i)})))return!1}return!this.doColDefPropsPreventInference(e,i)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some((([i,s])=>this.doesColDefPropPreventInference(e,t,i,s)))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return null===o?(t[i]=!1,!1):void 0===s?!!o:o===s}inferCellDataType(e,t){if(!e)return;let i;const s=this.getInitialData();if(s){const t=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");i=Q(s,e,t)}else this.initWaitForRowData(t);if(null==i)return;const[o]=Object.entries(this.dataTypeMatchers).find((([e,t])=>t(i)))??["object"];return o}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(e?.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const[i]=this.addManagedEventListeners({rowDataUpdateStarted:e=>{const{firstRowData:s}=e;if(!s)return;i?.(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(s,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();this.eventService.dispatchEvent({type:"dataTypesInferred"})}})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.destroyColumnStateUpdateListeners();const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach((([e,n])=>{const r=this.columnModel.getCol(e);if(!r)return;const l=r.getColDef();if(!this.columnModel.resetColDefIntoCol(r,"cellDataTypeInferred"))return;const a=r.getColDef();if(t&&a.type&&a.type!==l.type){const t=this.getUpdatedColumnState(r,n);t.rowGroup&&null==t.rowGroupIndex&&(s[e]=t),t.pivot&&null==t.pivotIndex&&(o[e]=t),i.push(t)}})),t&&i.push(...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnApplyStateService.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnApplyStateService.getColumnStateFromColDef(e);return t.forEach((e=>{delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex})),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}getDateStringTypeDefinition(e){return e?this.getDataTypeDefinition(e)??this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(null==t)return!0;const i=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!i||i(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||he('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&he('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}getFormatValue(e){return this.formatValueFuncs[e]}setColDefPropertiesForBaseDataType(e,t,i,s){const o=this.formatValueFuncs[t],n=Ji.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId),r=this.localeService.getLocaleTextFunc(),l=t=>{const{filterParams:i}=e;e.filterParams="object"==typeof i?{...i,...t}:t};switch(i.baseDataType){case"number":e.cellEditor="agNumberCellEditor",n&&l({comparator:(e,t)=>{const i=null==e?0:parseInt(e),s=null==t?0:parseInt(t);return i===s?0:i>s?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===ts.SPACE,l(n?{valueFormatter:e=>k(e.value)?r(String(e.value),e.value?"True":"False"):r("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=o,n&&l({valueFormatter:e=>{const t=o(e);return k(t)?t:r("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=ja[Number(e)-1];return r(t,$a[t])}return e??r("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=o;const t=i.dateParser;l(n?{valueFormatter:e=>{const t=o(e);return k(t)?t:r("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const i=t(e??void 0);return i?[String(i.getFullYear()),String(i.getMonth()+1),String(i.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=ja[Number(e)-1];return r(t,$a[t])}return e??r("blanks","(Blanks)")}}:{comparator:(e,i)=>{const s=t(i);return null==i||s<e?-1:s>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const i=this.columnModel.getColDefCol(s),n=i?.getColDef();if(!i||!n)return 0;const r=null==e?"":o({column:i,node:null,value:e}),l=null==t?"":o({column:i,node:null,value:t});return r===l?0:r>l?1:-1},e.keyCreator=o,n?l({valueFormatter:e=>{const t=o(e);return k(t)?t:r("blanks","(Blanks)")}}):e.filterValueGetter=e=>o({column:e.column,node:e.node,value:this.valueService.getValue(e.column,e.node)})}}getDefaultDataTypes(){const e=e=>!!e.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>""===e.newValue?.trim?.()?null:Number(e.newValue),valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:H(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>null==e.newValue?e.newValue:""===e.newValue?.trim?.()?null:"true"===String(e.newValue).toLowerCase(),valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>jo(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?Uo(e.value,!1)??"":t("invalidDate","Invalid Date"),dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>jo(e)??void 0,dateFormatter:e=>Uo(e??null,!1)??void 0,valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>H(e.value)??""}}}destroyColumnStateUpdateListeners(){this.columnStateUpdateListenerDestroyFuncs.forEach((e=>e())),this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}},Ya={version:dn,moduleName:"@ag-grid-community/data-type",beans:[qa]};function Qa(e,t){const{colKey:i,rowNode:s,useFormatter:o}=t,n=e.columnModel.getColDefCol(i)??e.columnModel.getCol(i);if(G(n))return null;const r=e.valueService.getValue(n,s);if(o){return e.valueService.formatValue(n,s,r)??We(r,!0)}return r}function Xa(e,t){e.gos.updateGridOptions({options:t})}function Ja(e){return e.rowRenderer.getFirstVirtualRenderedRow()}function Za(e){return e.rowRenderer.getLastVirtualRenderedRow()}var eh={version:dn,moduleName:"@ag-grid-community/menu-api",apiFunctions:{showColumnMenuAfterButtonClick:function(e,t,i){const s=e.columnModel.getCol(t);e.menuService.showColumnMenu({column:s,buttonElement:i,positionBy:"button"})},showColumnMenuAfterMouseClick:function(e,t,i){let s=e.columnModel.getCol(t);s||(s=e.columnModel.getColDefCol(t)),s?e.menuService.showColumnMenu({column:s,mouseEvent:i,positionBy:"mouse"}):de(`column '${t}' not found`)},showColumnMenu:function(e,t){const i=e.columnModel.getCol(t);i?e.menuService.showColumnMenu({column:i,positionBy:"auto"}):de(`column '${t}' not found`)},hidePopupMenu:function(e){e.menuService.hidePopupMenu()}}},th={version:dn,moduleName:"@ag-grid-community/api",dependantModules:[{version:dn,moduleName:"@ag-grid-community/core-api",apiFunctions:{getGridId:function(e){return e.context.getGridId()},destroy:function(e){e.gridDestroyService.destroy()},isDestroyed:function(e){return e.gridDestroyService.isDestroyCalled()},getGridOption:function(e,t){return e.gos.get(t)},setGridOption:function(e,t,i){Xa(e,{[t]:i})},updateGridOptions:Xa}},{version:dn,moduleName:"@ag-grid-community/pinned-row-api",apiFunctions:{getPinnedTopRowCount:function(e){return e.pinnedRowModel.getPinnedTopRowCount()},getPinnedBottomRowCount:function(e){return e.pinnedRowModel.getPinnedBottomRowCount()},getPinnedTopRow:function(e,t){return e.pinnedRowModel.getPinnedTopRow(t)},getPinnedBottomRow:function(e,t){return e.pinnedRowModel.getPinnedBottomRow(t)}}},{version:dn,moduleName:"@ag-grid-community/row-selection-api",apiFunctions:{setNodesSelected:function(e,t){if(!t.nodes.every((e=>e.rowPinned?(he("cannot select pinned rows"),!1):void 0!==e.id||(he("cannot select node until id for node is known"),!1))))return;const{nodes:i,source:s,newValue:o}=t,n=i;e.selectionService.setNodesSelected({nodes:n,source:s??"api",newValue:o})},selectAll:function(e,t="apiSelectAll"){e.selectionService.selectAllRowNodes({source:t})},deselectAll:function(e,t="apiSelectAll"){e.selectionService.deselectAllRowNodes({source:t})},selectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionService.selectAllRowNodes({source:t,justFiltered:!0})},deselectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})},selectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})},deselectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})},getSelectedNodes:function(e){return e.selectionService.getSelectedNodes()},getSelectedRows:function(e){return e.selectionService.getSelectedRows()}}},{version:dn,moduleName:"@ag-grid-community/column-api",apiFunctions:{getColumnDef:function(e,t){const i=e.columnModel.getColDefCol(t);return i?i.getColDef():null},getColumnDefs:function(e){return e.columnModel.getColumnDefs()},sizeColumnsToFit:function(e,t){"number"==typeof t?e.columnSizeService.sizeColumnsToFit(t,"api"):e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t)},setColumnGroupOpened:function(e,t,i){e.columnModel.setColumnGroupOpened(t,i,"api")},getColumnGroup:function(e,t,i){return e.visibleColsService.getColumnGroup(t,i)},getProvidedColumnGroup:function(e,t){return e.columnModel.getProvidedColGroup(t)},getDisplayNameForColumn:function(e,t,i){return e.columnNameService.getDisplayNameForColumn(t,i)||""},getDisplayNameForColumnGroup:function(e,t,i){return e.columnNameService.getDisplayNameForColumnGroup(t,i)||""},getColumn:function(e,t){return e.columnModel.getColDefCol(t)},getColumns:function(e){return e.columnModel.getColDefCols()},applyColumnState:function(e,t){return e.columnApplyStateService.applyColumnState(t,"api")},getColumnState:function(e){return e.columnGetStateService.getColumnState()},resetColumnState:function(e){e.columnApplyStateService.resetColumnState("api")},getColumnGroupState:function(e){return e.columnGroupStateService.getColumnGroupState()},setColumnGroupState:function(e,t){e.columnGroupStateService.setColumnGroupState(t,"api")},resetColumnGroupState:function(e){e.columnGroupStateService.resetColumnGroupState("api")},isPinning:function(e){return e.visibleColsService.isPinningLeft()||e.visibleColsService.isPinningRight()},isPinningLeft:function(e){return e.visibleColsService.isPinningLeft()},isPinningRight:function(e){return e.visibleColsService.isPinningRight()},getDisplayedColAfter:function(e,t){return e.visibleColsService.getColAfter(t)},getDisplayedColBefore:function(e,t){return e.visibleColsService.getColBefore(t)},setColumnVisible:function(e,t,i){e.columnModel.setColsVisible([t],i,"api")},setColumnsVisible:function(e,t,i){e.columnModel.setColsVisible(t,i,"api")},setColumnPinned:function(e,t,i){e.columnModel.setColsPinned([t],i,"api")},setColumnsPinned:function(e,t,i){e.columnModel.setColsPinned(t,i,"api")},getAllGridColumns:function(e){return e.columnModel.getCols()},getDisplayedLeftColumns:function(e){return e.visibleColsService.getLeftCols()},getDisplayedCenterColumns:function(e){return e.visibleColsService.getCenterCols()},getDisplayedRightColumns:function(e){return e.visibleColsService.getRightCols()},getAllDisplayedColumns:function(e){return e.visibleColsService.getAllCols()},getAllDisplayedVirtualColumns:function(e){return e.columnViewportService.getViewportColumns()},moveColumn:function(e,t,i){e.columnMoveService.moveColumns([t],i,"api")},moveColumnByIndex:function(e,t,i){e.columnMoveService.moveColumnByIndex(t,i,"api")},moveColumns:function(e,t,i){e.columnMoveService.moveColumns(t,i,"api")},setColumnWidth:function(e,t,i,s=!0,o="api"){e.columnSizeService.setColumnWidths([{key:t,newWidth:i}],!1,s,o)},setColumnWidths:function(e,t,i=!0,s="api"){e.columnSizeService.setColumnWidths(t,!1,i,s)},getLeftDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeLeft()},getCenterDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeCenter()},getRightDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeRight()},getAllDisplayedColumnGroups:function(e){return e.visibleColsService.getAllTrees()},autoSizeColumn:function(e,t,i){return e.columnAutosizeService.autoSizeCols({colKeys:[t],skipHeader:i,source:"api"})},autoSizeColumns:function(e,t,i){e.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"api"})},autoSizeAllColumns:function(e,t){e.columnAutosizeService.autoSizeAllColumns("api",t)}}},{version:dn,moduleName:"@ag-grid-community/row-api",apiFunctions:{redrawRows:function(e,t={}){const i=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.redrawRows(i)))},setRowNodeExpanded:function(e,t,i,s,o){e.expansionService.setRowNodeExpanded(t,i,s,o)},getRowNode:function(e,t){return e.rowModel.getRowNode(t)},addRenderedRowListener:function(e,t,i,s){e.rowRenderer.addRenderedRowListener(t,i,s)},getRenderedNodes:function(e){return e.rowRenderer.getRenderedNodes()},forEachNode:function(e,t,i){e.rowModel.forEachNode(t,i)},getFirstDisplayedRow:function(e){return Ja(e)},getFirstDisplayedRowIndex:Ja,getLastDisplayedRow:function(e){return Za(e)},getLastDisplayedRowIndex:Za,getDisplayedRowAtIndex:function(e,t){return e.rowModel.getRow(t)},getDisplayedRowCount:function(e){return e.rowModel.getRowCount()},getModel:function(e){return e.rowModel}}},{version:dn,moduleName:"@ag-grid-community/drag-api",apiFunctions:{addRowDropZone:function(e,t){e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t)},removeRowDropZone:function(e,t){const i=e.dragAndDropService.findExternalZone(t);i&&e.dragAndDropService.removeDropTarget(i)},getRowDropZoneParams:function(e,t){return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t)}}},{version:dn,moduleName:"@ag-grid-community/scroll-api",apiFunctions:{getVerticalPixelRange:function(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition()},getHorizontalPixelRange:function(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition()},ensureColumnVisible:Hl,ensureIndexVisible:Bl,ensureNodeVisible:function(e,t,i=null){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t,i)),"ensureVisible")}}},{version:dn,moduleName:"@ag-grid-community/overlay-api",apiFunctions:{showLoadingOverlay:function(e){e.overlayService.showLoadingOverlay()},showNoRowsOverlay:function(e){e.overlayService.showNoRowsOverlay()},hideOverlay:function(e){e.overlayService.hideOverlay()}}},{version:dn,moduleName:"@ag-grid-community/keyboard-navigation-api",apiFunctions:{getFocusedCell:function(e){return e.focusService.getFocusedCell()},clearFocusedCell:function(e){return e.focusService.clearFocusedCell()},setFocusedCell:function(e,t,i,s){e.focusService.setFocusedCell({rowIndex:t,column:i,rowPinned:s,forceBrowserFocus:!0})},setFocusedHeader:function(e,t,i=!1){const s=e.headerNavigationService.getHeaderPositionForColumn(t,i);s&&e.focusService.focusHeaderPosition({headerPosition:s})},tabToNextCell:function(e,t){return e.navigationService.tabToNextCell(!1,t)},tabToPreviousCell:function(e,t){return e.navigationService.tabToNextCell(!0,t)}}},{version:dn,moduleName:"@ag-grid-community/event-api",apiFunctions:{addEventListener:function(e,t,i){e.apiEventService.addEventListener(t,i)},addGlobalListener:function(e,t){e.apiEventService.addGlobalListener(t)},removeEventListener:function(e,t,i){e.apiEventService.removeEventListener(t,i)},removeGlobalListener:function(e,t){e.apiEventService.removeGlobalListener(t)}}},{version:dn,moduleName:"@ag-grid-community/render-api",apiFunctions:{setGridAriaProperty:function(e,t,i){if(!t)return;const s=e.ctrlsService.getGridBodyCtrl().getGui(),o=`aria-${t}`;null===i?s.removeAttribute(o):s.setAttribute(o,i)},refreshCells:function(e,t={}){e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.refreshCells(t)))},flashCells:function(e,t={}){const i=e=>he(`Since v31.1 api.flashCells parameter '${e}Delay' is deprecated. Please use '${e}Duration' instead.`);k(t.fadeDelay)&&i("fade"),k(t.flashDelay)&&i("flash"),e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.flashCells(t)))},refreshHeader:function(e){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getHeaderRowContainerCtrls().forEach((e=>e.refresh()))))},isAnimationFrameQueueEmpty:function(e){return e.animationFrameService.isQueueEmpty()},flushAllAnimationFrames:function(e){e.animationFrameService.flushAllFrames()},getSizesForCurrentTheme:function(e){return{rowHeight:e.gos.getRowHeightAsNumber(),headerHeight:e.columnModel.getHeaderHeight()}},getCellRendererInstances:function(e,t={}){return e.rowRenderer.getCellRendererInstances(t).map(Vs)}}},{version:dn,moduleName:"@ag-grid-community/cell-api",apiFunctions:{expireValueCache:function(e){e.valueCache.expire()},getValue:function(e,t,i){return Qa(e,{colKey:t,rowNode:i})},getCellValue:Qa}},eh,{version:dn,moduleName:"@ag-grid-community/sort-api",apiFunctions:{onSortChanged:function(e){e.sortController.onSortChanged("api")}}}]};var ih={version:dn,moduleName:"@ag-grid-community/state-core",beans:[class extends I{constructor(){super(...arguments),this.beanName="stateService",this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Ce((()=>this.dispatchQueuedStateUpdateEvents()),0),this.onRowGroupOpenedDebounced=Ce((()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),0),this.onRowSelectedDebounced=Ce((()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())}),0),this.staleStateKeys=new Set}wireBeans(e){this.filterManager=e.filterManager,this.ctrlsService=e.ctrlsService,this.pivotResultColsService=e.pivotResultColsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnGroupStateService=e.columnGroupStateService,this.columnGetStateService=e.columnGetStateService,this.paginationService=e.paginationService,this.rowModel=e.rowModel,this.selectionService=e.selectionService,this.expansionService=e.expansionService,this.columnAnimationService=e.columnAnimationService,this.columnApplyStateService=e.columnApplyStateService,this.sideBarService=e.sideBarService,this.rangeService=e.rangeService}postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=this.gos.get("initialState")??{},this.ctrlsService.whenReady((()=>this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnGridReady()))));const[e,t,i]=this.addManagedEventListeners({newColumnsLoaded:({source:t})=>{"gridInitializing"===t&&(e(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnColumnsInitialised())))},rowCountReady:()=>{t?.(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnRowCountReady()))},firstDataRendered:()=>{i?.(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnFirstDataRendered()))}})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState());const e=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:e,sideBarUpdated:e})}setupStateOnColumnsInitialised(){const e=this.gos.get("initialState")??{};this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedEventListeners({columnValueChanged:()=>this.updateColumnState(["aggregation"]),columnMoved:()=>this.updateColumnState(["columnOrder"]),columnPinned:()=>this.updateColumnState(["columnPinning"]),columnResized:()=>this.updateColumnState(["columnSizing"]),columnVisible:()=>this.updateColumnState(["columnVisibility"]),columnPivotChanged:()=>this.updateColumnState(["pivot"]),columnPivotModeChanged:()=>this.updateColumnState(["pivot"]),columnRowGroupChanged:()=>this.updateColumnState(["rowGroup"]),sortChanged:()=>this.updateColumnState(["sort"]),newColumnsLoaded:()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setupStateOnRowCountReady(){const{filter:e,rowGroupExpansion:t,rowSelection:i,pagination:s}=this.gos.get("initialState")??{},o=this.gos.get("advancedFilterModel");(e||o)&&this.setFilterState(e,o),t&&this.setRowGroupExpansionState(t),i&&this.setRowSelectionState(i),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedEventListeners({filterChanged:()=>this.updateCachedState("filter",this.getFilterState()),rowGroupOpened:()=>this.onRowGroupOpenedDebounced(),expandOrCollapseAll:()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:e=>{(e.newPage||e.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}})}setupStateOnFirstDataRendered(){const{scroll:e,rangeSelection:t,focusedCell:i,columnOrder:s}=this.gos.get("initialState")??{};i&&this.setFocusedCellState(i),t&&this.setRangeSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!s?.orderedColIds),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedEventListeners({cellFocused:()=>this.updateCachedState("focusedCell",this.getFocusedCellState()),rangeSelectionChanged:e=>{e.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())},bodyScrollEnd:()=>this.updateCachedState("scroll",this.getScrollState())})}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],o=[],n=[],r=[],l=[],a=[],h=[],d=this.columnGetStateService.getColumnState();for(let e=0;e<d.length;e++){const{colId:c,sort:u,sortIndex:g,rowGroup:p,rowGroupIndex:m,aggFunc:C,pivot:f,pivotIndex:v,pinned:w,hide:S,width:y,flex:b}=d[e];h.push(c),u&&(t[g??0]={colId:c,sort:u}),p&&(i[m??0]=c),"string"==typeof C&&s.push({colId:c,aggFunc:C}),f&&(o[v??0]=c),w&&("right"===w?r:n).push(c),S&&l.push(c),(b||y)&&a.push({colId:c,flex:b??void 0,width:y})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:void 0,columnPinning:n.length||r.length?{leftColIds:n,rightColIds:r}:void 0,columnVisibility:l.length?{hiddenColIds:l}:void 0,columnSizing:a.length?{columnSizingModel:a}:void 0,columnOrder:h.length?{orderedColIds:h}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:o,columnPinning:n,columnVisibility:r,columnSizing:l,columnOrder:a}=e,h={},d=e=>{let t=h[e];return t||(t={colId:e},h[e]=t,t)};t&&t.sortModel.forEach((({colId:e,sort:t},i)=>{const s=d(e);s.sort=t,s.sortIndex=i})),i&&i.groupColIds.forEach(((e,t)=>{const i=d(e);i.rowGroup=!0,i.rowGroupIndex=t})),s&&s.aggregationModel.forEach((({colId:e,aggFunc:t})=>{d(e).aggFunc=t})),o&&(o.pivotColIds.forEach(((e,t)=>{const i=d(e);i.pivot=!0,i.pivotIndex=t})),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),n&&(n.leftColIds.forEach((e=>{d(e).pinned="left"})),n.rightColIds.forEach((e=>{d(e).pinned="right"}))),r&&r.hiddenColIds.forEach((e=>{d(e).hide=!0})),l&&l.columnSizingModel.forEach((({colId:e,flex:t,width:i})=>{const s=d(e);s.flex=t??null,s.width=i}));const c=a?.orderedColIds,u=!!c?.length,g=u?c.map((e=>d(e))):Object.values(h);if(g.length){this.columnStates=g;const e={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnApplyStateService.applyColumnState({state:g,applyOrder:u,defaultState:e},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,this.pivotResultColsService.isPivotResultColsPresent()){if(t){const i=[];for(const e of t)this.pivotResultColsService.getPivotResultCol(e.colId)&&i.push(e);this.columnApplyStateService.applyColumnState({state:i,applyOrder:e},"gridInitializing")}i&&this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnGroupStateService.getColumnGroupState(),t=[];return e.forEach((({groupId:e,open:i})=>{i&&t.push(e)})),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){if(!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const t=new Set(e.columnGroup?.openColumnGroupIds),i=this.columnGroupStateService.getColumnGroupState().map((({groupId:e})=>{const i=t.has(e);return i&&t.delete(e),{groupId:e,open:i}}));t.forEach((e=>{i.push({groupId:e,open:!0})})),i.length&&(this.columnGroupStates=i),this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}getFilterState(){let e=this.filterManager?.getFilterModel();e&&0===Object.keys(e).length&&(e=void 0);const t=this.filterManager?.getAdvancedFilterModel()??void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:s}=e??{advancedFilterModel:t};i&&this.filterManager?.setFilterModel(i,"columnFilter"),s&&this.filterManager?.setAdvancedFilterModel(s)}getRangeSelectionState(){const e=this.rangeService?.getCellRanges().map((e=>{const{id:t,type:i,startRow:s,endRow:o,columns:n,startColumn:r}=e;return{id:t,type:i,startRow:s,endRow:o,colIds:n.map((e=>e.getColId())),startColId:r.getColId()}}));return e?.length?{cellRanges:e}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach((e=>{const i=[];if(e.colIds.forEach((e=>{const t=this.columnModel.getCol(e);t&&i.push(t)})),!i.length)return;let s=this.columnModel.getCol(e.startColId);if(!s){const e=this.visibleColsService.getAllCols(),t=new Set(i);s=e.find((e=>t.has(e)))}t.push({...e,columns:i,startColumn:s})})),this.rangeService.setCellRanges(t)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.ctrlsService.getGridBodyCtrl()?.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:i}=e?.getVScrollPosition()??{top:0};return i||t?{top:i,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:i}=e;this.ctrlsService.getGridBodyCtrl()?.getScrollFeature().setScrollPosition(t,i)}getSideBarState(){return this.sideBarService?.getSideBarComp()?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getCol(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){if(!this.paginationService)return;const e=this.paginationService.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationService.getPageSize();return e||t?{page:e,pageSize:t}:void 0}setPaginationState(e){this.paginationService&&(e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationService.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationService.setPage(e.page))}getRowSelectionState(){const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(!1===e.selectAll||!1===e.selectAllChildren)&&!e?.toggledNodes?.length?void 0:e}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach((([e,t])=>{z(t,this.cachedState[e])||(i=!0)})),this.cachedState={...this.cachedState,...t},i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),z(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){this.staleStateKeys.forEach((e=>{if("rowSelection"===e)this.setCachedStateValue(e,this.getRowSelectionState())})),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach((e=>this.queuedUpdateSources.add(e))),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:"stateUpdated",sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout((()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))}))}}]},sh={version:dn,moduleName:"@ag-grid-community/state",dependantModules:[ih,{version:dn,moduleName:"@ag-grid-community/state-api",apiFunctions:{getState:function(e){return e.stateService?.getState()??{}}},dependantModules:[ih]}]};function oh(e,t,i){e.addManagedElementListeners(t,{keydown:e=>{if(!e.defaultPrevented&&e.key===ts.TAB){const s=e.shiftKey;i.findNextFocusableElement(t,!1,s)||i.focusNextGridCoreContainer(s)&&e.preventDefault()}}})}var nh={selector:"AG-PAGE-SIZE-SELECTOR",component:class extends Vi{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationService.getPageSize()||(this.paginationService.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.paginationService=e.paginationService}postConstruct(){this.addManagedPropertyListener("paginationPageSizeSelector",(()=>{this.onPageSizeSelectorValuesChange()})),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.paginationService.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){vi(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&!1!==this.gos.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationService.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),he("The paginationPageSize grid option is set to a value that is not in the list of page size options.\n Please make sure that the paginationPageSize grid option is set to one of the values in the \n paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp));const s=this.localeService.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),n=e.map((e=>({value:String(e),text:String(e)}))),r=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new wo).addOptions(n).setValue(String(i?"":t)).setAriaLabel(r).setLabel(o).onValueChange((()=>this.handlePageSizeItemSelected())),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get("paginationPageSizeSelector");return Array.isArray(t)&&this.validateValues(t)?[...t].sort(((e,t)=>e-t)):e}validateValues(e){if(!e.length)return he("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\n If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const i=e[t],s=i>0;if(!("number"==typeof i))return he("The paginationPageSizeSelector grid option contains a non-numeric value.\n Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!s)return he("The paginationPageSizeSelector grid option contains a negative number or zero.\n Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}}},rh={selector:"AG-PAGINATION",component:class extends aa{constructor(){super(),this.btFirst=Bi,this.btPrevious=Bi,this.btNext=Bi,this.btLast=Bi,this.lbRecordCount=Bi,this.lbFirstRowOnPage=Bi,this.lbLastRowOnPage=Bi,this.lbCurrent=Bi,this.lbTotal=Bi,this.pageSizeComp=Bi,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1}wireBeans(e){this.rowNodeBlockLoader=e.rowNodeBlockLoader,this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.focusService=e.focusService}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[nh]);const{btFirst:t,btPrevious:i,btNext:s,btLast:o}=this;this.activateTabIndex([t,i,s,o]),t.insertAdjacentElement("afterbegin",_i(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",_i(e?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",_i(e?"previous":"next",this.gos)),o.insertAdjacentElement("afterbegin",_i(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],(()=>this.onPageSizeRelatedOptionsChange())),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>{this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(e):this.focusService.focusGridInnerElement(e)},forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const e=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e),e&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)}),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach((e=>{const{el:t,fn:i}=e;this.addManagedListeners(t,{click:i,keydown:e=>{e.key!==ts.ENTER&&e.key!==ts.SPACE||(e.preventDefault(),i())}})})),oh(this,this.getGui(),this.focusService),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationService.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationService.getTotalPages()>0,t=this.paginationService.getCurrentPage(),i=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(i)}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t){return t({value:e})}const i=this.localeService.getLocaleTextFunc();return _o(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),o=e("firstPage","First Page"),n=e("previousPage","Previous Page"),r=e("nextPage","Next Page"),l=e("lastPage","Last Page"),a=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${a}">\n <ag-page-size-selector data-ref="pageSizeComp"></ag-page-size-selector>\n <span class="ag-paging-row-summary-panel" role="status">\n <span id="ag-${a}-first-row" data-ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-${a}-to">${i}</span>\n <span id="ag-${a}-last-row" data-ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-${a}-of">${s}</span>\n <span id="ag-${a}-row-count" data-ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n </span>\n <span class="ag-paging-page-summary-panel" role="presentation">\n <div data-ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n <div data-ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>\n <span class="ag-paging-description" role="status">\n <span id="ag-${a}-start-page">${t}</span>\n <span id="ag-${a}-start-page-number" data-ref="lbCurrent" class="ag-paging-number"></span>\n <span id="ag-${a}-of-page">${s}</span>\n <span id="ag-${a}-of-page-number" data-ref="lbTotal" class="ag-paging-number"></span>\n </span>\n <div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n <div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${l}"></div>\n </span>\n </div>`}onBtNext(){this.nextButtonDisabled||this.paginationService.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationService.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationService.goToLastPage()}enableOrDisableButtons(){const e=this.paginationService.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),i=this.paginationService.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===i-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Mt(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationService.getCurrentPage(),t=this.paginationService.getPageSize(),i=this.rowModel.isLastRowIndexKnown(),s=this.rowModel.isLastRowIndexKnown()?this.paginationService.getMasterRowCount():null;let o,n;if(this.isZeroPagesToDisplay()?o=n=0:(o=t*e+1,n=o+t-1,i&&n>s&&(n=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader?.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(n)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages(),i=e?this.paginationService.getMasterRowCount():null;if(1===i){const e=this.rowModel.getRow(0);if(e&&e.group&&!(e.groupData||e.aggData))return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}}},lh={version:dn,moduleName:"@ag-grid-community/pagination-core",beans:[class extends I{constructor(){super(...arguments),this.beanName="paginationService",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return rh}isPaginateChildRows(){return!(!this.gos.get("groupRemoveSingleChildren")&&!this.gos.get("groupRemoveLowestSingleChildren"))||this.gos.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){this.active&&this.currentPage!==e&&"number"==typeof this.currentPage&&(this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0}))}isRowPresent(e){return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){if(!this.active)return!0;return this.getPageForIndex(e.rowIndex)===this.currentPage}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return k(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:k(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:k(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:k(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}i!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:i=!1,newPageSize:s=!1}=e,o={type:"paginationChanged",animate:!1,newData:!1,newPage:i,newPageSize:s,keepRenderedRows:t};this.eventService.dispatchEvent(o)}},class extends I{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}postConstruct(){this.ctrlsService.whenReady((e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()}))}notActive(){return!this.gos.get("paginationAutoPageSize")||null==this.centerRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.paginationService.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=Math.max(this.gos.getRowHeightAsNumber(),1),i=Math.floor(e/t);this.paginationService.setPageSize(i,"autoCalculated")};this.isBodyRendered?Ce((()=>t()),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}}]},ah={version:dn,moduleName:"@ag-grid-community/pagination",dependantModules:[lh,{version:dn,moduleName:"@ag-grid-community/pagination-api",dependantModules:[lh],apiFunctions:{paginationIsLastPageFound:function(e){return e.rowModel.isLastRowIndexKnown()},paginationGetPageSize:function(e){return e.paginationService?.getPageSize()??100},paginationGetCurrentPage:function(e){return e.paginationService?.getCurrentPage()??0},paginationGetTotalPages:function(e){return e.paginationService?.getTotalPages()??1},paginationGetRowCount:function(e){return e.paginationService?e.paginationService.getMasterRowCount():e.rowModel.getRowCount()},paginationGoToNextPage:function(e){e.paginationService?.goToNextPage()},paginationGoToPreviousPage:function(e){e.paginationService?.goToPreviousPage()},paginationGoToFirstPage:function(e){e.paginationService?.goToFirstPage()},paginationGoToLastPage:function(e){e.paginationService?.goToLastPage()},paginationGoToPage:function(e,t){e.paginationService?.goToPage(t)}}}]},hh="@ag-grid-community/core",dh="@ag-grid-community/client-side-row-model",ch="@ag-grid-community/csv-export",uh="@ag-grid-community/infinite-row-model",gh="@ag-grid-enterprise/advanced-filter",ph="@ag-grid-enterprise/charts",mh="@ag-grid-enterprise/clipboard",Ch="@ag-grid-enterprise/excel-export",fh="@ag-grid-enterprise/master-detail",vh="@ag-grid-enterprise/menu",wh="@ag-grid-enterprise/range-selection",Sh="@ag-grid-enterprise/row-grouping",yh="@ag-grid-enterprise/server-side-row-model",bh="@ag-grid-enterprise/side-bar",Rh={dispatchEvent:hh,getState:hh,getGridId:hh,destroy:hh,isDestroyed:hh,getGridOption:hh,setGridOption:hh,updateGridOptions:hh,setNodesSelected:hh,selectAll:hh,deselectAll:hh,selectAllFiltered:hh,deselectAllFiltered:hh,selectAllOnCurrentPage:hh,deselectAllOnCurrentPage:hh,getSelectedNodes:hh,getSelectedRows:hh,redrawRows:hh,setRowNodeExpanded:hh,getRowNode:hh,addRenderedRowListener:hh,getRenderedNodes:hh,forEachNode:hh,getFirstDisplayedRow:hh,getFirstDisplayedRowIndex:hh,getLastDisplayedRow:hh,getLastDisplayedRowIndex:hh,getDisplayedRowAtIndex:hh,getDisplayedRowCount:hh,getModel:hh,getVerticalPixelRange:hh,getHorizontalPixelRange:hh,ensureColumnVisible:hh,ensureIndexVisible:hh,ensureNodeVisible:hh,getFocusedCell:hh,clearFocusedCell:hh,setFocusedCell:hh,tabToNextCell:hh,tabToPreviousCell:hh,setFocusedHeader:hh,addEventListener:hh,addGlobalListener:hh,removeEventListener:hh,removeGlobalListener:hh,expireValueCache:hh,getValue:hh,getCellValue:hh,showColumnMenuAfterButtonClick:hh,showColumnMenuAfterMouseClick:hh,showColumnMenu:hh,hidePopupMenu:hh,onSortChanged:hh,getPinnedTopRowCount:hh,getPinnedBottomRowCount:hh,getPinnedTopRow:hh,getPinnedBottomRow:hh,showLoadingOverlay:hh,showNoRowsOverlay:hh,hideOverlay:hh,setGridAriaProperty:hh,refreshCells:hh,flashCells:hh,refreshHeader:hh,isAnimationFrameQueueEmpty:hh,flushAllAnimationFrames:hh,getSizesForCurrentTheme:hh,getCellRendererInstances:hh,addRowDropZone:hh,removeRowDropZone:hh,getRowDropZoneParams:hh,getColumnDef:hh,getColumnDefs:hh,sizeColumnsToFit:hh,setColumnGroupOpened:hh,getColumnGroup:hh,getProvidedColumnGroup:hh,getDisplayNameForColumn:hh,getDisplayNameForColumnGroup:hh,getColumn:hh,getColumns:hh,applyColumnState:hh,getColumnState:hh,resetColumnState:hh,getColumnGroupState:hh,setColumnGroupState:hh,resetColumnGroupState:hh,isPinning:hh,isPinningLeft:hh,isPinningRight:hh,getDisplayedColAfter:hh,getDisplayedColBefore:hh,setColumnVisible:hh,setColumnsVisible:hh,setColumnPinned:hh,setColumnsPinned:hh,getAllGridColumns:hh,getDisplayedLeftColumns:hh,getDisplayedCenterColumns:hh,getDisplayedRightColumns:hh,getAllDisplayedColumns:hh,getAllDisplayedVirtualColumns:hh,moveColumn:hh,moveColumnByIndex:hh,moveColumns:hh,setColumnWidth:hh,setColumnWidths:hh,getLeftDisplayedColumnGroups:hh,getCenterDisplayedColumnGroups:hh,getRightDisplayedColumnGroups:hh,getAllDisplayedColumnGroups:hh,autoSizeColumn:hh,autoSizeColumns:hh,autoSizeAllColumns:hh,undoCellEditing:hh,redoCellEditing:hh,getCellEditorInstances:hh,getEditingCells:hh,stopEditing:hh,startEditingCell:hh,getCurrentUndoSize:hh,getCurrentRedoSize:hh,isAnyFilterPresent:hh,onFilterChanged:hh,isColumnFilterPresent:hh,getFilterInstance:hh,getColumnFilterInstance:hh,destroyFilter:hh,setFilterModel:hh,getFilterModel:hh,getColumnFilterModel:hh,setColumnFilterModel:hh,showColumnFilter:hh,isQuickFilterPresent:hh,getQuickFilter:hh,resetQuickFilter:hh,paginationIsLastPageFound:hh,paginationGetPageSize:hh,paginationGetCurrentPage:hh,paginationGetTotalPages:hh,paginationGetRowCount:hh,paginationGoToNextPage:hh,paginationGoToPreviousPage:hh,paginationGoToFirstPage:hh,paginationGoToLastPage:hh,paginationGoToPage:hh,expandAll:hh,collapseAll:hh,onRowHeightChanged:hh,setRowCount:hh,getCacheBlockState:hh,onGroupExpandedOrCollapsed:dh,refreshClientSideRowModel:dh,forEachLeafNode:dh,forEachNodeAfterFilter:dh,forEachNodeAfterFilterAndSort:dh,resetRowHeights:dh,applyTransaction:dh,applyTransactionAsync:dh,flushAsyncTransactions:dh,getBestCostNodeSelection:dh,getDataAsCsv:ch,exportDataAsCsv:ch,refreshInfiniteCache:uh,purgeInfiniteCache:uh,getInfiniteRowCount:uh,isLastRowIndexKnown:uh,getAdvancedFilterModel:gh,setAdvancedFilterModel:gh,showAdvancedFilterBuilder:gh,hideAdvancedFilterBuilder:gh,getChartModels:ph,getChartRef:ph,getChartImageDataURL:ph,downloadChart:ph,openChartToolPanel:ph,closeChartToolPanel:ph,createRangeChart:ph,createPivotChart:ph,createCrossFilterChart:ph,updateChart:ph,restoreChart:ph,copyToClipboard:mh,cutToClipboard:mh,copySelectedRowsToClipboard:mh,copySelectedRangeToClipboard:mh,copySelectedRangeDown:mh,pasteFromClipboard:mh,getDataAsExcel:Ch,exportDataAsExcel:Ch,getSheetDataForExcel:Ch,getMultipleSheetsAsExcel:Ch,exportMultipleSheetsAsExcel:Ch,addDetailGridInfo:fh,removeDetailGridInfo:fh,getDetailGridInfo:fh,forEachDetailGridInfo:fh,showContextMenu:vh,showColumnChooser:vh,hideColumnChooser:vh,getCellRanges:wh,addCellRange:wh,clearRangeSelection:wh,addAggFunc:Sh,addAggFuncs:Sh,clearAggFuncs:Sh,setColumnAggFunc:Sh,isPivotMode:Sh,getPivotResultColumn:Sh,setValueColumns:Sh,getValueColumns:Sh,removeValueColumn:Sh,removeValueColumns:Sh,addValueColumn:Sh,addValueColumns:Sh,setRowGroupColumns:Sh,removeRowGroupColumn:Sh,removeRowGroupColumns:Sh,addRowGroupColumn:Sh,addRowGroupColumns:Sh,getRowGroupColumns:Sh,moveRowGroupColumn:Sh,setPivotColumns:Sh,removePivotColumn:Sh,removePivotColumns:Sh,addPivotColumn:Sh,addPivotColumns:Sh,getPivotColumns:Sh,setPivotResultColumns:Sh,getPivotResultColumns:Sh,getServerSideSelectionState:yh,setServerSideSelectionState:yh,applyServerSideTransaction:yh,applyServerSideTransactionAsync:yh,applyServerSideRowData:yh,retryServerSideLoads:yh,flushServerSideAsyncTransactions:yh,refreshServerSide:yh,getServerSideGroupLevelState:yh,isSideBarVisible:bh,setSideBarVisible:bh,setSideBarPosition:bh,openToolPanel:bh,closeToolPanel:bh,getOpenedToolPanel:bh,refreshToolPanel:bh,isToolPanelShowing:bh,getToolPanelInstance:bh,getSideBar:bh,getStatusPanel:"@ag-grid-enterprise/status-bar"},Fh="clientSide",Ph="serverSide",Eh="infinite",Dh={onGroupExpandedOrCollapsed:[Fh],refreshClientSideRowModel:[Fh],forEachLeafNode:[Fh],forEachNodeAfterFilter:[Fh],forEachNodeAfterFilterAndSort:[Fh],resetRowHeights:[Fh],applyTransaction:[Fh],applyTransactionAsync:[Fh],flushAsyncTransactions:[Fh],getBestCostNodeSelection:[Fh],getServerSideSelectionState:[Ph],setServerSideSelectionState:[Ph],applyServerSideTransaction:[Ph],applyServerSideTransactionAsync:[Ph],applyServerSideRowData:[Ph],retryServerSideLoads:[Ph],flushServerSideAsyncTransactions:[Ph],refreshServerSide:[Ph],getServerSideGroupLevelState:[Ph],refreshInfiniteCache:[Eh],purgeInfiniteCache:[Eh],getInfiniteRowCount:[Eh],isLastRowIndexKnown:[Eh],expandAll:[Fh,Ph],collapseAll:[Fh,Ph],onRowHeightChanged:[Fh,Ph],setRowCount:[Eh,Ph],getCacheBlockState:[Eh,Ph]},Mh={getValue:{version:"v31.3",new:"getCellValue"},getFirstDisplayedRow:{version:"v31.1",new:"getFirstDisplayedRowIndex"},getLastDisplayedRow:{version:"v31.1",new:"getLastDisplayedRowIndex"},getModel:{version:"v31.1",message:"Please use the appropriate grid API methods instead."},setColumnVisible:{version:"v31.1",old:"setColumnVisible(key,visible)",new:"setColumnsVisible([key],visible)"},setColumnPinned:{version:"v31.1",old:"setColumnPinned(key,pinned)",new:"setColumnsPinned([key],pinned)"},moveColumn:{version:"v31.1",old:"moveColumn(key, toIndex)",new:"moveColumns([key], toIndex)"},setColumnWidth:{version:"v31.1",old:"setColumnWidth(col, width)",new:"setColumnWidths([{key: col, newWidth: width}])"},autoSizeColumn:{version:"v31.1",old:"autoSizeColumn(key, skipHeader)",new:"autoSizeColumns([key], skipHeader)"},addAggFunc:{version:"v31.1",old:"addAggFunc(key, func)",new:"addAggFuncs({ key: func })"},removeValueColumn:{version:"v31.1",old:"removeValueColumn(colKey)",new:"removeValueColumns([colKey])"},addValueColumn:{version:"v31.1",old:"addValueColumn(colKey)",new:"addValueColumns([colKey])"},removeRowGroupColumn:{version:"v31.1",old:"removeRowGroupColumn(colKey)",new:"removeRowGroupColumns([colKey])"},addRowGroupColumn:{version:"v31.1",old:"addRowGroupColumn(colKey)",new:"addRowGroupColumns([colKey])"},removePivotColumn:{version:"v31.1",old:"removePivotColumn(colKey)",new:"removePivotColumns([colKey])"},addPivotColumn:{version:"v31.1",old:"addPivotColumn(colKey)",new:"addPivotColumns([colKey])"},showColumnMenuAfterButtonClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere."},showColumnMenuAfterMouseClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere."},getFilterInstance:{version:"v31.1",message:"'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."},showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'}};var Th=(e,t)=>"clientSide"===(t.rowModelType??"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null,xh={enableRowGroup:Th,rowGroup:Th,rowGroupIndex:Th,enablePivot:Th,enableValue:Th,pivot:Th,pivotIndex:Th,aggFunc:Th,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some((e=>t.includes(e)))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>Ah},Ah={objectName:"colDef",allProperties:Object.keys({headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0}),docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"}},validations:xh},Ih={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0},Lh={version:dn,moduleName:"@ag-grid-community/core"},Oh={version:dn,moduleName:"@ag-grid-community/core-validations",beans:[class extends I{constructor(){super(...arguments),this.beanName="validationService"}wireBeans(e){this.beans=e,this.gridOptions=e.gridOptions}postConstruct(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,{objectName:"gridOptions",allProperties:[...it.ALL_PROPERTIES,...ot.EVENT_CALLBACKS],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:{advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."},suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."}},validations:{sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const i=`treeData requires 'getDataPath' in the ${t} row model.`;return e.getDataPath?null:i}case"serverSide":{const i=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:i}}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{switch(e.rowModelType??"clientSide"){case"clientSide":return null;case"serverSide":{const t="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?t:null}}return null}},groupHideOpenParents:{supportedRowModels:["clientSide"],dependencies:{groupTotalRow:[void 0,"bottom"]}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>Ah,defaultColDef:()=>Ah,defaultColGroupDef:()=>Ah,autoGroupColumnDef:()=>Ah}})}processColumnDefs(e){this.processOptions(e,Ah)}warnMissingApiFunction(e){!function(e,t){const i=Rh[e];i?Ji.__assertRegistered(i,`api.${e}`,t)&&he(`API function '${e}' not registered to module '${i}'`):de(`Unknown API function: '${e}' on GridApi.`)}(e,this.gridId)}validateApiFunction(e,t){return function(e,t,i){const s=Mh[e];if(s){const{version:i,new:o,old:n,message:r}=s,l=n??e;return(...e)=>(he(`Since ${i} api.${l} is deprecated. ${o?`Please use ${o} instead. `:""}${r??""}`),t.apply(t,e))}const o=Dh[e];return o?(...s)=>{const n=i.rowModel.getType();if(o.includes(n))return t.apply(t,s);de(`api.${e} can only be called when gridOptions.rowModelType is ${o.join(" or ")}`)}:t}(e,t,this.beans)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:o,propertyExceptions:n,objectName:r,docsUrl:l}=t;o&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...n??[],...Object.keys(s)],o,r,l);const a=new Set;Object.keys(e).forEach((t=>{const o=s[t];if(o)if("renamed"in o){const{renamed:i,version:s}=o;a.add(`As of v${s}, ${String(t)} is deprecated. Please use ${String(i)} instead.`),e[i]=e[t]}else{const{message:e,version:i}=o;a.add(`As of v${i}, ${String(t)} is deprecated. ${e??""}`)}const n=e[t];if(null==n||!1===n)return;const r=i[t];let l;if(!r)return;if("function"==typeof r){const i=r(e,this.gridOptions);if(!i)return;if("objectName"in i){const s=e[t];return Array.isArray(s)?void s.forEach((e=>{this.processOptions(e,i)})):void this.processOptions(e[t],i)}l=i}else l=r;const{module:h,dependencies:d,supportedRowModels:c}=l;if(c){const e=this.gridOptions.rowModelType??"clientSide";if(!c.includes(e))return void a.add(`${String(t)} is not supported with the '${e}' row model.`)}if(h){const e=Array.isArray(h)?h:[h];let i=!0;if(e.forEach((e=>{Ji.__assertRegistered(e,String(t),this.gridId)||(i=!1,a.add(`${String(t)} is only available when ${e} is loaded.`))})),!i)return}if(d){const i=this.checkForWarning(t,d,e);if(i)return void a.add(i)}})),a.size>0&&a.forEach((e=>{he(e)}))}checkForWarning(e,t,i){if("function"==typeof t)return t(i,this.gridOptions);const s=Object.entries(t).find((([e,t])=>{const s=i[e];return!t.includes(s)}));if(!s)return null;const[o,n]=s;return n.length>1?`'${String(e)}' requires '${o}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${o}' to be ${n[0]}.`}checkProperties(e,t,i,s,o){const n=function(e,t,i){const s={},o=e.filter((e=>!t.some((t=>t===e))));return o.length>0&&o.forEach((e=>s[e]=ms(e,i).values)),s}(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...i],i);if(K(n,((e,t)=>{let o=`invalid ${s} property '${e}' did you mean any of these: ${t.slice(0,8).join(", ")}.`;i.includes("context")&&(o+=`\nIf you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),he(o)})),Object.keys(n).length>0&&o){const e=this.getFrameworkOverrides().getDocLink(o);he(`to see all the valid ${s} properties please check: ${e}`)}}}]},kh={version:dn,moduleName:"@ag-grid-community/core-community-features",dependantModules:[Lh,Oh,Kl,En,sh,Ya,Ka,ah,th]},Gh=class extends I{constructor(){super(...arguments),this.beanName="gridDestroyService",this.destroyCalled=!1}wireBeans(e){this.beans=e}destroy(){if(this.destroyCalled)return;const e={type:"gridPreDestroyed",state:this.beans.stateService?.getState()??{}};this.eventService.dispatchEvent(e),this.destroyCalled=!0,this.beans.ctrlsService.get("gridCtrl")?.destroyGridUi(),this.beans.context.destroy(),super.destroy()}isDestroyCalled(){return this.destroyCalled}},Nh=new Set(["gridPreDestroyed","fillStart","pasteStart"]),Hh=e=>"checkboxSelected"===e||"rowClicked"===e||"spaceKey"===e||"uiSelectAll"===e||"uiSelectAllCurrentPage"===e||"uiSelectAllFiltered"===e,Bh=new Map([...it.BOOLEAN_PROPERTIES.map((e=>[e,W])),...it.NUMBER_PROPERTIES.map((e=>[e,Bo])),["groupAggFiltering",e=>"function"==typeof e?e:W(e)],["pageSize",Vo(1)],["autoSizePadding",Vo(0)],["keepDetailRowsCount",Vo(1)],["rowBuffer",Vo(0)],["infiniteInitialRowCount",Vo(1)],["cacheOverflowSize",Vo(1)],["cacheBlockSize",Vo(1)],["serverSideInitialRowCount",Vo(1)],["viewportRowModelPageSize",Vo(1)],["viewportRowModelBufferSize",Vo(0)]]);function Vh(e,t){const i=Bh.get(e);return i?i(t):t}var Wh=class e extends I{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new h,this.globalEventHandlerFactory=e=>(t,i)=>{if(!this.isAlive())return;const s=Nh.has(t);if(s&&!e||!s&&e)return;const o=ot.getCallbackForEvent(t),n=this.gridOptions[o];"function"==typeof n&&this.frameworkOverrides.wrapOutgoing((()=>{n(i)}))}}wireBeans(e){this.gridOptions=e.gridOptions,this.eGridDiv=e.eGridDiv,this.validationService=e.validationService,this.environment=e.environment,this.api=e.gridApi}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth(),this.addManagedEventListeners({gridOptionsChanged:({options:e})=>{this.updateGridOptions({options:e,force:!0,source:"gridOptionsUpdated"})}})}get(e){return this.gridOptions[e]??Ih[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return k(this.gridOptions[e])}mergeGridCommonParams(e){if(e){return t=>{const i=t;return i.api=this.api,i.context=this.gridOptionsContext,e(i)}}return e}updateGridOptions({options:t,force:i,source:s="api"}){const o={id:e.changeSetId++,properties:[]},n=[];Object.entries(t).forEach((([e,t])=>{"api"===s&&et[e]&&he(`${e} is an initial property and cannot be updated.`);const r=Vh(e,t),l=i||"object"==typeof r&&"api"===s,a=this.gridOptions[e];if(l||a!==r){this.gridOptions[e]=r;const t={type:e,currentValue:r,previousValue:a,changeSet:o,source:s};n.push(t)}})),this.validationService?.processGridOptions(this.gridOptions),o.properties=n.map((e=>e.type)),n.forEach((e=>{this.gridOptions.debug&&ae(`Updated property ${e.type} from`,e.previousValue," to ",e.currentValue),this.propertyEventService.dispatchEvent(e)}))}addPropertyEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removePropertyEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:(null==pt&&ei(),pt);null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&G(this.gridOptions.rowModelType)}isDomLayout(e){return(this.gridOptions.domLayout??"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const s={node:e,data:e.data},o=this.getCallback("getRowHeight")(s);if(this.isNumeric(o))return 0===o&&he("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,o),estimated:!1}}if(e.detail&&this.get("masterDetail"))return this.getMasterDetailRowHeight();return{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||G(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(he("row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const s=this.getDomDataKey();let o=e[s];G(o)&&(o={},e[s]=o),o[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&k(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&k(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return k(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!e?.comparator&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}getGrandTotalRow(){const e=this.gridOptions.grandTotalRow;if(e)return e;return this.gridOptions.groupIncludeTotalFooter?"bottom":void 0}getGroupTotalRowCallback(){const e=this.get("groupTotalRow");if("function"==typeof e)return this.getCallback("groupTotalRow");if(e)return()=>e;const t=this.get("groupIncludeFooter");if("function"==typeof t){const e=this.getCallback("groupIncludeFooter");return t=>e(t)?"bottom":void 0}return()=>t?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,context:this.gridOptionsContext}}addGridCommonParams(e){const t=e;return t.api=this.api,t.context=this.gridOptionsContext,t}getRowIdCallback(){const e=this.getCallback("getRowId");return void 0===e?e:t=>{let i=e(t);return"string"!=typeof i&&(he(`The getRowId callback must return a string. The ID ${i} is being cast to a string.`),i=String(i)),i}}};Wh.changeSetId=0;var zh=Wh,_h=class extends I{constructor(){super(...arguments),this.beanName="headerPositionUtils"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}findHeader(e,t){let i,s;if($e(e.column)?i=this.visibleColsService.getGroupAtDirection(e.column,t):(s=`getCol${t}`,i=this.visibleColsService[s](e.column)),!i)return;const{headerRowIndex:o}=e;if("filter"!==this.getHeaderRowType(o)){const e=[i];for(;i.getParent();)i=i.getParent(),e.push(i);i=e[e.length-1-o]}const{column:n,headerRowIndex:r}=this.getHeaderIndexToFocus(i,o);return{column:n,headerRowIndex:r}}getHeaderIndexToFocus(e,t){let i;if($e(e)&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let o=i;for(;o!==s;)t++,o=o.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some((e=>e.isSpanHeaderHeight()))}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s="column"===i;let o="filter"===i?e:e.getParent(),n=t-1,r=n;if(s&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;o&&o.isPadding();)o=o.getParent(),n--;r=n,n<0&&(o=e,n=t,r=void 0)}return{column:o,headerRowIndex:n,headerRowIndexWithoutSpan:r}}getColumnVisibleChild(e,t,i="After"){let s=e,o=t+1;const n=o;if("group"===this.getHeaderRowType(t)){const t=e.getDisplayedLeafColumns(),n="After"===i?t[0]:c(t),r=[];let l=n;for(;l.getParent()!==e;)l=l.getParent(),r.push(l);if(s=n,n.isSpanHeaderHeight())for(let e=r.length-1;e>=0;e--){const t=r[e];if(!t.isPadding()){s=t;break}o++}else s=c(r),s||(s=n)}return{column:s,headerRowIndex:o,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.visibleColsService.getAllCols(),s=i["start"===t?0:i.length-1];if(!s)return;const o=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);if("group"==o){return{headerRowIndex:e,column:this.visibleColsService.getColGroupAtLevel(s,e)}}return{headerRowIndex:null==o?-1:e,column:s}}},Uh=class extends I{constructor(){super(...arguments),this.beanName="localeService"}getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(t,i,s)=>e({key:t,defaultValue:i,variableValues:s});const t=this.gos.get("localeText");return(e,i,s)=>{let o=t&&t[e];if(o&&s&&s.length){let e=0;for(;!(e>=s.length);){if(-1===o.indexOf("${variable}"))break;o=o.replace("${variable}",s[e++])}}return o??i}}},Kh=class extends I{constructor(){super(...arguments),this.beanName="apiEventService",this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new L(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=this.gos.useAsyncEvents()&&!Nh.has(e),o=s?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){const i=this.frameworkEventWrappingService.unwrap(t),s=this.asyncEventListeners.get(e),o=!!s?.delete(i);o||this.syncEventListeners.get(e)?.delete(i),this.eventService.removeEventListener(e,i,o)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const i=(e,i)=>{Nh.has(e)&&t(e,i)},s=(e,i)=>{Nh.has(e)||t(e,i)};this.globalEventListenerPairs.set(e,{syncListener:i,asyncListener:s}),this.eventService.addGlobalListener(i,!1),this.eventService.addGlobalListener(s,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:i,asyncListener:s}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(s,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach(((e,i)=>{e.forEach((e=>this.eventService.removeEventListener(i,e,t))),e.clear()})),e.clear()}destroyGlobalListeners(e,t){e.forEach((e=>this.eventService.removeGlobalListener(e,t))),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach((({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)})),this.globalEventListenerPairs.clear()}},$h=class extends I{constructor(){super(...arguments),this.beanName="pageBoundsListener"}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages();const t={type:"paginationChanged",animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}calculatePages(){this.paginationService?this.paginationService.calculatePages():this.pageBoundsService.calculateBounds(0,this.rowModel.getRowCount()-1)}},jh=class extends I{constructor(){super(...arguments),this.beanName="pageBoundsService",this.pixelOffset=0}wireBeans(e){this.rowModel=e.rowModel}getFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getCurrentPageHeight(){return G(this.topRowBounds)||G(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}calculateBounds(e,t){this.topRowBounds=this.rowModel.getRowBounds(e),this.topRowBounds&&(this.topRowBounds.rowIndex=e),this.bottomRowBounds=this.rowModel.getRowBounds(t),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=t),this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=k(this.topRowBounds)?this.topRowBounds.rowTop:0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},qh=class extends I{constructor(){super(),this.beanName="ariaAnnouncementService",this.descriptionContainer=null,this.announceValue=Ce(this.announceValue.bind(this),200)}wireBeans(e){this.eGridDiv=e.eGridDiv}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),Et(t,"polite"),ft(t,"relevant","additions text"),function(e,t){ft(e,"atomic",t)}(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout((()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)}),50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(vi(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}},Yh=class extends I{constructor(){super(...arguments),this.beanName="columnAnimationService",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>this.gridBodyCtrl=e.gridBodyCtrl))}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush((()=>{this.active=!1}))}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push((()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)}))}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>t(this.executeNextFuncs)),0),window.setTimeout((()=>{e(),t(this.executeLaterFuncs)}),200)}))}},Qh=class extends I{constructor(){super(...arguments),this.beanName="columnHoverService"}setMouseOver(e){this.selectedColumns=e;this.eventService.dispatchEvent({type:"columnHoverChanged"})}clearMouseOver(){this.selectedColumns=null;this.eventService.dispatchEvent({type:"columnHoverChanged"})}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}},Xh=class extends I{constructor(){super(...arguments),this.beanName="overlayService",this.state=0,this.showInitialOverlay=!0}wireBeans(e){this.userComponentFactory=e.userComponentFactory,this.rowModel=e.rowModel,this.columnModel=e.columnModel}postConstruct(){const e=()=>this.updateOverlayVisibility();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e}),this.addManagedPropertyListener("loading",e)}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,this.updateOverlayVisibility()}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos.get("loading");(e||void 0===e&&!this.gos.get("suppressLoadingOverlay"))&&this.doShowLoadingOverlay()}showNoRowsOverlay(){this.showInitialOverlay=!1,this.gos.get("loading")||this.gos.get("suppressNoRowsOverlay")||this.doShowNoRowsOverlay()}hideOverlay(){this.showInitialOverlay=!1,this.gos.get("loading")||this.doHideOverlay()}updateOverlayVisibility(){let e=this.gos.get("loading");this.showInitialOverlay&&void 0===e&&!this.gos.get("suppressLoadingOverlay")&&(e=!this.gos.get("columnDefs")||!this.columnModel.isReady()||!this.gos.get("rowData")&&this.gos.isRowModelType("clientSide")),e?1!==this.state&&this.doShowLoadingOverlay():(this.showInitialOverlay=!1,this.rowModel.isEmpty()&&!this.gos.get("suppressNoRowsOverlay")&&this.gos.isRowModelType("clientSide")?2!==this.state&&this.doShowNoRowsOverlay():0!==this.state&&this.doHideOverlay())}doShowLoadingOverlay(){this.state=1,this.showOverlay(this.userComponentFactory.getLoadingOverlayCompDetails({}),"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}doShowNoRowsOverlay(){this.state=2,this.showOverlay(this.userComponentFactory.getNoRowsOverlayCompDetails({}),"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}doHideOverlay(){this.state=0,this.overlayWrapperComp.hideOverlay()}showOverlay(e,t,i){const s=e.newAgStackInstance();this.overlayWrapperComp.showOverlay(s,t,i)}},Jh=class extends I{constructor(){super(...arguments),this.beanName="rowCssClassCalculator"}wireBeans(e){this.stylingService=e.stylingService}getInitialRowClasses(e){const t=[];return k(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),b(t,this.processClassesFromGridOptions(e.rowNode)),b(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach((e=>t.push(e)))},s=this.gos.get("rowClass");if(s){if("function"==typeof s)return he("rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gos.getCallback("getRowClass");if(o){i(o({data:e.data,node:e,rowIndex:e.rowIndex}))}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,(e=>{t.push(e)}),(()=>{})),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}},Zh=class extends I{constructor(){super(...arguments),this.beanName="rowContainerHeightService",this.scrollY=0,this.uiBodyHeight=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=function(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=2*e;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}(),this.gos.get("debug")&&ae("RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.gos.get("debug")&&ae(`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}},ed=class extends I{constructor(){super(...arguments),this.beanName="rowNodeSorter"}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.showRowGroupColsService=e.showRowGroupColsService}postConstruct(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",(e=>this.isAccentedSort=e.currentValue)),this.addManagedPropertyListener("autoGroupColumnDef",(()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup()))}doFullSort(e,t){const i=e.map(((e,t)=>({currentPos:t,rowNode:e})));return i.sort(this.compareRowNodes.bind(this,t)),i.map((e=>e.rowNode))}compareRowNodes(e,t,i){const s=t.rowNode,o=i.rowNode;for(let t=0,i=e.length;t<i;t++){const i=e[t],n="desc"===i.sort,r=this.getValue(s,i.column),l=this.getValue(o,i.column);let a;const h=this.getComparator(i,s);a=h?h(r,l,s,o,n):_(r,l,this.isAccentedSort);if(!isNaN(a)&&0!==a)return"asc"===i.sort?a:-1*a}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(null!=s)return s;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const n=this.columnModel.getColDefCol(o);return n?n.getColDef().comparator:void 0}getValue(e,t){if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const i=e.allLeafChildren?.[0];return i?this.valueService.getValue(t,i,!1,!1):void 0}const i=this.showRowGroupColsService?.getShowRowGroupCol(t.getId());if(!i)return;return e.groupData?.[i.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}},td=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const o=e.childrenAfterGroup[s];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach((e=>this.nodeIdsToColumns[i.id][e.getId()]=!0)),i=i.parent}linkPathItems(e,t){let i=e;for(let e=0;e<t;e++){const e=this.mapToItems[i.id],t=this.mapToItems[i.parent.id];t.children||(t.children=[]),t.children.push(e),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter((e=>i[e.getId()]))}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter((e=>!i[e.getId()]))}},id=class extends I{constructor(){super(...arguments),this.beanName="selectionService",this.selectedNodes=new Map,this.selectionCtx=new ta}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.selectionCtx.init(this.rowModel),this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],(()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})})),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes(),this.selectionCtx.reset()}isMultiselect(){return"multiple"===this.rowSelection}overrideSelectionValue(e,t){if(!Hh(t))return e;const i=this.selectionCtx.getRoot();return!i||(i.isSelected()??!1)}setNodesSelected(e){const{newValue:t,clearSelection:i,suppressFinishActions:s,rangeSelect:o,nodes:n,event:r,source:l}=e;if(0===n.length)return 0;if(n.length>1&&!this.isMultiselect())return he("cannot multi select while rowSelection='single'"),0;const a=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,h=n.map((e=>e.footer?e.sibling:e));if(o){if(h.length>1)return he("cannot range select while selecting multiple rows"),0;const e=h[0],i=this.overrideSelectionValue(t,l);if(this.isMultiselect()){if(this.selectionCtx.isInRange(e)){const t=this.selectionCtx.truncate(e);return i&&this.selectRange(t.discard,!1,l),this.selectRange(t.keep,i,l)}if(this.selectionCtx.getRoot()!==e){const t=this.selectionCtx.extend(e,this.groupSelectsChildren);return i&&this.selectRange(t.discard,!1,l),this.selectRange(t.keep,i,l)}}else;}s||this.selectionCtx.setRoot(h[0]);let d=0;for(let e=0;e<h.length;e++){const i=h[e];if(!(a&&i.group)){i.selectThisNode(t,r,l)&&d++}this.groupSelectsChildren&&i.childrenAfterGroup?.length&&(d+=this.selectChildren(i,t,a,l))}if(!s){t&&(i||!this.isMultiselect())&&(d+=this.clearOtherNodes(h[0],l)),d>0&&(this.updateGroupsFromChildrenSelections(l),this.dispatchSelectionChanged(l))}return d}selectRange(e,t,i){let s=0;return e.forEach((e=>{if(e.group&&this.groupSelectsChildren)return;e.selectThisNode(t,void 0,i)&&s++})),s>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i)),s}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return G(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}getSelectedNodes(){const e=[];return this.selectedNodes.forEach((t=>{t&&e.push(t)})),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach((t=>{t&&t.data&&e.push(t.data)})),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach(((i,s)=>{i&&e(i)&&t.set(s,i)})),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const i=this.rowModel.getRootNode();t||(t=new td(!0,i)).setInactive();let s=!1;return t.forEachChangedNodeDepthFirst((t=>{if(t!==i){const i=t.calculateSelectedFromChildren();s=t.selectThisNode(null!==i&&i,void 0,e)||s}})),s}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach((o=>{if(o&&o.id!==e.id){const e=this.selectedNodes.get(o.id);s+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&i.set(o.parent.id,o.parent)}})),i.forEach((e=>{const i=e.calculateSelectedFromChildren();e.selectThisNode(null!==i&&i,void 0,t)})),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(k(t)&&e.id!==t.id&&t){const i=t.id;this.selectedNodes.get(i)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes?.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(i){for(let s=0,o=i.length;s<o;s++){const o=i[s];if(o.isSelected())t.push(o);else{const t=o;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return this.selectedNodes.forEach((t=>{t&&e++})),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,s),i="clientSide"===this.rowModel.getType(),{source:s,justFiltered:o,justCurrentPage:n}=e;if(n||o){if(!i)return void de("selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(o,n).forEach(t)}else this.selectedNodes.forEach((e=>{e&&t(e)})),this.reset(s);this.selectionCtx.reset(),i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)}getSelectedCounts(e,t){let i=0,s=0;return this.getNodesToSelect(e,t).forEach((e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?i++:e.selectable&&s++)})),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return(0!==i||0!==s)&&(i>0&&s>0?null:i>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter((e=>e.selectable)).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.forEachNodeOnPage((e=>{if(e.group)if(e.expanded)this.groupSelectsChildren||i.push(e);else{const t=e=>{i.push(e),e.childrenAfterFilter?.length&&e.childrenAfterFilter.forEach(t)};t(e)}else i.push(e)})),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter((e=>{i.push(e)})),i):(s.forEachNode((e=>{i.push(e)})),i)}forEachNodeOnPage(e){const t=this.pageBoundsService.getFirstRow(),i=this.pageBoundsService.getLastRow();for(let s=t;s<=i;s++){const t=this.rowModel.getRow(s);t&&e(t)}}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e,o=this.getNodesToSelect(i,s);o.forEach((e=>e.selectThisNode(!0,void 0,t))),this.selectionCtx.setRoot(o[0]??null),this.selectionCtx.setEndRange(c(o)??null),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.dispatchSelectionChanged(t)}getSelectionState(){const e=[];return this.selectedNodes.forEach((t=>{t?.id&&e.push(t.id)})),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),s=[];this.rowModel.forEachNode((e=>{i.has(e.id)&&s.push(e)})),this.setNodesSelected({newValue:!0,nodes:s,source:t})}dispatchSelectionChanged(e){const t={type:"selectionChanged",source:e};this.eventService.dispatchEvent(t)}},sd=class extends I{constructor(){super(...arguments),this.beanName="selectableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.addManagedPropertyListener("isRowSelectable",(()=>this.updateSelectable()))}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const s=this.gos.get("groupSelectsChildren"),o="clientSide"===this.rowModel.getType()&&s,n=[],r=t=>{if(e&&!t.group)return;if(o&&t.group){const e=t.childrenAfterGroup.some((e=>!0===e.selectable));return void t.setRowSelectable(e,!0)}const s=!i||i(t);t.setRowSelectable(s,!0),!s&&t.isSelected()&&n.push(t)};if(o){const e=this.rowModel;new td(!1,e.getRootNode()).forEachChangedNodeDepthFirst(r,!0,!0)}else this.rowModel.forEachNode(r);n.length&&this.selectionService.setNodesSelected({nodes:n,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof id&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}},od=["asc","desc",null],nd=class extends I{constructor(){super(...arguments),this.beanName="sortController"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.showRowGroupColsService=e.showRowGroupColsService}progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){"asc"!==t&&"desc"!==t&&(t=null);let o=[e];if(this.gos.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.funcColsService.getSourceColumnsForGroupColumn(e),i=t?.filter((e=>e.isSortable()));i&&(o=[e,...i])}o.forEach((e=>e.setSort(t,s)));const n=[];if(!((i||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"))){const e=this.clearSortBarTheseColumns(o,s);n.push(...e)}this.updateSortIndex(e),n.push(...o),this.dispatchSortChangedEvents(s,n)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.showRowGroupColsService?.getShowRowGroupCol(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getAllCols().forEach((e=>e.setSortIndex(null)));const n=o.filter((e=>(!t||!e.getColDef().showRowGroup)&&e!==s));(s.getSort()?[...n,s]:n).forEach(((e,t)=>{e.setSortIndex(t)}))}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const e=this.columnModel.getAllCols().filter((e=>!!e.getSort()));return e&&e.length>0}dispatchSortChangedEvents(e,t){const i={type:"sortChanged",source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getAllCols().forEach((s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))})),i}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gos.get("sortingOrder")?this.gos.get("sortingOrder"):od,!Array.isArray(t)||t.length<=0)return he(`sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,o=i==t.length-1;let n;return n=s||o?t[0]:t[i+1],od.indexOf(n)<0?(he("invalid sort type ",n),null):n}getIndexedSortMap(){let e=this.columnModel.getAllCols().filter((e=>!!e.getSort()));if(this.columnModel.isPivotMode()){const t=this.gos.isColumnsSortingCoupledToGroup();e=e.filter((e=>{const i=!!e.getAggFunc(),s=!e.isPrimary(),o=t?this.showRowGroupColsService?.getShowRowGroupCol(e.getId()):e.getColDef().showRowGroup;return i||s||o}))}const t=this.funcColsService.getRowGroupColumns().filter((e=>!!e.getSort())),i={};e.forEach(((e,t)=>i[e.getId()]=t)),e.sort(((e,t)=>{const s=e.getSortIndex(),o=t.getSortIndex();if(null!=s&&null!=o)return s-o;if(null==s&&null==o){return i[e.getId()]>i[t.getId()]?1:-1}return null==o?-1:1}));const s=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;s&&(e=[...new Set(e.map((e=>this.showRowGroupColsService?.getShowRowGroupCol(e.getId())??e)))]);const o=new Map;return e.forEach(((e,t)=>o.set(e,t))),s&&t.forEach((e=>{const t=this.showRowGroupColsService.getShowRowGroupCol(e.getId());o.set(e,o.get(t))})),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort((([e,t],[i,s])=>t-s)).map((([e])=>e))}getSortModel(){return this.getColumnsWithSortingOrdered().filter((e=>e.getSort())).map((e=>({sort:e.getSort(),colId:e.getId()})))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter((e=>e.getSort())).map((e=>({sort:e.getSort(),column:e})))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.funcColsService.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSort();const i=null!=e.getColDef().field||!!e.getColDef().valueGetter?[e,...t]:t,s=i[0].getSort();return i.every((e=>e.getSort()==s))?s:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}},rd=class extends I{constructor(){super(...arguments),this.beanName="syncService",this.waitingForColumns=!1}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.rowModel=e.rowModel}postConstruct(){this.addManagedPropertyListener("columnDefs",(e=>this.setColumnDefs(e)))}start(){this.ctrlsService.whenReady((()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()}))}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=Ji.__isRegistered("@ag-grid-enterprise/core",this.gridId);this.gos.get("debug")&&ae(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){this.eventService.dispatchEvent({type:"gridReady"})}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.columnModel.setColumnDefs(t,xe(e.source))}},ld=class extends I{constructor(){super(...arguments),this.beanName="changeDetectionService"}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer}postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),o=new td(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst((e=>{i.push(e)}))}this.rowRenderer.refreshCells({rowNodes:i})}},ad=class extends I{constructor(){super(...arguments),this.beanName="expressionService",this.expressionToFunctionCache={}}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);de("value should be either a string or a function",e)}evaluateExpression(e,t){try{const i=this.createExpressionFunction(e);return i(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(i){return ae("Processing of the expression failed"),ae("Expression = ",e),ae("Params = ",t),ae("Exception = ",i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}},hd=class extends I{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}},dd=class extends I{constructor(){super(...arguments),this.beanName="valueService",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionService=e.expressionService,this.columnModel=e.columnModel,this.valueCache=e.valueCache,this.dataTypeService=e.dataTypeService}postConstruct(){this.initialised||this.init()}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=e=>this.callColumnCellValueChangedHandler(e),t=this.gos.useAsyncEvents();this.eventService.addEventListener("cellValueChanged",e,t),this.addDestroyFunc((()=>this.eventService.removeEventListener("cellValueChanged",e,t))),this.addManagedPropertyListener("treeData",(e=>this.isTreeData=e.currentValue))}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),n=o.field,r=e.getColId(),l=t.data;let a;const h=t.groupData&&void 0!==t.groupData[r],d=!s&&t.aggData&&void 0!==t.aggData[r],c=this.isSsrm&&s&&!!e.getColDef().aggFunc,u=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?a=this.executeFilterValueGetter(o.filterValueGetter,l,e,t):this.isTreeData&&d?a=t.aggData[r]:this.isTreeData&&o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):this.isTreeData&&n&&l?a=Q(l,n,e.isFieldContainsDots()):h?a=t.groupData[r]:d?a=t.aggData[r]:o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):u?a=Q(l,t.field,e.isFieldContainsDots()):n&&l&&!c&&(a=Q(l,n,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof a&&0===a.indexOf("=")){const i=a.substring(1);a=this.executeValueGetter(i,l,e,t)}if(null==a){const i=this.getOpenedGroup(t,e);if(null!=i)return i}return a}parseValue(e,t,i,s){const o=e.getColDef(),n=this.gos.addGridCommonParams({node:t,data:t?.data,oldValue:s,newValue:i,colDef:o,column:e}),r=o.valueParser;return k(r)?"function"==typeof r?r(n):this.expressionService.evaluate(r,n):i}formatValue(e,t,i,s,o=!0){let n,r=null;const l=e.getColDef();if(s?n=s:o&&(n=l.valueFormatter),n){const s=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:l,column:e});r="function"==typeof n?n(s):this.expressionService.evaluate(n,s)}else if(l.refData)return l.refData[i]||"";return null==r&&Array.isArray(i)&&(r=i.join(", ")),r}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const i=t.getColDef().showRowGroup;let s=e.parent;for(;null!=s;){if(s.rowGroupColumn&&(!0===i||i===s.rowGroupColumn.getColId()))return s.key;s=s.parent}}setValue(e,t,i,s){const o=this.columnModel.getColDefCol(t);if(!e||!o)return!1;G(e.data)&&(e.data={});const{field:n,valueSetter:r}=o.getColDef();if(G(n)&&G(r))return he("you need either field or valueSetter set on colDef for editing to work"),!1;if(this.dataTypeService&&!this.dataTypeService.checkType(o,i))return he("Data type of the new value does not match the cell data type of the column"),!1;const l=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o});let a;if(l.newValue=i,a=k(r)?"function"==typeof r?r(l):this.expressionService.evaluate(r,l):this.setValueUsingField(e.data,n,i,o.isFieldContainsDots()),void 0===a&&(a=!0),!a)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),l.newValue=this.getValue(o,e);const h={type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:l.column,api:l.api,colDef:l.colDef,context:l.context,data:e.data,node:e,oldValue:l.oldValue,newValue:l.newValue,value:l.newValue,source:s};return this.eventService.dispatchEvent(h),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing((()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,context:e.context})}))}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(s){const s=t.split(".");let n=e;for(;s.length>0&&n;){const e=s.shift();0===s.length?(o=n[e]===i,o||(n[e]=i)):n=n[e]}}else o=e[t]===i,o||(e[t]=i);return!o}executeFilterValueGetter(e,t,i,s){const o=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return"function"==typeof e?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,s){const o=i.getColId(),n=this.valueCache.getValue(s,o);if(void 0!==n)return n;const r=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let l;return l="function"==typeof e?e(r):this.expressionService.evaluate(e,r),this.valueCache.setValue(s,o,l),l}getValueCallback(e,t){const i=this.columnModel.getColDefCol(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;if(s){o=s(this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data}))}return"string"==typeof o||null==o||(o=String(o),"[object Object]"===o&&he("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}},cd=class{};function ud(e){cd.gridOptions=e}function gd(e,t,i){if(!t)return de("No gridOptions provided to createGrid"),{};const s=(new Cd).create(e,t,(t=>{const i=new Ua(e);t.createBean(i)}),void 0,i);if(!Object.isFrozen(t)&&!i?.frameworkOverrides){const e="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{de(`gridOptions.api is no longer supported. See ${e}.`)},configurable:!0})}return s}cd.gridOptions=void 0;var pd=class{constructor(e,t,i){if(he("Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions."),!t)return void de("No gridOptions provided to the grid");this.gridOptions=t;const s=(new Cd).create(e,t,(t=>{const i=new Ua(e);t.createBean(i).addDestroyFunc((()=>{this.destroy()}))}),void 0,i);this.gridOptions.api=s}destroy(){this.gridOptions&&(this.gridOptions.api?.destroy(),delete this.gridOptions.api)}},md=1,Cd=class{create(e,t,i,s,o){let n={};cd.gridOptions?(Y(n,cd.gridOptions,!0,!0),n={...n,...t}):n=t;const r=function(e){const t={};return Object.entries(e).forEach((([e,i])=>{const s=Vh(e,i);t[e]=s})),t}(n),l=r.gridId??String(md++),a=this.getRegisteredModules(o,l),h=this.createBeansList(r.rowModelType,a,l),d=this.createProvidedBeans(e,r,o);if(!h)return void de("Failed to create grid.");const c=new zs({providedBeanInstances:d,beanClasses:h,gridId:l,beanInitComparator:Ea,beanDestroyComparator:Da,derivedBeans:[fa]});return this.registerModuleUserComponents(c,a),this.registerControllers(c,a),this.registerModuleApiFunctions(c,a),i(c),c.getBean("syncService").start(),s&&s(c),c.getBean("gridApi")}registerControllers(e,t){const i=e.getBean("ctrlsFactory");t.forEach((e=>{e.controllers&&e.controllers.forEach((e=>i.register(e)))}))}getRegisteredModules(e,t){const i=e?e.modules:null,s=Ji.__getRegisteredModules(t),o=[],n={},r=(e,t,i)=>{var s;n[(s=t).moduleName]||(n[s.moduleName]=!0,o.push(s),Ji.__register(s,e,i)),t.dependantModules&&t.dependantModules.forEach((t=>r(e,t,i)))};return r(!!i?.length||!Ji.__isPackageBased(),kh,void 0),i&&i.forEach((e=>r(!0,e,t))),s&&s.forEach((e=>r(!Ji.__isPackageBased(),e,void 0))),o}registerModuleUserComponents(e,t){const i=this.extractModuleEntity(t,(e=>e.userComponents?e.userComponents:[])),s=e.getBean("userComponentRegistry");i.forEach((e=>{s.registerDefaultComponent(e.name,e.classImp)}))}registerModuleApiFunctions(e,t){const i=e.getBean("apiFunctionService");t.forEach((e=>{const t=e.apiFunctions??{};Object.keys(t).forEach((e=>{i?.addFunction(e,t[e])}))}))}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;G(s)&&(s=new ua);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createBeansList(e="clientSide",t,i){const s=t.filter((t=>!t.rowModel||t.rowModel===e)),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[e])return void de("Could not find row model for rowModelType = ",e);if(!Ji.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const n=[Ia,xa,_h,Gh,ma,fs,Ra,Fa,gl,Bs,Zh,cl,Uh,Ql,Xs,Ye,Ba,zh,da,id,Te,On,jh,$h,ql,ad,De,dl,hd,dd,$l,ul,js,Wa,hl,Ga,ga,ia,rl,nd,Qh,Yh,sd,ld,pl,va,Jh,ed,Ta,za,Aa,Ma,rd,Xh,Cl,Kh,qh,fl,Oe,wa,Ge,Ie,Sa,ya,Ue,Le,ze,ba,_e],r=this.extractModuleEntity(s,(e=>e.beans?e.beans:[]));n.push(...r);const l=[];return n.forEach((e=>{l.indexOf(e)<0&&l.push(e)})),l}extractModuleEntity(e,t){return[].concat(...e.map(t))}},fd=class extends I{constructor(){super(...arguments),this.beanName="rowModelHelperService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){const e=this.rowModel;switch(e.getType()){case"clientSide":this.clientSideRowModel=e;break;case"infinite":this.infiniteRowModel=e;break;case"serverSide":this.serverSideRowModel=e}}getClientSideRowModel(){return this.clientSideRowModel}getInfiniteRowModel(){return this.infiniteRowModel}getServerSideRowModel(){return this.serverSideRowModel}};var vd={version:dn,moduleName:"@ag-grid-community/csrm-ssrm-shared-api",apiFunctions:{expandAll:function(e){e.expansionService.expandAll(!0)},collapseAll:function(e){e.expansionService.expandAll(!1)},onRowHeightChanged:function(e){const t=e.rowModelHelperService?.getClientSideRowModel(),i=e.rowModelHelperService?.getServerSideRowModel();t?t.onRowHeightChanged():i&&i.onRowHeightChanged()}}},wd={version:dn,moduleName:"@ag-grid-community/ssrm-infinite-shared-api",apiFunctions:{setRowCount:function(e,t,i){const s=e.rowModelHelperService?.getServerSideRowModel();if(s)return e.funcColsService.isRowGroupEmpty()?void s.setRowCount(t,i):void de("setRowCount cannot be used while using row grouping.");const o=e.rowModelHelperService?.getInfiniteRowModel();o&&o.setRowCount(t,i)},getCacheBlockState:function(e){return e.rowNodeBlockLoader?.getBlockState()??{}}}},Sd=class{wrap(e,t,i=[],s){const o=this.createWrapper(e,s);return t.forEach((e=>{this.createMethod(o,e,!0)})),i.forEach((e=>{this.createMethod(o,e,!1)})),o}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&he("Framework component is missing the method "+t+"()"),null)}}};function yd(e,t){if(!e)return!1;const i=(e,i)=>{const s=t[e.id],o=t[i.id],n=void 0!==s,r=void 0!==o;return n&&r?s-o:!n&&!r?e.__objectId-i.__objectId:n?1:-1};let s,o,n=!1;for(let t=0;t<e.length-1;t++)if(s=e[t],o=e[t+1],i(s,o)>0){n=!0;break}return!!n&&(e.sort(i),!0)}var bd=class{};bd.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},bd.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],bd.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var Rd=(e=>(e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd",e))(Rd||{}),Fd=void 0===i.g?{}:i.g;Fd.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,Fd.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,Fd.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,Fd.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,Fd.Node="undefined"==typeof Node?{}:Node,Fd.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent},209:function(e,t,i){var s,o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(a,{BaseCreator:()=>d,BaseGridSerializingSession:()=>c,CsvCreator:()=>f,CsvExportModule:()=>P,Downloader:()=>p,GridSerializer:()=>y,RowType:()=>S,XmlFactory:()=>M,ZipContainer:()=>B,_CsvExportCoreModule:()=>R}),e.exports=(s=a,((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of r(t))l.call(e,a)||a===i||o(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s));var h=i(423),d=class extends h.BeanStub{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},c=class{constructor(e){this.groupColumns=[];const{columnModel:t,funcColsService:i,columnNameService:s,valueService:o,gos:n,processCellCallback:r,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:h}=e;this.columnModel=t,this.funcColsService=i,this.columnNameService=s,this.valueService=o,this.gos=n,this.processCellCallback=r,this.processHeaderCallback=l,this.processGroupHeaderCallback=a,this.processRowGroupCallback=h}prepare(e){this.groupColumns=e.filter((e=>!!e.getColDef().showRowGroup))}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,i,s,o){const n=this.gos.get("groupHideOpenParents")&&!o.footer||!this.shouldRenderGroupSummaryCell(o,e,t)?this.valueService.getValue(e,o):this.createValueForGroupNode(e,o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){if(!(e&&e.group))return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=e.groupData?.[t.getId()])return!0;if(this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.funcColsService.getRowGroupColumns()[0].getId()}}const s=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&s}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnNameService.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),o=t=>{if(i||s)return t.key;const o=t.groupData?.[e.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport?this.valueService.formatValue(t.rowGroupColumn,t,o)??o:o},n=t.footer,r=[o(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,r.push(o(t));const l=r.reverse().join(" -> ");return n?`Total ${l}`:l}processCell(e){const{accumulatedRowIndex:t,rowNode:i,column:s,value:o,processCellCallback:n,type:r}=e;return n?{value:n(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:s,node:i,value:o,type:r,parseValue:e=>this.valueService.parseValue(s,i,e,this.valueService.getValue(s,i)),formatValue:e=>this.valueService.formatValue(s,i,e)??e}))??""}:!1!==s.getColDef().useValueFormatterForExport?{value:o??"",valueFormatted:this.valueService.formatValue(s,i,o)}:{value:o??""}}},u=i(423),g=i(423),p=class{static download(e,t){const i=document.defaultView||window;if(!i)return void(0,g._warnOnce)("There is no `window` associated with the current `document`");const s=document.createElement("a"),o=i.URL.createObjectURL(t);s.setAttribute("href",o),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout((()=>{i.URL.revokeObjectURL(o)}),0)}},m=i(423),C=class extends c{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach((e=>{this.beginNewLine(),e.forEach(((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)}))})))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){0!=t&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():((0,m._warnOnce)("unknown value type during csv conversion"),t="");return'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},f=class extends d{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.gridSerializer=e.gridSerializer}postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void(0,u._warnOnce)("Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\ufeff",i],{type:"text/plain"}),o="function"==typeof t.fileName?t.fileName(this.gos.getGridCommonParams()):t.fileName;p.download(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:n}=this,{processCellCallback:r,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:h,suppressQuotes:d,columnSeparator:c}=e;return new C({columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:n,processCellCallback:r||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:h||void 0,suppressQuotes:d||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}},v=i(423);var w=i(423),S=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(S||{}),y=class extends w.BeanStub{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.selectionService=e.selectionService,this.rowNodeSorter=e.rowNodeSorter,this.sortController=e.sortController}serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:o}=t,n=this.getColumnsToExport(i,o,s);return(0,w._compose)(this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const o=t.shouldRowBeSkipped||(()=>!1),n=this.gos.get("groupRemoveSingleChildren"),r=this.gos.get("groupRemoveLowestSingleChildren"),l=null!=t.rowPositions||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!l,h=this.columnModel.isPivotMode()?s.leafGroup:!s.group,d=!!s.footer,c=r&&s.leafGroup,u=1===s.allChildrenCount&&1===s.childrenAfterGroup?.length&&(n||c);if(!h&&!d&&(t.skipRowGroups||u||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned)return;if(-1===s.level&&!h&&!d)return;if(o(this.gos.addGridCommonParams({node:s})))return;const g=e.onNewBodyRow(s);if(i.forEach(((e,t)=>{g.onColumn(e,t,s)})),t.getCustomContentBelowRow){const i=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));i&&e.addCustomContent(i)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new w.GroupInstanceIdCreator,o=this.visibleColsService.createGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0});this.recursivelyAddHeaderGroups(o,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const e=i.onNewHeaderRow();t.forEach(((t,i)=>{e.onColumn(t,i,void 0)}))}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter((e=>"top"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex))).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,o=s.getType(),n="clientSide"===o,r="serverSide"===o,l=!n&&e.onlySelected,a=this.processRow.bind(this,i,e,t),{exportedRows:h="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter((e=>null==e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>s.getRow(e.rowIndex))).forEach(a);else if(this.columnModel.isPivotMode())n?s.forEachPivotNode(a,!0):r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||l){const e=this.selectionService.getSelectedNodes();this.replicateSortedOrder(e),e.forEach(a)}else"all"===h?s.forEachNode(a):n||r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(e,s)=>null!=e.rowIndex&&null!=s.rowIndex?e.rowIndex-s.rowIndex:e.level===s.level?e.parent?.id===s.parent?.id?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:e.rowIndex??-1},{rowNode:s,currentPos:s.rowIndex??-1}):i(e.parent,s.parent):e.level>s.level?i(e.parent,s):i(e,s.parent);e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter((e=>"bottom"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex))).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getColsForKeys(i);const o=this.gos.get("treeData");let n=[];return n=e&&!s?this.columnModel.getCols():this.visibleColsService.getAllCols(),t&&!o&&(n=n.filter((e=>e.getColId()!==w.GROUP_AUTO_COLUMN_ID))),n}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach((e=>{const t=e;t.getChildren&&t.getChildren().forEach((e=>s.push(e)))})),e.length>0&&(0,w.isColumnGroup)(e[0])&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let o=0;t.forEach((e=>{const t=e;let n;n=i?i(this.gos.addGridCommonParams({columnGroup:t})):this.columnNameService.getDisplayNameForColumnGroup(t,"header");const r=t.getLeafColumns().reduce(((e,t,i,s)=>{let o=(0,w._last)(e);return"open"===t.getColumnGroupShow()?o&&null==o[1]||(o=[i],e.push(o)):o&&null==o[1]&&(o[1]=i-1),i===s.length-1&&o&&null==o[1]&&(o[1]=i),e}),[]);s.onColumn(t,n||"",o++,t.getLeafColumns().length-1,r)}))}},b="32.0.0",R={version:b,moduleName:`${v.ModuleNames.CsvExportModule}-core`,beans:[f,y]},F={version:b,moduleName:`${v.ModuleNames.CsvExportModule}-api`,apiFunctions:{getDataAsCsv:function(e,t){return e.csvCreator?.getDataAsCsv(t)},exportDataAsCsv:function(e,t){e.csvCreator?.exportDataAsCsv(t)}},dependantModules:[R]},P={version:b,moduleName:v.ModuleNames.CsvExportModule,dependantModules:[R,F]},E="\r\n";function D(e,t,i){if(!t&&""!==t&&0!==t)return"";let s=t;return"boolean"==typeof t&&i&&(s=i(t)),` ${e}="${s}"`}var M=class{static createHeader(e={}){const t=["version"];e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone");return`<?xml ${t.map((t=>`${t}="${e[t]}"`)).join(" ")} ?>`}static createXml(e,t){let i="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach((e=>{Object.keys(e.map).forEach((s=>{i+=D(e.prefix+s,e.map[s],t)}))})),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach((s=>{i+=D(s,e.properties.rawMap[s],t)})));let s="<"+e.name+i;return e.children||null!=e.textNode?null!=e.textNode?s+">"+e.textNode+"</"+e.name+">"+E:(s+=">\r\n",e.children&&e.children.forEach((e=>{s+=this.createXml(e,t)})),s+"</"+e.name+">"+E):s+"/>"+E}},T=i(423),x=async e=>{const t=new Blob([e]),{size:i,content:s}=await(async e=>{let t=0;const i=[],s=new WritableStream({write:e=>{i.push(e),t+=e.length}}),o=new ReadableStream({start:t=>{const i=new FileReader;i.onload=e=>{e.target?.result&&t.enqueue(e.target.result),t.close()},i.readAsArrayBuffer(e)}}),n=new window.CompressionStream("deflate-raw");return await o.pipeThrough(n).pipeTo(s),{size:t,content:new Blob(i)}})(t);return{size:i,content:new Uint8Array(await s.arrayBuffer())}};function A(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}var I=e=>{if(!e.length)return 0;let t=~0,i=0,s=0,o=0;for(let n=0;n<e.length;n++)i=e[n],s=255&(t^i),o=O[s],t=t>>>8^o;return~t},L=e=>e.length?I("string"==typeof e?(new TextEncoder).encode(e):e):0,O=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),k=(e,t,i,s,o,n)=>{const{content:r,path:l,created:a}=e,h=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(a),d=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(a),c=L(o),u=void 0!==n?n:s,g=(0,T._utf8_encode)(l),p=g!==l;let m="";if(p){const e=A(1,1)+A(L(g),4)+g;m="up"+A(e.length,2)+e}const C="\0"+(p?"\0\b":"\0\0")+A(t?8:0,2)+A(h,2)+A(d,2)+A(u?c:0,4)+A(n??s,4)+A(s,4)+A(g.length,2)+A(m.length,2),f="PK"+C+g+m,v="PK\0"+C+"\0\0\0\0\0\0"+(r?"\0\0\0\0":"\0\0\0")+A(i,4)+g+m;return{localFileHeader:Uint8Array.from(f,(e=>e.charCodeAt(0))),centralDirectoryHeader:Uint8Array.from(v,(e=>e.charCodeAt(0)))}},G=e=>{let t;if("string"==typeof e){const i=atob(e.split(";base64,")[1]);t=Uint8Array.from(i,(e=>e.charCodeAt(0)))}else t=e;return{size:t.length,content:t}},N=async(e,t)=>{const{content:i}=e,{size:s,content:o}=i?G(i):{size:0,content:Uint8Array.from([])};let n,r,l=!1;if("file"===e.type&&o&&s>0){const e=await x(o);n=e.content,r=e.size,l=!0}return{...k(e,l,t,s,o,r),content:n||o,isCompressed:l}},H=(e,t)=>{const{content:i}=e,{content:s}=i?G(i):{content:Uint8Array.from([])};return{...k(e,!1,t,s.length,s,void 0),content:s,isCompressed:!1}},B=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:(new TextEncoder).encode(t),isBase64:i,type:"file"})}static async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=0,i=0;for(const s of e){const{localFileHeader:e,centralDirectoryHeader:o,content:n}=s;t+=e.length+n.length,i+=o.length}const s=new Uint8Array(t),o=new Uint8Array(i);let n=0,r=0;for(const t of e){const{localFileHeader:e,centralDirectoryHeader:i,content:l}=t;s.set(e,n),n+=e.length,s.set(l,n),n+=l.length,o.set(i,r),r+=i.length}const l=((e,t,i)=>{const s="PK\0\0\0\0"+A(e,2)+A(e,2)+A(t,4)+A(i,4)+"\0\0";return Uint8Array.from(s,(e=>e.charCodeAt(0)))})(e.length,i,t),a=new Uint8Array(s.length+o.length+l.length);return a.set(s),a.set(o,s.length),a.set(l,s.length+o.length),a}static async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=await N(s,i),{localFileHeader:o,content:n}=e;t.push(e),i+=o.length+n.length}return this.packageFiles(t)}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=H(s,i),{localFileHeader:o,content:n}=e;t.push(e),i+=o.length+n.length}return this.packageFiles(t)}};B.folders=[],B.files=[]},773:function(e,t,i){var s,o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(a,{InfiniteRowModelModule:()=>w}),e.exports=(s=a,((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of r(t))l.call(e,a)||a===i||o(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s));var h=i(423),d=i(423),c=i(423),u=i(423),g=class extends u.RowNodeBlock{wireBeans(e){this.beans=e}constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){(0,u._exists)(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();(0,u._missing)(this.params.datasource.getRows)?(0,u._warnOnce)("datasource is missing getRows method"):window.setTimeout((()=>{this.params.datasource.getRows(e)}),0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach(((s,o)=>{this.startRow+o<i&&e(s,t.next())}))}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new u.RowNode(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach(((t,i)=>{const s=e.rowData?e.rowData[i]:void 0;!t.id&&t.alreadyRendered&&s&&(this.rowNodes[i]=new u.RowNode(this.beans),this.rowNodes[i].setRowIndex(t.rowIndex),this.rowNodes[i].setRowTop(t.rowTop),this.rowNodes[i].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],s,this.startRow+i)}));const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroy(){this.rowNodes.forEach((e=>{e.clearRowTopAndRowIndex()})),super.destroy()}},p=class extends c.BeanStub{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}wireBeans(e){this.rowRenderer=e.rowRenderer,this.focusService=e.focusService}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new g(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach((e=>e.setStateWaitingToLoad())),this.params.rowNodeBlockLoader.checkBlockToLoad())}destroy(){this.getBlocksInOrder().forEach((e=>this.destroyBlock(e))),super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.gos.get("debug")&&(0,c._log)(`InfiniteCache - onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter((t=>t!=e));t.sort(((e,t)=>t.getLastAccessed()-e.getLastAccessed()));const i=this.params.maxBlocksInCache>0,s=i?this.params.maxBlocksInCache-1:null;t.forEach(((e,t)=>{if("needsLoading"===e.getState()&&t>=1||!!i&&t>=s){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}}))}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,(0,c._exists)(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize==0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new c.NumberSequence;this.getBlocksInOrder().forEach((i=>i.forEachNode(e,t,this.rowCount)))}getBlocksInOrder(){return(0,c._getAllValuesInObject)(this.blocks).sort(((e,t)=>e.getId()-t.getId()))}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:"storeUpdated"};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach((t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)})),e.length>0&&e.forEach((e=>this.destroyBlock(e)))}purgeCache(){this.getBlocksInOrder().forEach((e=>this.removeBlockFromCache(e))),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,o=!1;const n=new c.NumberSequence;let r=!1;this.getBlocksInOrder().forEach((l=>{r||(o&&s+1!==l.getId()?r=!0:(s=l.getId(),l.forEachNode((s=>{const n=s===e||s===t;(o||n)&&i.push(s),n&&(o=!o)}),n,this.rowCount)))}));return r||o?[]:i}},m=class extends d.BeanStub{constructor(){super(...arguments),this.beanName="rowModel"}wireBeans(e){this.filterManager=e.filterManager,this.sortController=e.sortController,this.selectionService=e.selectionService,this.rowRenderer=e.rowRenderer,this.rowNodeBlockLoader=e.rowNodeBlockLoader}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc((()=>this.destroyCache())),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&(0,d._warnOnce)("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onCacheUpdated.bind(this)}),this.addManagedPropertyListener("datasource",(()=>this.setDatasource(this.gos.get("datasource")))),this.addManagedPropertyListener("cacheBlockSize",(()=>this.resetCache())),this.addManagedPropertyListener("rowHeight",(()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()}))}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!(0,d._jsonEquals)(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;null!=this.gos.getRowIdCallback()||this.selectionService.reset("rowDataChanged"),this.resetCache()}createModelUpdatedEvent(){return{type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager?.getFilterModel()??{},sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new d.NumberSequence},this.infiniteCache=this.createBean(new p(this.cacheParams)),this.eventService.dispatchEventOnce({type:"rowCountReady"});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode((e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}));const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode((i=>{i.id===e&&(t=i)})),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};var C="32.0.0",f={version:C,moduleName:`${h.ModuleNames.InfiniteRowModelModule}-core`,rowModel:"infinite",beans:[m],dependantModules:[h._RowNodeBlockModule]},v={version:C,moduleName:`${h.ModuleNames.InfiniteRowModelModule}-api`,beans:[h.RowModelHelperService],apiFunctions:{refreshInfiniteCache:function(e){e.rowModelHelperService?.getInfiniteRowModel()?.refreshCache()},purgeInfiniteCache:function(e){e.rowModelHelperService?.getInfiniteRowModel()?.purgeCache()},getInfiniteRowCount:function(e){return e.rowModelHelperService?.getInfiniteRowModel()?.getRowCount()},isLastRowIndexKnown:function(e){return e.rowModelHelperService?.getInfiniteRowModel()?.isLastRowIndexKnown()}},dependantModules:[f,h._SsrmInfiniteSharedApiModule]},w={version:C,moduleName:h.ModuleNames.InfiniteRowModelModule,dependantModules:[f,v]}},12:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(608),o=i(886),n=i(423),r=i(209),l=i(773);n.ModuleRegistry.__registerModules([n.CommunityFeaturesModule,o.ClientSideRowModelModule,l.InfiniteRowModelModule,r.CsvExportModule],!1,void 0),s.__exportStar(i(423),t),s.__exportStar(i(886),t),s.__exportStar(i(209),t),s.__exportStar(i(773),t)},608:function(e,t,i){"use strict";i.r(t),i.d(t,{__addDisposableResource:function(){return O},__assign:function(){return n},__asyncDelegator:function(){return P},__asyncGenerator:function(){return F},__asyncValues:function(){return E},__await:function(){return R},__awaiter:function(){return p},__classPrivateFieldGet:function(){return A},__classPrivateFieldIn:function(){return L},__classPrivateFieldSet:function(){return I},__createBinding:function(){return C},__decorate:function(){return l},__disposeResources:function(){return G},__esDecorate:function(){return h},__exportStar:function(){return f},__extends:function(){return o},__generator:function(){return m},__importDefault:function(){return x},__importStar:function(){return T},__makeTemplateObject:function(){return D},__metadata:function(){return g},__param:function(){return a},__propKey:function(){return c},__read:function(){return w},__rest:function(){return r},__runInitializers:function(){return d},__setFunctionName:function(){return u},__spread:function(){return S},__spreadArray:function(){return b},__spreadArrays:function(){return y},__values:function(){return v}});var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},s(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var n=function(){return n=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function r(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(i[s[o]]=e[s[o]])}return i}function l(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r}function a(e,t){return function(i,s){t(i,s,e)}}function h(e,t,i,s,o,n){function r(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,a=s.kind,h="getter"===a?"get":"setter"===a?"set":"value",d=!t&&e?s.static?e:e.prototype:null,c=t||(d?Object.getOwnPropertyDescriptor(d,s.name):{}),u=!1,g=i.length-1;g>=0;g--){var p={};for(var m in s)p[m]="access"===m?{}:s[m];for(var m in s.access)p.access[m]=s.access[m];p.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(r(e||null))};var C=(0,i[g])("accessor"===a?{get:c.get,set:c.set}:c[h],p);if("accessor"===a){if(void 0===C)continue;if(null===C||"object"!=typeof C)throw new TypeError("Object expected");(l=r(C.get))&&(c.get=l),(l=r(C.set))&&(c.set=l),(l=r(C.init))&&o.unshift(l)}else(l=r(C))&&("field"===a?o.unshift(l):c[h]=l)}d&&Object.defineProperty(d,s.name,c),u=!0}function d(e,t,i){for(var s=arguments.length>2,o=0;o<t.length;o++)i=s?t[o].call(e,i):t[o].call(e);return s?i:void 0}function c(e){return"symbol"==typeof e?e:"".concat(e)}function u(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}function g(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,i,s){return new(i||(i=Promise))((function(o,n){function r(e){try{a(s.next(e))}catch(e){n(e)}}function l(e){try{a(s.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,l)}a((s=s.apply(e,t||[])).next())}))}function m(e,t){var i,s,o,n,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function l(l){return function(a){return function(l){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,l[0]&&(r=0)),r;)try{if(i=1,s&&(o=2&l[0]?s.return:l[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,l[1])).done)return o;switch(s=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,s=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(6===l[0]&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e],s=0}finally{i=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}}var C=Object.create?function(e,t,i,s){void 0===s&&(s=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,o)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]};function f(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||C(t,e,i)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],s=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,o,n=i.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)r.push(s.value)}catch(e){o={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(o)throw o.error}}return r}function S(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}function y(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var s=Array(e),o=0;for(t=0;t<i;t++)for(var n=arguments[t],r=0,l=n.length;r<l;r++,o++)s[o]=n[r];return s}function b(e,t,i){if(i||2===arguments.length)for(var s,o=0,n=t.length;o<n;o++)!s&&o in t||(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}function R(e){return this instanceof R?(this.v=e,this):new R(e)}function F(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,o=i.apply(e,t||[]),n=[];return s={},r("next"),r("throw"),r("return"),s[Symbol.asyncIterator]=function(){return this},s;function r(e){o[e]&&(s[e]=function(t){return new Promise((function(i,s){n.push([e,t,i,s])>1||l(e,t)}))})}function l(e,t){try{(i=o[e](t)).value instanceof R?Promise.resolve(i.value.v).then(a,h):d(n[0][2],i)}catch(e){d(n[0][3],e)}var i}function a(e){l("next",e)}function h(e){l("throw",e)}function d(e,t){e(t),n.shift(),n.length&&l(n[0][0],n[0][1])}}function P(e){var t,i;return t={},s("next"),s("throw",(function(e){throw e})),s("return"),t[Symbol.iterator]=function(){return this},t;function s(s,o){t[s]=e[s]?function(t){return(i=!i)?{value:R(e[s](t)),done:!1}:o?o(t):t}:o}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=v(e),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(i){t[i]=e[i]&&function(t){return new Promise((function(s,o){(function(e,t,i,s){Promise.resolve(s).then((function(t){e({value:t,done:i})}),t)})(s,o,(t=e[i](t)).done,t.value)}))}}}function D(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var M=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function T(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&C(t,e,i);return M(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function A(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}function I(e,t,i,s,o){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?o.call(e,i):o?o.value=i:t.set(e,i),i}function L(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function O(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=t[Symbol.asyncDispose]}if(void 0===s){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=t[Symbol.dispose]}if("function"!=typeof s)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:s,async:i})}else i&&e.stack.push({async:!0});return t}var k="function"==typeof SuppressedError?SuppressedError:function(e,t,i){var s=new Error(i);return s.name="SuppressedError",s.error=e,s.suppressed=t,s};function G(e){function t(t){e.error=e.hasError?new k(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function i(){for(;e.stack.length;){var s=e.stack.pop();try{var o=s.dispose&&s.dispose.call(s.value);if(s.async)return Promise.resolve(o).then(i,(function(e){return t(e),i()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:o,__assign:n,__rest:r,__decorate:l,__param:a,__metadata:g,__awaiter:p,__generator:m,__createBinding:C,__exportStar:f,__values:v,__read:w,__spread:S,__spreadArrays:y,__spreadArray:b,__await:R,__asyncGenerator:F,__asyncDelegator:P,__asyncValues:E,__makeTemplateObject:D,__importStar:T,__importDefault:x,__classPrivateFieldGet:A,__classPrivateFieldSet:I,__classPrivateFieldIn:L,__addDisposableResource:O,__disposeResources:G}}},t={};function i(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,i),n.exports}return i.d=function(e,t){for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(12)}()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.agGrid=t():e.agGrid=t()}(self,(function(){return function(){var e={886:function(e,t,i){var s,o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(a,{ClientSideRowModelModule:()=>M}),e.exports=(s=a,((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of r(t))l.call(e,a)||a===i||o(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s));var h=i(423),d=i(423),c=i(423),u=class{constructor(e,t,i,s,o,n){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=i,this.funcColsService=s,this.beans=n,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id="ROOT_NODE_ID",this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return(0,c._cloneObject)(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if("string"==typeof e)return void(0,c._warnOnce)("rowData must be an array.");this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,i=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map((e=>this.createNode(e,this.rootNode,0))):(t.allLeafChildren=[],t.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=t.childrenAfterFilter,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenAfterAggFilter=t.childrenAfterAggFilter,i.childrenAfterSort=t.childrenAfterSort,i.childrenMapped=t.childrenMapped,i.allLeafChildren=t.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&(0,c._sortRowNodesByOrder)(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const e={type:"selectionChanged",source:t};this.eventService.dispatchEvent(e)}}executeAdd(e,t){const{add:i,addIndex:s}=e;if((0,c._missingOrEmpty)(i))return;const o=i.map((e=>this.createNode(e,this.rootNode,0))),n=this.rootNode.allLeafChildren;if("number"==typeof s&&s>=0){const e=n.length;let t=s;if(this.gos.get("treeData")&&s>0&&e>0)for(let i=0;i<e;i++)if(n[i]?.rowIndex==s-1){t=i+1;break}const i=n.slice(0,t),r=n.slice(t,n.length);this.rootNode.allLeafChildren=[...i,...o,...r]}else this.rootNode.allLeafChildren=[...n,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=n),t.add=o}executeRemove(e,t,i){const{remove:s}=e;if((0,c._missingOrEmpty)(s))return;const o={};s.forEach((e=>{const s=this.lookupRowNode(e);s&&(s.isSelected()&&i.push(s),s.clearRowTopAndRowIndex(),o[s.id]=!0,delete this.allNodesMap[s.id],t.remove.push(s))})),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren?.filter((e=>!o[e.id]))??null,this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,t,i){const{update:s}=e;(0,c._missingOrEmpty)(s)||s.forEach((e=>{const s=this.lookupRowNode(e);s&&(s.updateData(e),!s.selectable&&s.isSelected()&&i.push(s),this.setMasterForRow(s,e,0,!1),t.update.push(s))}))}lookupRowNode(e){const t=this.gos.getRowIdCallback();let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return(0,c._errorOnce)(`could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren?.find((t=>t.data===e)),!i)return(0,c._errorOnce)("could not find data item as object was not found",e),(0,c._errorOnce)("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new c.RowNode(this.beans);return s.group=!1,this.setMasterForRow(s,e,i,!0),t&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&(0,c._warnOnce)(`duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const i=this.gos.get("isRowMaster");i?e.setMaster(i(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const t=this.funcColsService.getRowGroupColumns(),s=i+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(s)}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return-1===t||e<t}},g=class extends d.BeanStub{constructor(){super(...arguments),this.beanName="rowModel",this.onRowHeightChanged_debounced=(0,d._debounce)(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}wireBeans(e){this.beans=e,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.selectionService=e.selectionService,this.valueCache=e.valueCache,this.environment=e.environment,this.filterStage=e.filterStage,this.sortStage=e.sortStage,this.flattenStage=e.flattenStage,this.groupStage=e.groupStage,this.aggregationStage=e.aggregationStage,this.pivotStage=e.pivotStage,this.filterAggregatesStage=e.filterAggregatesStage}postConstruct(){const e=this.refreshModel.bind(this,{step:d.ClientSideRowModelSteps.EVERYTHING}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:d.ClientSideRowModelSteps.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedEventListeners({newColumnsLoaded:i,columnRowGroupChanged:e,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:d.ClientSideRowModelSteps.PIVOT}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:e,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this)}),this.addPropertyListeners(),this.rootNode=new d.RowNode(this.beans),this.nodeManager=new u(this.rootNode,this.gos,this.eventService,this.funcColsService,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),n=new Set(["postSortRows","groupDisplayType","accentedSort"]),r=new Set([]),l=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),a=[...e,...t,...i,...s,...s,...o,...n,...r,...l];this.addManagedPropertyListeners(a,(a=>{const h=a.changeSet?.properties;if(!h)return;const c=e=>h.some((t=>e.has(t)));c(e)?this.setRowData(this.rootNode.allLeafChildren.map((e=>e.data))):c(t)?this.refreshModel({step:d.ClientSideRowModelSteps.EVERYTHING}):c(i)?this.refreshModel({step:d.ClientSideRowModelSteps.FILTER}):c(s)?this.refreshModel({step:d.ClientSideRowModelSteps.PIVOT}):c(o)?this.refreshModel({step:d.ClientSideRowModelSteps.AGGREGATE}):c(n)?this.refreshModel({step:d.ClientSideRowModelSteps.SORT}):c(r)?this.refreshModel({step:d.ClientSideRowModelSteps.FILTER_AGGREGATES}):c(l)&&this.refreshModel({step:d.ClientSideRowModelSteps.MAP})})),this.addManagedPropertyListener("rowHeight",(()=>this.resetRowHeights()))}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let o,n=!1;do{o=!1;const r=this.getRowIndexAtPixel(e),l=this.getRowIndexAtPixel(t),a=Math.max(r,i),h=Math.min(l,s);for(let e=a;e<=h;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gos.getRowHeightForNode(t);t.setRowHeight(e.height),o=!0,n=!0}}o&&this.setRowTopAndRowIndex()}while(o);return n}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gos.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const n=this.rowsToDisplay[o];if(null!=n.id&&i.add(n.id),null==n.rowHeight){const t=this.gos.getRowHeightForNode(n,s,e);n.setRowHeight(t.height,t.estimated)}n.setRowTop(t),n.setRowIndex(o),t+=n.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},o=e=>{if(s(e),s(e.detailNode),s(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;i&&!t&&!e.expanded||e.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),n=!this.gos.get("suppressAnimationFrame");return o!==e[0]&&(e.forEach((e=>{(0,d._removeFromArray)(this.rootNode.allLeafChildren,e)})),e.forEach(((e,t)=>{(0,d._insertIntoArray)(this.rootNode.allLeafChildren,e,Math.max(s+i,0)+t)})),this.refreshModel({step:d.ClientSideRowModelSteps.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:n}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,s=null!=i?this.getRow(i):null;if(!s||!e||s===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const o=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(o),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const i=this.getRowIndexAtPixel(e);if(!(t=this.getRow(i||0)))return d.RowHighlightPosition.Below}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?d.RowHighlightPosition.Above:d.RowHighlightPosition.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.sibling?1:0,t=this.rootNode.childrenAfterAggFilter;return(t?t.length:0)+e}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=e;if(this.rowsToDisplay[0].footer){if(0===e)return 0;t-=1}let i=this.rootNode.childrenAfterSort[t];if(this.gos.get("groupHideOpenParents"))for(;i.expanded&&i.childrenAfterSort&&i.childrenAfterSort.length>0;)i=i.childrenAfterSort[0];return i.rowIndex}getRowBounds(e){if((0,d._missing)(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:d.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),i=0===e.columns.length||e.columns.some((e=>e.isPrimary()))?d.ClientSideRowModelSteps.FILTER:d.ClientSideRowModelSteps.FILTER_AGGREGATES;this.refreshModel({step:i,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:d.ClientSideRowModelSteps.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:d.ClientSideRowModelSteps.PIVOT}):this.refreshModel({step:d.ClientSideRowModelSteps.AGGREGATE})}createChangePath(e){const t=(0,d._missingOrEmpty)(e),i=new d.ChangedPath(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter((e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0));return null==t||0==t.length}buildRefreshModelParams(e){let t=d.ClientSideRowModelSteps.EVERYTHING;const i={everything:d.ClientSideRowModelSteps.EVERYTHING,group:d.ClientSideRowModelSteps.EVERYTHING,filter:d.ClientSideRowModelSteps.FILTER,map:d.ClientSideRowModelSteps.MAP,aggregate:d.ClientSideRowModelSteps.AGGREGATE,sort:d.ClientSideRowModelSteps.SORT,pivot:d.ClientSideRowModelSteps.PIVOT};if((0,d._exists)(e)&&(t=i[e]),(0,d._missing)(t))return void(0,d._errorOnce)(`invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gos.get("suppressAnimationFrame")}}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.isChangeEventsDispatching())return;const t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case d.ClientSideRowModelSteps.EVERYTHING:this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case d.ClientSideRowModelSteps.FILTER:this.doFilter(i);case d.ClientSideRowModelSteps.PIVOT:this.doPivot(i);case d.ClientSideRowModelSteps.AGGREGATE:this.doAggregate(i);case d.ClientSideRowModelSteps.FILTER_AGGREGATES:this.doFilterAggregates(i);case d.ClientSideRowModelSteps.SORT:this.doSort(t.rowNodeTransactions,i);case d.ClientSideRowModelSteps.MAP:this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1;const o={type:"modelUpdated",animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const e=(0,d._missing)(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return(0,d._missing)(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return(0,d._exists)(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!1,s=!1;const o=[],n=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort((r=>{if(s)return;if(i&&(r===t||r===e)&&(s=!0,r.group&&n))return void o.push(...r.allLeafChildren);if(!i){if(r!==t&&r!==e)return;i=!0}(!r.group||!n)&&o.push(r)})),o}setDatasource(e){(0,d._errorOnce)("should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if((0,d._last)(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let s=-1,o=-1;for(;;){const n=Math.floor((t+i)/2),r=this.rowsToDisplay[n];if(this.isRowInPixel(r,e))return n;r.rowTop<e?t=n+1:r.rowTop>e&&(i=n-1);if(s===t&&o===i)return n;s=t,o=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach(((t,i)=>e(t,i)))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:o}=e;let{index:n}=e;const r=e=>{const s=t[0]?.parent;if(!s)return;const r=o&&this.gos.getGrandTotalRow(),l=this.gos.getGroupTotalRowCallback(),a=o&&l({node:s});s===this.rootNode?r===e&&(s.createFooter(),i(s.sibling,n++)):a===e&&(s.createFooter(),i(s.sibling,n++))};r("top");for(let e=0;e<t.length;e++){const r=t[e];if(i(r,n++),r.hasChildren()&&!r.footer){let e=null;switch(s){case 0:e=r.childrenAfterGroup;break;case 1:e=r.childrenAfterAggFilter;break;case 2:e=r.childrenAfterSort;break;case 3:e=r.leafGroup?null:r.childrenAfterSort}e&&(n=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:i,recursionType:s,index:n,includeFooterNodes:o}))}}return r("bottom"),n}doAggregate(e){this.aggregationStage?.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=o=>{o&&o.forEach((o=>{const n=()=>{o.expanded=e,s(o.childrenAfterGroup)};if(t){return void((0,d._exists)(o.childrenAfterGroup)&&n())}if(i){return void(!o.leafGroup&&n())}o.group&&n()}))};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:d.ClientSideRowModelSteps.MAP});const o={type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"};this.eventService.dispatchEvent(o)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:s}),this.gos.get("groupSelectsChildren")){if(this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const e={type:"selectionChanged",source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){this.pivotStage?.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(d.RowNode.ID_PREFIX_ROW_GROUP)){let t;return this.forEachNode((i=>{i.id===e&&(t=i)})),t}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:d.ClientSideRowModelSteps.EVERYTHING,newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout((()=>{this.executeBatchUpdateRowData()}),e)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach((s=>{const o=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(o),s.callback&&e.push(s.callback.bind(null,o)),"number"==typeof s.rowDataTransaction.addIndex&&(i=!0)})),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout((()=>{e.forEach((e=>e()))}),0),t.length>0){const e={type:"asyncTransactionsFlushed",results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s="number"==typeof e.addIndex;return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const s=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());this.eventService.dispatchEvent({type:"rowDataUpdated"}),this.refreshModel({step:d.ClientSideRowModelSteps.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:d.ClientSideRowModelSteps.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode((t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0})),e}onGridStylesChanges(e){if(e.rowHeightChanged){if(this.columnModel.isAutoRowHeightActive())return;this.resetRowHeights()}}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}},p=i(423);var m=i(423),C=class extends m.BeanStub{constructor(){super(...arguments),this.beanName="filterStage"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){const t=!!this.filterManager?.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(t,i)=>{t.hasChildren()?t.childrenAfterFilter=e&&!i?t.childrenAfterGroup.filter((e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,i=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||i})):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,s)=>{if(t.childrenAfterGroup)for(let o=0;o<t.childrenAfterGroup.length;o++){const n=t.childrenAfterGroup[o],r=s||this.filterManager.doesRowPassFilter({rowNode:n});n.childrenAfterGroup?e(t.childrenAfterGroup[o],r):i(n,r)}i(t,s)},s=t=>e(t,!1);t.executeFromRootNode(s)}else{const e=e=>i(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},f=i(423),v=class extends f.BeanStub{constructor(){super(...arguments),this.beanName="flattenStage"}wireBeans(e){this.beans=e,this.columnModel=e.columnModel}execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),o=s&&t.leafGroup,n=o?[t]:t.childrenAfterSort,r=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(r,n,i,s,0);if(!o&&i.length>0&&r.grandTotalRow){t.createFooter();const e="top"===r.grandTotalRow;this.addRowNodeToRowsToDisplay(r,t.sibling,i,0,e)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(!(0,f._missingOrEmpty)(t))for(let n=0;n<t.length;n++){const r=t[n],l=r.hasChildren(),a=s&&!l,h=e.groupRemoveSingleChildren&&l&&1===r.childrenAfterGroup.length,d=e.groupRemoveLowestSingleChildren&&l&&r.leafGroup&&1===r.childrenAfterGroup.length,c=s&&r.leafGroup,u=e.hideOpenParents&&r.expanded&&!r.master&&!c;if(!(a||u||h||d)&&this.addRowNodeToRowsToDisplay(e,r,i,o),!s||!r.leafGroup)if(l){const t=h||d;if(r.expanded||t){const n=e.groupTotalRow({node:r});n||r.destroyFooter();const l=t?o:o+1;"top"===n&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,l)),this.recursivelyAddToRowsToDisplay(e,r.childrenAfterSort,i,s,l),"bottom"===n&&(r.createFooter(),this.addRowNodeToRowsToDisplay(e,r.sibling,i,l))}}else if(r.master&&r.expanded){const t=this.createDetailNode(r);this.addRowNodeToRowsToDisplay(e,t,i,o)}}}addRowNodeToRowsToDisplay(e,t,i,s,o){o?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if((0,f._exists)(e.detailNode))return e.detailNode;const t=new f.RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,(0,f._exists)(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}},w=i(423),S=class extends w.BeanStub{constructor(){super(...arguments),this.beanName="immutableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",(()=>this.onRowDataUpdated())))}isActive(){const e=this.gos.exists("getRowId");return!this.gos.get("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if((0,w._missing)(this.clientSideRowModel))return void(0,w._errorOnce)("ImmutableService only works with ClientSideRowModel");const t=this.gos.getRowIdCallback();if(null==t)return void(0,w._errorOnce)("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),o=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return(0,w._exists)(e)&&e.forEach(((e,n)=>{const r=t({data:e,level:0}),l=s[r];if(o&&(o[r]=n),l){l.data!==e&&i.update.push(e),s[r]=void 0}else i.add.push(e)})),(0,w._iterateObject)(s,((e,t)=>{t&&i.remove.push(t.data)})),[i,o]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}},y=i(423),b=class extends y.BeanStub{constructor(){super(...arguments),this.beanName="sortService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowNodeSorter=e.rowNodeSorter,this.showRowGroupColsService=e.showRowGroupColsService}sort(e,t,i,s,o,n){const r=this.gos.get("groupMaintainOrder"),l=this.columnModel.getCols().some((e=>e.isRowGroupActive()));let a={};i&&s&&(a=this.calculateDirtyNodes(s));const h=this.columnModel.isPivotMode(),d=this.gos.getCallback("postSortRows"),c=s=>{this.pullDownGroupDataForHideOpenParents(s.childrenAfterAggFilter,!0);const c=h&&s.leafGroup;if(r&&l&&!s.leafGroup&&!n){const e=this.funcColsService.getRowGroupColumns()?.[s.level+1],t=null===e?.getSort(),i=s.childrenAfterAggFilter.slice(0);if(s.childrenAfterSort&&!t){const e={};s.childrenAfterSort.forEach(((t,i)=>{e[t.id]=i})),i.sort(((t,i)=>(e[t.id]??0)-(e[i.id]??0)))}s.childrenAfterSort=i}else s.childrenAfterSort=!t||c?s.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(s,a,o,e):this.rowNodeSorter.doFullSort(s.childrenAfterAggFilter,e);if(s.sibling&&(s.sibling.childrenAfterSort=s.childrenAfterSort),this.updateChildIndexes(s),d){const e={nodes:s.childrenAfterSort};d(e)}};o&&o.forEachChangedNodeDepthFirst(c),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},i=e=>{e&&e.forEach((e=>t[e.id]=!0))};return e&&e.forEach((e=>{i(e.add),i(e.update),i(e.remove)})),t}doDeltaSort(e,t,i,s){const o=e.childrenAfterAggFilter,n=e.childrenAfterSort;if(!n)return this.rowNodeSorter.doFullSort(o,s);const r={},l=[];o.forEach((e=>{t[e.id]||!i.canSkip(e)?l.push(e):r[e.id]=!0}));const a=n.filter((e=>r[e.id])),h=(e,t)=>({currentPos:t,rowNode:e}),d=l.map(h).sort(((e,t)=>this.rowNodeSorter.compareRowNodes(s,e,t)));return this.mergeSortedArrays(s,d,a.map(h)).map((({rowNode:e})=>e))}mergeSortedArrays(e,t,i){const s=[];let o=0,n=0;for(;o<t.length&&n<i.length;){this.rowNodeSorter.compareRowNodes(e,t[o],i[n])<0?s.push(t[o++]):s.push(i[n++])}for(;o<t.length;)s.push(t[o++]);for(;n<i.length;)s.push(i[n++]);return s}updateChildIndexes(e){if((0,y._missing)(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],o=0===i,n=i===e.childrenAfterSort.length-1;s.setFirstChild(o),s.setLastChild(n),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return(0,y._warnOnce)("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."),!1;const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach((e=>{e.hasChildren()&&t(e)}))};e&&e.executeFromRootNode((e=>t(e)))}pullDownGroupDataForHideOpenParents(e,t){this.gos.get("groupHideOpenParents")&&!(0,y._missing)(e)&&e.forEach((e=>{(this.showRowGroupColsService?.getShowRowGroupCols()??[]).forEach((i=>{const s=i.getColDef().showRowGroup;if("string"!=typeof s)return void(0,y._errorOnce)("groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const o=s,n=this.columnModel.getColDefCol(o);if(!(n===e.rowGroupColumn))if(t)e.setGroupValue(i.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(n);t&&e.setGroupValue(i.getId(),t.key)}}))}))}},R=i(423),F=class extends R.BeanStub{constructor(){super(...arguments),this.beanName="sortStage"}wireBeans(e){this.sortService=e.sortService,this.sortController=e.sortController}execute(e){const t=this.sortController.getSortOptions(),i=(0,R._exists)(t)&&t.length>0,s=i&&(0,R._exists)(e.rowNodeTransactions)&&this.gos.get("deltaSort"),o=t.some((e=>this.gos.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup));this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}},P="32.0.2",E={version:P,moduleName:`${h.ModuleNames.ClientSideRowModelModule}-core`,rowModel:"clientSide",beans:[g,C,F,v,b,S]},D={version:P,moduleName:`${h.ModuleNames.ClientSideRowModelModule}-api`,beans:[h.RowModelHelperService],apiFunctions:{onGroupExpandedOrCollapsed:function(e){e.expansionService.onGroupExpandedOrCollapsed()},refreshClientSideRowModel:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.refreshModel(t)},forEachLeafNode:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachLeafNode(t)},forEachNodeAfterFilter:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilter(t)},forEachNodeAfterFilterAndSort:function(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilterAndSort(t)},resetRowHeights:function(e){e.columnModel.isAutoRowHeightActive()?(0,p._warnOnce)("calling gridApi.resetRowHeights() makes no sense when using Auto Row Height."):e.rowModelHelperService?.getClientSideRowModel()?.resetRowHeights()},applyTransaction:function(e,t){return e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.updateRowData(t)))},applyTransactionAsync:function(e,t,i){e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.batchUpdateRowData(t,i)))},flushAsyncTransactions:function(e){e.frameworkOverrides.wrapIncoming((()=>e.rowModelHelperService?.getClientSideRowModel()?.flushAsyncTransactions()))},getBestCostNodeSelection:function(e){return e.selectionService.getBestCostNodeSelection()}},dependantModules:[E,h._CsrmSsrmSharedApiModule]},M={version:P,moduleName:h.ModuleNames.ClientSideRowModelModule,dependantModules:[E,D]}},423:function(e,t,i){var s,o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(a,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>Hh,AbstractHeaderCellCtrl:()=>an,AgAbstractField:()=>os,AgAbstractInputField:()=>ns,AgAbstractLabel:()=>ss,AgCheckbox:()=>rs,AgCheckboxSelector:()=>ls,AgColumn:()=>se,AgColumnGroup:()=>qe,AgInputDateField:()=>xl,AgInputNumberField:()=>xo,AgInputNumberFieldSelector:()=>To,AgInputTextArea:()=>wl,AgInputTextField:()=>Do,AgInputTextFieldSelector:()=>Mo,AgPickerField:()=>wo,AgPromise:()=>ws,AgProvidedColumnGroup:()=>ne,AgRadioButton:()=>fo,AgSelect:()=>So,AgSelectSelector:()=>yo,AgToggleButton:()=>oa,AgToggleButtonSelector:()=>na,AnimateShowChangeCellRenderer:()=>es,AnimateSlideCellRenderer:()=>ts,AnimationFrameService:()=>ml,AriaAnnouncementService:()=>Yh,AutoScrollService:()=>Ys,AutoWidthCalculator:()=>jl,BarColumnLabelPlacement:()=>Fd,BaseComponentWrapper:()=>yd,BeanStub:()=>I,BodyDropPivotTarget:()=>Hn,BodyDropTarget:()=>Un,CellComp:()=>Cr,CellCtrl:()=>Ir,CellNavigationService:()=>pa,CellPositionUtils:()=>Aa,CellRangeType:()=>Dr,ChangedPath:()=>id,ChartMappings:()=>Rd,CheckboxCellEditor:()=>kl,CheckboxCellRenderer:()=>as,CheckboxSelectionComponent:()=>Sr,ClientSideRowModelSteps:()=>Cl,ColumnApplyStateService:()=>ke,ColumnAutosizeService:()=>Le,ColumnFactory:()=>Me,ColumnKeyCreator:()=>ye,ColumnModel:()=>Te,ColumnMoveService:()=>Ne,ColumnNameService:()=>_e,ColumnSizeService:()=>Ke,CommunityFeaturesModule:()=>Gh,Component:()=>Wi,ComponentUtil:()=>nt,Context:()=>_s,CssClassManager:()=>ft,CtrlsService:()=>Ta,DataTypeService:()=>Ya,DateCellEditor:()=>Il,DateFilter:()=>Zo,DateStringCellEditor:()=>Ol,DragAndDropService:()=>qs,DragService:()=>Js,DragSourceType:()=>js,Environment:()=>Na,EventService:()=>Va,ExcelFactoryMode:()=>Us,ExpansionService:()=>fl,ExpressionService:()=>hd,FakeHScrollComp:()=>ar,FakeVScrollComp:()=>cr,FilterManager:()=>no,FilterWrapperComp:()=>ro,FocusService:()=>za,FuncColsService:()=>Oe,GROUP_AUTO_COLUMN_ID:()=>be,Grid:()=>md,GridBodyComp:()=>nl,GridBodyCtrl:()=>mr,GridComp:()=>Ka,GridCoreCreator:()=>fd,GridCoreModule:()=>Oh,GridCtrl:()=>Ua,GridHeaderComp:()=>tr,GridHeaderCtrl:()=>Gn,GridOptionsService:()=>_h,GroupInstanceIdCreator:()=>Ye,HeaderCellCtrl:()=>jn,HeaderFilterCellComp:()=>xn,HeaderFilterCellCtrl:()=>dn,HeaderGroupCellCtrl:()=>Qn,HeaderNavigationDirection:()=>On,HeaderNavigationService:()=>kn,HeaderPositionUtils:()=>Uh,HeaderRowComp:()=>Ln,HeaderRowContainerComp:()=>er,HeaderRowContainerCtrl:()=>Zn,HeaderRowCtrl:()=>Jn,HeaderRowType:()=>In,HorizontalDirection:()=>$s,HorizontalResizeService:()=>ul,KeyCode:()=>is,LargeTextCellEditor:()=>yl,LayoutCssClasses:()=>sr,LocalEventService:()=>h,LocaleService:()=>Kh,ManagedFocusFeature:()=>uo,MenuService:()=>vl,ModuleNames:()=>Xi,ModuleRegistry:()=>Zi,MouseEventService:()=>dl,MoveColumnFeature:()=>_n,NavigationService:()=>cl,NumberCellEditor:()=>Ml,NumberFilter:()=>ko,NumberSequence:()=>ki,OverlayWrapperComponent:()=>nr,PinnedRowModel:()=>Xl,PivotResultColsService:()=>Ue,PopupComponent:()=>ps,PopupEditorWrapper:()=>bl,PopupService:()=>ca,PositionableFeature:()=>ho,PropertyKeys:()=>st,ProvidedFilter:()=>Co,RefPlaceholder:()=>Vi,ResizeObserverService:()=>pl,RowContainerComp:()=>tl,RowContainerCtrl:()=>el,RowCtrl:()=>kr,RowDragComp:()=>Zs,RowHighlightPosition:()=>Qs,RowModelHelperService:()=>vd,RowNode:()=>oo,RowNodeBlock:()=>Zl,RowNodeBlockLoader:()=>ea,RowNodeSorter:()=>td,RowPositionUtils:()=>La,RowRenderer:()=>Yl,ScalarFilter:()=>Fo,ScrollVisibleService:()=>ll,SelectCellEditor:()=>Rl,SelectableService:()=>od,SelectionHandleType:()=>Er,ServerSideTransactionResultStatus:()=>Jl,SetLeftFeature:()=>en,SimpleFilter:()=>Ro,SortController:()=>rd,SortIndicatorComp:()=>ji,SortIndicatorSelector:()=>qi,StandardMenuFactory:()=>gl,StylingService:()=>sa,TabGuardClassNames:()=>ra,TabGuardComp:()=>ha,TabGuardCtrl:()=>la,TabGuardFeature:()=>aa,TextCellEditor:()=>El,TextFilter:()=>Bo,TextFloatingFilter:()=>fn,TooltipFeature:()=>Hi,TooltipStateManager:()=>Ni,TouchListener:()=>$i,UserComponentFactory:()=>Vs,UserComponentRegistry:()=>vs,ValueCache:()=>dd,ValueService:()=>cd,VanillaFrameworkOverrides:()=>ga,VerticalDirection:()=>Ks,VisibleColsService:()=>Qe,_ColumnFilterModule:()=>Sn,_CommunityMenuApiModule:()=>th,_CsrmSsrmSharedApiModule:()=>wd,_EditCoreModule:()=>Wl,_FilterCoreModule:()=>vn,_FloatingFilterModule:()=>Rn,_ReadOnlyFloatingFilterModule:()=>Fn,_RowNodeBlockModule:()=>ta,_SsrmInfiniteSharedApiModule:()=>Sd,_addFocusableContainerListener:()=>nh,_areEqual:()=>u,_bindCellRendererToHtmlElement:()=>Oi,_capitalise:()=>We,_clearElement:()=>wi,_cloneObject:()=>j,_combineAttributesAndGridOptions:()=>rt,_compose:()=>Se,_createIcon:()=>_i,_createIconNoSpan:()=>Ui,_debounce:()=>fe,_defaultComparator:()=>_,_doOnce:()=>ae,_errorOnce:()=>ce,_escapeString:()=>ze,_exists:()=>k,_existsAndNotEmpty:()=>d,_flatten:()=>y,_forEachReverse:()=>R,_formatNumberCommas:()=>Uo,_formatNumberTwoDecimalPlacesAndCommas:()=>_o,_fuzzySuggestions:()=>Cs,_getAbsoluteHeight:()=>gi,_getAbsoluteWidth:()=>pi,_getAllValuesInObject:()=>Y,_getAriaPosInSet:()=>Rt,_getCtrlForEventTarget:()=>T,_getHeaderClassesFromColDef:()=>tn,_getInnerHeight:()=>ci,_getInnerWidth:()=>ui,_getRowContainerOptions:()=>Kr,_getToolPanelClassesFromColDef:()=>sn,_includes:()=>S,_insertArrayIntoArray:()=>v,_insertIntoArray:()=>f,_isElementInEventPath:()=>A,_isEventFromPrintableCharacter:()=>Po,_isIOSUserAgent:()=>Jt,_isNodeOrElement:()=>Ai,_isStopPropagationForAgGrid:()=>M,_isVisible:()=>bi,_iterateObject:()=>$,_jsonEquals:()=>z,_last:()=>c,_loadTemplate:()=>Ri,_log:()=>he,_makeNull:()=>O,_mergeDeep:()=>Q,_missing:()=>G,_missingOrEmpty:()=>N,_parseDateTimeFromString:()=>qo,_processOnChange:()=>lt,_radioCssClass:()=>si,_removeAriaExpanded:()=>Lt,_removeAriaSort:()=>zt,_removeFromArray:()=>C,_removeFromParent:()=>Si,_removeRepeatsFromArray:()=>p,_serialiseDate:()=>Ko,_setAriaActiveDescendant:()=>At,_setAriaChecked:()=>Ut,_setAriaColCount:()=>Ht,_setAriaColIndex:()=>Bt,_setAriaColSpan:()=>Vt,_setAriaControls:()=>Kt,_setAriaDescribedBy:()=>Et,_setAriaDisabled:()=>xt,_setAriaExpanded:()=>It,_setAriaHidden:()=>Tt,_setAriaLabel:()=>Ft,_setAriaLabelledBy:()=>Pt,_setAriaLevel:()=>Mt,_setAriaPosInSet:()=>kt,_setAriaRole:()=>bt,_setAriaRowCount:()=>Gt,_setAriaRowIndex:()=>Nt,_setAriaSelected:()=>_t,_setAriaSetSize:()=>Ot,_setAriaSort:()=>Wt,_setDisabled:()=>ai,_setDisplayed:()=>ri,_setFixedWidth:()=>Mi,_setVisible:()=>li,_shallowCompare:()=>g,_sortRowNodesByOrder:()=>bd,_stopPropagationForAgGrid:()=>D,_toStringOrNull:()=>H,_unwrapUserComp:()=>Ws,_utf8_encode:()=>Ve,_values:()=>U,_waitUntil:()=>we,_warnOnce:()=>de,createGrid:()=>pd,getDefaultFloatingFilterType:()=>un,isColumn:()=>ie,isColumnGroup:()=>je,isProvidedColumnGroup:()=>oe,isSelectionUIEvent:()=>Bh,provideGlobalGridOptions:()=>gd}),e.exports=(s=a,((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of r(t))l.call(e,a)||a===i||o(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s));var h=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);if(s&&(s.delete(t),0===s.size)){(i?this.allAsyncListeners:this.allSyncListeners).delete(e)}}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){const t=e;this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const i=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const s=(i,s)=>i.forEach((i=>{if(!s.has(i))return;const o=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming((()=>i(e))):()=>i(e);t?this.dispatchAsync(o):o()})),o=this.getListeners(i,t,!1)??new Set,n=new Set(o);n.size>0&&s(n,o);new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach((s=>{const o=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming((()=>s(i,e))):()=>s(i,e);t?this.dispatchAsync(o):o()}))}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const e=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(e):e(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach((e=>e()))}};function d(e){return null!=e&&e.length>0}function c(e){if(e&&e.length)return e[e.length-1]}function u(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every(((e,s)=>i?i(e,t[s]):t[s]===e))}function g(e,t){return u(e,t)}function p(e,t){if(e)for(let i=e.length-2;i>=0;i--){const s=e[i]===t,o=e[i+1]===t;s&&o&&e.splice(i+1,1)}}function m(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function C(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function f(e,t,i){e.splice(i,0,t)}function v(e,t,i){if(null!=e&&null!=t)for(let s=t.length-1;s>=0;s--){f(e,t[s],i)}}function w(e,t,i){!function(e,t){for(let i=0;i<t.length;i++)C(e,t[i])}(e,t),t.slice().reverse().forEach((t=>f(e,t,i)))}function S(e,t){return e.indexOf(t)>-1}function y(e){return[].concat.apply([],e)}function b(e,t){null!=t&&null!=e&&t.forEach((t=>e.push(t)))}function R(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}var F="__ag_Grid_Stop_Propagation",P=["touchstart","touchend","touchmove","touchcancel","scroll"],E={};function D(e){e[F]=!0}function M(e){return!0===e[F]}var x=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof E[t])return E[t];const i=document.createElement(e[t]||"div");return E[t="on"+t]=t in i}})();function T(e,t,i){let s=t;for(;s;){const t=e.getDomData(s,i);if(t)return t;s=s.parentElement}return null}function A(e,t){return!(!t||!e)&&function(e){const t=e;if(t.path)return t.path;if(t.composedPath)return t.composedPath();return function(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}(t)}(t).indexOf(e)>=0}var I=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.gridId=e.context.getGridId(),this.frameworkOverrides=e.frameworkOverrides,this.stubContext=e.context,this.eventService=e.eventService,this.gos=e.gos,this.localeService=e.localeService}getFrameworkOverrides(){return this.frameworkOverrides}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t){this.localEventService||(this.localEventService=new h),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchLocalEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventService,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const i=[];for(const s in t){const o=t[s];o&&i.push(this._setupListener(e,s,o))}return i}_setupListener(e,t,i){if(this.destroyed)return()=>null;e instanceof HTMLElement?function(e,t,i,s){const o=S(P,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,o)}(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter((e=>e!==s)),null)}setupGridOptionListener(e,t){this.gos.addPropertyEventListener(e,t);const i=()=>(this.gos.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter((e=>e!==i)),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const s={type:"gridPropertyChanged",changeSet:e.changeSet,source:e.source};t(s)};e.forEach((e=>this.setupGridOptionListener(e,s)))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.stubContext).createBean(e,i)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}},L=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=t=>{this.frameworkOverrides.wrapOutgoing((()=>e(t)))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(t,i)=>{this.frameworkOverrides.wrapOutgoing((()=>e(t,i)))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}};function O(e){return null==e||""===e?null:e}function k(e,t=!1){return null!=e&&(""!==e||t)}function G(e){return!k(e)}function N(e){return null==e||0===e.length}function H(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function B(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function V(e){if(void 0!==e)return null!==e&&""!==e&&W(e)}function W(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}function z(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)}function _(e,t,i=!1){const s=null==e,o=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function n(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return n(e,t);if(!i)return n(e,t);try{return e.localeCompare(t)}catch(i){return n(e,t)}}function U(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach((e=>t.push(e))),t}return Object.values(e)}var K=new Set(["__proto__","constructor","prototype"]);function $(e,t){if(null!=e)if(Array.isArray(e))for(let i=0;i<e.length;i++)t(i.toString(),e[i]);else for(const[i,s]of Object.entries(e))t(i,s)}function j(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(K.has(i[s]))continue;const o=i[s],n=e[o];t[o]=n}return t}function q(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach((e=>{if(t&&t.indexOf(e)>=0||K.has(e))return;const o=i[e],n=J(o)&&o.constructor===Object;s[e]=n?q(o):o})),s}function Y(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&i.push(e[t]);return i}function Q(e,t,i=!0,s=!1){k(t)&&$(t,((t,o)=>{if(K.has(t))return;let n=e[t];if(n!==o){if(s){if(null==n&&null!=o){"object"==typeof o&&o.constructor===Object&&(n={},e[t]=n)}}J(o)&&J(n)&&!Array.isArray(n)?Q(n,o,i,s):(i||void 0!==o)&&(e[t]=o)}}))}function X(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let e=0;e<s.length;e++){if(null==o)return;o=o[s[e]]}return o}function J(e){return"object"==typeof e&&null!==e}var Z={resizable:!0,sortable:!0},ee=0;function te(){return ee++}function ie(e){return e instanceof se}var se=class extends I{constructor(e,t,i,s){super(),this.isColumn=!0,this.instanceId=te(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new h,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}wireBeans(e){this.columnHoverService=e.columnHoverService}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const s=e.hide,o=e.initialHide;this.visible=void 0!==s?!s:!o,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=e.flex,r=e.initialFlex;void 0!==n?this.flex=n:void 0!==r&&(this.flex=r)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}postConstruct(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=k(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=k(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??20,this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=k(this.colDef.tooltipField)||k(this.colDef.tooltipValueGetter)||k(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=B(e.width),s=B(e.initialWidth);return t=null!=i?i:null!=s?s:200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(G(this.colDef)||G(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new L(this.frameworkOverrides));const i=this.frameworkEventListenerService?.wrap(t)??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){const i=this.frameworkEventListenerService?.unwrap(t)??t;this.columnEventService.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gos.get("enableGroupEdit"))&&this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??Z[e]}isColumnFunc(e,t){if("boolean"==typeof t)return t;if("function"==typeof t){return t(this.createColumnFunctionCallbackParams(e))}return!1}setMoving(e,t){this.moving=e,this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return G(this.sort)}isSorting(){return k(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&Q(s,i),this.columnEventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t){const i=!0===e;this.visible!==i&&(this.visible=i,this.columnEventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(G(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(G(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}};function oe(e){return e instanceof ne}var ne=class extends I{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=te(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some((e=>e.isVisible()))}isPadding(){return this.padding}setExpanded(e){this.expanded=void 0!==e&&e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach((t=>{ie(t)?e.push(t):oe(t)&&t.addLeafColumns(e)}))}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach((t=>t.addEventListener("visibleChanged",e))),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach((t=>t.removeEventListener("visibleChanged",e))),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const s=this.findChildrenRemovingPadding();for(let o=0,n=s.length;o<n;o++){const n=s[o];if(!n.isVisible())continue;const r=n.getColumnGroupShow();"open"===r?(e=!0,i=!0):"closed"===r?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach((i=>{oe(i)&&i.isPadding()?t(i.children):e.push(i)}))};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},re={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},le={};function ae(e,t){le[t]||(e(),le[t]=!0)}function he(e,...t){console.log("AG Grid: "+e,...t)}function de(e,...t){ae((()=>console.warn("AG Grid: "+e,...t)),e+t?.join(""))}function ce(e,...t){ae((()=>console.error("AG Grid: "+e,...t)),e+t?.join(""))}function ue(e){return!!(e&&e.constructor&&e.call&&e.apply)}function ge(e){!function(e,t=0){e.length>0&&window.setTimeout((()=>e.forEach((e=>e()))),t)}(e,400)}var pe=[],me=!1;function Ce(e){pe.push(e),me||(me=!0,window.setTimeout((()=>{const e=pe.slice();pe.length=0,me=!1,e.forEach((e=>e()))}),0))}function fe(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout((function(){e.apply(o,s)}),t)}}function ve(e,t){let i=0;return function(...s){const o=(new Date).getTime();o-i<t||(i=o,e.apply(this,s))}}function we(e,t,i=100,s){const o=(new Date).getTime();let n=null,r=!1;const l=()=>{const l=(new Date).getTime()-o>i;(e()||l)&&(t(),r=!0,null!=n&&(window.clearInterval(n),n=null),l&&s&&de(s))};l(),r||(n=window.setInterval(l,10))}function Se(...e){return t=>e.reduce(((e,t)=>t(e)),t)}var ye=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=H(e);let i=0;for(;;){let s;if(e?(s=e,0!==i&&(s+="_"+i)):t?(s=t,0!==i&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},be="ag-Grid-AutoColumn";function Re(e){const t=[],i=e=>{for(let s=0;s<e.length;s++){const o=e[s];ie(o)?t.push(o):oe(o)&&i(o.getChildren())}};return i(e),t}function Fe(e){return e.reduce(((e,t)=>e+t.getActualWidth()),0)}function Pe(e,t,i){const s={};if(!t)return;xe(null,t,(e=>{s[e.getInstanceId()]=e})),i&&xe(null,i,(e=>{s[e.getInstanceId()]=null}));const o=Object.values(s).filter((e=>null!=e));e.destroyBeans(o)}function Ee(e){return e.getId().startsWith(be)}function De(e){let t=[];if(e instanceof Array){e.some((e=>"string"!=typeof e))?de("if colDef.type is supplied an array it should be of type 'string[]'"):t=e}else"string"==typeof e?t=e.split(","):de("colDef.type should be of type 'string' | 'string[]'");return t}var Me=class extends I{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,i,s){const o=new ye,{existingCols:n,existingGroups:r,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(e,0,t,n,o,r,s),h=this.findMaxDept(a,0),d=this.balanceColumnTree(a,0,h,o);return xe(null,d,((e,t)=>{oe(e)&&e.setupExpandable(),e.setOriginalParent(t)})),{columnTree:d,treeDept:h}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&xe(null,e,(e=>{if(oe(e)){const t=e;i.push(t)}else{const i=e;s.push(i.getId()),t.push(i)}})),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){const i=[],s=this.findDepth(t);return e.forEach((e=>{let t=e;for(let i=s-1;i>=0;i--){const s=new ne(null,`FAKE_PATH_${e.getId()}}_${i}`,!0,i);this.createBean(s),s.setChildren([t]),t.setOriginalParent(s),t=s}0===s&&e.setOriginalParent(null),i.push(t)})),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&oe(i[0]);)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let n=0;n<e.length;n++){const r=e[n];if(oe(r)){const e=r,n=this.balanceColumnTree(e.getChildren(),t+1,i,s);e.setChildren(n),o.push(e)}else{let n,l;for(let e=i-1;e>=t;e--){const e=s.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),o=new ne(i,e,!0,t);this.createBean(o),l&&l.setChildren([o]),l=o,n||(n=l)}if(n&&l){o.push(n);if(e.some((e=>oe(e)))){l.setChildren([r]);continue}l.setChildren(e);break}o.push(r)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(oe(o)){const e=o,s=this.findMaxDept(e.getChildren(),t+1);i<s&&(i=s)}}return i}recursivelyCreateColumns(e,t,i,s,o,n,r){if(!e)return[];const l=new Array(e.length);for(let a=0;a<l.length;a++){const h=e[a];this.isColumnGroup(h)?l[a]=this.createColumnGroup(i,h,t,s,o,n,r):l[a]=this.createColumn(i,h,s,o,r)}return l}createColumnGroup(e,t,i,s,o,n,r){const l=this.createMergedColGroupDef(t),a=o.getUniqueKey(l.groupId||null,null),h=new ne(l,a,!1,i);this.createBean(h);const d=this.findExistingGroup(t,n);d&&n.splice(d.idx,1);const c=d?.group;c&&h.setExpanded(c.isExpanded());const u=this.recursivelyCreateColumns(l.children,i+1,e,s,o,n,r);return h.setChildren(u),h}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,o){const n=this.findExistingColumn(t,i);n&&i?.splice(n.idx,1);let r=n?.column;if(r){const e=this.addColumnDefaultAndTypes(t,r.getColId());r.setColDef(e,t,o),this.applyColumnState(r,e,o)}else{const i=s.getUniqueKey(t.colId,t.field),o=this.addColumnDefaultAndTypes(t,i);r=new se(o,t,i,e),this.createBean(r)}return this.dataTypeService?.addColumnListeners(r),r}applyColumnState(e,t,i){const s=B(t.flex);void 0!==s&&e.setFlex(s);if(e.getFlex()<=0){const s=B(t.width);if(null!=s)e.setActualWidth(s,i);else{const t=e.getActualWidth();e.setActualWidth(t,i)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort,i):e.setSort(void 0,i));const o=B(t.sortIndex);void 0!==o&&e.setSortIndex(o);const n=V(t.hide);void 0!==n&&e.setVisible(!n,i),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(!s)continue;if(null!=e.colId){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(null!=e.field){if(s.field===e.field)return{idx:i,column:t[i]}}else if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const s=t[i];if(s.getColGroupDef()&&s.getId()===e.groupId)return{idx:i,group:s}}}addColumnDefaultAndTypes(e,t){const i={};Q(i,this.gos.get("defaultColDef"),!1,!0);const s=this.updateColDefAndGetColumnType(i,e,t);s&&this.assignColumnTypes(s,i),Q(i,e,!1,!0);const o=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&o&&n&&Q(i,{sort:o.sort,initialSort:o.initialSort},!1,!0),this.dataTypeService?.validateColDef(i),i}updateColDefAndGetColumnType(e,t,i){const s=this.dataTypeService?.updateColDefAndGetColumnType(e,t,i),o=t.type??s??e.type;return e.type=o,o?De(o):void 0}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},re);$(this.gos.get("columnTypes")||{},((e,t)=>{if(e in i)de(`the column type '${e}' is a default column type and cannot be overridden.`);else{t.type&&de("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[e]=t}})),e.forEach((e=>{const s=i[e.trim()];s?Q(t,s,!1,!0):de("colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")}))}isColumnGroup(e){return void 0!==e.children}};function xe(e,t,i){if(t)for(let s=0;s<t.length;s++){const o=t[s];oe(o)&&xe(o,o.getChildren(),i),i(o,e)}}var Te=class extends I{constructor(){super(...arguments),this.beanName="columnModel",this.pivotMode=!1,this.autoHeightActiveAtLeastOnce=!1,this.ready=!1,this.changeEventsDispatching=!1,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}wireBeans(e){this.context=e.context,this.columnFactory=e.columnFactory,this.columnSizeService=e.columnSizeService,this.visibleColsService=e.visibleColsService,this.columnViewportService=e.columnViewportService,this.pivotResultColsService=e.pivotResultColsService,this.columnAnimationService=e.columnAnimationService,this.autoColService=e.autoColService,this.valueCache=e.valueCache,this.columnDefFactory=e.columnDefFactory,this.columnApplyStateService=e.columnApplyStateService,this.columnGroupStateService=e.columnGroupStateService,this.eventDispatcher=e.columnEventDispatcher,this.columnMoveService=e.columnMoveService,this.columnAutosizeService=e.columnAutosizeService,this.funcColsService=e.funcColsService,this.quickFilterService=e.quickFilterService,this.showRowGroupColsService=e.showRowGroupColsService,this.environment=e.environment}postConstruct(){const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],(e=>this.refreshAll(Ae(e.source)))),this.addManagedPropertyListener("autoGroupColumnDef",(e=>this.onAutoGroupColumnDefChanged(Ae(e.source)))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],(e=>this.recreateColumnDefs(Ae(e.source)))),this.addManagedPropertyListener("pivotMode",(e=>this.setPivotMode(this.gos.get("pivotMode"),Ae(e.source)))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e,t){const i=e?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire();const s=this.colDefCols&&this.colDefCols.list,o=this.colDefCols&&this.colDefCols.tree,n=this.columnFactory.createColumnTree(this.colDefs,!0,o,t);Pe(this.context,this.colDefCols?.tree,n.columnTree);const r=n.columnTree,l=n.treeDept,a=Re(r),h={};a.forEach((e=>h[e.getId()]=e)),this.colDefCols={tree:r,treeDepth:l,list:a,map:h},this.funcColsService.extractCols(t,s),this.ready=!0,this.refreshCols();e&&!this.showingPivotResult&&!this.gos.get("maintainColumnOrder")&&this.orderColsLikeColDefCols(),this.visibleColsService.refresh(t),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(t),i&&(this.changeEventsDispatching=!0,i(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(t),"gridInitializing"===t&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(){if(!this.colDefCols)return;const e=this.cols?.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.restoreColOrder(),this.positionLockedCols(),this.showRowGroupColsService?.refresh(),this.quickFilterService?.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear();!u(e,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=null!=e,e){const{map:t,list:i,tree:s,treeDepth:o}=e;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o};e.list.some((e=>void 0!==this.cols?.map[e.getColId()]))||(this.lastPivotOrder=null)}else{const{map:e,list:t,tree:i,treeDepth:s}=this.colDefCols;this.cols={list:t.slice(),map:{...e},tree:i.slice(),treeDepth:s}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns();return this.cols.list.filter((i=>{const s=Ee(i);if(e){const e=t&&S(t,i);return s||e}return s||i.isVisible()}))}addAutoCols(){var e;null!=this.autoCols&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),(e=this.cols).map={},e.list.forEach((t=>e.map[t.getId()]=t)))}createAutoCols(){const e=this.gos.isGroupUseEntireRow(this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),i=this.funcColsService.getRowGroupColumns(),s=()=>{this.autoCols&&(Pe(this.context,this.autoCols.tree),this.autoCols=null)};if(!(i.length>0||this.gos.get("treeData"))||t||e||!this.autoColService)return void s();const o=this.autoColService.createAutoCols(i)??[],n=(r=o,l=this.autoCols?.list||null,u(r,l,((e,t)=>e.getColId()===t.getColId())));var r,l;const a=this.cols.treeDepth,h=this.autoCols?this.autoCols.treeDepth:-1;if(n&&h==a)return;s();const[d,c]=this.columnFactory.createForAutoGroups(o,this.cols?.tree);this.autoCols={list:o,tree:d,treeDepth:c,map:{}};const g=e=>{if(!e)return null;const t=e.filter((e=>!Ee(e)));return[...o,...t]};this.lastOrder=g(this.lastOrder),this.lastPivotOrder=g(this.lastPivotOrder)}refreshAll(e){this.isReady()&&(this.refreshCols(),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,i){this.columnApplyStateService.applyColumnState({state:e.map((e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t})))},i)}setColsPinned(e,t,i){if(!this.cols)return;if(N(e))return;if(this.gos.isDomLayout("print"))return void de("Changing the column pinning status is not allowed with domLayout='print'");let s;this.columnAnimationService.start(),s=!0===t||"left"===t?"left":"right"===t?"right":null;const o=[];e.forEach((e=>{if(!e)return;const t=this.getCol(e);t&&t.getPinned()!==s&&(t.setPinned(s),o.push(t))})),o.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(o,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;s=oe(e)?e.getId():e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){let t=null;return xe(null,this.cols?.tree,(i=>{oe(i)&&i.getId()===e&&(t=i)})),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||0===t)return!1;if(-1===t)return!0;return t>this.funcColsService.getRowGroupColumns().findIndex((t=>t.getColId()===e.getColId()))}isSuppressAutoCol(){if("custom"===this.gos.get("groupDisplayType"))return!0;return"custom"===this.gos.get("treeDataDisplayType")}setAutoHeightActive(){if(this.autoHeightActive=this.cols.list.some((e=>e.isAutoHeight())),this.autoHeightActive){this.autoHeightActiveAtLeastOnce=!0;this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||de("autoHeight columns only work with Client Side Row Model and Server Side Row Model.")}}restoreColOrder(){const e=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!e)return;const t=new Map(e.map(((e,t)=>[e,t])));if(!this.cols.list.some((e=>t.has(e))))return;const i=new Map(this.cols.list.map((e=>[e,!0]))),s=e.filter((e=>i.has(e))),o=new Map(s.map((e=>[e,!0]))),n=this.cols.list.filter((e=>!o.has(e))),r=s.slice();n.forEach((e=>{let t=e.getOriginalParent();if(!t)return void r.push(e);const i=[];for(;!i.length&&t;){t.getLeafColumns().forEach((e=>{const t=r.indexOf(e)>=0,s=i.indexOf(e)<0;t&&s&&i.push(e)})),t=t.getOriginalParent()}if(!i.length)return void r.push(e);const s=i.map((e=>r.indexOf(e))),o=Math.max(...s);f(r,e,o+1)})),this.cols.list=r}orderColsLikeColDefCols(){if(!this.colDefCols||!this.cols)return;const e=this.colDefCols.list.filter((e=>this.cols.list.indexOf(e)>=0)),t=this.cols.list.filter((t=>e.indexOf(t)<0));this.cols.list=[...t,...e],this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}sortColsLikeKeys(e){if(null==this.cols)return;let t=[];const i={};e.forEach((e=>{if(i[e])return;const s=this.cols.map[e];s&&(t.push(s),i[e]=!0)}));let s=0;this.cols.list.forEach((e=>{const o=e.getColId();if(null!=i[o])return;o.startsWith(be)?f(t,e,s++):t.push(e)})),t=this.columnMoveService.placeLockedColumns(t),this.columnMoveService.doesMovePassMarryChildren(t)?this.cols.list=t:de("Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}sortColsLikeCols(e){if(!e||e.length<=1)return;e.filter((e=>this.cols.list.indexOf(e)<0)).length>0||e.sort(((e,t)=>this.cols.list.indexOf(e)-this.cols.list.indexOf(t)))}resetColDefIntoCol(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}queueResizeOperations(){this.shouldQueueResizeOperations=!0}isShouldQueueResizeOperations(){return this.shouldQueueResizeOperations}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach((e=>e())),this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}moveInCols(e,t,i){w(this.cols?.list,e,t),this.visibleColsService.refresh(i)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list:this.lastOrder=this.cols?.list}getColumnDefs(){if(!this.colDefCols)return;const e=this.colDefCols.list.slice();this.showingPivotResult?e.sort(((e,t)=>this.lastOrder.indexOf(e)-this.lastOrder.indexOf(t))):this.lastOrder&&e.sort(((e,t)=>this.cols.list.indexOf(e)-this.cols.list.indexOf(t)));const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns();return this.columnDefFactory.buildColumnDefs(e,t,i)}isShowingPivotResult(){return this.showingPivotResult}isChangeEventsDispatching(){return this.changeEventsDispatching}isColSpanActive(){return this.colSpanActive}isProvidedColGroupsPresent(){return this.colDefCols?.treeDepth>0}setColSpanActive(){this.colSpanActive=this.cols.list.some((e=>null!=e.getColDef().colSpan))}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}getHeaderRowCount(){return this.cols?this.cols.treeDepth+1:-1}isReady(){return this.ready}isPivotMode(){return this.pivotMode}setPivotMode(e,t){e!==this.pivotMode&&this.isPivotSettingAllowed(this.pivotMode)&&(this.pivotMode=e,this.ready&&(this.refreshCols(),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return!e||!this.gos.get("treeData")||(de("Pivot mode not available with treeData."),!1)}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!N(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(!0,e))}setColumnDefs(e,t){const i=!!this.colDefs;this.colDefs=e,this.createColsFromColDefs(i,t)}destroy(){Pe(this.context,this.colDefCols?.tree),Pe(this.context,this.autoCols?.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){return this.colDefCols?.list?this.colDefCols.list:null}getCols(){return this.cols?.list??[]}getAllCols(){const e=this.pivotResultColsService.getPivotResultCols(),t=e?.list;return[].concat(this.colDefCols?.list||[],this.autoCols?.list||[],t||[])}getColsForKeys(e){if(!e)return[];return e.map((e=>this.getCol(e))).filter((e=>null!=e))}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return null==e?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(null==t)return null;const{map:i,list:s}=t;if("string"==typeof e&&i[e])return i[e];for(let t=0;t<s.length;t++)if(Ie(s[t],e))return s[t];return this.getAutoCol(e)}getAutoCol(e){return null==this.autoCols?null:this.autoCols.list.find((t=>Ie(t,e)))||null}getAutoCols(){return this.autoCols?.list||null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&this.eventDispatcher.headerHeight(e)}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.visibleColsService.getAllCols().filter((e=>e.isAutoHeaderHeight())).map((e=>e.getAutoHeaderHeight()||0));return Math.max(e,...t)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if("fitCellContents"!==e?.type)return;const{colIds:t,skipHeader:i}=e;setTimeout((()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",i)}))}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}};function Ae(e){return"gridOptionsUpdated"===e?"gridOptionsChanged":e}function Ie(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}var Le=class extends I{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,this.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.autoSizeCols(e)));const{colKeys:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:n="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered())return this.timesDelayed++,void setTimeout((()=>this.autoSizeCols(e)));this.timesDelayed=0;const r=[];let l=-1;const a=null!=i?i:this.gos.get("skipHeaderOnAutoSize"),h=null!=s?s:a;for(;0!==l;){l=0;const e=[];t.forEach((t=>{if(!t)return;const i=this.columnModel.getCol(t);if(!i)return;if(r.indexOf(i)>=0)return;const s=this.autoWidthCalculator.getPreferredWidthForColumn(i,a);if(s>0){const e=this.normaliseColumnWidth(i,s);i.setActualWidth(e,n),r.push(i),l++}e.push(i)})),e.length&&this.visibleColsService.refresh(n)}h||this.autoSizeColumnGroupsByColumns(t,n,o),this.eventDispatcher.columnResized(r,!0,"autosizeColumns")}autoSizeColumn(e,t,i){e&&this.autoSizeCols({colKeys:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;let o;this.columnModel.getColsForKeys(e).forEach((e=>{let t=e.getParent();for(;t&&t!=i;)t.isPadding()||s.add(t),t=t.getParent()}));for(const e of s){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(o=t.getHeaderCtrlForColumn(e),o)break;o&&o.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.autoSizeAllColumns(e,t)));const i=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:i,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const i=e.getMinWidth();t<i&&(t=i);const s=e.getMaxWidth();return e.isGreaterThanMax(t)&&(t=s),t}},Oe=class extends I{constructor(){super(...arguments),this.beanName="funcColsService",this.rowGroupCols=[],this.valueCols=[],this.pivotCols=[]}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.aggFuncService=e.aggFuncService,this.visibleColsService=e.visibleColsService}getModifyColumnsNoEventsCallbacks(){return{addGroupCol:e=>this.rowGroupCols.push(e),removeGroupCol:e=>C(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>C(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>C(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupCols.slice(0);const i=this.columnModel.getColDefCol(t);return i?[i]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return N(this.rowGroupCols)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.columnModel.getColDefCol(e);s&&(s.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[s],i))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,((e,i)=>this.setRowGroupActive(e,i,t)),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,i),e||this.gos.get("suppressMakeColumnVisibleAfterUnGroup")||this.columnModel.setColsVisible([t],!0,i))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,(e=>this.setRowGroupActive(!0,e,t)),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,(e=>this.setRowGroupActive(!1,e,t)),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,(e=>e.setPivotActive(!0,t)),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"columnPivotChanged",!0,!1,((e,i)=>{i.setPivotActive(e,t)}),t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,(e=>e.setPivotActive(!1,t)),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,((e,i)=>this.setValueActive(e,i,t)),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,(e=>this.setValueActive(!0,e,t)),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,(e=>this.setValueActive(!1,e,t)),"columnValueChanged",t)}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupCols[e],o=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,s),this.eventDispatcher.rowGroupChanged(o,i)}setColList(e,t,i,s,o,n,r){if(N(this.columnModel.getCols()))return;const l=new Map;t.forEach(((e,t)=>l.set(e,t))),t.length=0,k(e)&&e.forEach((e=>{const i=this.columnModel.getColDefCol(e);i&&t.push(i)})),t.forEach(((e,t)=>{const i=l.get(e);void 0!==i?s&&i!==t||l.delete(e):l.set(e,0)}));(this.columnModel.getColDefCols()||[]).forEach((e=>{const i=t.indexOf(e)>=0;n(i,e)})),o&&this.columnModel.refreshCols(),this.visibleColsService.refresh(r),this.eventDispatcher.columnChanged(i,[...l.keys()],r)}updateColList(e,t,i,s,o,n,r){if(!e||N(e))return;let l=!1;e.forEach((e=>{if(!e)return;const s=this.columnModel.getColDefCol(e);if(s){if(i){if(t.indexOf(s)>=0)return;t.push(s)}else{if(t.indexOf(s)<0)return;C(t,s)}o(s),l=!0}})),l&&(s&&this.columnModel.refreshCols(),this.visibleColsService.refresh(r),this.eventDispatcher.genericColumnEvent(n,t,r))}extractCols(e,t){this.extractRowGroupCols(e,t),this.extractPivotCols(e,t),this.extractValueCols(e,t)}extractValueCols(e,t){this.valueCols=this.extractColsCommon(t,this.valueCols,((t,i)=>t.setValueActive(i,e)),(()=>{}),(()=>{}),(e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0}),(e=>null!=e.initialAggFunc&&""!=e.initialAggFunc)),this.valueCols.forEach((e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)}))}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,((t,i)=>t.setRowGroupActive(i,e)),(e=>e.rowGroupIndex),(e=>e.initialRowGroupIndex),(e=>e.rowGroup),(e=>e.initialRowGroup))}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,((t,i)=>t.setPivotActive(i,e)),(e=>e.pivotIndex),(e=>e.initialPivotIndex),(e=>e.pivot),(e=>e.initialPivot))}extractColsCommon(e=[],t=[],i,s,o,n,r){const l=[],a=[];(this.columnModel.getColDefCols()||[]).forEach((i=>{const h=e.indexOf(i)<0,d=i.getColDef(),c=V(n(d)),u=V(r(d)),g=B(s(d)),p=B(o(d));let m;if(m=void 0!==c?c:void 0!==g?null!==g&&g>=0:h?void 0!==u?u:!!(void 0!==p)&&(null!=p&&p>=0):t.indexOf(i)>=0,m){(h?null!=g||null!=p:null!=g)?l.push(i):a.push(i)}}));const h=e=>{const t=s(e.getColDef()),i=o(e.getColDef());return null!=t?t:i};l.sort(((e,t)=>{const i=h(e),s=h(t);return i===s?0:i<s?-1:1}));const d=[].concat(l);return t.forEach((e=>{a.indexOf(e)>=0&&d.push(e)})),a.forEach((e=>{d.indexOf(e)<0&&d.push(e)})),t.forEach((e=>{d.indexOf(e)<0&&i(e,!1)})),d.forEach((e=>{t.indexOf(e)<0&&i(e,!0)})),d}generateColumnStateForRowGroupAndPivotIndexes(e,t){const i={},s=(e,t,s,o,n,r)=>{const l=this.columnModel.getColDefCols();if(!t.length||!l)return[];const a=Object.keys(e),h=new Set(a),d=new Set(a),c=new Set(t.map((e=>{const t=e.getColId();return d.delete(t),t})).concat(a)),u=[],g={};let p=0;for(let e=0;e<l.length;e++){const t=l[e].getColId();c.has(t)&&(u.push(t),g[t]=p++)}let m=1e3,C=!1,f=0;const v=t=>{const i=g[t];for(let t=f;t<i;t++){const i=u[t];d.has(i)&&(e[i][n]=m++,d.delete(i))}f=i};t.forEach((t=>{const l=t.getColId();if(h.has(l))v(l),e[l][n]=m++;else{const a=t.getColDef();if(null===a[n]||void 0===a[n]&&null==a[r]){if(!C){a[s]||void 0===a[s]&&a[o]?v(l):(d.forEach((t=>{e[t][n]=m+g[t]})),m+=u.length,C=!0)}i[l]||(i[l]={colId:l}),i[l][n]=m++}}}))};return s(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}},ke=class extends I{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const i=this.columnModel.getColDefCols()||[];if(N(i))return!1;if(e&&e.state&&!e.state.forEach)return de("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."),!1;const s=this.funcColsService.getModifyColumnsNoEventsCallbacks(),o=(i,o,n)=>{const r=this.compareColumnStatesAndDispatchEvents(t),l=o.slice(),a={},h={},d=[],c=[];let u=0;const g=this.funcColsService.getRowGroupColumns().slice(),p=this.funcColsService.getPivotColumns().slice();i.forEach((i=>{const o=i.colId||"";if(o.startsWith(be))return d.push(i),void c.push(i);const r=n(o);r?(this.syncColumnWithStateItem(r,i,e.defaultState,a,h,!1,t,s),C(l,r)):(c.push(i),u+=1)}));const m=i=>this.syncColumnWithStateItem(i,null,e.defaultState,a,h,!1,t,s);l.forEach(m),this.funcColsService.sortRowGroupColumns(Ge.bind(this,a,g)),this.funcColsService.sortPivotColumns(Ge.bind(this,h,p)),this.columnModel.refreshCols();const f=(this.columnModel.getAutoCols()||[]).slice();return d.forEach((i=>{const o=this.columnModel.getAutoCol(i.colId);C(f,o),this.syncColumnWithStateItem(o,i,e.defaultState,null,null,!0,t,s)})),f.forEach(m),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),r(),{unmatchedAndAutoStates:c,unmatchedCount:u}};this.columnAnimationService.start();let{unmatchedAndAutoStates:n,unmatchedCount:r}=o(e.state||[],i,(e=>this.columnModel.getColDefCol(e)));if(n.length>0||k(e.defaultState)){const e=this.pivotResultColsService.getPivotResultCols(),t=e?.list;r=o(n,t||[],(e=>this.pivotResultColsService.getPivotResultCol(e))).unmatchedCount}return this.columnAnimationService.finish(),0===r}resetColumnState(e){if(N(this.columnModel.getColDefCols()))return;const t=Re(this.columnModel.getColDefColTree()),i=[];let s=1e3,o=1e3,n=[];const r=this.columnModel.getAutoCols();r&&(n=n.concat(r)),t&&(n=n.concat(t)),n.forEach((e=>{const t=this.getColumnStateFromColDef(e);G(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=s++),G(t.pivotIndex)&&t.pivot&&(t.pivotIndex=o++),i.push(t)})),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),n=t(i.hide,i.initialHide),r=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),a=t(i.flex,i.initialFlex);let h=t(i.rowGroupIndex,i.initialRowGroupIndex),d=t(i.rowGroup,i.initialRowGroup);null!=h||null!=d&&0!=d||(h=null,d=null);let c=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);null!=c||null!=u&&0!=u||(c=null,u=null);const g=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:n,pinned:r,width:l,flex:a,rowGroup:d,rowGroupIndex:h,pivot:u,pivotIndex:c,aggFunc:g}}syncColumnWithStateItem(e,t,i,s,o,n,r,l){if(!e)return;const a=(e,s)=>{const o={value1:void 0,value2:void 0};let n=!1;return t&&(void 0!==t[e]&&(o.value1=t[e],n=!0),k(s)&&void 0!==t[s]&&(o.value2=t[s],n=!0)),!n&&i&&(void 0!==i[e]&&(o.value1=i[e]),k(s)&&void 0!==i[s]&&(o.value2=i[s])),o},h=a("hide").value1;void 0!==h&&e.setVisible(!h,r);const d=a("pinned").value1;void 0!==d&&e.setPinned(d);const c=e.getColDef().minWidth??20,u=a("flex").value1;if(void 0!==u&&e.setFlex(u),null==u){const t=a("width").value1;null!=t&&null!=c&&t>=c&&e.setActualWidth(t,r)}const g=a("sort").value1;void 0!==g&&("desc"===g||"asc"===g?e.setSort(g,r):e.setSort(void 0,r));const p=a("sortIndex").value1;if(void 0!==p&&e.setSortIndex(p),n||!e.isPrimary())return;const m=a("aggFunc").value1;void 0!==m&&("string"==typeof m?(e.setAggFunc(m),e.isValueActive()||(e.setValueActive(!0,r),l.addValueCol(e))):(k(m)&&de("stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,r),l.removeValueCol(e))));const{value1:C,value2:f}=a("rowGroup","rowGroupIndex");void 0===C&&void 0===f||("number"==typeof f||C?(e.isRowGroupActive()||(e.setRowGroupActive(!0,r),l.addGroupCol(e)),s&&"number"==typeof f&&(s[e.getId()]=f)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,r),l.removeGroupCol(e)));const{value1:v,value2:w}=a("pivot","pivotIndex");void 0===v&&void 0===w||("number"==typeof w||v?(e.isPivotActive()||(e.setPivotActive(!0,r),l.addPivotCol(e)),o&&"number"==typeof w&&(o[e.getId()]=w)):e.isPivotActive()&&(e.setPivotActive(!1,r),l.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach((e=>{null!=e.colId&&t.push(e.colId)})),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},i=this.columnGetStateService.getColumnState(),s={};return i.forEach((e=>{s[e.colId]=e})),()=>{const o=this.columnModel.getAllCols(),n=(t,i,s,o)=>{if(u(i.map(o),s.map(o)))return;const n=new Set(i);s.forEach((e=>{n.delete(e)||n.add(e)}));const r=[...n],l={type:t,columns:r,column:1===r.length?r[0]:null,source:e};this.eventService.dispatchEvent(l)},r=e=>{const t=[];return o.forEach((i=>{const o=s[i.getColId()];o&&e(o,i)&&t.push(i)})),t},l=e=>e.getColId();n("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),l),n("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),l);const a=r(((e,t)=>{const i=null!=e.aggFunc,s=i!=t.isValueActive(),o=i&&e.aggFunc!=t.getAggFunc();return s||o}));a.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",a,e);this.eventDispatcher.columnResized(r(((e,t)=>e.width!=t.getActualWidth())),!0,e);this.eventDispatcher.columnPinned(r(((e,t)=>e.pinned!=t.getPinned())),e);this.eventDispatcher.columnVisible(r(((e,t)=>e.hide==t.isVisible())),e);const h=r(((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex()));h.length>0&&this.sortController.dispatchSortChangedEvents(e,h),this.normaliseColumnMovedEventForColumnState(i,e)}}normaliseColumnMovedEventForColumnState(e,t){const i=this.columnGetStateService.getColumnState(),s={};i.forEach((e=>s[e.colId]=e));const o={};e.forEach((e=>{s[e.colId]&&(o[e.colId]=!0)}));const n=e.filter((e=>o[e.colId])),r=i.filter((e=>o[e.colId])),l=[];r.forEach(((e,t)=>{const i=n&&n[t];if(i&&i.colId!==e.colId){const e=this.columnModel.getCol(i.colId);e&&l.push(e)}})),l.length&&this.eventDispatcher.columnMoved({movedColumns:l,source:t,finished:!0})}},Ge=(e,t,i,s)=>{const o=e[i.getId()],n=e[s.getId()],r=null!=o,l=null!=n;if(r&&l)return o-n;if(r)return-1;if(l)return 1;const a=t.indexOf(i),h=t.indexOf(s),d=a>=0;return d&&h>=0?a-h:d?-1:1},Ne=class extends I{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,i){const s=this.columnModel.getCols();if(!s)return;const o=s[e];this.moveColumns([o],t,i)}moveColumns(e,t,i,s=!0){const o=this.columnModel.getCols();if(!o)return;if(this.columnAnimationService.start(),t>o.length-e.length)return de("tried to insert columns in invalid location, toIndex = ",t),void de("remember that you should not count the moving columns when calculating the new index");const n=this.columnModel.getColsForKeys(e);!this.doesMovePassRules(n,t)||(this.columnModel.moveInCols(n,t,i),this.eventDispatcher.columnMoved({movedColumns:n,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const i=this.columnModel.getCols().slice();return w(i,e,t),i}doesMovePassLockedPositions(e){const t=this.gos.get("enableRtl");let i=t?1:-1,s=!0;return e.forEach((e=>{const o=(n=e.getColDef().lockPosition)?"left"===n||!0===n?-1:1:0;var n;t?o>i&&(s=!1):o<i&&(s=!1),i=o})),s}doesMovePassMarryChildren(e){let t=!0;return xe(null,this.columnModel.getColTree(),(i=>{if(!oe(i))return;const s=i,o=s.getColGroupDef();if(!(o&&o.marryChildren))return;const n=[];s.getLeafColumns().forEach((t=>{const i=e.indexOf(t);n.push(i)}));Math.max.apply(Math,n)-Math.min.apply(Math,n)>s.getLeafColumns().length-1&&(t=!1)})),t}placeLockedColumns(e){const t=[],i=[],s=[];e.forEach((e=>{const o=e.getColDef().lockPosition;"right"===o?s.push(e):"left"===o||!0===o?t.push(e):i.push(e)}));return this.gos.get("enableRtl")?[...s,...i,...t]:[...t,...i,...s]}},He=/[&<>"']/g,Be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ve(e){const t=String.fromCharCode;function i(e,i){return t(e>>i&63|128)}function s(e){if(!(4294967168&e))return t(e);let s="";return 4294965248&e?4294901760&e?4292870144&e||(s=t(e>>18&7|240),s+=i(e,12),s+=i(e,6)):(!function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),s=t(e>>12&15|224),s+=i(e,6)):s=t(e>>6&31|192),s+=t(63&e|128),s}const o=function(e){const t=[];if(!e)return[];const i=e.length;let s,o,n=0;for(;n<i;)s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<i?(o=e.charCodeAt(n++),56320==(64512&o)?t.push(((1023&s)<<10)+(1023&o)+65536):(t.push(s),n--)):t.push(s);return t}(e),n=o.length;let r,l=-1,a="";for(;++l<n;)r=o[l],a+=s(r);return a}function We(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function ze(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(He,(e=>Be[e]))}var _e=class extends I{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const n=e.headerValueGetter;if(n){const r=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o});return"function"==typeof n?n(r):"string"==typeof n?this.expressionService.evaluate(n,r):(de("headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?(r=e.field)&&null!=r?r.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map((e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):""))).join(" "):null:"";var r}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn;let s,o=null;if(k(i)){const n=this.funcColsService.getValueColumns(),r=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&1===n.length,l=void 0!==e.getColDef().pivotTotalColumnIds;if(r&&!l)return t;o=i?i.getAggFunc():null,s=!0}else{const t=e.isValueActive(),i=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();t&&i?(o=e.getAggFunc(),s=!0):s=!1}if(s){const e="string"==typeof o?o:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${t})`}return t}},Ue=class extends I{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){Pe(this.context,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return null!=this.pivotResultCols}lookupPivotResultCol(e,t){if(null==this.pivotResultCols)return null;const i=this.columnModel.getColDefCol(t);let s=null;return this.pivotResultCols.list.forEach((t=>{const o=t.getColDef().pivotKeys,n=t.getColDef().pivotValueColumn;u(o,e)&&n===i&&(s=t)})),s}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.columnModel.isReady()&&(null!=e||null!=this.pivotResultCols)){if(e){this.processPivotResultColDef(e);const i=this.columnFactory.createColumnTree(e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);Pe(this.context,this.pivotResultCols?.tree,i.columnTree);const s=i.columnTree,o=i.treeDept,n=Re(s),r={};this.pivotResultCols={tree:s,treeDepth:o,list:n,map:r},this.pivotResultCols.list.forEach((e=>this.pivotResultCols.map[e.getId()]=e)),this.previousPivotResultCols=null}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null;this.columnModel.refreshCols(),this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=e=>{e.forEach((e=>{if(k(e.children)){const t=e;i&&i(t),s(t.children)}else{t&&t(e)}}))};e&&s(e)}},Ke=class extends I{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,i,s){const o=[];e.forEach((e=>{const i=this.columnModel.getColDefCol(e.key)||this.columnModel.getCol(e.key);if(!i)return;o.push({width:e.newWidth,ratios:[1],columns:[i]});if("shift"===this.gos.get("colResizeDefault")&&(t=!t),t){const t=this.visibleColsService.getColAfter(i);if(!t)return;const s=i.getActualWidth()-e.newWidth,n=t.getActualWidth()+s;o.push({width:n,ratios:[1],columns:[t]})}})),0!==o.length&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(!(!t||t.every((e=>this.checkMinAndMaxWidthsForSet(e))))){if(i){const e=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(e,i,s)}return}const o=[],n=[];t.forEach((e=>{const{width:t,columns:i,ratios:r}=e,l={},a={};i.forEach((e=>n.push(e)));let h=!0,d=0;for(;h;){if(d++,d>1e3){ce("infinite loop in resizeColumnSets");break}h=!1;const e=[];let s=0,o=t;i.forEach(((t,i)=>{if(a[t.getId()])o-=l[t.getId()];else{e.push(t);const o=r[i];s+=o}}));const n=1/s;e.forEach(((i,s)=>{let d;s===e.length-1?d=o:(d=Math.round(r[s]*t*n),o-=d);const c=i.getMinWidth(),u=i.getMaxWidth();d<c?(d=c,a[i.getId()]=!0,h=!0):u>0&&d>u&&(d=u,a[i.getId()]=!0,h=!0),l[i.getId()]=d}))}i.forEach((e=>{const t=l[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,s),o.push(e))}))}));const r=o.length>0;let l=[];r&&(l=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.visibleColsService.setLeftValues(s),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const a=n.concat(l);(r||i)&&this.eventDispatcher.columnResized(a,i,s,l)}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,n=!0;t.forEach((e=>{const t=e.getMinWidth();s+=t||0;const i=e.getMaxWidth();i>0?o+=i:n=!1}));return i>=s&&(!n||i<=o)}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const i=this.visibleColsService.getCenterCols();let s=-1;if(e.resizingCols){const t=new Set(e.resizingCols);for(let e=i.length-1;e>=0;e--)if(t.has(i[e])){s=e;break}}let o=0,n=[],r=0,l=0;for(let e=0;e<i.length;e++){i[e].getFlex()&&e>s?(n.push(i[e]),l+=i[e].getFlex(),r+=i[e].getMinWidth()):o+=i[e].getActualWidth()}if(!n.length)return[];let a=[];o+r>this.flexViewportWidth&&(n.forEach((e=>e.setActualWidth(e.getMinWidth(),t))),a=n,n=[]);const h=[];let d;e:for(;;){d=this.flexViewportWidth-o;const e=d/l;for(let i=0;i<n.length;i++){const s=n[i],r=e*s.getFlex();let d=0;const c=s.getMinWidth(),u=s.getMaxWidth();if(r<c?d=c:r>u&&(d=u),d){s.setActualWidth(d,t),m(n,s),l-=s.getFlex(),a.push(s),o+=s.getActualWidth();continue e}h[i]=Math.round(r)}break}let c=d;return n.forEach(((e,i)=>{e.setActualWidth(Math.min(h[i],c),t),a.push(e),c-=h[i]})),e.skipSetLeft||this.visibleColsService.setLeftValues(t),e.updateBodyWidths&&this.visibleColsService.updateBodyWidths(),e.fireResizedEvent&&this.eventDispatcher.columnResized(a,!0,t,n),n}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){if(this.columnModel.isShouldQueueResizeOperations())return void this.columnModel.pushResizeOperation((()=>this.sizeColumnsToFit(e,t,i,s)));const o={};s&&s?.columnLimits?.forEach((({key:e,...t})=>{o["string"==typeof e?e:e.getColId()]=t}));const n=this.visibleColsService.getAllCols(),r=e===Fe(n);if(e<=0||!n.length||r)return;const l=[],a=[];n.forEach((e=>{!0===e.getColDef().suppressSizeToFit?a.push(e):l.push(e)}));const h=l.slice(0);let d=!1;const c=e=>{C(l,e),a.push(e)};for(l.forEach((e=>{e.resetActualWidth(t);const i=o?.[e.getId()],n=i?.minWidth??s?.defaultMinWidth,r=i?.maxWidth??s?.defaultMaxWidth,l=e.getActualWidth();"number"==typeof n&&l<n?e.setActualWidth(n,t,!0):"number"==typeof r&&l>r&&e.setActualWidth(r,t,!0)}));!d;){d=!0;const i=e-Fe(a);if(i<=0)l.forEach((e=>{const i=o?.[e.getId()]?.minWidth??s?.defaultMinWidth;"number"!=typeof i?e.setMinimum(t):e.setActualWidth(i,t,!0)}));else{const e=i/Fe(l);let n=i;for(let i=l.length-1;i>=0;i--){const r=l[i],a=o?.[r.getId()],h=a?.minWidth??s?.defaultMinWidth,u=a?.maxWidth??s?.defaultMaxWidth,g=r.getMinWidth(),p=r.getMaxWidth(),m="number"==typeof h&&h>g?h:g,C="number"==typeof u&&u<p?u:p;let f=Math.round(r.getActualWidth()*e);f<m?(f=m,c(r),d=!1):f>C?(f=C,c(r),d=!1):0===i&&(f=n),r.setActualWidth(f,t,!0),n-=f}}}h.forEach((e=>{e.fireColumnWidthChangedEvent(t)})),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),i||this.eventDispatcher.columnResized(h,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout((()=>{if("fitGridWidth"===t){const{columnLimits:t,defaultMinWidth:i,defaultMaxWidth:s}=e,o=t?.map((({colId:e,minWidth:t,maxWidth:i})=>({key:e,minWidth:t,maxWidth:i})));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:i,defaultMaxWidth:s,columnLimits:o})}else"fitProvidedWidth"===t&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")}))}};function $e(e,t){return e+"_"+t}function je(e){return e instanceof qe}var qe=class extends I{constructor(e,t,i,s){super(),this.isColumn=!1,this.displayedChildren=[],this.parent=null,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return $e(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every((e=>e.isMoving()))}checkLeft(){if(this.displayedChildren.forEach((e=>{je(e)&&e.checkLeft()})),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const e=c(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach((t=>{e+=t.getActualWidth()})),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach((t=>{t.isResizable()&&(e=!0)})),e}getMinWidth(){let e=0;return this.displayedChildren.forEach((t=>{e+=t.getMinWidth()})),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach((t=>{ie(t)?e.push(t):je(t)&&t.addDisplayedLeafColumns(e)}))}addLeafColumns(e){this.children.forEach((t=>{ie(t)?e.push(t):je(t)&&t.addLeafColumns(e)}))}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;null!=e&&e.isPadding();)e=e.getParent();if(!(!!e&&e.getProvidedColumnGroup().isExpandable()))return this.displayedChildren=this.children,void this.dispatchLocalEvent({type:"displayedChildrenChanged"});this.children.forEach((t=>{if(je(t)&&(!t.displayedChildren||!t.displayedChildren.length))return;switch(t.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(t);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(t);break;default:this.displayedChildren.push(t)}})),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},Ye=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}},Qe=class extends I{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=Je(this.treeLeft),this.columnsCenter=Je(this.treeCenter),this.columnsRight=Je(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter((e=>e.isAutoHeight())),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols()}updateBodyWidths(){const e=Fe(this.columnsCenter),t=Fe(this.columnsLeft),i=Fe(this.columnsRight);this.bodyWidthDirty=this.bodyWidth!==e;if(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const s={type:"columnContainerWidthChanged"};this.eventService.dispatchEvent(s);const o={type:"displayedColumnsWidthChanged"};this.eventService.dispatchEvent(o)}}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,i=this.columnsRight?c(this.columnsRight):null):(t=this.columnsLeft?c(this.columnsLeft):null,i=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach((s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)}))}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter((e=>"left"==e.getPinned())),i=e.filter((e=>"right"==e.getPinned())),s=e.filter((e=>"left"!=e.getPinned()&&"right"!=e.getPinned())),o=new Ye;this.treeLeft=this.createGroups({columns:t,idCreator:o,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:i,idCreator:o,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:s,idCreator:o,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],i=[],s=[];for(const o of e){const e=o.getPinned();e?!0===e||"left"===e?t.push(o):s.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(s)}getAriaColIndex(e){let t;return t=je(e)?e.getLeafColumns()[0]:e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach((e=>{e.forEach((e=>{if(je(e)){e.checkLeft()}}))}))}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const t=this.columnModel.getCols().slice(0),i=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach((s=>{if(i){let t=Fe(s);s.forEach((i=>{t-=i.getActualWidth(),i.setLeft(t,e)}))}else{let t=0;s.forEach((i=>{i.setLeft(t,e),t+=i.getActualWidth()}))}!function(e,t){for(let i=0;i<t.length;i++)m(e,t[i])}(t,s)})),t.forEach((t=>{t.setLeft(null,e)}))}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,i,s){const o=[];let n=null;for(let r=0;r<t.length;r++){const l=t[r],a=t.length-r,h=Math.min(l.getColSpan(e),a),d=[l];if(h>1){const e=h-1;for(let i=1;i<=e;i++)d.push(t[r+i]);r+=e}let c;if(i?(c=!1,d.forEach((e=>{i(e)&&(c=!0)}))):c=!0,c){if(0===o.length&&n){!!s&&s(l)&&o.push(n)}o.push(l)}n=l}return o}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),i=t.indexOf(e);return i>0?t[i-1]:null}getGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o="After"===t?c(s):s[0],n=`getCol${t}`;for(;;){const t=this[n](o);if(!t)return null;const s=this.getColGroupAtLevel(t,i);if(s!==e)return s}}getColGroupAtLevel(e,t){let i,s,o=e.getParent();for(;;){if(i=o.getProvidedColumnGroup().getLevel(),s=o.getPaddingLevel(),i+s<=t)break;o=o.getParent()}return o}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=e=>{this.colsAndGroupsMap[e.getUniqueId()]=e};Xe(this.treeCenter,!1,e),Xe(this.treeLeft,!1,e),Xe(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){Xe(this.getAllTrees(),!1,(e=>{je(e)&&e.calculateDisplayedColumns()}))}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?c(s):s[0]}return null}getColumnGroup(e,t){if(!e)return null;if(je(e))return e;const i=this.getAllTrees(),s="number"==typeof t;let o=null;return Xe(i,!1,(i=>{if(je(i)){const n=i;let r;r=s?e===n.getGroupId()&&t===n.getPartId():e===n.getGroupId(),r&&(o=n)}})),o}getColAfter(e){const t=this.getAllCols(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}isBodyWidthDirty(){return this.bodyWidthDirty}setBodyWidthDirty(){this.bodyWidthDirty=!0}getColsLeftWidth(){return Fe(this.columnsLeft)}getDisplayedColumnsRightWidth(){return Fe(this.columnsRight)}isColAtEdge(e,t){const i=this.getAllCols();if(!i.length)return!1;const s="first"===t;let o;if(je(e)){const t=e.getDisplayedLeafColumns();if(!t.length)return!1;o=s?t[0]:c(t)}else o=e;return(s?i[0]:c(i))===o}createGroups(e){const{columns:t,idCreator:i,pinned:s,oldDisplayedGroups:o,isStandaloneStructure:n}=e,r=this.mapOldGroupsById(o),l=[];let a=t;for(;a.length;){const e=a;a=[];let t=0;const o=o=>{const h=t;t=o;const d=e[h],c=(je(d)?d.getProvidedColumnGroup():d).getOriginalParent();if(null==c){for(let t=h;t<o;t++)l.push(e[t]);return}const u=this.createColGroup(c,i,r,s,n);for(let t=h;t<o;t++)u.addChild(e[t]);a.push(u)};for(let i=1;i<e.length;i++){const s=e[i],n=(je(s)?s.getProvidedColumnGroup():s).getOriginalParent(),r=e[t];n!==(je(r)?r.getProvidedColumnGroup():r).getOriginalParent()&&o(i)}t<e.length&&o(e.length)}return n||this.setupParentsIntoCols(l,null),l}createColGroup(e,t,i,s,o){const n=e.getGroupId(),r=t.getInstanceIdForKey(n);let l=i[$e(n,r)];return l&&l.getProvidedColumnGroup()!==e&&(l=null),k(l)?l.reset():(l=new qe(e,n,r,s),o||this.createBean(l)),l}mapOldGroupsById(e){const t={},i=e=>{e.forEach((e=>{if(je(e)){const s=e;t[e.getUniqueId()]=s,i(s.getChildren())}}))};return e&&i(e),t}setupParentsIntoCols(e,t){e.forEach((e=>{if(e.setParent(t),je(e)){const t=e;this.setupParentsIntoCols(t.getChildren(),t)}}))}};function Xe(e,t,i){if(e)for(let s=0;s<e.length;s++){const o=e[s];if(je(o)){Xe(t?o.getDisplayedChildren():o.getChildren(),t,i)}i(o)}}function Je(e){const t=[];return Xe(e,!0,(e=>{ie(e)&&t.push(e)})),t}var Ze=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","rangeSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterOpened","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd"],et=[...Ze,"scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged"],tt={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},it=class{};it.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],it.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"],it.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],it.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],it.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading"],it.OTHER_PROPERTIES=["suppressStickyTotalRow"],it.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],it.ALL_PROPERTIES=[...it.ARRAY_PROPERTIES,...it.OBJECT_PROPERTIES,...it.STRING_PROPERTIES,...it.NUMBER_PROPERTIES,...it.FUNCTION_PROPERTIES,...it.BOOLEAN_PROPERTIES,...it.OTHER_PROPERTIES];var st=it,ot=class{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}};ot.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",ot.PUBLIC_EVENTS=Ze,ot.EVENT_CALLBACKS=et.map((e=>ot.getCallbackForEvent(e))),ot.BOOLEAN_PROPERTIES=st.BOOLEAN_PROPERTIES,ot.ALL_PROPERTIES=st.ALL_PROPERTIES,ot.ALL_PROPERTIES_AND_CALLBACKS=[...ot.ALL_PROPERTIES,...ot.EVENT_CALLBACKS],ot.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(ot.ALL_PROPERTIES_AND_CALLBACKS);var nt=ot;function rt(e,t){"object"!=typeof e&&(e={});const i={...e};return nt.ALL_PROPERTIES_AND_CALLBACKS.forEach((e=>{const s=t[e];void 0!==s&&s!==nt.VUE_OMITTED_PROPERTY&&(i[e]=s)})),i}function lt(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).filter((e=>nt.ALL_PROPERTIES_AND_CALLBACKS_SET.has(e))).forEach((t=>{i[t]=e[t],s=!0})),!s)return;const o={type:"gridOptionsChanged",options:i};t.dispatchEvent(o);const n={type:"componentStateChanged"};$(i,((e,t)=>{n[e]=t})),t.dispatchEvent(n)}var at,ht,dt,ct,ut,gt,pt,mt,Ct,ft=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)return void t.forEach((e=>this.addCssClass(e)));if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)return void t.forEach((e=>this.removeCssClass(e)));if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1)return void i.forEach((e=>this.addOrRemoveCssClass(e,t)))}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}};function vt(e,t,i){null==i||"string"==typeof i&&""==i?St(e,t):wt(e,t,i)}function wt(e,t,i){e.setAttribute(yt(t),i.toString())}function St(e,t){e.removeAttribute(yt(t))}function yt(e){return`aria-${e}`}function bt(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Rt(e){return parseInt(e.getAttribute("aria-posinset"),10)}function Ft(e,t){vt(e,"label",t)}function Pt(e,t){vt(e,"labelledby",t)}function Et(e,t){vt(e,"describedby",t)}function Dt(e,t){vt(e,"live",t)}function Mt(e,t){vt(e,"level",t)}function xt(e,t){vt(e,"disabled",t)}function Tt(e,t){vt(e,"hidden",t)}function At(e,t){vt(e,"activedescendant",t)}function It(e,t){wt(e,"expanded",t)}function Lt(e){St(e,"expanded")}function Ot(e,t){wt(e,"setsize",t)}function kt(e,t){wt(e,"posinset",t)}function Gt(e,t){wt(e,"rowcount",t)}function Nt(e,t){wt(e,"rowindex",t)}function Ht(e,t){wt(e,"colcount",t)}function Bt(e,t){wt(e,"colindex",t)}function Vt(e,t){wt(e,"colspan",t)}function Wt(e,t){wt(e,"sort",t)}function zt(e){St(e,"sort")}function _t(e,t){vt(e,"selected",t)}function Ut(e,t){wt(e,"checked",void 0===t?"mixed":t)}function Kt(e,t){vt(e,"controls",t.id),Pt(t,e.id)}function $t(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}function jt(){return void 0===at&&(at=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),at}function qt(){if(void 0===ht)if(jt()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(ht=null!=e[1]?parseFloat(e[1]):0)}else ht=0;return ht}function Yt(){if(void 0===dt){const e=window;dt=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return dt}function Qt(){return void 0===ct&&(ct=/(firefox)/i.test(navigator.userAgent)),ct}function Xt(){return void 0===ut&&(ut=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),ut}function Jt(){return void 0===gt&&(gt=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),gt}function Zt(){return!jt()||qt()>=15}function ei(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||Qt())?t.toString():null}function ti(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(mt=i,pt=0===i)}function ii(){return null==pt&&ti(),pt}function si(e,t,i){const s=e.parentElement;let o=s&&s.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),i&&o.classList.toggle(i,o!==e),o=o.nextSibling}var oi="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function ni(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),s=t.call(e,oi),o=bi(e);return i&&!s&&o}function ri(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Tt(e,!t)}function li(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Tt(e,!t)}function ai(e,t){const i="disabled",s=t?e=>e.setAttribute(i,""):e=>e.removeAttribute(i);s(e),Li(e.querySelectorAll("input"),(e=>s(e)))}function hi(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++s>i)break}else if(e===i)break}return!1}function di(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:n,borderLeftWidth:r,paddingTop:l,paddingRight:a,paddingBottom:h,paddingLeft:d,marginTop:c,marginRight:u,marginBottom:g,marginLeft:p,boxSizing:m}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(n||"0"),borderLeftWidth:parseFloat(r||"0"),paddingTop:parseFloat(l||"0"),paddingRight:parseFloat(a||"0"),paddingBottom:parseFloat(h||"0"),paddingLeft:parseFloat(d||"0"),marginTop:parseFloat(c||"0"),marginRight:parseFloat(u||"0"),marginBottom:parseFloat(g||"0"),marginLeft:parseFloat(p||"0"),boxSizing:m}}function ci(e){const t=di(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function ui(e){const t=di(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function gi(e){const{height:t,marginBottom:i,marginTop:s}=di(e);return Math.floor(t+i+s)}function pi(e){const{width:t,marginLeft:i,marginRight:s}=di(e);return Math.floor(t+i+s)}function mi(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:n}=di(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(n||0)}}function Ci(){if("boolean"==typeof Ct)return Ct;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n <span style="display: inline-block; width: 1px"></span>\n <span style="display: inline-block; width: 1px"></span>\n </div>',document.body.appendChild(e),e.scrollLeft=1,Ct=0===Math.floor(e.scrollLeft),document.body.removeChild(e),Ct}function fi(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),Yt()&&!Ci()&&(i=e.scrollWidth-e.clientWidth-i)),i}function vi(e,t,i){i&&(Ci()?t*=-1:(jt()||Yt())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function wi(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function Si(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function yi(e){return!!e.offsetParent}function bi(e){const t=e;if(t.checkVisibility)return t.checkVisibility({checkVisibilityCSS:!0});return!(!yi(e)||"visible"!==window.getComputedStyle(e).visibility)}function Ri(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function Fi(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function Pi(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function Ei(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||null==s)continue;const t=i.replace(/[A-Z]/g,(e=>`-${e.toLocaleLowerCase()}`)),o=s.toString(),n=o.replace(/\s*!important/g,""),r=n.length!=o.length?"important":void 0;e.style.setProperty(t,n,r)}}function Di(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):Mi(e,t)}function Mi(e,t){t=Ti(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function xi(e,t){t=Ti(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function Ti(e){return"number"==typeof e?`${e}px`:e}function Ai(e){return e instanceof Node||e instanceof HTMLElement}function Ii(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function Li(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function Oi(e,t){e.then((e=>{const i=e.getGui();null!=i&&("object"==typeof i?t.appendChild(i):t.innerHTML=i)}))}var ki=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},Gi=class e extends I{constructor(e,t,i,s){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.shouldDisplayTooltip=s,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(e){this.popupService=e.popupService,this.userComponentFactory=e.userComponentFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const e=this.parentComp.getGui();0===this.tooltipTrigger&&this.addManagedListeners(e,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),1===this.tooltipTrigger&&this.addManagedListeners(e,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(e,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(e,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(e){const t=this.gos.get(e);return t<0&&de(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){return"show"===e?this.tooltipShowDelayOverride??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipHideDelayOverride??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gos.get("tooltipTrigger");return e&&"hover"!==e?1:0}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),Jt()||(e.isLocked?this.showTooltipTimeoutId=window.setTimeout((()=>{this.prepareToShowTooltip(t)}),100):this.prepareToShowTooltip(t))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&2===this.state&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){const t=e.relatedTarget,i=this.parentComp.getGui(),s=this.tooltipComp?.getGui();this.isInteractingWithTooltip||i.contains(t)||this.interactionEnabled&&s?.contains(t)||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(0!=this.state||e.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){return(new Date).getTime()-e.lastTooltipHideTime<1e3}setToDoNothing(){2===this.state&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const e={...this.parentComp.getTooltipParams()};if(!k(e.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip())return void this.setToDoNothing();this.state=2,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),e.lastTooltipHideTime=(new Date).getTime());const i={type:"tooltipHide",parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),t&&(this.isInteractingWithTooltip=!1),this.state=0}newTooltipComponentCallback(e,t){if(2!==this.state||this.tooltipInstanceCount!==e)return void this.destroyBean(t);const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),0===this.tooltipTrigger&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const s=this.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({eChild:i,ariaLabel:s("ariaLabelTooltip","Tooltip")});if(o&&(this.tooltipPopupDestroyFunc=o.hideFunc),this.positionTooltip(),1===this.tooltipTrigger){const e=this.setToDoNothing.bind(this);[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:e,columnMoved:e})}this.interactionEnabled&&(0===this.tooltipTrigger?[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(i,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}):[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(i,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}));const n={type:"tooltipShow",tooltipGui:i,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(n),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){const t=this.parentComp.getGui(),i=this.tooltipComp?.getGui(),s=e.relatedTarget;i?.contains(s)||(this.isInteractingWithTooltip=!1,t.contains(s)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...e,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...e,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,i=0===this.tooltipTrigger?1e3:0;window.setTimeout((()=>{e(),this.destroyBean(t)}),i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach((e=>{e&&e()})),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){e.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout((()=>{this.unlockService(),this.setToDoNothing()}),100)}unlockService(){e.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};Gi.isLocked=!1;var Ni=Gi,Hi=class extends I{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(null!=e&&""!=e?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){if(null!=this.tooltipManager)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new Ni(e,this.ctrl.getTooltipShowDelayOverride?.(),this.ctrl.getTooltipHideDelayOverride?.(),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>this.tooltipManager?.hideTooltip(!0)}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},Bi=new ki,Vi=null,Wi=class e extends I{constructor(e,t){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=Bi.next(),this.cssClassManager=new ft((()=>this.eGui)),this.componentSelectors=new Map((t??[]).map((e=>[e.selector,e]))),e&&this.setTemplate(e)}preWireBeans(e){super.preWireBeans(e)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(e,t){e&&this.gos&&(this.applyElementsToComponent(e),this.createChildComponentsFromTags(e,t))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e){const{newTooltipText:t,showDelayOverride:i,hideDelayOverride:s,location:o,shouldDisplayTooltip:n}=e||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==t&&(this.tooltipText=t);const r=()=>this.tooltipText;null!=t&&(this.tooltipFeature=this.createBean(new Hi({getTooltipValue:r,getGui:()=>this.getGui(),getLocation:()=>o??"UNKNOWN",getColDef:e?.getColDef,getColumn:e?.getColumn,getTooltipShowDelayOverride:null!=i?()=>i:void 0,getTooltipHideDelayOverride:null!=s?()=>s:void 0,shouldDisplayTooltip:n})))}getDataRefAttribute(e){return e.getAttribute?e.getAttribute("data-ref"):null}applyElementsToComponent(e,t,i,s=null){if(void 0===t&&(t=this.getDataRefAttribute(e)),t){const o=this[t];if(o===Vi)this[t]=s??e;else{const e=i&&i[t];this.suppressDataRefValidation||e||de(`Issue with data-ref: ${t} on ${this.constructor.name} with ${o}`)}}}createChildComponentsFromTags(e,t){(function(e){if(null==e)return[];const t=[];return Li(e,(e=>t.push(e))),t})(e.childNodes).forEach((i=>{if(!(i instanceof HTMLElement))return;const s=this.createComponentFromElement(i,(e=>{e.getGui()&&this.copyAttributesFromNode(i,e.getGui())}),t);if(s){if(s.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);s.addItems(e)}this.swapComponentForNode(s,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)}))}createComponentFromElement(t,i,s){const o=t.nodeName,n=this.getDataRefAttribute(t),r=0===o.indexOf("AG-"),l=r?this.componentSelectors.get(o):null;let a=null;if(l){e.elementGettingCreated=t;const o=s&&n?s[n]:void 0;a=new l.component(o),a.setParentComponent(this),this.createBean(a,null,i)}else r&&de(`Missing selector: ${o}`);return this.applyElementsToComponent(t,n,s,a),a}copyAttributesFromNode(e,t){!function(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}(e.attributes,((e,i)=>t.setAttribute(e,i)))}swapComponentForNode(e,t,i){const s=e.getGui();t.replaceChild(s,i),t.insertBefore(document.createComment(i.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e))}activateTabIndex(e){const t=this.gos.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach((e=>e.setAttribute("tabindex",t.toString())))}setTemplate(e,t,i){const s=Ri(e);this.setTemplateFromElement(s,t,i)}setTemplateFromElement(e,t,i,s=!1){if(this.eGui=e,this.suppressDataRefValidation=s,t)for(let e=0;e<t.length;e++){const i=t[e];this.componentSelectors.set(i.selector,i)}this.wireTemplate(e,i)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}getContainerAndElement(e,t){let i=t;return null==e?null:(i||(i=this.eGui),Ai(e)?{element:e,parent:i}:{element:e.getGui(),parent:i})}prependChild(e,t){const{element:i,parent:s}=this.getContainerAndElement(e,t)||{};i&&s&&s.insertAdjacentElement("afterbegin",i)}appendChild(e,t){const{element:i,parent:s}=this.getContainerAndElement(e,t)||{};i&&s&&s.appendChild(i)}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;li(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:i}=t;ri(this.eGui,e,{skipAriaHidden:i});const s={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(s)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}addGuiEventListener(e,t,i){this.eGui.addEventListener(e,t,i),this.addDestroyFunc((()=>this.eGui.removeEventListener(e,t)))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}},zi={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"};function _i(e,t,i){const s=Ui(e,t,i);if(s){const{className:e}=s;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function Ui(e,t,i,s){let o=null;const n=i&&i.getColDef().icons;if(n&&(o=n[e]),t&&!o){const i=t.get("icons");i&&(o=i[e])}if(!o){const t=document.createElement("span");let i=zi[e];return i||(s?i=e:(de(`Did not find icon ${e}`),i="")),t.setAttribute("class",`ag-icon ag-icon-${i}`),t.setAttribute("unselectable","on"),bt(t,"presentation"),t}{let e;if("function"==typeof o)e=o();else{if("string"!=typeof o)throw new Error("icon from grid options needs to be a string or a function");e=o}if("string"==typeof e)return Ri(e);if(Ai(e))return e;de("iconRenderer should return back a string or a dom object")}}function Ki(e,t,i){if(0===i)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}var $i=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new h,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push((()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})}))}getActiveTouch(e){for(let t=0;t<e.length;t++){if(e[t].identifier===this.touchStart.identifier)return e[t]}return null}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout((()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const t={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(t)}}),500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!Ki(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const e={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(e),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0){if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const e={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(e),this.lastTapTime=null}else this.lastTapTime=e}else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach((e=>e()))}},ji=class extends Wi{constructor(e){super(),this.eSortOrder=Vi,this.eSortAsc=Vi,this.eSortDesc=Vi,this.eSortMixed=Vi,this.eSortNone=Vi,e||this.setTemplate('<span class="ag-sort-indicator-container">\n <span data-ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n <span data-ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n <span data-ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n <span data-ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n <span data-ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n </span>')}wireBeans(e){this.sortController=e.sortController}attachCustomElements(e,t,i,s,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=o}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),(this.column.isSortable()||this.column.getColDef().showRowGroup)&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",(()=>this.updateIcons())),this.addManagedEventListeners({newColumnsLoaded:this.updateIcons.bind(this),sortChanged:this.onSortChanged.bind(this),columnRowGroupChanged:this.onSortChanged.bind(this)}),this.onSortChanged())}addInIcon(e,t,i){if(null==t)return;const s=Ui(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;ri(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;ri(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=null==e;ri(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gos.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);ri(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){if(!this.eSortOrder)return;const e=this.sortController.getColumnsWithSortingOrdered(),t=this.sortController.getDisplaySortIndexForColumn(this.column)??-1,i=e.some((e=>this.sortController.getDisplaySortIndexForColumn(e)??!1)),s=t>=0&&i;ri(this.eSortOrder,s,{skipAriaHidden:!0}),t>=0?this.eSortOrder.textContent=(t+1).toString():wi(this.eSortOrder)}},qi={selector:"AG-SORT-INDICATOR",component:ji},Yi=class extends Wi{constructor(){super(...arguments),this.eFilter=Vi,this.eFilterButton=Vi,this.eSortIndicator=Vi,this.eMenu=Vi,this.eLabel=Vi,this.eText=Vi,this.eSortOrder=Vi,this.eSortAsc=Vi,this.eSortDesc=Vi,this.eSortMixed=Vi,this.eSortNone=Vi,this.lastMovingChanged=0}wireBeans(e){this.sortController=e.sortController,this.menuService=e.menuService,this.funcColsService=e.funcColsService}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()==this.currentTemplate&&this.workOutShowMenu()==this.currentShowMenu&&this.workOutSort()==this.currentSort&&this.shouldSuppressMenuHide()==this.currentSuppressMenuHide&&t.enableFilterButton==e.enableFilterButton&&t.enableFilterIcon==e.enableFilterIcon&&(this.setDisplayName(e),!0)}workOutTemplate(){let e=this.params.template??'<div class="ag-cell-label-container" role="presentation">\n <span data-ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n <span data-ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>\n <div data-ref="eLabel" class="ag-header-cell-label" role="presentation">\n <span data-ref="eText" class="ag-header-cell-text"></span>\n <span data-ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n <ag-sort-indicator data-ref="eSortIndicator"></ag-sort-indicator>\n </div>\n </div>';return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate,[qi]),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=ze(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(null==t)return;const s=Ui(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new $i(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&k(this.eMenu),o=s?new $i(this.eMenu,!0):t;if(this.params.enableMenu){const e=s?"tap":"longTap",t=e=>this.params.showColumnMenuAfterMouseClick(e.touchStart);this.addManagedListeners(o,{[e]:t})}if(this.params.enableSorting){const e=e=>{const t=e.touchStart.target;i&&(this.eMenu?.contains(t)||this.eFilterButton?.contains(t))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListeners(t,{tap:e})}if(this.params.enableFilterButton){const e=new $i(this.eFilterButton,!0);this.addManagedListeners(e,{tap:()=>this.params.showFilter(this.eFilterButton)}),this.addDestroyFunc((()=>e.destroy()))}this.addDestroyFunc((()=>t.destroy())),s&&this.addDestroyFunc((()=>o.destroy()))}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return Si(this.eMenu),void(this.eMenu=void 0);const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedElementListeners(this.eMenu,{click:()=>this.params.showColumnMenu(this.eMenu)}),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){const t=this.params.column,i=this.menuService.isLegacyMenuEnabled();if(e&&!i){if(this.menuService.isFilterMenuInHeaderEnabled(t))return this.params.showFilter(this.eFilterButton??this.eMenu??this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(this.eMenu??this.eFilterButton??this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.createBean(new ji(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListeners(this.params.column,{movingChanged:()=>{this.lastMovingChanged=(new Date).getTime()}}),this.eLabel&&this.addManagedElementListeners(this.eLabel,{click:e=>{const t=this.params.column.isMoving(),i=(new Date).getTime()-this.lastMovingChanged<50;if(!(t||i)){const t="ctrl"===this.gos.get("multiSortKey")?e.ctrlKey||e.metaKey:e.shiftKey;this.params.progressSort(t)}}});const e=()=>{const e=this.params.column.getSort();if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc","asc"===e),this.addOrRemoveCssClass("ag-header-cell-sorted-desc","desc"===e),this.addOrRemoveCssClass("ag-header-cell-sorted-none",!e),this.params.column.getColDef().showRowGroup){const e=this.funcColsService.getSourceColumnsForGroupColumn(this.params.column),t=e?.every((e=>this.params.column.getSort()==e.getSort())),i=!t;this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",i)}};this.addManagedEventListeners({sortChanged:e,columnRowGroupChanged:e})}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedElementListeners(this.eFilterButton,{click:()=>this.params.showFilter(this.eFilterButton)}):this.eFilterButton=void 0}configureFilter(e,t,i){if(!e)return Si(t),!1;const s=this.params.column;return this.addInIcon("filter",t,s),this.addManagedListeners(s,{filterChanged:i}),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();ri(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){return e?this.eFilterButton??this.eMenu??this.getGui():this.eMenu??this.eFilterButton??this.getGui()}},Qi=class extends Wi{constructor(){super('<div class="ag-header-group-cell-label" role="presentation">\n <span data-ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n <span data-ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n <span data-ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n </div>'),this.agOpened=Vi,this.agClosed=Vi,this.agLabel=Vi}wireBeans(e){this.columnModel=e.columnModel}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&de("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened",this.agOpened),this.addInIcon("columnGroupClosed",this.agClosed);const e=e=>{if(M(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.agClosed,e),this.addTouchAndClickListeners(this.agOpened,e);const t=e=>{D(e)};this.addManagedElementListeners(this.agClosed,{dblclick:t}),this.addManagedElementListeners(this.agOpened,{dblclick:t}),this.addManagedElementListeners(this.getGui(),{dblclick:e}),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup(),s=this.updateIconVisibility.bind(this);this.addManagedListeners(i,{expandedChanged:s,expandableChanged:s})}addTouchAndClickListeners(e,t){const i=new $i(e,!0);this.addManagedListeners(i,{tap:t}),this.addDestroyFunc((()=>i.destroy())),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();ri(this.agOpened,e),ri(this.agClosed,!e)}else ri(this.agOpened,!1),ri(this.agClosed,!1)}addInIcon(e,t){const i=Ui(e,this.gos,null);i&&t.appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return ri(this.agOpened,!1),void ri(this.agClosed,!1)}setupLabel(){const{displayName:e,columnGroup:t}=this.params;if(k(e)){const t=ze(e,!0);this.agLabel.textContent=t}this.addOrRemoveCssClass("ag-sticky-label",!t.getColGroupDef()?.suppressStickyLabel)}},Xi=(e=>(e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue",e))(Xi||{}),Ji=class e{static register(t){e.__register(t,!0,void 0)}static registerModules(t){e.__registerModules(t,!0,void 0)}static __register(t,i,s){e.runVersionChecks(t),void 0!==s?(e.areGridScopedModules=!0,void 0===e.gridModulesMap[s]&&(e.gridModulesMap[s]={}),e.gridModulesMap[s][t.moduleName]=t):e.globalModulesMap[t.moduleName]=t,e.setModuleBased(i)}static __unRegisterGridModules(t){delete e.gridModulesMap[t]}static __registerModules(t,i,s){e.setModuleBased(i),t&&t.forEach((t=>e.__register(t,i,s)))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[o,n]=e.currentModuleVersion.split(".")||[];return i===o&&s===n}static runVersionChecks(t){e.currentModuleVersion||(e.currentModuleVersion=t.version);const i=e=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${e} Please update all modules to the same version.`;if(t.version?e.isValidModuleVersion(t)||ce(i(`'${t.moduleName}' is version ${t.version} but the other modules are version ${e.currentModuleVersion}.`)):ce(i(`'${t.moduleName}' is incompatible.`)),t.validate){const e=t.validate();if(!e.isValid){ce(`${e.message}`)}}}static setModuleBased(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&(ce("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),ce("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information."))}static __setIsBundled(){e.isBundled=!0}static __assertRegistered(t,i,s){if(this.__isRegistered(t,s))return!0;let o;if(e.isBundled)o=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(e.moduleBased||void 0===e.moduleBased){const n=Object.entries(Xi).find((([e,i])=>i===t))?.[0];o=`AG Grid: unable to use ${i} as the ${n} is not registered${e.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module:\n \n import { ModuleRegistry } from '@ag-grid-community/core';\n import { ${n} } from '${t}';\n \n ModuleRegistry.registerModules([ ${n} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n \n import 'ag-grid-enterprise';`;return ce(o),!1}static __isRegistered(t,i){return!!e.globalModulesMap[t]||!!e.gridModulesMap[i]?.[t]}static __getRegisteredModules(t){return[...U(e.globalModulesMap),...U(e.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){return U(e.gridModulesMap[t]??{})||[]}static __isPackageBased(){return!e.moduleBased}};Ji.globalModulesMap={},Ji.gridModulesMap={},Ji.areGridScopedModules=!1;var Zi=Ji,es=class extends Wi{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}wireBeans(e){this.filterManager=e.filterManager}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),o=k(s)?s:i,n=t>=0;this.eDelta.textContent=n?"↑"+o:"↓"+o,this.eDelta.classList.toggle("ag-value-change-delta-up",n),this.eDelta.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.hideDeltaValue()}),2e3)}))}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),wi(this.eDelta)}refresh(e,t=!1){const i=e.value;if(i===this.lastValue)return!1;if(k(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:k(e.value)?this.eValue.textContent=i:wi(this.eValue),this.filterManager?.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof i&&"number"==typeof this.lastValue){const t=i-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}},ts=class extends Wi{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}wireBeans(e){this.filterManager=e.filterManager}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")}),50),window.setTimeout((()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)}),3e3)}))}refresh(e,t=!1){let i=e.value;return G(i)&&(i=""),i!==this.lastValue&&(!this.filterManager?.isSuppressFlashingCellsBecauseFiltering()&&(t||this.addSlideAnimation(),this.lastValue=i,k(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:k(e.value)?this.eCurrent.textContent=i:wi(this.eCurrent),!0))}},is=class{};is.BACKSPACE="Backspace",is.TAB="Tab",is.ENTER="Enter",is.ESCAPE="Escape",is.SPACE=" ",is.LEFT="ArrowLeft",is.UP="ArrowUp",is.RIGHT="ArrowRight",is.DOWN="ArrowDown",is.DELETE="Delete",is.F2="F2",is.PAGE_UP="PageUp",is.PAGE_DOWN="PageDown",is.PAGE_HOME="Home",is.PAGE_END="End",is.A="KeyA",is.C="KeyC",is.D="KeyD",is.V="KeyV",is.X="KeyX",is.Y="KeyY",is.Z="KeyZ";var ss=class extends Wi{constructor(e,t,i){super(t,i),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:o}=this.config;null!=o&&this.setDisabled(o),null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){wi(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(ri(this.eLabel,!1),bt(this.eLabel,"presentation")):(ri(this.eLabel,!0),bt(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||Di(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return ai(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},os=class extends ss{constructor(e,t,i,s){super(e,t,i),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),null!=i&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),i=this.getLabel();null==i||""==i||null!==e.getAttribute("aria-label")?Pt(e,""):Pt(e,t??"")}setAriaLabel(e){return Ft(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return Mi(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"})),this}},ns=class extends os{constructor(e,t,i="text",s="input"){super(e,e?.template??`\n <div role="presentation">\n <div data-ref="eLabel" class="ag-input-field-label"></div>\n <div data-ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n <${s} data-ref="eInput" class="ag-input-field-input"></${s}>\n </div>\n </div>`,[],t),this.inputType=i,this.displayFieldTag=s,this.eLabel=Vi,this.eWrapper=Vi,this.eInput=Vi}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;null!=e&&this.setInputName(e),null!=t&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return Di(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return Ii(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Ft(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return ai(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)Ii(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";Ii(this.eInput,"autocomplete",t)}return this}},rs=class extends ns{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;"boolean"==typeof e&&this.setReadOnly(e),"boolean"==typeof t&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:i});const s=this.getInputElement(),o={type:"checkboxChanged",id:s.id,name:s.name,selected:e,previousValue:t};this.eventService.dispatchEvent(o)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}},ls={selector:"AG-CHECKBOX",component:rs},as=class extends Wi{constructor(){super('\n <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\n </div>',[ls]),this.eCheckbox=Vi}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),Dt(t,"polite"),this.addManagedListeners(t,{click:e=>{if(D(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)},dblclick:e=>{D(e)}}),this.addManagedElementListeners(this.params.eGridCell,{keydown:e=>{if(e.key===is.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const t=this.eCheckbox.getValue();this.onCheckboxChanged(t),e.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,i=!0;if(e.node.group&&e.column){const s=e.column.getColId();s.startsWith(be)?t=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[s]?t=e.value??void 0:i=!1}else t=e.value??void 0;if(!i)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(t);const s=null!=e.disabled?e.disabled:!e.column?.isCellEditable(e.node);this.eCheckbox.setDisabled(s);const o=this.localeService.getLocaleTextFunc(),n=$t(o,t),r=s?n:`${o("ariaToggleCellValue","Press SPACE to toggle cell value")} (${n})`;this.eCheckbox.setInputAriaLabel(r)}onCheckboxChanged(e){const{column:t,node:i,value:s}=this.params,o={type:"cellEditingStarted",column:t,colDef:t?.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s};this.eventService.dispatchEvent(o);const n=this.params.node.setDataValue(this.params.column,e,"edit"),r={type:"cellEditingStopped",column:t,colDef:t?.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:n};this.eventService.dispatchEvent(r)}},hs=class extends Wi{constructor(){super('<div class="ag-loading">\n <span class="ag-loading-icon" data-ref="eLoadingIcon"></span>\n <span class="ag-loading-text" data-ref="eLoadingText"></span>\n </div>'),this.eLoadingIcon=Vi,this.eLoadingText=Vi}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=Ui("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},ds=class extends Wi{constructor(){super('<div class="ag-skeleton-container"></div>')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc((()=>Pt(e.eParentOfValue))),Pt(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");Ft(this.getGui(),t)}setupLoading(e){const t=this.gos.getDocument().createElement("div");t.classList.add("ag-skeleton-effect");const i=e.node.rowIndex;if(null!=i){const e=75+25*(i%2==0?Math.sin(i):Math.cos(i));t.style.width=`${e}%`}this.getGui().appendChild(t);const s=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");Ft(this.getGui(),s)}refresh(e){return!1}destroy(){super.destroy()}},cs=class extends Wi{constructor(){super()}destroy(){super.destroy()}},us=class extends cs{init(){const e=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(e??'<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>'),!e){const e=this.localeService.getLocaleTextFunc();setTimeout((()=>{this.getGui().textContent=e("loadingOoo","Loading...")}))}}},gs=class extends cs{init(){const e=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(e??'<span class="ag-overlay-no-rows-center"></span>'),!e){const e=this.localeService.getLocaleTextFunc();setTimeout((()=>{this.getGui().textContent=e("noRowsToShow","No Rows To Show")}))}}},ps=class extends Wi{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},ms=class extends ps{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=ze(t,!0)}};function Cs(e,t,i,s){let o=t.map(((t,i)=>({value:t,relevance:fs(e.toLowerCase(),t.toLocaleLowerCase()),idx:i})));if(o.sort(((e,t)=>t.relevance-e.relevance)),i&&(o=o.filter((e=>0!==e.relevance))),o.length>0&&s&&s>0){const e=o[0].relevance*s;o=o.filter((t=>e-t.relevance<0))}const n=[],r=[];for(const e of o)n.push(e.value),r.push(e.idx);return{values:n,indices:r}}function fs(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let o=0,n=-1;for(let e=0;e<i.length;e++){const t=s.indexOf(i[e],n+1);-1!==t&&(n=t,o+=100-100*n/1e4*100)}return o}var vs=class extends I{constructor(){super(...arguments),this.beanName="userComponentRegistry",this.agGridDefaults={agColumnHeader:Yi,agColumnGroupHeader:Qi,agSortIndicator:ji,agAnimateShowChangeCellRenderer:es,agAnimateSlideCellRenderer:ts,agLoadingCellRenderer:hs,agSkeletonCellRenderer:ds,agCheckboxCellRenderer:as,agLoadingOverlay:us,agNoRowsOverlay:gs,agTooltipComponent:ms},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agGroupCellRenderer:"@ag-grid-enterprise/row-grouping",agGroupRowRenderer:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}postConstruct(){const e=this.gos.get("components");null!=e&&$(e,((e,t)=>this.registerJsComponent(e,t)))}registerDefaultComponent(e,t){this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(e,t)=>({componentFromFramework:t,component:e}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(null!=s)return i(s,!0);const o=this.jsComps[t];if(o){return i(o,this.getFrameworkOverrides().isFrameworkComponent(o))}const n=this.agGridDefaults[t];if(n)return i(n,!1);const r=this.enterpriseAgDefaultCompsModule[t];return r?Zi.__assertRegistered(r,`AG Grid '${e}' component: ${t}`,this.gridId):ae((()=>{this.warnAboutMissingComponent(e,t)}),"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=Cs(t,[...Object.keys(this.agGridDefaults).filter((e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e))),...Object.keys(this.jsComps)],!0,.8).values;de(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),i.length>0&&de(` Did you mean: [${i.slice(0,3)}]?`),de(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},ws=class e{constructor(e){this.status=0,this.resolution=null,this.waiters=[],e((e=>this.onDone(e)),(e=>this.onReject(e)))}static all(t){return t.length?new e((e=>{let i=t.length;const s=new Array(i);t.forEach(((t,o)=>{t.then((t=>{s[o]=t,i--,0===i&&e(s)}))}))})):e.resolve()}static resolve(t=null){return new e((e=>e(t)))}then(t){return new e((e=>{1===this.status?e(t(this.resolution)):this.waiters.push((i=>e(t(i))))}))}onDone(e){this.status=1,this.resolution=e,this.waiters.forEach((t=>t(e)))}onReject(e){}},Ss={propertyName:"dateComponent",cellRenderer:!1},ys={propertyName:"headerComponent",cellRenderer:!1},bs={propertyName:"headerGroupComponent",cellRenderer:!1},Rs={propertyName:"cellRenderer",cellRenderer:!0},Fs={propertyName:"cellRenderer",cellRenderer:!1},Ps={propertyName:"loadingCellRenderer",cellRenderer:!0},Es={propertyName:"cellEditor",cellRenderer:!1},Ds={propertyName:"innerRenderer",cellRenderer:!0},Ms={propertyName:"loadingOverlayComponent",cellRenderer:!1},xs={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Ts={propertyName:"tooltipComponent",cellRenderer:!1},As={propertyName:"filter",cellRenderer:!1},Is={propertyName:"floatingFilterComponent",cellRenderer:!1},Ls={propertyName:"toolPanel",cellRenderer:!1},Os={propertyName:"statusPanel",cellRenderer:!1},ks={propertyName:"fullWidthCellRenderer",cellRenderer:!0},Gs={propertyName:"loadingCellRenderer",cellRenderer:!0},Ns={propertyName:"groupRowRenderer",cellRenderer:!0},Hs={propertyName:"detailCellRenderer",cellRenderer:!0},Bs={propertyName:"menuItem",cellRenderer:!1},Vs=class e extends I{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(e){this.agComponentUtils=e.agComponentUtils,this.componentMetadataProvider=e.componentMetadataProvider,this.userComponentRegistry=e.userComponentRegistry,this.frameworkComponentWrapper=e.frameworkComponentWrapper,this.gridOptions=e.gridOptions}getHeaderCompDetails(e,t){return this.getCompDetails(e,ys,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,bs,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,ks,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Gs,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Ns,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,Hs,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,Ds,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,Ds,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,Rs,null,t)}getEditorRendererDetails(e,t){return this.getCompDetails(e,Fs,null,t)}getLoadingCellRendererDetails(e,t){return this.getCompDetails(e,Ps,"agSkeletonCellRenderer",t,!0)}getCellEditorDetails(e,t){return this.getCompDetails(e,Es,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,As,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,Ss,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,Ms,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,xs,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,Ts,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,Rs,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,Is,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,Ls,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,Os,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,Bs,"agMenuItem",t,!0)}getCompDetails(t,i,s,o,n=!1){const{propertyName:r,cellRenderer:l}=i;let{compName:a,jsComp:h,fwComp:d,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:g}=e.getCompKeys(this.frameworkOverrides,t,i,o);const p=e=>{const t=this.userComponentRegistry.retrieve(r,e);t&&(h=t.componentFromFramework?void 0:t.component,d=t.componentFromFramework?t.component:void 0)};if(null!=a&&p(a),null==h&&null==d&&null!=s&&p(s),h&&l&&!this.agComponentUtils.doesImplementIComponent(h)&&(h=this.agComponentUtils.adaptFunction(r,h)),!h&&!d)return void(n&&ce(`Could not find component ${a}, did you forget to configure this component?`));const m=this.mergeParamsWithApplicationProvidedParams(t,i,o,c),C=null==h,f=h||d;return{componentFromFramework:C,componentClass:f,params:m,type:i,popupFromSelector:u,popupPositionFromSelector:g,newAgStackInstance:()=>this.newAgStackInstance(f,C,m,i)}}static getCompKeys(e,t,i,s){const{propertyName:o}=i;let n,r,l,a,h,d;if(t){const i=t,c=i[o+"Selector"],u=c?c(s):null,g=t=>{if("string"==typeof t)n=t;else if(null!=t&&!0!==t){e.isFrameworkComponent(t)?l=t:r=t}};u?(g(u.component),a=u.params,h=u.popup,d=u.popupPosition):g(i[o])}return{compName:n,jsComp:r,fwComp:l,paramsFromSelector:a,popupFromSelector:h,popupPositionFromSelector:d}}newAgStackInstance(e,t,i,s){const o=s.propertyName;let n;if(!t)n=new e;else{const t=this.componentMetadataProvider.retrieve(o);n=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,s)}const r=this.initComponent(n,i);return null==r?ws.resolve(n):r.then((()=>n))}mergeParamsWithApplicationProvidedParams(e,t,i,s=null){const o=this.gos.getGridCommonParams();Q(o,i);const n=e&&e[t.propertyName+"Params"];if("function"==typeof n){Q(o,n(i))}else"object"==typeof n&&Q(o,n);return Q(o,s),o}initComponent(e,t){if(this.createBean(e),null!=e.init)return e.init(t)}};function Ws(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}var zs=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,e&&e.beanClasses&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){Object.entries(e.providedBeanInstances).forEach((([e,t])=>{this.beans[e]=t})),e.beanClasses.forEach((e=>{const t=new e;t.beanName?this.beans[t.beanName]=t:console.error(`Bean ${e.name} is missing beanName`),this.createdBeans.push(t)})),e.derivedBeans?.forEach((e=>{const{beanName:t,bean:i}=e(this);this.beans[t]=i,this.createdBeans.push(i)})),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.initBeans([e],t),e}initBeans(e,t){e.forEach((e=>{e.preWireBeans?.(this.beans),e.wireBeans?.(this.beans)})),e.forEach((e=>e.preConstruct?.())),t&&e.forEach(t),e.forEach((e=>e.postConstruct?.()))}getBeans(){return this.beans}getBean(e){return this.beans[e]}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[]}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},_s=class extends zs{init(e){this.gridId=e.gridId,this.beans.context=this,super.init(e)}destroy(){super.destroy(),Zi.__unRegisterGridModules(this.gridId)}getGridId(){return this.gridId}},Us=(e=>(e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET",e))(Us||{}),Ks=(e=>(e[e.Up=0]="Up",e[e.Down=1]="Down",e))(Ks||{}),$s=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))($s||{}),js=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(js||{}),qs=class extends I{constructor(){super(...arguments),this.beanName="dragAndDropService",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.dragService=e.dragService,this.mouseEventService=e.mouseEventService,this.environment=e.environment}postConstruct(){this.dropIconMap={pinned:_i("columnMovePin",this.gos,null),hide:_i("columnMoveHide",this.gos,null),move:_i("columnMoveMove",this.gos,null),left:_i("columnMoveLeft",this.gos,null),right:_i("columnMoveRight",this.gos,null),group:_i("columnMoveGroup",this.gos,null),aggregate:_i("columnMoveValue",this.gos,null),pivot:_i("columnMovePivot",this.gos,null),notAllowed:_i("dropNotAllowed",this.gos,null)}}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find((t=>t.dragSource===e));t&&(this.dragService.removeDragSource(t.params),C(this.dragSourceAndParamsList,t))}destroy(){this.dragSourceAndParamsList.forEach((e=>this.dragService.removeDragSource(e.params))),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0,super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=void 0,this.dragItem=null,this.removeGhost()}onDragging(e,t){const i=this.getHorizontalDirection(e),s=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const o=this.dropTargets.filter((t=>this.isMouseOnDropTarget(e,t))),n=this.findCurrentDropTarget(e,o);if(n!==this.lastDropTarget)this.leaveLastTargetIfExists(e,i,s,t),null!==this.lastDropTarget&&null===n&&this.dragSource.onGridExit?.(this.dragItem),null===this.lastDropTarget&&null!==n&&this.dragSource.onGridEnter?.(this.dragItem),this.enterDragTargetIfExists(n,e,i,s,t),this.lastDropTarget=n;else if(n&&n.onDragging){const o=this.createDropTargetEvent(n,e,i,s,t);n.onDragging(o)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const t=i.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const s=e.clientX>=t.left&&e.clientX<t.right,o=e.clientY>=t.top&&e.clientY<t.bottom;if(!s||!o)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const t of i)if(this.allContainersIntersect(e,t)){s=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&(s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement))}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const s=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of s)for(const i of t){if(-1!==y(this.getAllContainersFromDropTarget(i)).indexOf(e))return i}return null}enterDragTargetIfExists(e,t,i,s,o){if(e){if(e.onDragEnter){const n=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(n)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter((t=>t.getContainer()!==e.getContainer()))}hasExternalDropZones(){return this.dropTargets.some((e=>e.external))}findExternalZone(e){return this.dropTargets.filter((e=>e.external)).find((t=>t.getContainer()===e.getContainer()))||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,o){const n=e.getContainer(),r=n.getBoundingClientRect(),{dragItem:l,dragSource:a}=this,h=t.clientX-r.left,d=t.clientY-r.top;return this.gos.addGridCommonParams({event:t,x:h,y:d,vDirection:s,hDirection:i,dragSource:a,fromNudge:o,dragItem:l,dropZoneTarget:n})}positionGhost(e){const t=this.eGhost;if(!t)return;const i=t.getBoundingClientRect().height,s=(document.body?.clientWidth??(window.innerHeight||document.documentElement?.clientWidth||-1))-2,o=(document.body?.clientHeight??(window.innerHeight||document.documentElement?.clientHeight||-1))-2,n=mi(t.offsetParent),{clientY:r,clientX:l}=e;let a=r-n.top-i/2,h=l-n.left-10;const d=this.gos.getDocument(),c=d.defaultView||window,u=c.pageYOffset||d.documentElement.scrollTop,g=c.pageXOffset||d.documentElement.scrollLeft;s>0&&h+t.clientWidth>s+g&&(h=s+g-t.clientWidth),h<0&&(h=0),o>0&&a+t.clientHeight>o+u&&(a=o+u-t.clientHeight),a<0&&(a=0),t.style.left=`${h}px`,t.style.top=`${a}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=Ri('<div class="ag-dnd-ghost ag-unselectable">\n<span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n<div class="ag-dnd-ghost-label"></div>\n</div>'),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost),this.environment.applyThemeClasses(this.eGhost),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const e=this.eGhost.querySelector(".ag-dnd-ghost-label");let t=this.dragSource.dragItemName;ue(t)&&(t=t()),e.innerHTML=ze(t)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const i=this.gos.getDocument();let s=null,o=null;try{s=i.fullscreenElement}catch(e){}finally{s||(s=this.gos.getRootNode());const e=s.querySelector("body");o=e||(s instanceof ShadowRoot?s:s instanceof Document?s?.documentElement:s)}this.eGhostParent=o,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):de("Could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){wi(this.eGhostIcon);let i=null;e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():"notAllowed"),i=this.dropIconMap[e],this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),i===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns")||i&&this.eGhostIcon.appendChild(i)}},Ys=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<s.left+o,this.tickRight=e.clientX>s.right-o,this.tickUp=e.clientY<s.top+o&&!i,this.tickDown=e.clientY>s.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},Qs=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(Qs||{}),Xs=class extends I{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.sortController=e.sortController,this.filterManager=e.filterManager,this.selectionService=e.selectionService,this.mouseEventService=e.mouseEventService,this.ctrlsService=e.ctrlsService,this.funcColsService=e.funcColsService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady((e=>{const t=e.gridBodyCtrl;this.autoScrollService=new Ys({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:e=>t.getScrollFeature().setVerticalScrollPosition(e),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})}))}getContainer(){return this.eContainer}isInterestedIn(e){return 2===e}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?"notAllowed":"move"}shouldPreventRowMove(){if(this.funcColsService.getRowGroupColumns().length)return!0;const e=this.filterManager?.isAnyFilterPresent();if(e)return!0;return!!this.sortController.isSortActive()}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const e=[...this.selectionService.getSelectedNodes()].sort(((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t)));if(-1!==e.indexOf(t))return e}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach((e=>{e.setDragging(!0)})),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=e;return!t.contains(i)}onEnterOrDragging(e){this.dispatchGridEvent("rowDragMove",e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(c(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&1===t.highlighted,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let n=i?1:0;if(this.isFromThisGrid(e))o.forEach((e=>{e.rowTop<s&&(n-=1)})),this.moveRows(o,s,n);else{const e=this.gos.getRowIdCallback();let t=this.clientSideRowModel.getRowIndexAtPixel(s)+1;0===this.clientSideRowModel.getHighlightPosition(s)&&t--,this.clientSideRowModel.updateRowData({add:o.filter((t=>!this.clientSideRowModel.getRowNode(e?.({data:t.data,level:0,rowPinned:t.rowPinned})??t.data.id))).map((e=>e.data)),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),this.rangeService?.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void de("addRowDropZone - A container target needs to be provided");if(this.dragAndDropService.findExternalZone(e))return void de("addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",t))}),e.onDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",t))})),this.dragAndDropService.addDropTarget({isInterestedIn:e=>2===e,getIconName:()=>"move",external:!0,...t})}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),n=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{i(t),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",t))}:i,onDragLeave:e.onDragLeave?t=>{s(t),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",t))}:s,onDragging:e.onDragging?t=>{o(t),e.onDragging(this.draggingToRowDragEvent("rowDragMove",t))}:o,onDragStop:e.onDragStop?t=>{n(t),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",t))}:n,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:n,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let s,o,n=-1;switch(i>this.pageBoundsService.getCurrentPageHeight()||(n=this.rowModel.getRowIndexAtPixel(i),s=this.rowModel.getRow(n)),t.vDirection){case 1:o="down";break;case 0:o="up";break;default:o=null}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:n,overNode:s,y:i,vDirection:o})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e),!this.gos.get("rowDragManaged")||!this.gos.get("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach((e=>{e.setDragging(!1)}))}},Js=class extends I{constructor(){super(...arguments),this.beanName="dragService",this.dragEndFunctions=[],this.dragSources=[]}wireBeans(e){this.mouseEventService=e.mouseEventService}destroy(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find((t=>t.dragSource===e));t&&(this.removeListener(t),C(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let n=null;const r=this.gos.get("suppressTouch");s&&!r&&(n=t=>{ni(t.target)||(t.cancelable&&(t.preventDefault(),o&&t.stopPropagation()),this.onTouchStart(e,t))},i.addEventListener("touchstart",n,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:n,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=t=>this.onTouchUp(t,e.eElement),o=t.target,n=[{target:this.gos.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:o,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:o,type:"touchend",listener:s,options:{passive:!0}},{target:o,type:"touchcancel",listener:s,options:{passive:!0}}];this.addTemporaryEvents(n),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(i._alreadyProcessedByDragService)return;if(i._alreadyProcessedByDragService=!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=this.gos.getRootNode(),o=[{target:s,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:s,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:s,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(o),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach((e=>{const{target:t,type:i,listener:s,options:o}=e;t.addEventListener(i,s,o)})),this.dragEndFunctions.push((()=>{e.forEach((e=>{const{target:t,type:i,listener:s,options:o}=e;t.removeEventListener(i,s,o)}))}))}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams;return Ki(e,t,k(i)?i:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:"dragStarted",target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){if(jt()){const e=this.gos.getDocument();e.getSelection()?.removeAllRanges()}this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i="mousemove"===e.type;return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=t?.tagName.toLocaleLowerCase();return!!i?.match("^a$|textarea|input|select|button")}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:"dragStopped",target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach((e=>e())),this.dragEndFunctions.length=0}},Zs=class extends Wi{constructor(e,t,i,s,o,n){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=n,this.dragSource=null}wireBeans(e){this.beans=e}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(Ui("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new io(this,this.beans,this.rowNode,this.column):new to(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&de("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.getGui();this.gos.get("enableCellTextSelection")&&(this.removeMouseDownListener(),this.mouseDownListener=this.addManagedElementListeners(t,{mousedown:e=>{e?.preventDefault()}})[0]);const i=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:()=>{const e=this.getDragItem(),t=e.rowNodes?.length||1,s=this.getRowDragText(this.column);return s?s(e,t):1===t?this.cellValueFn():`${t} ${i("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},eo=class extends I{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,i=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=ue(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}},to=class extends eo{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this));const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:e}),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}},io=class extends eo{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.beans.eventService,{sortChanged:e,filterChanged:e,columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),t=e&&e.shouldPreventRowMove(),i=this.gos.get("suppressRowDrag"),s=this.beans.dragAndDropService.hasExternalDropZones(),o=t&&!s||i;this.setDisplayedOrVisible(o)}},so=class e{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=e.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const s=this.createDataChangedEvent(e,i,t);this.localEventService?.dispatchEvent(s)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,t,i){return{type:"dataChanged",node:this,oldData:t,newData:e,update:i}}getRowIndexString(){return null==this.rowIndex?(ce("Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."),null):"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new e(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(e,t){const i=k(this.id)?this.createDaemonNode():null,s=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const o=this.createDataChangedEvent(e,s,!1);this.localEventService?.dispatchEvent(o)}checkRowSelectable(){const e=this.beans.gos.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(e,t){if(this.selectable!==e){if(this.selectable=e,this.dispatchRowEvent("selectableChanged"),t)return;if(this.beans.gos.get("groupSelectsChildren")){const e=this.calculateSelectedFromChildren();return void this.setSelectedParams({newValue:e??!1,source:"selectableChanged"})}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getRowIdCallback();if(i)if(this.data){const t=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:t.length>0?t:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(e.ID_PREFIX_ROW_GROUP)&&ce(`Row IDs cannot start with ${e.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`)}else this.id=void 0;else this.id=t}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!(!k(this.rowTop)||!k(this.rowHeight))&&(e>=this.rowTop&&e<this.rowTop+this.rowHeight)}updateIfDifferent(e,t,i){this[e]!==t&&(this[e]=t,this.dispatchRowEvent(i))}setFirstChild(e){this.updateIfDifferent("firstChild",e,"firstChildChanged")}setLastChild(e){this.updateIfDifferent("lastChild",e,"lastChildChanged")}setChildIndex(e){this.updateIfDifferent("childIndex",e,"childIndexChanged")}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.dispatchRowEvent("topChanged"),this.setDisplayed(null!==e))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(e){this.updateIfDifferent("displayed",e,"displayedChanged")}setDragging(e){this.updateIfDifferent("dragging",e,"draggingChanged")}setHighlighted(e){this.updateIfDifferent("highlighted",e,"rowHighlightChanged")}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(e){this.updateIfDifferent("allChildrenCount",e,"allChildrenCountChanged")}setMaster(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.dispatchRowEvent("masterChanged"))}setGroup(e){this.group!==e&&(this.group&&!e&&(this.expanded=!1),this.group=e,this.updateHasChildren(),this.checkRowSelectable(),this.dispatchRowEvent("groupChanged"))}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.dispatchRowEvent("heightChanged")}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=fe(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const s=this.__autoHeights;if(null==s)return;if(this.beans.visibleColsService.getAllAutoHeightCols().forEach((o=>{let n=s[o.getId()];if(null==n){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(o.getPinned()){case"left":t=this.beans.visibleColsService.getLeftColsForRow(this);break;case"right":t=this.beans.visibleColsService.getRightColsForRow(this);break;case null:t=this.beans.columnViewportService.getColsWithinViewport(this)}if(t.includes(o))return void(e=!0);n=-1}}else t=!1;n>i&&(i=n)})),e)return;if((t||i<10)&&(i=this.beans.gos.getRowHeightForNode(this).height),i==this.rowHeight)return;this.setRowHeight(i);const o=this.beans.rowModel;o.onRowHeightChangedDebounced&&o.onRowHeightChangedDebounced()}setRowIndex(e){this.updateIfDifferent("rowIndex",e,"rowIndexChanged")}setUiLevel(e){this.updateIfDifferent("uiLevel",e,"uiLevelChanged")}setExpanded(e,t,i){if(this.expanded===e)return;this.expanded=e,this.dispatchRowEvent("expandedChanged");const s={...this.createGlobalRowEvent("rowGroupOpened"),expanded:e,event:t||null};this.beans.rowNodeEventThrottle.dispatchExpanded(s,i),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gos.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}setDataValue(e,t,i){const s=(()=>"string"!=typeof e?e:this.beans.columnModel.getCol(e)??this.beans.columnModel.getColDefCol(e))(),o=this.getValueFromValueService(s);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(s,o,t,i),!1;const n=this.beans.valueService.setValue(this,s,t,i);return this.dispatchCellChangedEvent(s,t,o),this.checkRowSelectable(),n}getValueFromValueService(e){const t=this.leafGroup&&this.beans.columnModel.isPivotMode(),i=this.group&&this.expanded&&!this.footer&&!t;let s=!1;const o=this.beans.gos.get("groupTotalRow")??this.beans.gos.get("groupIncludeFooter");if("function"!=typeof o)s=!!o;else{s=!!(this.beans.gos.getCallback("groupTotalRow")??this.beans.gos.getCallback("groupIncludeFooter"))({node:this})}const n=this.beans.gos.get("groupSuppressBlankHeader"),r=i&&s&&!n;return this.beans.valueService.getValue(e,this,!1,r)}dispatchEventForSaveValueReadOnly(e,t,i,s){const o=this.beans.gos.addGridCommonParams({type:"cellEditRequest",event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:t,newValue:i,value:i,source:s});this.beans.eventService.dispatchEvent(o)}setGroupValue(e,t){const i=this.beans.columnModel.getCol(e);G(this.groupData)&&(this.groupData={});const s=i.getColId(),o=this.groupData[s];o!==t&&(this.groupData[s]=t,this.dispatchCellChangedEvent(i,t,o))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.localEventService){const i=e=>{const i=this.aggData?this.aggData[e]:void 0,s=t?t[e]:void 0;if(i===s)return;const o=this.beans.columnModel.getCol(e);o&&this.dispatchCellChangedEvent(o,i,s)};for(const e in this.aggData)i(e);for(const t in e)t in this.aggData||i(t)}}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const t=this.beans.gos.get("treeData"),i=this.beans.gos.get("isServerSideGroup");e=!this.stub&&!this.footer&&(t?!!i&&i(this.data):!!this.group)}e!==this.__hasChildren&&(this.__hasChildren=!!e,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return(this.group&&N(this.childrenAfterGroup))??!1}dispatchCellChangedEvent(e,t,i){const s={type:"cellChanged",node:this,column:e,newValue:t,oldValue:i};this.localEventService?.dispatchEvent(s)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!this.footer&&(this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach((t=>t.depthFirstSearch(e))),e(this)}calculateSelectedFromChildren(){let e=!1,t=!1,i=!1;if(!this.childrenAfterGroup?.length)return this.selectable?this.selected:null;for(let s=0;s<this.childrenAfterGroup.length;s++){const o=this.childrenAfterGroup[s];let n=o.isSelected();if(!o.selectable){const e=o.calculateSelectedFromChildren();if(null===e)continue;n=e}switch(n){case!0:e=!0;break;case!1:t=!0;break;default:i=!0}}return i||e&&t?void 0:!!e||!t&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}dispatchRowEvent(e){const t={type:e,node:this};this.localEventService?.dispatchEvent(t)}selectThisNode(e,t,i="api"){const s=!this.selectable&&e,o=this.selected===e;if(s||o)return!1;this.selected=e,this.dispatchRowEvent("rowSelected");const n=this.sibling;n&&n.footer&&n.localEventService&&n.dispatchRowEvent("rowSelected");const r={...this.createGlobalRowEvent("rowSelected"),event:t||null,source:i};return this.beans.eventService.dispatchEvent(r),!0}setSelected(e,t=!1,i="api"){"boolean"!=typeof i?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i}):de("since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(de("cannot select pinned rows"),0):void 0===this.id?(de("cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected({...e,nodes:[this.footer?this.sibling:this]})}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){this.localEventService||(this.localEventService=new h),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new L(this.beans.frameworkOverrides));const i=this.frameworkEventListenerService?.wrap(t)??t;this.localEventService.addEventListener(e,i)}removeEventListener(e,t){if(!this.localEventService)return;const i=this.frameworkEventListenerService?.unwrap(t)??t;this.localEventService.removeEventListener(e,i),this.localEventService.noRegisteredListenersExist()&&(this.localEventService=null)}onMouseEnter(){this.dispatchRowEvent("mouseEnter")}onMouseLeave(){this.dispatchRowEvent("mouseLeave")}getFirstChildOfFirstChild(e){let t=this,i=!0,s=!1,o=null;for(;i&&!s;){const n=t.parent;k(n)&&t.firstChild?n.rowGroupColumn===e&&(s=!0,o=n):i=!1,t=n}return s?o:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gos.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;t&&null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new e(this.beans);Object.keys(this).forEach((e=>{t.has(e)||(i[e]=this[e])})),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};so.ID_PREFIX_ROW_GROUP="row-group-",so.ID_PREFIX_TOP_PINNED="t-",so.ID_PREFIX_BOTTOM_PINNED="b-",so.OBJECT_ID_SEQUENCE=0;var oo=so,no=class extends I{constructor(){super(...arguments),this.beanName="filterManager",this.advancedFilterModelUpdateQueue=[]}wireBeans(e){this.columnModel=e.columnModel,this.dataTypeService=e.dataTypeService,this.quickFilterService=e.quickFilterService,this.advancedFilterService=e.advancedFilterService,this.columnFilterService=e.columnFilterService}postConstruct(){this.addManagedEventListeners({columnValueChanged:this.refreshFiltersForAggregations.bind(this),columnPivotChanged:this.refreshFiltersForAggregations.bind(this),columnPivotModeChanged:this.refreshFiltersForAggregations.bind(this),newColumnsLoaded:this.updateAdvancedFilterColumns.bind(this),columnVisible:this.updateAdvancedFilterColumns.bind(this),advancedFilterEnabledChanged:({enabled:e})=>this.onAdvancedFilterEnabledChanged(e),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],(()=>{this.onFilterChanged({source:"api"})})),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",(()=>{this.updateAggFiltering(),this.onFilterChanged()})),this.addManagedPropertyListener("advancedFilterModel",(e=>this.setAdvancedFilterModel(e.currentValue))),this.quickFilterService&&this.addManagedListeners(this.quickFilterService,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e,t="api"){this.isAdvancedFilterEnabled()?this.warnAdvancedFilters():this.columnFilterService?.setFilterModel(e,t)}getFilterModel(){return this.columnFilterService?.getFilterModel()??{}}isColumnFilterPresent(){return!!this.columnFilterService?.isColumnFilterPresent()}isAggregateFilterPresent(){return!!this.columnFilterService?.isAggregateFilterPresent()}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){e?this.columnFilterService?.disableColumnFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilterService?.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){return!!this.advancedFilterService?.isEnabled()}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}resetQuickFilterCache(){this.quickFilterService?.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:i,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.columnFilterService?this.columnFilterService.updateBeforeFilterChanged(e):ws.resolve()).then((()=>{const e={source:t,type:"filterChanged",columns:s};i&&Q(e,i),this.eventService.dispatchEvent(e),this.columnFilterService?.updateAfterFilterChanged()}))}isSuppressFlashingCellsBecauseFiltering(){return!!this.columnFilterService?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilterService?.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode))&&!(this.isAggregateFilterPresent()&&!this.columnFilterService.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode))&&(!(this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode))&&(!(this.isColumnFilterPresent()&&!this.columnFilterService.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip))&&!(this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))))}isFilterActive(e){return!!this.columnFilterService?.isFilterActive(e)}getOrCreateFilterWrapper(e){return this.columnFilterService?.getOrCreateFilterWrapper(e)??null}getDefaultFloatingFilter(e){return this.columnFilterService.getDefaultFloatingFilter(e)}createFilterParams(e,t){return this.columnFilterService.createFilterParams(e,t)}isFilterAllowed(e){return!this.isAdvancedFilterEnabled()&&!!this.columnFilterService?.isFilterAllowed(e)}getFloatingFilterCompDetails(e,t){return this.columnFilterService?.getFloatingFilterCompDetails(e,t)}getCurrentFloatingFilterParentModel(e){return this.columnFilterService?.getCurrentFloatingFilterParentModel(e)}destroyFilter(e,t="api"){this.columnFilterService?.destroyFilter(e,t)}areFilterCompsDifferent(e,t){return!!this.columnFilterService?.areFilterCompsDifferent(e,t)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.dataTypeService?.isPendingInference()?this.advancedFilterModelUpdateQueue.push(e):(this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})))}toggleAdvancedFilterBuilder(e,t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(t,e)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return!this.isAdvancedFilterEnabled()&&!!this.columnFilterService?.hasFloatingFilters()}getFilterInstance(e,t){if(!this.isAdvancedFilterEnabled())return this.columnFilterService?.getFilterInstance(e,t);this.warnAdvancedFilters()}getColumnFilterInstance(e){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve(void 0)):this.columnFilterService?.getColumnFilterInstance(e)??Promise.resolve(void 0)}warnAdvancedFilters(){de("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){this.advancedFilterService?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.advancedFilterModelUpdateQueue.forEach((e=>this.setAdvancedFilterModel(e))),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){return this.columnFilterService?.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve()):this.columnFilterService?.setColumnFilterModel(e,t)??Promise.resolve()}},ro=class extends Wi{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}wireBeans(e){this.filterManager=e.filterManager,this.columnModel=e.columnModel}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){return this.filterWrapper?.filterPromise??null}afterInit(){return this.filterWrapper?.filterPromise?.then((()=>{}))??ws.resolve()}afterGuiAttached(e){this.filterWrapper?.filterPromise?.then((t=>{t?.afterGuiAttached?.(e)}))}afterGuiDetached(){this.filterWrapper?.filterPromise?.then((e=>{e?.afterGuiDetached?.()}))}createFilter(e){const{column:t,source:i}=this;this.filterWrapper=this.filterManager?.getOrCreateFilterWrapper(t)??null,this.filterWrapper?.filterPromise&&this.filterWrapper.filterPromise.then((s=>{const o=s.getGui();if(k(o)||de(`getGui method from filter returned ${o}; it should be a DOM element.`),this.appendChild(o),e){const e={type:"filterOpened",column:t,source:i,eGui:this.getGui()};this.eventService.dispatchEvent(e)}}))}onFilterDestroyed(e){"api"!==e.source&&"paramsUpdated"!==e.source||e.column.getId()!==this.column.getId()||!this.columnModel.getColDefCol(this.column)||(wi(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},lo="ag-resizer-wrapper",ao=`<div class="${lo}">\n <div data-ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n <div data-ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n <div data-ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n <div data-ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n <div data-ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n <div data-ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n <div data-ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n <div data-ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n </div>`,ho=class extends I{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}wireBeans(e){this.popupService=e.popupService,this.resizeObserverService=e.resizeObserverService,this.dragService=e.dragService}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:n,x:r,y:l}=this.config;this.offsetParent||this.setOffsetParent();let a=0,h=0;const d=bi(this.element);if(d){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const i=e.offsetWidth-this.element.offsetWidth;h=parseInt(t.minWidth,10)-i}if(null!=t.minHeight){const i=e.offsetHeight-this.element.offsetHeight;a=parseInt(t.minHeight,10)-i}}if(this.minHeight=o||a,this.minWidth=i||h,s&&this.setWidth(s),n&&this.setHeight(n),s&&n||this.refreshSize(),e)this.center();else if(r||l)this.offsetElement(r,l);else if(d&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const i=parseFloat(e.style.top),s=parseFloat(e.style.left);t?this.offsetElement(isNaN(s)?0:s,isNaN(i)?0:i):this.setPosition(s,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach((t=>{const i=!!e[t],s=this.getResizerElement(t),o={dragStartPixels:0,eElement:s,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(o),this.resizeListeners.push(o),s.style.pointerEvents="all"):s.style.pointerEvents="none",this.resizable[t]=i)}))}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=`${t}px`),-1!==e&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))xi(i,e),e=gi(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?xi(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),n=e?this.position.y:s.top,r=e?0:o.top;let l=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();l=t-s.bottom}}return i+r-n-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))Mi(t,e),e=pi(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,s=i?this.position.x:this.element.getBoundingClientRect().left;t&&e+s>t&&(e=t-s)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?Mi(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",`${e}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),t):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:o,topBuffer:n}=e,r=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!o,r)?0:r,movementY:this.shouldSkipY(t,!!s,n,l)?0:l}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let a=l<=0&&n.left>=e.clientX||n.right<=e.clientX&&n.right<=r.right;return!!a||(a=t?s<0&&e.clientX>l+n.left||s>0&&e.clientX<l+n.left:i?s<0&&e.clientX>r.right||s>0&&e.clientX<l+n.left:s<0&&e.clientX>r.right||s>0&&e.clientX<r.right,a)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),n=this.offsetParent.getBoundingClientRect(),r=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let a=l<=0&&n.top>=e.clientY||n.bottom<=e.clientY&&n.bottom<=r.bottom;return!!a||(a=t?s<0&&e.clientY>l+n.top+i||s>0&&e.clientY<l+n.top:s<0&&e.clientY>r.bottom||s>0&&e.clientY<r.bottom,a)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[data-ref=eTopLeftResizer]")},top:{element:e.querySelector("[data-ref=eTopResizer]")},topRight:{element:e.querySelector("[data-ref=eTopRightResizer]")},right:{element:e.querySelector("[data-ref=eRightResizer]")},bottomRight:{element:e.querySelector("[data-ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[data-ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[data-ref=eBottomLeftResizer]")},left:{element:e.querySelector("[data-ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString(ao,"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${lo}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;i||s||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter((e=>!e.classList.contains("ag-hidden"))):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const o=e[s],n=!!o.style.flex&&"0 0 auto"!==o.style.flex;if(o===this.element)continue;let r=this.minHeight||0,l=this.minWidth||0;if(n){const e=window.getComputedStyle(o);e.minHeight&&(r=parseInt(e.minHeight,10)),e.minWidth&&(l=parseInt(e.minWidth,10))}else r=o.offsetHeight,l=o.offsetWidth;t+=r,i+=l}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some((e=>e))}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:n,isLeft:r}=this.currentResizer,l=o||r,a=n||s,{movementX:h,movementY:d}=this.calculateMouseMovement({e:e,isLeft:r,isTop:s}),c=this.position.x,u=this.position.y;let g=0,p=0;if(l&&h){const e=r?-1:1,t=this.getWidth(),i=t+h*e;let s=!1;r&&(g=t-i,(c+g<=0||i<=this.minWidth)&&(s=!0,g=0)),s||this.setWidth(i)}if(a&&d){const e=s?-1:1,t=this.getHeight(),i=t+d*e;let o=!1;s?(p=t-i,(u+p<=0||i<=this.minHeight)&&(o=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<i&&this.getMinSizeOfSiblings().height+i>this.element.parentElement.offsetHeight&&(o=!0),o||this.setHeight(i)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&g||p)&&this.offsetElement(c+g,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:n}=this.calculateMouseMovement({e:e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+n),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},co=class e extends I{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())},...t}}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.eFocusableElement.classList.add(e.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedElementListeners(this.eFocusableElement,{focusin:this.callbacks.onFocusIn}),this.callbacks.onFocusOut&&this.addManagedElementListeners(this.eFocusableElement,{focusout:this.callbacks.onFocusOut})}addKeyDownListeners(e){this.addManagedElementListeners(e,{keydown:e=>{e.defaultPrevented||M(e)||(this.callbacks.shouldStopEventPropagation(e)?D(e):e.key===is.TAB?this.callbacks.onTabKeyDown(e):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))}})}};co.FOCUS_MANAGED_CLASS="ag-focus-managed";var uo=co,go={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};function po(e,t){return mo(e)?(null!=e.debounceMs&&de("debounceMs is ignored when apply button is present"),0):null!=e.debounceMs?e.debounceMs:t}function mo(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}var Co=class extends Wi{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=Vi,this.buttonListeners=[]}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.resetTemplate(),this.createManagedBean(new uo(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new ho(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`\n <form class="ag-filter-wrapper">\n <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody">\n ${this.createBodyTemplate()}\n </div>\n </form>`;this.setTemplate(i,this.getAgComponents(),e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then((()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()}))}setParams(e){this.providedFilterParams=e,this.applyActive=mo(e),this.resetButtonsPanel()}updateParams(e){this.providedFilterParams=e,this.applyActive=mo(e),this.resetUiToActiveModel(this.getModel(),(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()}))}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(wi(this.eButtonsPanel),this.buttonListeners.forEach((e=>e())),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t)return void(this.eButtonsPanel&&Si(this.eButtonsPanel));const i=document.createDocumentFragment(),s=e=>{let t,s;switch(e){case"apply":t=this.translate("applyFilter"),s=e=>this.onBtApply(!1,!1,e);break;case"clear":t=this.translate("clearFilter"),s=()=>this.onBtClear();break;case"reset":t=this.translate("resetFilter"),s=()=>this.onBtReset();break;case"cancel":t=this.translate("cancelFilter"),s=e=>{this.onBtCancel(e)};break;default:return void de("Unknown button type specified")}const o=Ri(`<button\n type="${"apply"===e?"submit":"button"}"\n data-ref="${e}FilterButton"\n class="ag-button ag-standard-button ag-filter-apply-panel-button"\n >${t}\n </button>`);this.buttonListeners.push(...this.addManagedElementListeners(o,{click:s})),i.append(o)};e.forEach((e=>s(e))),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=po(this.providedFilterParams,this.getDefaultDebounceMs()),t=fe(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?this.setModelIntoUi(e):this.resetUiToDefaults()).then((()=>{this.updateUiVisibility(),this.applyModel("api")}))}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),(()=>{this.handleCancelEnd(e)}))}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),t?.()};null!=e?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then((()=>this.onUiChanged()))}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const i="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:i})}const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;"Enter"!==i&&"Space"!==i||(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi()),t=this.queryForHtmlElement('[data-ref="applyFilterButton"]');t&&ai(t,!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e?.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="floatingFilter"===e||"columnFilter"===e,{positionableFeature:i,gos:s}=this;t?(i.restoreLastSize(),i.setResizable(s.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,go[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}},fo=class extends rs{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedEventListeners({checkboxChanged:this.onChange.bind(this)})}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}},vo=class extends Wi{constructor(e="default",t=!1){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.unFocusable=t,this.activeClass="ag-active-item",this.options=[],this.itemEls=[]}postConstruct(){const e=this.getGui();this.addManagedElementListeners(e,{mouseleave:()=>this.clearHighlighted()}),this.unFocusable||this.addManagedElementListeners(e,{keydown:this.handleKeyDown.bind(this)})}handleKeyDown(e){const t=e.key;switch(t){case is.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case is.DOWN:case is.UP:e.preventDefault(),this.navigate(t);break;case is.PAGE_DOWN:case is.PAGE_UP:case is.PAGE_HOME:case is.PAGE_END:e.preventDefault(),this.navigateToPage(t)}}navigate(e){const t=e===is.DOWN;let i;if(this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(t?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),i=this.itemEls[e]}else i=this.itemEls[t?0:this.itemEls.length-1];this.highlightItem(i)}navigateToPage(e){if(!this.highlightedEl||0===this.itemEls.length)return;const t=this.itemEls.indexOf(this.highlightedEl),i=this.options.length-1,s=this.itemEls[0].clientHeight,o=Math.floor(this.getGui().clientHeight/s);let n=-1;e===is.PAGE_HOME?n=0:e===is.PAGE_END?n=i:e===is.PAGE_DOWN?n=Math.min(t+o,i):e===is.PAGE_UP&&(n=Math.max(t-o,0)),-1!==n&&this.highlightItem(this.itemEls[n])}addOptions(e){return e.forEach((e=>this.addOption(e))),this}addOption(e){const{value:t,text:i}=e,s=i||t;return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}clearOptions(){this.options=[],this.reset(!0),this.itemEls.forEach((e=>{Si(e)})),this.itemEls=[]}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach(((t,i)=>{kt(t,i+1),Ot(t,e.length)}))}renderOption(e,t){const i=this.gos.getDocument(),s=i.createElement("div");bt(s,"option"),s.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`);const o=i.createElement("span");s.appendChild(o),o.textContent=t,this.unFocusable||(s.tabIndex=-1),this.itemEls.push(s),this.addManagedListeners(s,{mouseover:()=>this.highlightItem(s),mousedown:t=>{t.preventDefault(),t.stopPropagation(),this.setValue(e)}}),this.createManagedBean(new Hi({getTooltipValue:()=>t,getGui:()=>s,getLocation:()=>"UNKNOWN",shouldDisplayTooltip:()=>o.scrollWidth>o.clientWidth})),this.getGui().appendChild(s)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(t),this;const i=this.options.findIndex((t=>t.value===e));if(-1!==i){const e=this.options[i];this.value=e.value,this.displayValue=e.text,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex((e=>e.value===this.value));-1!==e&&this.highlightItem(this.itemEls[e])}reset(e){this.value=null,this.displayValue=null,this.clearHighlighted(),e||this.fireChangeEvent()}highlightItem(e){if(!bi(e))return;this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(this.activeClass),_t(this.highlightedEl,!0);const t=this.getGui(),{scrollTop:i,clientHeight:s}=t,{offsetTop:o,offsetHeight:n}=e;(o+n>i+s||o<i)&&this.highlightedEl.scrollIntoView({block:"nearest"}),this.unFocusable||this.highlightedEl.focus()}clearHighlighted(){this.highlightedEl&&bi(this.highlightedEl)&&(this.highlightedEl.classList.remove(this.activeClass),_t(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchLocalEvent({type:"fieldValueChanged"}),this.fireItemSelected()}fireItemSelected(){this.dispatchLocalEvent({type:"selectedItem"})}},wo=class extends os{constructor(e){if(super(e,e?.template||'\n <div class="ag-picker-field" role="presentation">\n <div data-ref="eLabel"></div>\n <div data-ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n <div data-ref="eDisplayField" class="ag-picker-field-display"></div>\n <div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n </div>\n </div>',e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=Vi,this.eWrapper=Vi,this.eDisplayField=Vi,this.eIcon=Vi,this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:o,maxPickerWidth:n}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!s,null!=i&&this.setPickerMaxHeight(i),null!=o&&this.setPickerMinWidth(o),null!=n&&this.setPickerMaxWidth(n)}wireBeans(e){this.popupService=e.popupService}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:i,inputWidth:s}=this.config;if(i){const e=Ui(i,this.gos);e&&this.eIcon.appendChild(e)}null!=s&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),It(e,!1),this.ariaRole&&bt(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case is.UP:case is.DOWN:case is.ENTER:case is.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case is.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:o,modalPicker:n=!0}=this.config,r={modal:n,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=this.gos.getActiveDomElement(),i=!t||t===e.body;this.beforeHidePicker(),i&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(s,o)},l=this.popupService.addPopup(r),{maxPickerHeight:a,minPickerWidth:h,maxPickerWidth:d,variableWidth:c}=this;c?(h&&(t.style.minWidth=h),t.style.width=Ti(pi(this.eWrapper)),d&&(t.style.maxWidth=d)):Di(t,d??pi(this.eWrapper));const u=a??`${ci(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",u),t.style.position="absolute",this.alignPickerToComponent(),l.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;It(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return Di(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e=`${e}px`),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e=`${e}px`),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}},So=class extends wo{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox",...e})}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;null!=e&&this.addOptions(e),null!=t&&this.setValue(t,!0),i&&null==t&&(this.eDisplayField.textContent=i),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new vo("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),Kt(this.getAriaElement(),e),this.listComponent.addManagedListeners(this.listComponent,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})}}),this.listComponent.addManagedListeners(this.listComponent,{fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){const{key:t}=e;switch(t===is.TAB&&this.hidePicker(),t){case is.ENTER:case is.UP:case is.DOWN:case is.PAGE_UP:case is.PAGE_DOWN:case is.PAGE_HOME:case is.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case is.ESCAPE:super.onKeyDown(e)}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach((e=>this.addOption(e))),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;i||this.listComponent.setValue(e,!0);if(this.listComponent.getValue()===this.getValue())return this;let s=this.listComponent.getDisplayValue();return null==s&&this.config.placeholder&&(s=this.config.placeholder),this.eDisplayField.textContent=s,this.setTooltip({newTooltipText:s??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),super.destroy()}},yo={selector:"AG-SELECT",component:So},bo=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach((e=>{if("string"==typeof e)return;[["displayKey"],["displayName"],["predicate","test"]].every((t=>!!t.some((t=>null!=e[t]))||(de(`ignoring FilterOptionDef as it doesn't contain one of '${t}'`),!1)))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter((t=>t===e))||[]}))}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:de("invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else de("no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},Ro=class extends Co{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:e}=t;return null!=e?e:1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:"inRange"===e?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach(((t,i)=>{0===i?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)}))}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map((e=>e.getValue()))}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let o;if(i){const i=e,s=t;o=this.areSimpleModelsEqual(i,s)}else{const i=e,s=t;o=i.operator===s.operator&&u(i.conditions,s.conditions,((e,t)=>this.areSimpleModelsEqual(e,t)))}return o}shouldRefresh(e){const t=this.getModel(),i=t?t.conditions??[t]:null,s=e.filterOptions?.map((e=>"string"==typeof e?e:e.displayKey))??this.getDefaultFilterOptions();return!(i&&!i.every((e=>void 0!==s.find((t=>t===e.type)))))&&!("number"==typeof e.maxNumConditions&&i&&i.length>e.maxNumConditions)}refresh(e){if(!this.shouldRefresh(e))return!1;return!!super.refresh(e)&&(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){const t=e;let i=t.conditions;null==i&&(i=[],de("Filter model is missing 'conditions'"));const s=this.validateAndUpdateConditions(i),o=this.getNumConditions();if(s<o)this.removeConditionsAndOperators(s);else if(s>o)for(let e=o;e<s;e++)this.createJoinOperatorPanel(),this.createOption();const n="OR"===t.operator;this.eJoinOperatorsAnd.forEach((e=>e.setValue(!n,!0))),this.eJoinOperatorsOr.forEach((e=>e.setValue(n,!0))),i.forEach(((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)}))}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),ws.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),de('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){const t=this.getModel();if(null==t)return!0;const{operator:i}=t,s=[];if(i){const e=t;s.push(...e.conditions??[])}else s.push(t);return s[i&&"OR"===i?"some":"every"]((t=>this.individualConditionPasses(e,t)))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new bo,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){this.maxNumConditions=e.maxNumConditions??2,this.maxNumConditions<1&&(de('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=e.numAlwaysVisibleConditions??1,this.numAlwaysVisibleConditions<1&&(de('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(de('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new So);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,(e=>this.resetInput(e))),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(i,s,o),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new fo);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map((e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e)))}putOptionsIntoDropdown(e){this.filterListOptions.forEach((t=>{e.addOption(t)})),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}createBodyTemplate(){return""}getAgComponents(){return[]}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let i=0;i<this.getNumConditions();i++)this.isConditionUiComplete(i)?e=i:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const t=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<t){this.removeConditionsAndOperators(t+1);const i=e+1,s=t-i;s>0&&this.removeConditionsAndOperators(i,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach(((t,i)=>{const s=this.isConditionDisabled(i,e);t.setDisabled(s||this.filterListOptions.length<=1),1===i&&(ai(this.eJoinOperatorPanels[0],s),this.eJoinOperatorsAnd[0].setDisabled(s),this.eJoinOperatorsOr[0].setDisabled(s))})),this.eConditionBodies.forEach(((e,t)=>{ri(e,this.isConditionBodyVisible(t))}));const i="OR"===(t??this.getJoinOperator());this.eJoinOperatorsAnd.forEach((e=>{e.setValue(!i,!0)})),this.eJoinOperatorsOr.forEach((e=>{e.setValue(i,!0)})),this.forEachInput(((t,i,s,o)=>{this.setElementDisplayed(t,i<o),this.setElementDisabled(t,this.isConditionDisabled(s,e))})),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach((e=>Si(e)))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach((e=>{Si(e.getGui()),this.destroyBean(e)}))}removeItems(e,t,i){return null==i?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus)if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof ns&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const o=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,i=e);else{const o=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||o)&&(this.removeConditionsAndOperators(e,1),s=!0,o&&i--)}let n=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),n=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),n=!0),n&&this.updateConditionStatusesAndValues(i,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(ue(this.filterPlaceholder)){const e=this.filterPlaceholder,s=this.eTypes[t].getValue();i=e({filterOptionKey:s,filterOption:this.translate(s),placeholder:i})}else"string"==typeof this.filterPlaceholder&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput(((t,i,s,o)=>{if(!(t instanceof ns))return;const n=0===i&&o>1?"inRangeStart":0===i?"filterOoo":"inRangeEnd",r=0===i&&o>1?e("ariaFilterFromValue","Filter from value"):0===i?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(n,s)),t.setInputAriaLabel(r)}))}setElementValue(e,t,i){e instanceof ns&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Wi&&ri(e.getGui(),t)}setElementDisabled(e,t){e instanceof Wi&&ai(e.getGui(),t)}attachElementOnChange(e,t){e instanceof ns&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach(((t,i)=>{this.forEachPositionTypeInput(i,t,e)}))}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),o=this.getInputs(e);for(let t=0;t<o.length;t++){const n=o[t];null!=n&&i(n,t,e,s)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){if(e>=this.getNumConditions())return!1;return"empty"!==this.getConditionType(e)&&!this.getValues(e).some((e=>null==e))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach((e=>this.resetType(e))),this.eJoinOperatorsAnd.forEach(((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t))),this.eJoinOperatorsOr.forEach(((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t))),this.joinOperatorId++,this.forEachInput((e=>this.resetInput(e))),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),ws.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,o){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach(((e,t)=>this.updateJoinOperatorDisabled(e,t))),this.eJoinOperatorsOr.forEach(((e,t)=>this.updateJoinOperatorDisabled(e,t)))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput(((e,s,o)=>{o===t&&this.setElementValue(e,null!=i[s]?i[s]:null)}))}setValueFromFloatingFilter(e){this.forEachInput(((t,i,s)=>{this.setElementValue(t,0===i&&0===s?e:null,!0)}))}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,(e=>{this.attachElementOnChange(e,this.listener)})))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),n=this.evaluateCustomFilter(o,s,i);return null!=n?n:null==i?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e)}evaluateCustomFilter(e,t,i){if(null==e)return;const{predicate:s}=e;return null==s||t.some((e=>null==e))?void 0:s(t,i)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}},Fo=class extends Ro{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case"equals":case"notEqual":if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case"lessThan":case"lessThanOrEqual":if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case"inRange":if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,i){const s=this.comparator(),o=null!=e[0]?s(e[0],t):0;switch(i.type){case"equals":return 0===o;case"notEqual":return 0!==o;case"greaterThan":return o>0;case"greaterThanOrEqual":return o>=0;case"lessThan":return o<0;case"lessThanOrEqual":return o<=0;case"inRange":{const i=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&i<=0:o>0&&i<0}case"blank":return this.isBlank(t);case"notBlank":return!this.isBlank(t);default:return de('Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}};function Po(e){if(e.altKey||e.ctrlKey||e.metaKey)return!1;return 1===e.key.length}function Eo(e,t,i,s,o){const n=s?s.getColDef().suppressKeyboardEvent:void 0;if(!n)return!1;const r=e.addGridCommonParams({event:t,editing:o,column:s,node:i,data:i.data,colDef:s.getColDef()});if(n){if(n(r))return!0}return!1}var Do=class extends ns{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=k(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListeners(this.eInput,{keydown:t=>{Po(t)&&t.key&&!e.test(t.key)&&t.preventDefault()},paste:t=>{const i=t.clipboardData?.getData("text");i&&i.split("").some((t=>!e.test(t)))&&t.preventDefault()}})}},Mo={selector:"AG-INPUT-TEXT-FIELD",component:Do},xo=class extends Do{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListeners(this.eInput,{blur:()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)},wheel:this.onWheel.bind(this)}),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;"number"==typeof e&&this.setPrecision(e),"number"==typeof t&&this.setMin(t),"number"==typeof i&&this.setMax(i),"number"==typeof s&&this.setStep(s)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,Ii(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,Ii(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,Ii(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue((e=>super.setValue(e,t)),(()=>this),e)}setStartValue(e){return this.setValueOrInputValue((e=>super.setValue(e,!0)),(e=>{this.eInput.value=e}),e)}setValueOrInputValue(e,t,i){if(k(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(!s){s=(i=this.adjustPrecision(i))!=this.normalizeValue(i)}if(s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}},To={selector:"AG-INPUT-NUMBER-FIELD",component:xo},Ao=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],Io=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const t=e,s=(t.conditions??[]).map((e=>this.getModelAsString(e))),o="AND"===t.operator?"andCondition":"orCondition";return s.join(` ${i(o,go[o])} `)}if("blank"===e.type||"notBlank"===e.type)return i(e.type,e.type);{const t=e,s=this.optionsFactory.getCustomOption(t.type),{displayKey:o,displayName:n,numberOfInputs:r}=s||{};return o&&n&&0===r?(i(o,n),n):this.conditionToString(t,s)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){return this.valueFormatter?this.valueFormatter(e??null)??"":String(e)}},Lo=class extends Io{conditionToString(e,t){const{numberOfInputs:i}=t||{};return"inRange"==e.type||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):`${e.type}`}};function Oo(e){const{allowedCharPattern:t}=e??{};return t??null}var ko=class extends Fo{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern===e.allowedCharPattern&&super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new Lo(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return Ao}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,s)}createValueElement(){const e=Oo(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),bt(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const o=this.createManagedBean(s?new Do({allowedCharPattern:s}):new xo);o.addCssClass(`ag-filter-${i}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,((e,i,s,o)=>{i<o&&t.push(this.processValue(this.stringToFloat(e.getValue())))})),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(e){if("number"==typeof e)return e;let t=O(e);return null!=t&&""===t.trim()&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):null==t||"-"===t.trim()?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}hasInvalidInputs(){let e=!1;return this.forEachInput((t=>{t.getInputElement().validity.valid||(e=!0)})),e}},Go=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],No=class extends Io{conditionToString(e,t){const{numberOfInputs:i}=t||{};return"inRange"==e.type||2===i?`${e.filter}-${e.filterTo}`:null!=e.filter?`${e.filter}`:`${e.type}`}};function Ho(e){const t=e&&e.trim();return""===t?e:t}var Bo=class extends Ro{constructor(){super("textFilter"),this.defaultFormatter=e=>e,this.defaultLowercaseFormatter=e=>null==e?null:e.toString().toLowerCase(),this.defaultMatcher=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case"contains":return t.indexOf(i)>=0;case"notContains":return t.indexOf(i)<0;case"equals":return t===i;case"notEqual":return t!=i;case"startsWith":return 0===t.indexOf(i);case"endsWith":{const e=t.lastIndexOf(i);return e>=0&&e===t.length-i.length}default:return!1}},this.eValuesFrom=[],this.eValuesTo=[]}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?this.defaultFormatter:this.defaultLowercaseFormatter),this.filterModelFormatter=new No(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(de("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||this.defaultMatcher}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const i=[];return this.forEachPositionInput(e,((e,s,o,n)=>{if(s<n){let s=O(e.getValue());t&&this.textFilterParams.trimInput&&(s=Ho(s)??null,e.setValue(s,!0)),i.push(s)}})),i}getDefaultFilterOptions(){return Go}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),bt(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new Do);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){return!!e&&["notEqual","notContains","blank"].indexOf(e)>=0}evaluateNonNullValue(e,t,i,s){const o=e.map((e=>this.formatter(e)))||[],n=this.formatter(t),{api:r,colDef:l,column:a,context:h,textFormatter:d}=this.textFilterParams;if("blank"===i.type)return this.isBlank(t);if("notBlank"===i.type)return!this.isBlank(t);const c={api:r,colDef:l,column:a,context:h,node:s.node,data:s.data,filterOption:i.type,value:n,textFormatter:d};return o.some((e=>this.matcher({...c,filterText:e})))}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}};function Vo(e){if("number"==typeof e)return e;if("string"==typeof e){const t=parseInt(e);if(isNaN(t))return;return t}}function Wo(e,t=Number.MAX_VALUE){return i=>{const s=Vo(i);if(!(null==s||s<e||s>t))return s}}function zo(e,t){return e.toString().padStart(t,"0")}function _o(e,t,i){return"number"!=typeof e?"":Uo(Math.round(100*e)/100,t,i)}function Uo(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function Ko(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map((e=>zo(e,2))).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map((e=>zo(e,2))).join(":")),s}var $o=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function jo(e,t="YYYY-MM-DD"){const i=zo(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>zo(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${$o(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${$o(e.getDate())}`,DD:()=>zo(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>o[e.getDay()],ddd:()=>o[e.getDay()].slice(0,3),dd:()=>o[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${$o(e.getDay())}`,d:()=>`${e.getDay()}`},r=new RegExp(Object.keys(n).join("|"),"g");return t.replace(r,(e=>e in n?n[e]():e))}function qo(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map((e=>parseInt(e,10)));if(3!==s.filter((e=>!isNaN(e))).length)return null;const[o,n,r]=s,l=new Date(o,n-1,r);if(l.getFullYear()!==o||l.getMonth()!==n-1||l.getDate()!==r)return null;if(!i||"00:00:00"===i)return l;const[a,h,d]=i.split(":").map((e=>parseInt(e,10)));return a>=0&&a<24&&l.setHours(a),h>=0&&h<60&&l.setMinutes(h),d>=0&&d<60&&l.setSeconds(d),l}var Yo=class{constructor(e,t,i,s,o){this.alive=!0,this.context=e,this.eParent=s;t.getDateCompDetails(i).newAgStackInstance().then((t=>{this.alive?(this.dateComp=t,t&&(s.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled),o?.(this))):e.destroyBean(t)}))}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){ri(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){let t=!1;if(this.dateComp?.refresh&&"function"==typeof this.dateComp.refresh){null!==this.dateComp.refresh(e)&&(t=!0)}if(!t&&this.dateComp?.onParamsUpdated&&"function"==typeof this.dateComp.onParamsUpdated){null!==this.dateComp.onParamsUpdated(e)&&de("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}},Qo=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],Xo=class extends Io{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o="inRange"==i||2===s,n=qo(e.dateFrom),r=qo(e.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){return`${null!==n?jo(n,l):"null"}-${null!==r?jo(r,l):"null"}`}return null!=n?jo(n,l):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},Jo=1/0,Zo=class extends Fo{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=Jo,this.minValidDate=null,this.maxValidDate=null}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&qo(t)||null,i&&qo(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,i)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?i:Number(e[t]);de(`DateFilter ${t} is not a number`)}return i};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",Jo),this.minValidYear>this.maxValidYear&&de("DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:qo(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:qo(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&de("DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Xo(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new Yo(this.context,this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc((()=>t.destroy())),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return Qo}createValueElement(){const e=this.gos.getDocument().createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,s){const o=this.gos.getDocument().createElement("div");o.classList.add(`ag-filter-${s}`),o.classList.add(`ag-filter-date-${s}`),t.push(o),e.appendChild(o),i.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach((e=>e.destroy()))}isValidDateValue(e){if(null===e)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput(((i,s,o,n)=>{o!==e||!t||s>=n||(t=t&&this.isValidDateValue(i.getDate()))})),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=Ko(s[0])),s.length>1&&(i.dateTo=Ko(s[1])),{dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t,...i}}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput((e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(i)}))}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,((e,i,s,o)=>{i<o&&t.push(e.getDate())})),t}translate(e){return"lessThan"===e?super.translate("before"):"greaterThan"===e?super.translate("after"):super.translate(e)}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}},en=class extends I{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?c(this.colsSpanning):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=k(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn((()=>{this.actualLeft===o&&this.setLeft(o)}))}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const i=this.beans.visibleColsService.getColsLeftWidth();if("right"===e.getPinned()){return i+this.beans.visibleColsService.getBodyContainerWidth()+t}return i+t}setLeft(e){if(k(e)&&(this.eCell.style.left=`${e}px`),je(this.columnOrGroup)){const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&Vt(this.ariaEl,e.length)}}};function tn(e,t,i,s){return G(e)?[]:nn(e.headerClass,e,t,i,s)}function sn(e,t,i,s){return G(e)?[]:nn(e.toolPanelClass,e,t,i,s)}function on(e,t,i){e.addOrRemoveCssClass("ag-column-first",i.isColAtEdge(t,"first")),e.addOrRemoveCssClass("ag-column-last",i.isColAtEdge(t,"last"))}function nn(e,t,i,s,o){if(G(e))return[];let n;if("function"==typeof e){const r=function(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}(t,i,s,o);n=e(r)}else n=e;return"string"==typeof n?[n]:Array.isArray(n)?[...n]:[]}var rn=0,ln=class e extends I{constructor(e,t,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=t,this.instanceId=e.getUniqueId()+"-"+rn++}wireBeans(e){this.pinnedWidthService=e.pinnedWidthService,this.focusService=e.focusService,this.userComponentFactory=e.userComponentFactory,this.ctrlsService=e.ctrlsService,this.dragAndDropService=e.dragAndDropService,this.menuService=e.menuService}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],(()=>this.refreshTabIndex()))}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return function(e,t,i,s){const o=s.getDefinition(),n=o&&o.suppressHeaderKeyboardEvent;return!!k(n)&&!!n(e.addGridCommonParams({colDef:o,column:s,headerRowIndex:i,event:t}))}(this.gos,e,t,i)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onGuiFocus(){const e={type:"headerFocused",column:this.column};this.eventService.dispatchEvent(e)}onDisplayedColumnsChanged(){this.comp&&this.column&&(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:i}=this;on(e,t,i.visibleColsService)}refreshAriaColIndex(){const{beans:e,column:t}=this,i=e.visibleColsService.getAriaColIndex(t);Bt(this.eGui,i)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&this.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){const t=this.gos.getActiveDomElement(),i=e.key===is.LEFT||e.key===is.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),t!==this.eGui||!e.shiftKey&&!e.altKey)return;if((this.isResizing||i)&&(e.preventDefault(),e.stopImmediatePropagation()),!i)return;const s=e.key===is.LEFT!==this.gos.get("enableRtl"),o=$s[s?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const t=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(t,e.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(o)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const e=this.pinnedWidthService.getPinnedLeftWidth(),i=this.pinnedWidthService.getPinnedRightWidth(),s=ui(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(e+i+t>s){if(!(s>e+i))return 0;t=s-e-i}}return t}getResizeDiff(e){let t=e.key===is.LEFT!==this.gos.get("enableRtl");const i=this.column.getPinned(),s=this.gos.get("enableRtl");return i&&s!==("right"===i)&&(t=!t),(t?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout((()=>{this.resizeFeature?.toggleColumnResizing(!1)}),150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case is.PAGE_DOWN:case is.PAGE_UP:case is.PAGE_HOME:case is.PAGE_END:t&&e.preventDefault()}}addDomData(){const t=e.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc((()=>this.gos.setDomData(this.eGui,t,null)))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,i){const s=e??t;this.gos.get("preventDefaultOnContextMenu")&&s.preventDefault();const o=ie(i)?i:void 0;this.menuService.isHeaderContextMenuEnabled(o)&&this.menuService.showHeaderContextMenu(o,e,t),this.dispatchColumnMouseEvent("columnHeaderContextMenu",i)}dispatchColumnMouseEvent(e,t){const i={type:e,column:t};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};ln.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";var an=ln,hn=class extends I{wireBeans(e){this.columnHoverService=e.columnHoverService}constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListeners(this.element,{mouseout:this.onMouseOut.bind(this),mouseover:this.onMouseOver.bind(this)})}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}},dn=class extends an{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(),this.addManagedListeners(this.column,{colDefChanged:this.onColDefChanged.bind(this)})}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=Ui("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new uo(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();Ft(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleColsService;let i=this.column;do{if(i=e?t.getColBefore(i):t.getColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case is.UP:case is.DOWN:t||e.preventDefault();case is.LEFT:case is.RIGHT:if(t)return;e.stopPropagation();case is.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case is.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&hi(e.relatedTarget,"ag-floating-filter");if(t&&i&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==is.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const s=this.getRowIndex();this.beans.focusService.setFocusedHeader(s,this.column)}setupHover(){this.createManagedBean(new hn([this.column],this.eGui));const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedEventListeners({columnHoverChanged:e}),e()}setupLeft(){const e=new en(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager?.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter()));e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=t=>{if("filterDestroyed"===t?.source&&!this.isAlive())return;const i=this.comp.getFloatingFilterComp();i&&i.then((i=>{if(i){const s=e?.getCurrentFloatingFilterParentModel(this.column),o=t?{...t,columns:t.columns??[],source:"api"===t.source?"api":"columnFilter"}:null;i.onParentModelChanged(s,o)}}))};[this.destroySyncListener]=this.addManagedListeners(this.column,{filterChanged:t}),e?.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const e=`${this.column.getActualWidth()}px`;this.comp.setWidth(e)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupFilterChangedListener(){this.active&&([this.destroyFilterChangedListener]=this.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){const e=this.active;this.setupActive();const t=!e&&this.active;e&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const i=this.active?this.beans.filterManager?.getFloatingFilterCompDetails(this.column,(()=>this.showParentFilter())):null,s=this.comp.getFloatingFilterComp();s&&i?s.then((e=>{!e||this.beans.filterManager?.areFilterCompsDifferent(this.userCompDetails??null,i)?this.updateCompDetails(i,t):this.updateFloatingFilterParams(i)})):this.updateCompDetails(i,t)}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){if(!e)return;const t=e.params;this.comp.getFloatingFilterComp()?.then((e=>{let i=!1;if(e?.refresh&&"function"==typeof e.refresh){null!==e.refresh(t)&&(i=!0)}if(!i&&e?.onParamsUpdated&&"function"==typeof e.onParamsUpdated){null!==e.onParamsUpdated(t)&&de("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}}))}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},cn="32.0.2";function un(e,t,i){if(null==t)return null;let s=null;const{compName:o,jsComp:n,fwComp:r}=Vs.getCompKeys(e,t,As);if(o){s={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o]}else{null==n&&null==r&&!0===t.filter&&(s=i())}return s}var gn=class extends Wi{wireBeans(e){this.columnNameService=e.columnNameService}getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e?.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;if(e.operator){t=e.conditions[0]}else t=e;this.lastType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new bo,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&["inRange","empty","blank","notBlank"].indexOf(e)<0}getAriaLabel(e){return`${this.columnNameService.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},pn=class extends I{constructor(e){super(),this.params=e,this.eFloatingFilterTextInput=Vi,this.valueChangedListener=()=>{}}setupGui(e){this.eFloatingFilterTextInput=this.createManagedBean(new Do(this.params?.config));const t=this.eFloatingFilterTextInput.getGui();e.appendChild(t);const i=e=>this.valueChangedListener(e);this.addManagedListeners(t,{input:i,keydown:i})}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}},mn=class extends gn{constructor(){super(...arguments),this.eFloatingFilterInputContainer=Vi}postConstruct(){this.setTemplate('\n <div class="ag-floating-filter-input" role="presentation" data-ref="eFloatingFilterInputContainer"></div>\n ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){this.params=e;const t=e.browserAutoComplete??!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=mo(this.params.filterParams),!this.isReadOnly()){const e=po(this.params.filterParams,this.getDefaultDebounceMs()),t=fe(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();wi(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}syncUpWithParentFilter(e){const t=e.key===is.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=Ho(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance((e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,i||null)}))}setEditable(e){this.floatingFilterInputService.setEditable(e)}},Cn=class extends I{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new xo),this.eFloatingFilterTextInput=this.createManagedBean(new Do),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,(e=>this.valueChangedListener(e))),this.setupListeners(i,(e=>this.valueChangedListener(e)))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}},fn=class extends mn{init(e){super.init(e),this.filterModelFormatter=new No(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Go}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new pn)}};var vn={version:cn,moduleName:"@ag-grid-community/filter-core",beans:[no]},wn={version:cn,moduleName:"@ag-grid-community/filter-api",apiFunctions:{isAnyFilterPresent:function(e){return!!e.filterManager?.isAnyFilterPresent()},onFilterChanged:function(e,t="api"){e.filterManager?.onFilterChanged({source:t})}},dependantModules:[vn]},Sn={version:cn,moduleName:"@ag-grid-community/column-filter",beans:[class extends I{constructor(){super(...arguments),this.beanName="columnFilterService",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[]}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.userComponentFactory=e.userComponentFactory,this.rowRenderer=e.rowRenderer,this.dataTypeService=e.dataTypeService,this.filterManager=e.filterManager}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),rowDataUpdated:()=>this.onNewRowsLoaded("rowDataUpdated"),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.initialFilterModel={...this.gos.get("initialState")?.filter?.filterModel??{}}}setFilterModel(e,t="api"){if(this.dataTypeService?.isPendingInference())return void this.filterModelUpdateQueue.push({model:e,source:t});const i=[],s=this.getFilterModel();if(e){const t=new Set(Object.keys(e));this.allColumnFilters.forEach(((s,o)=>{const n=e[o];i.push(this.setModelOnFilterWrapper(s.filterPromise,n)),t.delete(o)})),t.forEach((t=>{const s=this.columnModel.getColDefCol(t)||this.columnModel.getCol(t);if(!s)return void de("setFilterModel() - no column found for colId: "+t);if(!s.isFilterAllowed())return void de("setFilterModel() - unable to fully apply model, filtering disabled for colId: "+t);const o=this.getOrCreateFilterWrapper(s);o?i.push(this.setModelOnFilterWrapper(o.filterPromise,e[t])):de("setFilterModel() - unable to fully apply model, unable to create filter for colId: "+t)}))}else this.allColumnFilters.forEach((e=>{i.push(this.setModelOnFilterWrapper(e.filterPromise,null))}));ws.all(i).then((()=>{const e=this.getFilterModel(),i=[];this.allColumnFilters.forEach(((t,o)=>{z(s?s[o]:null,e?e[o]:null)||i.push(t.column)})),i.length>0&&this.filterManager?.onFilterChanged({columns:i,source:t})}))}setModelOnFilterWrapper(e,t){return new ws((i=>{e.then((e=>{"function"!=typeof e.setModel&&(de("filter missing setModel method, which is needed for setFilterModel"),i()),(e.setModel(t)||ws.resolve()).then((()=>i()))}))}))}getFilterModel(){const e={};return this.allColumnFilters.forEach(((t,i)=>{const s=this.getModelFromFilterWrapper(t);k(s)&&(e[i]=s)})),e}getModelFromFilterWrapper(e){const{filter:t}=e;return t?"function"!=typeof t.getModel?(de("filter API missing getModel method, which is needed for getFilterModel"),null):t.getModel():this.getModelFromInitialState(e.column)}getModelFromInitialState(e){return this.initialFilterModel[e.getColId()]??null}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}disableColumnFilters(){return!!this.allColumnFilters.size&&(this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"advancedFilterEnabled"))),!0)}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){const e=!!this.gos.getGroupAggFiltering(),t=t=>{if(!t.isPrimary())return!0;const i=!this.columnModel.isPivotActive();return!(!t.isValueActive()||!i)&&(!!this.columnModel.isPivotMode()||e)},i=[],s=[];return this.forEachColumnFilter(((e,o)=>{const n=(e=>!!e&&(e.isFilterActive?e.isFilterActive():(de("Filter is missing isFilterActive() method"),!1)))(e);n&&(t(o.column)?i.push(e):s.push(e))})).then((()=>{this.activeAggregateFilters=i,this.activeColumnFilters=s}))}updateFilterFlagInColumns(e,t){return this.forEachColumnFilter(((i,s)=>s.column.setFilterActive(i.isFilterActive(),e,t)))}forEachColumnFilter(e){return ws.all(Array.from(this.allColumnFilters.values()).map((t=>t.filterPromise.then((i=>e(i,t))))))}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,n=i?this.activeAggregateFilters:this.activeColumnFilters,r=i?o:s;for(let i=0;i<n.length;i++){const s=n[i];if(null!=s&&s!==t){if("function"!=typeof s.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!s.doesFilterPass({node:e,data:r}))return!1}}return!0}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.filterManager?.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}updateBeforeFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:i}=e;return this.updateDependentFilters(),this.updateActiveFilters().then((()=>this.updateFilterFlagInColumns("filterChanged",i).then((()=>{this.allColumnFilters.forEach((e=>{e.filterPromise&&e.filterPromise.then((e=>{e&&e!==t&&e.onAnyFilterChanged&&e.onAnyFilterChanged()}))})),this.processingFilterChange=!0}))))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){this.forEachColumnFilter((e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()})).then((()=>this.updateFilterFlagInColumns(e,{afterDataChange:!0}))).then((()=>this.updateActiveFilters()))}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getCol(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}isFilterActive(e){const{filter:t}=this.cachedFilter(e)??{};return t?t.isFilterActive():null!=this.getModelFromInitialState(e)}getOrCreateFilterWrapper(e){if(!e.isFilterAllowed())return null;let t=this.cachedFilter(e);return t||(t=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,t)),t}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(Zi.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFilter";else{const i=this.dataTypeService?.getBaseDataType(e);t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(Zi.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService?.getBaseDataType(e);t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e,t){const i=this.getDefaultFilter(e),s=e.getColDef();let o;const n={...this.createFilterParams(e,s),filterModifiedCallback:()=>this.filterModifiedCallbackFactory(o,e)(),filterChangedCallback:t=>this.filterChangedCallbackFactory(o,e)(t),doesRowPassOtherFilter:e=>!this.filterManager||this.filterManager.doesRowPassOtherFilters(o,e)},r=this.userComponentFactory.getFilterDetails(s,n,i);return r?{filterPromise:()=>{const e=r.newAgStackInstance();return null!=e&&e.then((e=>{o=e,t&&(t.filter=e)})),e},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:j(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e){const t={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:i,compDetails:s}=this.createFilterInstance(e,t);return t.filterPromise=i?.()??null,t.compDetails=s,t}onColumnsChanged(){const e=[];this.allColumnFilters.forEach(((t,i)=>{let s;s=t.column.isPrimary()?this.columnModel.getColDefCol(i):this.columnModel.getCol(i),s&&s===t.column||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))})),e.length>0?this.filterManager?.onFilterChanged({columns:e,source:"api"}):this.updateDependentFilters()}updateDependentFilters(){const e=this.columnModel.getAutoCols();e?.forEach((e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e)}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const{filter:t}=this.allColumnFilters.get(e.getColId())??{};return!t||("function"!=typeof t?.isFilterAllowed||t.isFilterAllowed())}getFloatingFilterCompDetails(e,t){const i=t=>{const i=this.getOrCreateFilterWrapper(e)?.filterPromise;null!=i&&i.then((e=>{t(Ws(e))}))},s=e.getColDef(),o={...this.createFilterParams(e,s),filterChangedCallback:()=>i((t=>this.filterChangedCallbackFactory(t,e)()))},n=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,As,o);let r=un(this.frameworkOverrides,s,(()=>this.getDefaultFloatingFilter(e)));null==r&&(r="agReadOnlyFloatingFilter");const l={column:e,filterParams:n,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,l,r)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),this.filterManager?.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then((i=>{this.destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:"filterDestroyed",source:t,column:e.column};this.eventService.dispatchEvent(s)}))}filterModifiedCallbackFactory(e,t){return()=>{const i={type:"filterModified",column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{const s={filter:e,additionalEventAttributes:i,columns:[t],source:i?.source??"columnFilter"};this.callOnFilterChangedOutsideRenderCycle(s)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s))return void this.destroyFilter(i,"paramsUpdated");const o=i.getColDef().filterParams;t.filterPromise?t.filterPromise.then((e=>{!1===(!e?.refresh||e.refresh({...this.createFilterParams(i,i.getColDef()),filterModifiedCallback:this.filterModifiedCallbackFactory(e,i),filterChangedCallback:this.filterChangedCallbackFactory(e,i),doesRowPassOtherFilter:t=>!this.filterManager||this.filterManager.doesRowPassOtherFilters(e,t),...o}))&&this.destroyFilter(i,"paramsUpdated")})):this.destroyFilter(i,"paramsUpdated")}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListeners(e,{colDefChanged:()=>this.checkDestroyFilter(i)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||i?.render&&s?.render&&i.render===s.render)}hasFloatingFilters(){return this.columnModel.getCols().some((e=>e.getColDef().floatingFilter))}getFilterInstance(e,t){t&&this.getFilterInstanceImpl(e).then((e=>{const i=Ws(e);t(i)}))}getColumnFilterInstance(e){return new Promise((t=>{this.getFilterInstanceImpl(e).then((e=>{t(Ws(e))}))}))}getFilterInstanceImpl(e){const t=this.columnModel.getColDefCol(e);if(!t)return ws.resolve(void 0);const i=this.getOrCreateFilterWrapper(t)?.filterPromise;return i??ws.resolve(null)}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach((({model:e,source:t})=>this.setFilterModel(e,t))),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach((({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then((()=>i()))})),this.columnFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.dataTypeService?.isPendingInference()){let i=()=>{};const s=new Promise((e=>{i=e}));return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:i}),s}const i=this.columnModel.getColDefCol(e),s=i?this.getOrCreateFilterWrapper(i):null;return s?(o=this.setModelOnFilterWrapper(s.filterPromise,t),new Promise((e=>{o.then((t=>e(t)))}))):Promise.resolve();var o}getFilterWrapper(e){const t=this.columnModel.getColDefCol(e);return t?this.cachedFilter(t)??null:null}destroy(){super.destroy(),this.allColumnFilters.forEach((e=>this.disposeFilterWrapper(e,"gridDestroyed"))),this.allColumnListeners.clear()}}],dependantModules:[vn]},yn={version:cn,moduleName:"@ag-grid-community/column-filter-api",apiFunctions:{isColumnFilterPresent:function(e){return!!e.filterManager?.isColumnFilterPresent()||!!e.filterManager?.isAggregateFilterPresent()},getFilterInstance:function(e,t,i){return e.filterManager?.getFilterInstance(t,i)},getColumnFilterInstance:function(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)},destroyFilter:function(e,t){const i=e.columnModel.getColDefCol(t);if(i)return e.filterManager?.destroyFilter(i,"api")},setFilterModel:function(e,t){e.frameworkOverrides.wrapIncoming((()=>e.filterManager?.setFilterModel(t)))},getFilterModel:function(e){return e.filterManager?.getFilterModel()??{}},getColumnFilterModel:function(e,t){return e.filterManager?.getColumnFilterModel(t)??null},setColumnFilterModel:function(e,t,i){return e.filterManager?.setColumnFilterModel(t,i)??Promise.resolve()},showColumnFilter:function(e,t){const i=e.columnModel.getCol(t);i?e.menuService.showFilterMenu({column:i,containerType:"columnFilter",positionBy:"auto"}):ce(`column '${t}' not found`)}},dependantModules:[Sn,wn]},bn={version:cn,moduleName:"@ag-grid-community/floating-filter-core",controllers:[{name:"headerFilterCell",classImp:dn}],dependantModules:[Sn]},Rn={version:cn,moduleName:"@ag-grid-community/floating-filter",dependantModules:[bn,Sn]},Fn={version:cn,moduleName:"@ag-grid-community/read-only-floating-filter",userComponents:[{name:"agReadOnlyFloatingFilter",classImp:class extends Wi{constructor(){super('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field>\n </div>',[Mo]),this.eFloatingFilterText=Vi}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){null!=e?this.params.parentFilterInstance((t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}}}],dependantModules:[bn]},Pn={version:cn,moduleName:"@ag-grid-community/simple-floating-filter",dependantModules:[{version:cn,moduleName:"@ag-grid-community/simple-filter",dependantModules:[Sn],userComponents:[{name:"agTextColumnFilter",classImp:Bo},{name:"agNumberColumnFilter",classImp:ko},{name:"agDateColumnFilter",classImp:Zo},{name:"agDateInput",classImp:class extends Wi{constructor(){super('\n <div class="ag-filter-filter">\n <ag-input-text-field class="ag-date-filter" data-ref="eDateInput"></ag-input-text-field>\n </div>',[Mo]),this.eDateInput=Vi}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus()},input:e=>{e.target===this.gos.getActiveDomElement()&&(this.eDateInput.isDisabled()||this.params.onDateChanged())}})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&jt(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:o,minValidDate:n,maxValidDate:r}=e.filterParams||{};if(n&&s&&de("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),r&&o&&de("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),n&&r){const[e,t]=[n,r].map((e=>e instanceof Date?e:qo(e)));e&&t&&e.getTime()>t.getTime()&&de("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}n?n instanceof Date?t.min=jo(n):t.min=n:s&&(t.min=`${s}-01-01`),r?r instanceof Date?t.max=jo(r):t.max=r:o&&(t.max=`${o}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return qo(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(Ko(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:Yt()||Qt()||jt()&&qt()>=14.1}}}]},bn],userComponents:[{name:"agTextColumnFloatingFilter",classImp:fn},{name:"agNumberColumnFloatingFilter",classImp:class extends mn{init(e){super.init(e),this.filterModelFormatter=new Lo(this.localeService,this.optionsFactory,e.filterParams?.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){Oo(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Ao}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=Oo(e.filterParams),this.allowedCharPattern?this.createManagedBean(new pn({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Cn)}}},{name:"agDateColumnFloatingFilter",classImp:class extends gn{constructor(){super('\n <div class="ag-floating-filter-input" role="presentation">\n <ag-input-text-field data-ref="eReadOnlyText"></ag-input-text-field>\n <div data-ref="eDateWrapper" style="display: flex;"></div>\n </div>',[Mo]),this.eReadOnlyText=Vi,this.eDateWrapper=Vi}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}getDefaultFilterOptions(){return Qo}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Xo(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const t=e;this.dateComp.setDate(qo(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){ri(this.eDateWrapper,e),ri(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=Ko(this.dateComp.getDate());this.params.parentFilterInstance((t=>{if(t){const i=qo(e);t.onFloatingFilterChanged(this.getLastType()||null,i)}}))}getDateComponentParams(){const e=po(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:fe(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Yo(this.context,this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper,(e=>{e.setInputAriaLabel(this.getAriaLabel(this.params))})),this.addDestroyFunc((()=>this.dateComp.destroy()))}updateDateComponent(){const e=this.gos.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}}}]},En={version:cn,moduleName:"@ag-grid-community/quick-filter-core",beans:[class extends I{constructor(){super(...arguments),this.beanName="quickFilterService",this.quickFilter=null,this.quickFilterParts=null}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.pivotResultColsService=e.pivotResultColsService}postConstruct(){const e=this.resetQuickFilterCache.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{this.gos.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}}),this.addManagedPropertyListener("quickFilterText",(e=>this.setQuickFilter(e.currentValue))),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],(()=>this.onQuickFilterColumnConfigChanged())),this.quickFilter=this.parseQuickFilter(this.gos.get("quickFilterText")),this.parser=this.gos.get("quickFilterParser"),this.matcher=this.gos.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],(()=>this.setQuickFilterParserAndMatcher()))}refreshQuickFilterCols(){const e=this.columnModel.isPivotMode(),t=this.columnModel.getAutoCols(),i=this.columnModel.getColDefCols();let s=(e&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")?this.pivotResultColsService.getPivotResultCols()?.list:i)??[];t&&(s=s.concat(t)),this.colsForQuickFilter=this.gos.get("includeHiddenColumnsInQuickFilter")?s:s.filter((e=>e.isVisible()||e.isRowGroupActive()))}isQuickFilterPresent(){return null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every((i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i)))}resetQuickFilterCache(){this.rowModel.forEachNode((e=>e.quickFilterAggregateText=null))}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return k(e)?this.gos.isRowModelType("clientSide")?e.toUpperCase():(de("Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void de("Grid option quickFilterText only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setQuickFilterParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onQuickFilterColumnConfigChanged(){this.refreshQuickFilterCols(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassQuickFilterNoCache(e,t){return this.colsForQuickFilter.some((i=>{const s=this.getQuickFilterTextForColumn(i,e);return k(s)&&s.indexOf(t)>=0}))}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const s=e.getColDef();if(s.getQuickFilterText){const o=this.gos.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:s});i=s.getQuickFilterText(o)}return k(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.colsForQuickFilter.forEach((i=>{const s=this.getQuickFilterTextForColumn(i,e);k(s)&&t.push(s)})),t.join("\n")}}],dependantModules:[vn]},Dn={version:cn,moduleName:"@ag-grid-community/filter",dependantModules:[Pn,Fn,{version:cn,moduleName:"@ag-grid-community/quick-filter",dependantModules:[En,{version:cn,moduleName:"@ag-grid-community/quick-filter-api",apiFunctions:{isQuickFilterPresent:function(e){return!!e.filterManager?.isQuickFilterPresent()},getQuickFilter:function(e){return e.gos.get("quickFilterText")},resetQuickFilter:function(e){e.filterManager?.resetQuickFilterCache()}},dependantModules:[En]}]},yn]},Mn=class extends Wi{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}},xn=class extends Mn{constructor(e){super('<div class="ag-header-cell ag-floating-filter" role="gridcell">\n <div data-ref="eFloatingFilterBody" role="presentation"></div>\n <div class="ag-floating-filter-button ag-hidden" data-ref="eButtonWrapper" role="presentation">\n <button type="button" class="ag-button ag-floating-filter-button-button" data-ref="eButtonShowMainFilter" tabindex="-1"></button>\n </div>\n </div>',e),this.eFloatingFilterBody=Vi,this.eButtonWrapper=Vi,this.eButtonShowMainFilter=Vi}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>ri(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then((e=>this.afterCompCreated(e)))}destroy(){this.destroyFloatingFilterComp(),super.destroy()}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}},Tn=class extends Mn{constructor(e){super('<div class="ag-header-cell" role="columnheader">\n <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n <div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n </div>',e),this.eResize=Vi,this.eHeaderCompWrapper=Vi,this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();var t,i;t="col-id",null!=(i=this.column.getColId())&&""!=i?e.setAttribute(t,i):e.removeAttribute(t);const s={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaSort:t=>t?Wt(e,t):zt(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper);const o=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",o)}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then((e=>this.afterCompCreated(t,e)))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}},An=class extends Mn{constructor(e){super('<div class="ag-header-group-cell" role="columnheader">\n <div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n </div>',e),this.eResize=Vi}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>ri(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return i="aria-expanded",null!=(s=t)?e.setAttribute(i,s):e.removeAttribute(i);var i,s},setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then((e=>this.afterHeaderCompCreated(e)))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const i=this.getGui(),s=e.getGui();i.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}},In=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(In||{}),Ln=class extends Wi{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}postConstruct(){Nt(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach((e=>{const t=e.getInstanceId();let s=i[t];delete i[t],null==s&&(s=this.createHeaderComp(e),this.getGui().appendChild(s.getGui())),this.headerComps[t]=s})),$(i,((e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)})),t){const e=Y(this.headerComps);e.sort(((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft()));const t=e.map((e=>e.getGui()));Pi(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new An(e);break;case"filter":t=new xn(e);break;default:t=new Tn(e)}return this.createBean(t),t.setParentComponent(this),t}},On=(e=>(e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT",e))(On||{}),kn=class extends I{constructor(){super(...arguments),this.beanName="headerNavigationService",this.currentHeaderRowWithoutSpan=-1}wireBeans(e){this.focusService=e.focusService,this.headerPositionUtils=e.headerPositionUtils,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.visibleColService=e.visibleColsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}));const e=this.gos.getDocument();this.addManagedElementListeners(e,{mousedown:()=>this.setCurrentHeaderRowWithoutSpan(-1)})}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}getHeaderPositionForColumn(e,t){let i;if("string"==typeof e?(i=this.columnModel.getCol(e),i||(i=this.visibleColService.getColumnGroup(e))):i=e,!i)return null;const s="filter"===c(this.ctrlsService.getHeaderRowContainerCtrl().getAllCtrls()).getType(),o=this.getHeaderRowCount()-1;let n=-1,r=i;for(;r;)n++,r=r.getParent();let l=n;return t&&s&&l===o-1&&l++,-1===l?null:{headerRowIndex:l,column:i}}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s}=t,o=t.column,n=this.getHeaderRowCount(),r=0===e;let{headerRowIndex:l,column:a,headerRowIndexWithoutSpan:h}=r?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),d=!1;return l<0&&(l=0,a=o,d=!0),l>=n?(l=-1,this.setCurrentHeaderRowWithoutSpan(-1)):void 0!==h&&(this.currentHeaderRowWithoutSpan=h),!(!d&&!a)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:a},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),o=2===e,n=this.gos.get("enableRtl");let r,l;if(-1!==this.currentHeaderRowWithoutSpan?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,o!==n?(l="Before",r=this.headerPositionUtils.findHeader(s,l)):(l="After",r=this.headerPositionUtils.findHeader(s,l)),r||!t)return this.focusService.focusHeaderPosition({headerPosition:r,direction:l,fromTab:t,allowUserOverride:!0,event:i});if(t){const e=this.gos.getCallback("tabToNextHeader");if(e)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:e,headerPosition:r,direction:l})}return this.focusNextHeaderRow(s,l,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let o,n=null;if("Before"===t?s>0&&(o=s-1,this.currentHeaderRowWithoutSpan-=1,n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"end")):(o=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),n=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"start")),!n)return!1;const{column:r,headerRowIndex:l}=this.headerPositionUtils.getHeaderIndexToFocus(n.column,n?.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:r,headerRowIndex:l},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(je(e)){const s=e.getDisplayedLeafColumns();i="Before"===t?c(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}},Gn=class extends I{wireBeans(e){this.headerNavigationService=e.headerNavigationService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.menuService=e.menuService}setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new uo(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:s}),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedEventListeners({displayedColumnsChanged:e,columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e})}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,i=0,s=e.getHeaderRowCount();const o=this.filterManager?.hasFloatingFilters();o&&(s++,i=1);const n=this.columnModel.getColumnGroupHeaderRowHeight(),r=this.columnModel.getColumnHeaderRowHeight(),l=s-(1+i);if(t=i*e.getFloatingFiltersHeight(),t+=l*n,t+=r,this.headerHeight===t)return;this.headerHeight=t;const a=`${t+1}px`;this.comp.setHeightAndMinHeight(a),this.eventService.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.visibleColsService.getAllCols().some((e=>e.isSpanHeaderHeight()));this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case is.LEFT:t=2;case is.RIGHT:k(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case is.UP:t=0;case is.DOWN:k(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=e??t;s!==this.eGui&&s!==this.ctrlsService.getHeaderRowContainerCtrl().getViewport()||this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!Jt())return;const t=new $i(this.eGui);this.addManagedListeners(t,{longTap:t=>{e(void 0,t.touchStart,t.touchEvent)}}),this.addDestroyFunc((()=>t.destroy()))}},Nn=class extends I{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}wireBeans(e){this.visibleColsService=e.visibleColsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=this.gos.isDomLayout("print"),t=this.visibleColsService.getBodyContainerWidth(),i=this.visibleColsService.getColsLeftWidth(),s=this.visibleColsService.getDisplayedColumnsRightWidth();let o;if(e)o=t+i+s;else if(o=t,this.addSpacer){0===(this.gos.get("enableRtl")?i:s)&&this.scrollVisibleService.isVerticalScrollShowing()&&(o+=this.gos.getScrollbarWidth())}this.callback(o)}},Hn=class extends I{constructor(e){super(),this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}wireBeans(e){this.funcColsService=e.funcColsService}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach((e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))}))}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.funcColsService.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.funcColsService.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.funcColsService.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};function Bn(e){const{isFromHeader:t,hDirection:i,xPosition:s,fromEnter:o,fakeEvent:n,pinned:r,gos:l,columnModel:a,columnMoveService:h,presentedColsService:d}=e,g=0===i,p=1===i;let{allMovingColumns:m}=e;if(t){const e=[];m.forEach((t=>{let i=null,s=t.getParent();for(;null!=s&&1===s.getDisplayedLeafColumns().length;)i=s,s=s.getParent();if(null!=i){(!!i.getColGroupDef()?.marryChildren?i.getProvidedColumnGroup().getLeafColumns():i.getLeafColumns()).forEach((t=>{e.includes(t)||e.push(t)}))}else e.includes(t)||e.push(t)})),m=e}const C=m.slice();a.sortColsLikeCols(C);const f=function(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:o,gos:n,columnModel:r,presentedColsService:l}=e,a=n.get("suppressMovableColumns")||t.some((e=>e.getColDef().suppressMovable));if(a)return[];const h=function(e,t){switch(t){case"left":return e.getLeftCols();case"right":return e.getRightCols();default:return e.getCenterCols()}}(l,o),d=r.getCols(),c=h.filter((e=>S(t,e))),u=h.filter((e=>!S(t,e))),g=d.filter((e=>!S(t,e)));let p,m=0,C=s;if(i){let e=0;c.forEach((t=>e+=t.getActualWidth())),C-=e}if(C>0){for(let e=0;e<u.length;e++){if(C-=u[e].getActualWidth(),C<0)break;m++}i&&m++}if(m>0){const e=u[m-1];p=g.indexOf(e)+1}else p=g.indexOf(u[0]),-1===p&&(p=0);const f=[p],v=(e,t)=>e-t;if(i){let e=p+1;const t=d.length-1;for(;e<=t;)f.push(e),e++;f.sort(v)}else{let e=p;const t=d.length-1;let i=d[e];for(;e<=t&&h.indexOf(i)<0;)e++,f.push(e),i=d[e];e=p-1;const s=0;for(;e>=s;)f.push(e),e--;f.sort(v).reverse()}return f}({movingCols:C,draggingRight:p,xPosition:s,pinned:r,gos:l,columnModel:a,presentedColsService:d}),v=function(e,t){const i=t.getCols(),s=(r=e.map((e=>i.indexOf(e))),r.sort(((e,t)=>e-t))),o=s[0],n=c(s);var r;return n-o!=s.length-1?null:o}(C,a);if(0===f.length)return;const w=f[0];let y=null!==v&&!o;if(t&&(y=null!==v),y&&!n){if(g&&w>=v)return;if(p&&w<=v)return}const b=d.getAllCols(),R=[];let F=null;for(let e=0;e<f.length;e++){const t=f[e],i=h.getProposedColumnOrder(C,t);if(!h.doesOrderPassRules(i))continue;const s=i.filter((e=>b.includes(e)));if(null===F)F=s;else if(!u(s,F))break;const o=Wn(i);R.push({move:t,fragCount:o})}return 0!==R.length?(R.sort(((e,t)=>e.fragCount-t.fragCount)),Vn(m,R[0].move,"uiColumnMoved",!1,h)):void 0}function Vn(e,t,i,s,o){return o.moveColumns(e,t,i,s),s?null:{columns:e,toIndex:t}}function Wn(e){function t(e){const t=[];let i=e.getOriginalParent();for(;null!=i;)t.push(i),i=i.getOriginalParent();return t}let i=0;for(let s=0;s<e.length-1;s++){let o=t(e[s]),n=t(e[s+1]);[o,n]=o.length>n.length?[o,n]:[n,o],o.forEach((e=>{-1===n.indexOf(e)&&i++}))}return i}function zn(e,t,i,s,o){const n=o.getHeaderRowContainerCtrl(t).getViewport();if(i&&(e-=n.getBoundingClientRect().left),s.get("enableRtl")){e=n.clientWidth-e}return null==t&&(e+=o.get("center").getCenterViewportScrollLeft()),e}var _n=class extends I{constructor(e){super(),this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!k(e)}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnMoveService=e.columnMoveService,this.dragAndDropService=e.dragAndDropService,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}))}getIconName(){return this.pinned?"pinned":"move"}onDragEnter(e){const t=e.dragItem.columns;if(0===e.dragSource.type)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const i=e.dragItem.visibleState,s=(t||[]).filter((e=>i[e.getId()]));this.setColumnsVisible(s,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const s=e.filter((e=>!e.getColDef().lockVisible));this.columnModel.setColsVisible(s,t,i)}}setColumnsPinned(e,t,i){if(e){const s=e.filter((e=>!e.getColDef().lockPinned));this.columnModel.setColsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>s-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>s-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){if(s){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;Vn(e,t,"uiColumnMoved",!0,this.columnMoveService)}return}if(this.lastDraggingEvent=e,G(e.hDirection))return;const o=zn(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(o);const n=this.normaliseDirection(e.hDirection),r=e.dragSource.type,l=Bn({allMovingColumns:e.dragSource.getDragItem().columns?.filter((e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned))||[],isFromHeader:1===r,hDirection:n,xPosition:o,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel,columnMoveService:this.columnMoveService,presentedColsService:this.visibleColsService});l&&(this.lastMovedInfo=l)}normaliseDirection(e){if(!this.gos.get("enableRtl"))return e;switch(e){case 0:return 1;case 1:return 0;default:ce(`Unknown direction ${e}`)}}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.dragAndDropService.setGhostIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon("move"))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter((e=>!e.getColDef().lockPinned));if(e.length>0&&(this.dragAndDropService.setGhostIcon("pinned"),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}},Un=class extends I{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady((e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]]}})),this.moveColumnFeature=this.createManagedBean(new _n(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new Hn(this.pinned)),this.dragAndDropService.addDropTarget(this)}isInterestedIn(e){return 1===e||0===e&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&0===e.dragSource.type}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}},Kn=class extends I{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.pinnedWidthService=e.pinnedWidthService,this.ctrlsService=e.ctrlsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=o}postConstruct(){const e=[];let t,i;const s=()=>{if(ri(this.eResize,t),!t)return;const s=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(s),i){const t=this.gos.get("skipHeaderOnAutoSize"),i=()=>{this.columnAutosizeService.autoSizeColumn(this.column,"uiColumnResized",t)};this.eResize.addEventListener("dblclick",i);const s=new $i(this.eResize);s.addEventListener("doubleTap",i),e.push((()=>{this.eResize.removeEventListener("dblclick",i),s.removeEventListener("doubleTap",i),s.destroy()}))}},o=()=>{e.forEach((e=>e())),e.length=0},n=()=>{const e=this.column.isResizable(),n=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(e!==t||n!==i)&&(t=e,i=n,o(),s())};n(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(n)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:o}=this,n=this.normaliseResizeAmount(t),r=[{key:i,newWidth:o+n}];if(this.column.getPinned()){if(this.pinnedWidthService.getPinnedLeftWidth()+this.pinnedWidthService.getPinnedRightWidth()+(n-s)>ui(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50)return}this.lastResizeAmount=n,this.columnSizeService.setColumnWidths(r,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,s="right"===this.pinned;return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}},$n=class extends I{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new rs),this.cbSelectAll.addCssClass("ag-header-select-all"),bt(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:this.onNewColumnsLoaded.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedListeners(this.cbSelectAll,{fieldValueChanged:this.onCbSelectAll.bind(this)}),Tt(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),i=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${t})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gos.get("rowSelection"))||(de(`${e} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t)||(de(`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const o={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;if("function"==typeof e){e=e(this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()}))}return!!e&&(this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"))}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}},jn=class extends an{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new Kn(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new hn([this.column],t)),this.createManagedBean(new en(this.column,t,this.beans)),this.createManagedBean(new uo(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListeners(this.column,{colDefChanged:this.refresh.bind(this)}),this.addManagedEventListeners({columnValueChanged:this.onColumnValueChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this),columnPivotChanged:this.onColumnPivotChanged.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}resizeHeader(e,t){if(!this.column.isResizable())return;const i=this.column.getActualWidth(),s=this.column.getMinWidth(),o=this.column.getMaxWidth(),n=Math.min(Math.max(i+e,s),o);this.beans.columnSizeService.setColumnWidths([{key:this.column,newWidth:n}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:s,ctrlsService:o}=this,n=this.getPinned(),r=t.getBoundingClientRect().left,l=i.getActualWidth();Bn({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:zn(0===e!==s.get("enableRtl")?r-20:r+l+20,n,!0,s,o),pinned:n,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:this.beans.columnModel,columnMoveService:this.beans.columnMoveService,presentedColsService:this.beans.visibleColsService}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:e=>{this.menuService.showColumnMenu({column:this.column,buttonElement:e,positionBy:"button"})},showColumnMenuAfterMouseClick:e=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:e,positionBy:"mouse"})},showFilter:e=>{this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"columnFilter",positionBy:"button"})},progressSort:e=>{this.beans.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{this.beans.sortController.setSortForColumn(this.column,e,!!t,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(e,t)=>{this.setupTooltip(e,t)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new $n(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===is.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===is.ENTER&&this.onEnterKeyDown(e),e.key===is.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();i&&i instanceof Yi&&i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i="whenTruncated"===this.gos.get("tooltipShowMode"),s=this.eGui,o=this.column.getColDef();t||!i||o.headerComponent||(t=()=>{const e=s.querySelector(".ag-header-cell-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>{if(null!=e)return e;return this.column.getColDef().headerTooltip},shouldDisplayTooltip:t},r=this.createManagedBean(new Hi(n));this.refreshFunctions.push((()=>r.refreshToolTip()))}setupClassesFromColDef(){const e=()=>{const e=tn(this.column.getColDef(),this.gos,this.column,null),t=this.userHeaderClasses;this.userHeaderClasses=new Set(e),e.forEach((e=>{t.has(e)?t.delete(e):this.comp.addOrRemoveCssClass(e,!0)})),t.forEach((e=>this.comp.addOrRemoveCssClass(e,!1)))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:o,gos:n}=this,{columnModel:r}=i;let l=!this.gos.get("suppressDragLeaveHidesColumns");const a=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{l=!n.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{if(l){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];r.setColsVisible(t,!0,"uiColumnMoved")}},onGridExit:e=>{if(l){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];r.setColsVisible(t,!1,"uiColumnMoved")}}};o.addDragSource(a,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach((e=>e()))}refreshHeaderComp(){const e=this.lookupUserCompDetails();!!(null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass)&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();if(!t)return!1;if(!t.refresh)return!1;return t.refresh(e)}calculateDisplayName(){return this.beans.columnNameService.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(`${e}px`)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListeners(this.column,{movingChanged:e}),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListeners(this.column,{menuVisibleChanged:e}),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(){const e=()=>{const e=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",e),this.refreshAria()};this.addManagedListeners(this.column,{filterActiveChanged:e}),e()}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight())return e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),void i.addOrRemoveCssClass("ag-header-span-total",!1);const{numberOfParents:o,isSpanningTotal:n}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:r}=s,l=r.getColumnHeaderRowHeight();if(0===o)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",`${l}px`);i.addOrRemoveCssClass("ag-header-span-total",n);const a=o*(r.isPivotMode()?r.getPivotGroupHeaderHeight():r.getGroupHeaderHeight());e.style.setProperty("top",-a+"px"),e.style.setProperty("height",`${l+a}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,s=i=>{if(!this.isAlive())return;const{paddingTop:o,paddingBottom:n,borderBottomWidth:r,borderTopWidth:l}=di(this.getGui()),a=o+n+r+l,h=e.offsetHeight+a;if(i<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==h)return void window.setTimeout((()=>s(i+1)),0)}t.setColHeaderHeight(this.column,h)};let o,n=!1;const r=()=>{const e=this.column.isAutoHeaderHeight();e&&!n&&l(),!e&&n&&a()},l=()=>{n=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),o=i.observeResize(e,(()=>s(0)))},a=()=>{n=!1,o&&o(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),o=void 0};r(),this.addDestroyFunc((()=>a())),this.addManagedListeners(this.column,{widthChanged:()=>n&&s(0)}),this.addManagedEventListeners({sortChanged:()=>{n&&window.setTimeout((()=>s(0)))}}),this.addRefreshFunction(r)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(function(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort(((e,t)=>"filter"===e?-1:t.charCodeAt(0)-e.charCodeAt(0))).map((e=>this.ariaDescriptionProperties.get(e))).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedEventListeners({columnHoverChanged:e}),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column)})}handleMouseOverChange(e){this.setActiveHeader(e);const t={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column};this.eventService.dispatchEvent(t)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof Yi?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},qn=class extends I{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.autoWidthCalculator=e.autoWidthCalculator,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const e=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",(()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach((e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())})),t.length>0&&this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")}))}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),o=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(o,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s={columnsToResize:t,resizeStartWidth:i,resizeRatios:this.getSizeRatiosOfColumns(t,i)};let o=null;if(e&&(o=this.visibleColsService.getGroupAtDirection(this.columnGroup,"After")),o){const e=o.getDisplayedLeafColumns(),t=s.groupAfterColumns=e.filter((e=>e.isResizable())),i=s.groupAfterStartWidth=this.getInitialSizeOfColumns(t);s.groupAfterRatios=this.getSizeRatiosOfColumns(t,i)}else s.groupAfterColumns=void 0,s.groupAfterStartWidth=void 0,s.groupAfterRatios=void 0;return s}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:o,groupAfterStartWidth:n,groupAfterRatios:r}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=n,this.resizeTakeFromRatios=r}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols??void 0,groupAfterStartWidth:this.resizeTakeFromStartWidth??void 0,groupAfterRatios:this.resizeTakeFromRatios??void 0};this.resizeColumns(s,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:o,resizeStartWidth:n,resizeRatios:r,groupAfterColumns:l,groupAfterStartWidth:a,groupAfterRatios:h}=e,d=[];if(d.push({columns:o,ratios:r,width:t}),l){const e=t-n;d.push({columns:l,ratios:h,width:a-e})}this.columnSizeService.resizeColumnSets({resizeSets:d,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter((e=>e.isResizable()))}getInitialSizeOfColumns(e){return e.reduce(((e,t)=>e+t.getActualWidth()),0)}getSizeRatiosOfColumns(e,t){return e.map((e=>e.getActualWidth()/t))}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}},Yn=class extends I{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach((t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push((()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)}))}))}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach((e=>e())),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}},Qn=class extends an{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const e=this.getGui();this.setDragSource(e)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnNameService.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc((()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))})),this.setupUserComp(),this.addHeaderMouseListeners();const s=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new hn(o,t)),this.createManagedBean(new en(this.column,t,this.beans)),this.createManagedBean(new Yn(e,this.column)),this.resizeFeature=this.createManagedBean(new qn(e,i,s,this.column)),this.createManagedBean(new uo(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,gos:o,ctrlsService:n}=this,r=o.get("enableRtl"),l=0===e,a=this.getPinned(),h=i.getBoundingClientRect(),d=h.left,u=h.width,g=zn(l!==r?d-20:d+u+20,a,!0,o,n),p=s.getGroupId(),m=this.focusService.getFocusedHeader();Bn({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:g,pinned:a,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:t.columnModel,columnMoveService:t.columnMoveService,presentedColsService:t.visibleColsService});const C=s.getDisplayedLeafColumns(),f=l?C[0]:c(C);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(f,"auto"),!this.isAlive()&&m&&this.restoreFocus(p,s,m)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const o=s[0].getParent();if(!o)return;const n=this.findGroupWidthId(o,e);n&&this.focusService.focusHeaderPosition({headerPosition:{...i,column:n}})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:e=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),e,"gridInitializing")},setTooltip:(e,t)=>{this.setupTooltip(e,t)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=e=>this.handleMouseOverChange("mouseenter"===e.type);this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column.getProvidedColumnGroup()),contextmenu:e=>this.handleContextMenuMouseEvent(e,void 0,this.column.getProvidedColumnGroup())})}handleMouseOverChange(e){const t={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(t)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),s="whenTruncated"===this.gos.get("tooltipShowMode"),o=this.eGui;t||!s||i?.headerGroupComponent||(t=()=>{const e=o.querySelector(".ag-header-group-text");return!e||e.scrollWidth>e.clientWidth});const n={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>e??(i&&i.headerTooltip),shouldDisplayTooltip:t};i&&(n.getColDef=()=>i),this.createManagedBean(new Hi(n))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded();const t=this.refreshExpanded.bind(this);this.addManagedListeners(e,{expandedChanged:t,expandableChanged:t})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=tn(this.column.getColGroupDef(),this.gos,null,this.column);if(this.column.isPadding()){e.push("ag-header-group-cell-no-group");this.column.getLeafColumns().every((e=>e.isSpanHeaderHeight()))&&e.push("ag-header-span-height")}else e.push("ag-header-group-cell-with-group");e.forEach((e=>this.comp.addOrRemoveCssClass(e,!0)))}setupMovingCss(){const e=this.column.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());e.forEach((e=>{this.addManagedListeners(e,{movingChanged:t})})),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===is.ENTER){const e=this.column,t=!e.isExpanded();this.beans.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving())return;if(this.removeDragSource(),!e)return;const{beans:t,column:i,displayName:s,gos:o,dragAndDropService:n}=this,{columnModel:r}=t,l=i.getProvidedColumnGroup().getLeafColumns();let a=!o.get("suppressDragLeaveHidesColumns");const h=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?"hide":"notAllowed",dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),l.forEach((e=>e.setMoving(!0,"uiColumnDragged")))},onDragStopped:()=>l.forEach((e=>e.setMoving(!1,"uiColumnDragged"))),onGridEnter:e=>{if(a){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];r.setColsVisible(t,!0,"uiColumnMoved")}},onGridExit:e=>{if(a){const t=e?.columns?.filter((e=>!e.getColDef().lockVisible))||[];r.setColsVisible(t,!1,"uiColumnMoved")}}};n.addDragSource(h,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach((e=>i[e.getId()]=e.isVisible()));const s=[];return this.beans.visibleColsService.getAllCols().forEach((e=>{t.indexOf(e)>=0&&(s.push(e),C(t,e))})),t.forEach((e=>s.push(e))),{columns:s,visibleState:i}}isSuppressMoving(){let e=!1;this.column.getLeafColumns().forEach((t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)}));return e||this.gos.get("suppressMovableColumns")}},Xn=0,Jn=class extends I{constructor(e,t,i){super(),this.instanceId=Xn++,this.rowIndex=e,this.pinned=t,this.type=i;const s="group"==i?"ag-header-row-column-group":"filter"==i?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}wireBeans(e){this.beans=e}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}areCellsRendered(){return!!this.comp&&this.getHeaderCellCtrls().every((e=>null!=e.getGui()))}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){const e=this.onRowHeightChanged.bind(this);this.addManagedEventListeners({columnResized:this.onColumnResized.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:e=>this.onVirtualColumnsChanged(e.afterScroll),columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e}),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",(e=>this.isEnsureDomOrder=e.currentValue)),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e)}getHeaderCellCtrl(e){if(this.headerCellCtrls)return U(this.headerCellCtrls).find((t=>t.getColumnGroupChild()===e))}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleColsService:e}=this.beans;if(this.isPrintLayout){return null!=this.pinned?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null)}return e.getContainerWidth(this.pinned)}onRowHeightChanged(){const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const s=[];let o=0;t?.hasFloatingFilters()&&(i++,o=1);const n=e.getColumnGroupHeaderRowHeight(),r=e.getColumnHeaderRowHeight(),l=i-(1+o);for(let e=0;e<l;e++)s.push(n);s.push(r);for(let t=0;t<o;t++)s.push(e.getFloatingFiltersHeight());let a=0;for(let e=0;e<this.rowIndex;e++)a+=s[e];return{topOffset:a,rowHeight:s[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const i of t)this.recycleAndCreateHeaderCtrls(i,e);const i=e=>{const{focusService:t,visibleColsService:i}=this.beans;if(!t.isHeaderWrapperFocused(e))return!1;return i.isVisible(e.getColumnGroupChild())};if(e)for(const[t,s]of e){i(s)?this.headerCellCtrls.set(t,s):this.destroyBean(s)}return this.getHeaderCellCtrls()}getHeaderCellCtrls(){return Array.from(this.headerCellCtrls?.values()??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls)return;if(e.isEmptyGroup())return;const i=e.getUniqueId();let s;t&&(s=t.get(i),t.delete(i));if(s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),null==s)switch(this.type){case"filter":s=this.createBean(this.beans.ctrlsFactory.getInstance("headerFilterCell",e,this.beans,this));break;case"group":s=this.createBean(new Qn(e,this.beans,this));break;default:s=this.createBean(new jn(e,this.beans,this))}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth(),{columnViewportService:i}=this.beans;return["left",null,"right"].forEach((s=>{const o=i.getHeadersToRender(s,t);e=e.concat(o)})),e}getActualDepth(){return"filter"==this.type?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnViewportService.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){if(!this.headerCellCtrls)return;return this.getHeaderCellCtrls().find((t=>t.getColumnGroupChild()==e))}focusHeader(e,t){const i=this.findHeaderCellCtrl(e);if(!i)return!1;return i.focus(t)}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach((e=>{this.destroyBean(e)})),this.headerCellCtrls=void 0,super.destroy()}},Zn=class extends I{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}wireBeans(e){this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.focusService=e.focusService,this.filterManager=e.filterManager}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport);const i=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:i,advancedFilterEnabledChanged:i}),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const t=new ki,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let i=0;i<e;i++){const e=this.createBean(new Jn(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(e)}})(),(()=>{const i=t.next(),s=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===i);(s||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),s&&(this.columnsRowCtrl=this.createBean(new Jn(i,this.pinned,"column")))})(),(()=>{this.includeFloatingFilter=!!this.filterManager?.hasFloatingFilters()&&!this.hidden;const i=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void i();const s=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==s;e&&!t||i()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Jn(s,this.pinned,"filter")))})();const s=this.getAllCtrls();this.comp.setCtrls(s),this.restoreFocusOnHeader(i)}getHeaderCtrlForColumn(e){if(ie(e)){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,i){const s=this.getAllCtrls()[e];return!!s&&s.focusHeader(t,i)}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}setupDragAndDrop(e){const t=new Un(this.pinned,e);this.createManagedBean(t)}restoreFocusOnHeader(e){if(!e)return;const{column:t}=e;t.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager?.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new Nn((e=>this.comp.setCenterWidth(`${e}px`)),!0))}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const i=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==i)return;const s=0==i,o=this.hidden!==s,n=this.gos.get("enableRtl"),r=this.gos.getScrollbarWidth(),l=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?i+r:i;this.comp.setPinnedContainerWidth(`${l}px`),this.comp.setDisplayed(!s),o&&(this.hidden=s,this.refresh())};this.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}},er=class extends Wi{constructor(e){super(),this.eCenterContainer=Vi,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new Zn(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e="left"==this.pinned,t="right"==this.pinned,i=e?'<div class="ag-pinned-left-header" role="rowgroup"></div>':t?'<div class="ag-pinned-right-header" role="rowgroup"></div>':'<div class="ag-header-viewport" role="presentation">\n <div class="ag-header-container" data-ref="eCenterContainer" role="rowgroup"></div>\n </div>';this.setTemplate(i),this.eRowContainer=this.eCenterContainer!==Vi?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;let i;this.headerRowComps={},this.rowCompsList=[];const s=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),i&&Fi(this.eRowContainer,t,i),i=t};e.forEach((e=>{const i=e.getInstanceId(),o=t[i];delete t[i];const n=o||this.createBean(new Ln(e));this.headerRowComps[i]=n,this.rowCompsList.push(n),s(n)})),Y(t).forEach((e=>this.destroyRowComp(e)))}},tr=class extends Wi{constructor(){super('<div class="ag-header" role="presentation"/>')}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new Gn).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new er("left")),t(new er(null)),t(new er("right"))}},ir={selector:"AG-HEADER-ROOT",component:tr},sr=(e=>(e.AUTO_HEIGHT="ag-layout-auto-height",e.NORMAL="ag-layout-normal",e.PRINT="ag-layout-print",e))(sr||{}),or=class extends I{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){const e=this.gos.get("domLayout")??"normal";return-1===["normal","print","autoHeight"].indexOf(e)?(de(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):e}},nr=class extends Wi{constructor(){super('\n <div class="ag-overlay" role="presentation">\n <div class="ag-overlay-panel" role="presentation">\n <div class="ag-overlay-wrapper" data-ref="eOverlayWrapper" role="presentation"></div>\n </div>\n </div>'),this.eOverlayWrapper=Vi,this.activePromise=null,this.activeOverlay=null,this.updateListenerDestroyFunc=null,this.activeOverlayWrapperCssClass=null}wireBeans(e){this.overlayService=e.overlayService}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print)}postConstruct(){this.createManagedBean(new or(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i){this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.activePromise=e,e?.then((t=>{if(this.activePromise===e){if(this.activePromise=null,t&&this.activeOverlay!=t&&(this.eOverlayWrapper.appendChild(t.getGui()),this.activeOverlay=t,i)){const e=t;this.updateListenerDestroyFunc=this.addManagedPropertyListener(i,(({currentValue:t})=>{e.refresh?.(this.gos.addGridCommonParams({...t??{}}))}))}}else this.activeOverlay!==t&&(this.destroyBean(t),t=null)})),this.setDisplayed(!0,{skipAriaHidden:!0})}destroyActiveOverlay(){this.activePromise=null;const e=this.activeOverlay;if(!e)return;this.activeOverlay=null;const t=this.updateListenerDestroyFunc;t&&(t(),this.updateListenerDestroyFunc=null),this.destroyBean(e),wi(this.eOverlayWrapper)}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}},rr={selector:"AG-OVERLAY-WRAPPER",component:nr},lr=class extends Wi{constructor(e,t){super(),this.direction=t,this.eViewport=Vi,this.eContainer=Vi,this.hideTimeout=null,this.setTemplate(e)}wireBeans(e){this.animationFrameService=e.animationFrameService}postConstruct(){this.addManagedEventListeners({scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this)}),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",Xt()||Jt())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=ii(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui(),t=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0),i=()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1);this.addManagedListeners(e,{mouseenter:t,mousedown:t,touchstart:t,mouseleave:i,touchend:i})}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame((()=>this.setScrollVisible()))}hideAndShowInvisibleScrollAsNeeded(){this.addManagedEventListeners({bodyScroll:e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))},bodyScrollEnd:()=>{this.hideTimeout=window.setTimeout((()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null}),400)}})}attemptSettingScrollPosition(e){const t=this.getViewport();we((()=>bi(t)),(()=>this.setScrollPosition(e)),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedElementListeners(this.getViewport(),{scroll:e})}},ar=class extends lr{constructor(){super('<div class="ag-body-horizontal-scroll" aria-hidden="true">\n <div class="ag-horizontal-left-spacer" data-ref="eLeftSpacer"></div>\n <div class="ag-body-horizontal-scroll-viewport" data-ref="eViewport">\n <div class="ag-body-horizontal-scroll-container" data-ref="eContainer"></div>\n </div>\n <div class="ag-horizontal-right-spacer" data-ref="eRightSpacer"></div>\n </div>',"horizontal"),this.eLeftSpacer=Vi,this.eRightSpacer=Vi}wireBeans(e){super.wireBeans(e),this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e,pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this)}),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.register("fakeHScrollComp",this),this.createManagedBean(new Nn((e=>this.eContainer.style.width=`${e}px`))),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gos.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.visibleColsService.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.gos.getScrollbarWidth();i&&(t+=s),Mi(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let o=this.visibleColsService.getColsLeftWidth();this.enableRtl&&e&&(o+=s),Mi(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gos.get("suppressHorizontalScroll"),s=e&&this.gos.getScrollbarWidth()||0,o=i?0:0===s&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),xi(this.getGui(),o),xi(this.eViewport,o),xi(this.eContainer,o),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return fi(this.getViewport(),this.enableRtl)}setScrollPosition(e){bi(this.getViewport())||this.attemptSettingScrollPosition(e),vi(this.getViewport(),e,this.enableRtl)}},hr={selector:"AG-FAKE-HORIZONTAL-SCROLL",component:ar},dr=class extends I{wireBeans(e){this.maxDivHeightScaler=e.rowContainerHeightService}constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedEventListeners({rowContainerHeightChanged:this.onHeightChanged.bind(this)})}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}},cr=class extends lr{wireBeans(e){super.wireBeans(e),this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService}constructor(){super('<div class="ag-body-vertical-scroll" aria-hidden="true">\n <div class="ag-body-vertical-scroll-viewport" data-ref="eViewport">\n <div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div>\n </div>\n </div>',"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new dr(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this)})}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,s=0===i&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),Mi(this.getGui(),s),Mi(this.eViewport,s),Mi(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,t=e.getGridBodyCtrl().getBodyViewportElement(),i=this.getScrollPosition(),s=t.scrollTop;i!=s&&this.setScrollPosition(s,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){t||bi(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}},ur={selector:"AG-FAKE-VERTICAL-SCROLL",component:cr},gr=class extends I{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=fe((()=>this.lastScrollSource[1]=null),500),this.resetLastVScrollDebounced=fe((()=>this.lastScrollSource[0]=null),500)}wireBeans(e){this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.rowModel=e.rowModel,this.heightScaler=e.rowContainerHeightService,this.rowRenderer=e.rowRenderer,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)}),this.ctrlsService.whenReady((e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()}))}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(),{scroll:this.onHScroll.bind(this)}),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),s=i?fe(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?fe(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedElementListeners(this.eBodyViewport,{scroll:s}),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowsCtrl)return;void 0===e&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,{topCenter:i,stickyTopCenter:s,stickyBottomCenter:o,centerHeader:n,bottomCenter:r,fakeHScrollComp:l}=this.ctrlsService.getParams();n.setHorizontalScroll(-t),r.setContainerTranslateX(t),i.setContainerTranslateX(t),s.setContainerTranslateX(t),o.setContainerTranslateX(t);const a=this.centerRowsCtrl.getViewportElement(),h=0===this.lastScrollSource[1];e=Math.abs(e),h?l.setScrollPosition(e):vi(a,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let s;s=0===e?fi(t,this.enableRtl):this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;t=0===e?this.eBodyViewport.scrollTop:this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),this.shouldBlockScrollUpdate(0,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,0===e?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:"bodyScroll",direction:1===e?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout((()=>{const e={...t,type:"bodyScrollEnd"};this.eventService.dispatchEvent(e)}),100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!Jt())&&(0===e?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=ci(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&Ci()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(e=this.enableRtl&&Ci()?e>0?0:i:Math.min(Math.max(e,0),i)),vi(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight;return{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let t=0;t<i;t++){const i=this.rowModel.getRow(t);if("function"==typeof e){if(i&&e(i)){s=t;break}}else if(e===i||e===i.data){s=t;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.rowModel.getRowCount();if("number"!=typeof e||e<0||e>=i)return void de("Invalid row index for ensureIndexVisible: "+e);const s=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming((()=>{s||this.paginationService?.goToPageWithIndex(e);const i=this.ctrlsService.getGridBodyCtrl(),o=i.getStickyTopHeight(),n=i.getStickyBottomHeight(),r=this.rowModel.getRow(e);let l;do{const e=r.rowTop,i=r.rowHeight,s=this.pageBoundsService.getPixelOffset(),a=r.rowTop-s,h=a+r.rowHeight,d=this.getVScrollPosition(),c=this.heightScaler.getDivStretchOffset(),u=d.top+c,g=d.bottom+c,p=g-u,m=this.heightScaler.getScrollPositionForPixel(a),C=this.heightScaler.getScrollPositionForPixel(h-p),f=Math.min((m+C)/2,a);let v=null;"top"===t?v=m:"bottom"===t?v=C:"middle"===t?v=f:u+o>a?v=m-o:g-n<h&&(v=C+n),null!==v&&(this.setVerticalScrollPosition(v),this.rowRenderer.redraw({afterScroll:!0})),l=e!==r.rowTop||i!==r.rowHeight}while(l);this.animationFrameService.flushAllFrames()}))}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getCol(e);if(!i)return;if(i.isPinned())return;if(!this.visibleColsService.isColDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming((()=>{null!==s&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()}))}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming((()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()}))}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),n=this.centerRowsCtrl.getCenterWidth(),r=this.enableRtl;let l=(r?i:s)||o,a=r?s:i;"auto"!==t&&(l="start"===t,a="end"===t);const h="middle"===t;if(l||a||h){const{colLeft:t,colMiddle:i,colRight:s}=this.getColumnBounds(e);return h?i-n/2:l?r?s:t:r?t-n:s-n}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),n=this.enableRtl;return{columnBeforeStart:n?t>o:i<o,columnAfterEnd:n?i<s:t>s}}getColumnBounds(e){const t=this.enableRtl,i=this.visibleColsService.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),n=t?-1:1,r=t?i-o:o;return{colLeft:r,colMiddle:r+s/2*n,colRight:r+s*n}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}},pr="ag-force-vertical-scroll",mr=class extends I{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.menuService=e.menuService,this.headerNavigationService=e.headerNavigationService,this.dragAndDropService=e.dragAndDropService,this.pinnedRowModel=e.pinnedRowModel,this.rowRenderer=e.rowRenderer,this.popupService=e.popupService,this.mouseEventService=e.mouseEventService,this.rowModel=e.rowModel,this.filterManager=e.filterManager,this.environment=e.environment}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,n,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=n,this.eStickyBottom=r,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",(e=>this.setCellTextSelection(e.currentValue))),this.createManagedBean(new or(this.comp)),this.bodyScrollFeature=this.createManagedBean(new gr(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,n,r]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager?.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),pinnedRowDataChanged:this.setFloatingHeights.bind(this),pinnedHeightChanged:this.setFloatingHeights.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}addFocusListeners(e){e.forEach((e=>{this.addManagedElementListeners(e,{focusin:t=>{const{target:i}=t,s=hi(i,"ag-root",e);e.classList.toggle("ag-has-focus",!s)},focusout:t=>{const{target:i,relatedTarget:s}=t,o=e.contains(s),n=hi(s,"ag-root",e);hi(i,"ag-root",e)||o&&!n||e.classList.remove("ag-has-focus")}})}))}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=`calc(100% + ${(e&&this.gos.getScrollbarWidth()||0)+(ii()?16:0)}px)`;this.animationFrameService.requestAnimationFrame((()=>this.comp.setBodyViewportWidth(t)))}onGridColumnsChanged(){const e=this.columnModel.getCols();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const i=e.relatedTarget;if(null===ei(i))return void this.rowRenderer.stopEditing();let s=t.some((e=>e.contains(i)))&&this.mouseEventService.isElementInThisGrid(i);if(!s){const e=this.popupService;s=e.getActivePopups().some((e=>e.contains(i)))||e.isElementWithinCustomPopup(i)}s||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach((t=>this.addManagedElementListeners(t,{focusout:e})))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+(this.filterManager?.getHeaderRowCount()??0),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=-1===t?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?pr:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&(s=this.eBodyViewport).clientHeight<s.scrollHeight;var s}setupRowAnimationCssClass(){let e=this.environment.hasMeasuredSizes();const t=()=>{const t=e&&this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),i=t?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(i,t)};t(),this.addManagedEventListeners({heightScaleChanged:t}),this.addManagedPropertyListener("animateRows",t),this.addManagedEventListeners({gridStylesChanged:()=>{!e&&this.environment.hasMeasuredSizes()&&(e=!0,t())}})}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:e}),this.mockContextMenuForIPad(e),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this)}),this.addManagedElementListeners(this.eStickyTop,{wheel:this.onStickyWheel.bind(this)}),this.addManagedElementListeners(this.eStickyBottom,{wheel:this.onStickyWheel.bind(this)}),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedElementListeners(e,{wheel:e=>this.onFullWidthContainerWheel(e,t)})}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;if(this.gos.get("preventDefaultOnContextMenu")){(e||i).preventDefault()}const{target:s}=e||t;s!==this.eBodyViewport&&s!==this.ctrlsService.get("center").getViewportElement()||this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!Jt())return;const t=new $i(this.eBodyViewport);this.addManagedListeners(t,{longTap:t=>{e(void 0,t.touchStart,t.touchEvent)}}),this.addDestroyFunc((()=>t.destroy()))}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Xs(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(e){const e=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+(this.filterManager?.getHeaderHeight()??0),t=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e),t>0&&(i+=t),i>0&&(i+=1),this.comp.setStickyTopTop(`${i}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight()+(this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0);this.comp.setStickyBottomBottom(`${e}px`)}sizeColumnsToFit(e,t){const i=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,s=ui(this.eGridBody)-i;s>0?this.columnSizeService.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,100)}),0):100===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,500)}),100):500===t?window.setTimeout((()=>{this.sizeColumnsToFit(e,-1)}),500):de("tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}},Cr=class extends Wi{constructor(e,t,i,s,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(n);const r=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l=(e,t)=>{null!=t&&""!=t?r.setAttribute(e,t):r.removeAttribute(e)};bt(r,t.getCellAriaRole()),l("col-id",t.getColumnIdSanitised());const a=t.getTabIndex();void 0!==a&&l("tabindex",a.toString());const h={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Ei(r,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,i)=>this.setRenderDetails(e,t,i),setEditDetails:(e,t,i)=>this.setEditDetails(e,t,i),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(h,this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const s=this.refreshWrapper(!1);if(this.refreshEditStyles(!1),e){!(i||s)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e))}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&null==this.eCellWrapper;if(s){const e=document.createElement("div");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=e,this.getGui().appendChild(this.eCellWrapper)}const o=!i&&null!=this.eCellWrapper;o&&(Si(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const n=!e&&i,r=n&&null==this.eCellValue;if(r){const e=document.createElement("span");e.setAttribute("role","presentation"),e.setAttribute("class","ag-cell-value"),this.eCellValue=e,this.eCellWrapper.appendChild(this.eCellValue)}const l=!n&&null!=this.eCellValue;l&&(Si(this.eCellValue),this.eCellValue=void 0);const a=s||o||r||l;return a&&this.removeControls(),e||t&&this.addControls(),a}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,o=e.newAgStackInstance();if(null==o)return;const{params:n}=e;o.then((e=>this.afterCellEditorCreated(s,e,n,t,i)));G(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();wi(t);const i=null!=e?ze(e,!0):null;null!=i&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),Si(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),Si(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gos.get("suppressAnimationFrame"),i=this.rendererVersion,{componentClass:s}=e,o=()=>{if(this.rendererVersion!==i||!this.isAlive())return;const t=e.newAgStackInstance(),o=this.afterCellRendererCreated.bind(this,i,s);t&&t.then(o)};t&&this.firstRender?this.beans.animationFrameService.createTask(o,this.rowNode.rowIndex,"createTasksP2"):o()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion)this.beans.context.destroyBean(i);else if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();wi(e),e.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,s,o){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return de(`cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const n=s||void 0!==t.isPopup&&t.isPopup();n?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,n),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),this.rowCtrl?.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();if(e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui){this.getParentOfValue().appendChild(this.cellEditorGui)}}addPopupCellEditor(e,t){"fullRow"===this.beans.gos.get("editType")&&de("popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(this.beans.editService.createPopupEditorWrapper(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,n=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),r=null!=t?t:i.getPopupPosition?i.getPopupPosition():"over",l=this.beans.gos.get("enableRtl"),a={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:r,alignSide:l?"right":"left",keepWithinBounds:!0},h=o.positionPopupByComponent.bind(o,a),d=this.beans.localeService.getLocaleTextFunc(),c=o.addPopup({modal:n,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:h,ariaLabel:d("ariaLabelCellEditor","Cell Editor")});c&&(this.hideEditorPopup=c.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&Zt()&&e.focus({preventScroll:!0}),wi(this.getParentOfValue())}},fr=class extends Wi{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const o=this.getGui(),n=o.style;this.domOrder=this.rowCtrl.getDomOrder(),bt(o,"row");const r=this.rowCtrl.getTabIndex();null!=r&&o.setAttribute("tabindex",r.toString());const l={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>Ei(o,e),setTop:e=>n.top=e,setTransform:e=>n.transform=e,setRowIndex:e=>o.setAttribute("row-index",e),setRowId:e=>o.setAttribute("row-id",e),setRowBusinessKey:e=>o.setAttribute("row-business-key",e),refreshFullWidth:e=>this.refreshFullWidth(e)};e.setComp(l,this.getGui(),i),this.addDestroyFunc((()=>{e.unsetComp(i)}))}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then((e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)}))}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach((e=>{const i=e.getInstanceId();null==this.cellComps[i]?this.newCellComp(e):t[i]=null}));const i=Y(t).filter((e=>null!=e));this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach((e=>{const i=this.cellComps[e.getInstanceId()];i&&t.push(i.getGui())})),Pi(this.getGui(),t)}newCellComp(e){const t=new Cr(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=Y(this.cellComps).filter((e=>null!=e));this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&ce("should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc((()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)}))}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach((e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)}))}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},vr=class extends I{wireBeans(e){this.ctrlsService=e.ctrlsService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.columnViewportService=e.columnViewportService}constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()})),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],(()=>{this.checkViewportAndScrolls()}))}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnSizeService.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=ui(this.gridBodyCtrl.getBodyViewportElement());if(e<=50)return;let t=this.getPinnedColumnsOverflowingViewport(e-50);const i=this.gos.getCallback("processUnpinnedColumns");if(t.length){if(i){t=i({columns:t,viewportWidth:e})}this.columnModel.setColsPinned(t,null,"viewportSizeFeature")}}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth()+this.pinnedWidthService.getPinnedLeftWidth();if(t<e)return[];const i=[...this.visibleColsService.getLeftCols()],s=[...this.visibleColsService.getRightCols()];let o=0,n=0;const r=[];let l=t-0-e;for(;(n<i.length||o<s.length)&&l>0;){if(o<s.length){const e=s[o++];l-=e.getActualWidth(),r.push(e)}if(n<i.length&&l>0){const e=i[n++];l-=e.getActualWidth(),r.push(e)}}return r}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=ci(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:"bodyHeightChanged"};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnViewportService.setScrollPosition(e,t)}},wr=class extends I{wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",(e=>{e.currentValue?this.enableFeature():this.disableFeature()})),this.addDestroyFunc((()=>this.disableFeature()));this.gos.get("enableRangeSelection")&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}},Sr=class extends Wi{constructor(){super('\n <div class="ag-selection-checkbox" role="presentation">\n <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\n </div>',[ls]),this.eCheckbox=Vi}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=$t(e,t),[s,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],n=e(s,o);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement(),{dblclick:e=>D(e),click:e=>{D(e);const t=this.gos.get("groupSelectsFiltered"),i=this.eCheckbox.getValue();if(this.shouldHandleIndeterminateState(i,t)){0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e)}else i?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)});if(this.gos.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){let e=this.rowNode.selectable;const t=this.getIsVisible();if(e)if("function"==typeof t){const i=this.overrides?.callbackParams;if(this.column){const s=this.column.createColumnFunctionCallbackParams(this.rowNode);e=t({...i,...s})}else e=t({...i,node:this.rowNode,data:this.rowNode.data})}else e=t??!1;const i=this.column?.getColDef().showDisabledCheckboxes;if(i)return this.eCheckbox.setDisabled(!e),this.setVisible(!0),void this.setDisplayed(!0);this.overrides?.removeHidden?this.setDisplayed(e):this.setVisible(e)}getIsVisible(){return this.overrides?this.overrides.isVisible:this.column?.getColDef()?.checkboxSelection}},yr=class extends Wi{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(Ui("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",(e=>{e.stopPropagation()})),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}};if(t){t(this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e}))}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},br=class extends I{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,(e=>this.cellComp.addOrRemoveCssClass(e,!0)),(e=>this.cellComp.addOrRemoveCssClass(e,!1))),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex});t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach((e=>this.cellComp.addOrRemoveCssClass(e,!1))),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach((e=>this.cellComp.addOrRemoveCssClass(e,!0)))}destroy(){super.destroy()}},Rr=class extends I{constructor(e,t,i,s,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case is.ENTER:this.onEnterKeyDown(e);break;case is.F2:this.onF2KeyDown(e);break;case is.ESCAPE:this.onEscapeKeyDown(e);break;case is.TAB:this.onTabKeyDown(e);break;case is.BACKSPACE:case is.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case is.DOWN:case is.UP:case is.RIGHT:case is.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:o}=this,{gos:n,rangeService:r,eventService:l}=s;if(!i.isEditing()){if(l.dispatchEvent({type:"keyShortcutChangedCellStart"}),function(e,t=!1){return e===is.DELETE||!t&&e===is.BACKSPACE&&Xt()}(e,n.get("enableCellEditingOnBackspace"))){if(r&&n.get("enableRangeSelection"))r.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const e=i.getColumn(),t=this.beans.valueService.parseValue(e,o,"",o.getValueFromValueService(e))??null;o.setDataValue(e,t,"cellClear")}}else i.startRowOrCellEdit(e,t);l.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?is.UP:is.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(is.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(is.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.get("suppressRowDeselection")){const t=this.beans.gos.get("groupSelectsFiltered"),o=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===i&&0===o&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},Fr=class extends I{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!M(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gos:s}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const n=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(n);const r=this.column.getColDef();r.onCellClicked&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{r.onCellClicked(n)}))}),0);!((s.get("singleClickEdit")||r.singleClickEdit)&&!s.get("suppressClickEdit"))||e.shiftKey&&0!=i?.getCellRanges().length||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!Jt()||x("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const{column:t,beans:i,cellCtrl:s}=this,{eventService:o,frameworkOverrides:n,gos:r}=i,l=t.getColDef(),a=s.createEvent(e,"cellDoubleClicked");o.dispatchEvent(a),"function"==typeof l.onCellDoubleClicked&&window.setTimeout((()=>{n.wrapOutgoing((()=>{l.onCellDoubleClicked(a)}))}),0);!r.get("singleClickEdit")&&!r.get("suppressClickEdit")&&s.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{cellCtrl:n,beans:r}=this,{eventService:l,rangeService:a,focusService:h,gos:d}=r;if(this.isRightClickInExistingRange(e))return;const c=a&&0!=a.getCellRanges().length;if(!s||!c){const t=d.get("enableCellTextSelection")&&e.defaultPrevented,i=(jt()||t)&&!n.isEditing()&&!ni(o);n.focusCell(i)}if(s&&c&&!h.isCellFocused(n.getCellPosition())){e.preventDefault();const t=h.getFocusedCell();if(t){const{column:e,rowIndex:i,rowPinned:s}=t,o=r.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s}),n=o?.getCellCtrl(e);n?.isEditing()&&n.stopEditing(),h.setFocusedCell({column:e,rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(a){const e=this.cellCtrl.getCellPosition();if(s)a.extendLatestRangeToCell(e);else{const s=t||i;a.setRangeToCell(e,s)}}l.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=2===e.button||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return hi(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOut");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOver");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){super.destroy()}},Pr=class extends I{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();u(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce(((e,t)=>e+t.getActualWidth()),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let o=0;i&&o<e&&(t.push(i),i=this.beans.visibleColsService.getColAfter(i),i&&!G(i))&&s===i.getPinned();o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gos.get("enableRtl")&&this.colsSpanning?c(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.visibleColsService.getColsLeftWidth();if("right"===this.column.getPinned()){return t+this.beans.visibleColsService.getBodyContainerWidth()+(e||0)}return t+(e||0)}applyRowSpan(e){if(1===this.rowSpan&&!e)return;const t=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${t}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},Er=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(Er||{}),Dr=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(Dr||{}),Mr="ag-cell-range-selected",xr=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(Mr,0!==this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Mr}-1`,1===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Mr}-2`,2===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Mr}-3`,3===this.rangeCount),this.cellComp.addOrRemoveCssClass(`${Mr}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),_t(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,o=!t&&e.bottom,n=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",i),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",o),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",n)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every((e=>S([1,0],e.type)))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,o=!1;const n=this.cellCtrl.getCellPosition().column,r=this.beans.visibleColsService;let l,a;e?(l=r.getColAfter(n),a=r.getColBefore(n)):(l=r.getColBefore(n),a=r.getColAfter(n));const h=this.rangeService.getCellRanges().filter((e=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e)));l||(o=!0),a||(i=!0);for(let e=0;e<h.length&&!(t&&i&&s&&o);e++){const n=h[e],r=this.rangeService.getRangeStartRow(n),d=this.rangeService.getRangeEndRow(n);!t&&this.beans.rowPositionUtils.sameRow(r,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(d,this.cellCtrl.getCellPosition())&&(s=!0),!o&&l&&n.columns.indexOf(l)<0&&(o=!0),!i&&a&&n.columns.indexOf(a)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=c(t),o=this.cellCtrl.getCellPosition(),n=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),r=e.get("enableRangeHandle");let l=1===i&&!this.cellCtrl.isEditing()&&(n||r);if(this.hasChartRange){const e=1===t[0].type&&this.rangeService.isCellInSpecificRange(o,t[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),l=0===s.type}return l&&null!=s.endRow&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,o)}addSelectionHandle(){const e=this.beans.gos,t=c(this.rangeService.getCellRanges()).type,i=e.get("enableFillHandle")&&G(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==i&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(i)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},Tr=0,Ar=class e extends I{constructor(e,t,i,s){super(),this.column=e,this.rowNode=t,this.beans=i,this.rowCtrl=s,this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.instanceId=e.getId()+"-"+Tr++,this.colIdSanitised=ze(this.column.getId()),i.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new Pr(this,this.beans),this.addDestroyFunc((()=>{this.cellPositionFeature?.destroy(),this.cellPositionFeature=null})),this.cellCustomStyleFeature=new br(this,this.beans),this.addDestroyFunc((()=>{this.cellCustomStyleFeature?.destroy(),this.cellCustomStyleFeature=null})),this.cellMouseListenerFeature=new Fr(this,this.beans,this.column),this.addDestroyFunc((()=>{this.cellMouseListenerFeature?.destroy(),this.cellMouseListenerFeature=null})),this.cellKeyboardListenerFeature=new Rr(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc((()=>{this.cellKeyboardListenerFeature?.destroy(),this.cellKeyboardListenerFeature=null})),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc((()=>{this.disableTooltipFeature()})));this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new xr(this.beans,this),this.addDestroyFunc((()=>{this.cellRangeFeature?.destroy(),this.cellRangeFeature=null})))}enableTooltipFeature(e,t){const i="whenTruncated"===this.beans.gos.get("tooltipShowMode");t||!i||this.isCellRenderer()||(t=()=>{const e=this.getGui(),t=0===e.children.length?e:e.querySelector(".ag-cell-value");return!t||t.scrollWidth>t.clientWidth});const s={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:null!=e?()=>e:()=>{const e=this.column.getColDef(),t=this.rowNode.data;if(e.tooltipField&&k(t))return X(t,e.tooltipField,this.column.isTooltipFieldContainsDots());const i=e.tooltipValueGetter;return i?i(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:t};this.tooltipFeature=new Hi(s,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,i,s,o){this.cellComp=e,this.eGui=t,this.printLayout=s,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),this.cellPositionFeature?.setComp(t),this.cellCustomStyleFeature?.setComp(e),this.tooltipFeature?.refreshToolTip(),this.cellKeyboardListenerFeature?.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach((e=>e())),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,i=this.beans.gos.getRowHeightForNode(this.rowNode).height,s=o=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:n,paddingBottom:r,borderBottomWidth:l,borderTopWidth:a}=di(t),h=n+r+l+a,d=e.offsetHeight+h;if(o<5){const t=this.beans.gos.getDocument();if(!t||!t.contains(e)||0==d)return void window.setTimeout((()=>s(o+1)),0)}const c=Math.max(d,i);this.rowNode.setRowAutoHeight(c,this.column)},o=()=>s(0);o();const n=this.beans.resizeObserverService.observeResize(e,o);this.addDestroyFunc((()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)}))}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return null!=e.cellRenderer||null!=e.cellRendererSelector}getValueToDisplay(){return this.valueFormatted??this.value}showValue(e=!1){const t=this.getValueToDisplay();let i;if(this.rowNode.stub){const e=this.createCellRendererParams();i=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),e)}else if(this.isCellRenderer()){const e=this.createCellRendererParams();i=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(i,t,e),this.cellRangeFeature?.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return!(null!=this.rowNode.rowPinned)&&("function"==typeof e||!0===e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource),o=this.isAutoHeight!=this.column.isAutoHeight();return t||i||s||o}startEditing(e=null,t=!1,i=null){const{editService:s}=this.beans;this.isCellEditable()&&!this.editing&&s&&(this.cellComp?s.startEditing(this,e,t,i):this.onCellCompAttachedFuncs.push((()=>{this.startEditing(e,t,i)})))}setEditing(e,t){this.editCompDetails=t,this.editing!==e&&(this.editing=e,this.cellRangeFeature?.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(e=!1){const{editService:t}=this.beans;return!(!this.editing||!t)&&t.stopEditing(this,e)}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(e,t,i,s)=>this.registerRowDragger(e,t,s),setTooltip:(e,t)=>{this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(e,t),this.tooltipFeature?.refreshToolTip()}})}setFocusOutOnEditor(){this.editing&&this.beans.editService?.setFocusOutOnEditor(this)}setFocusInOnEditor(){this.editing&&this.beans.editService?.setFocusInOnEditor(this)}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(e)}refreshCell(e){if(this.suppressRefreshCell||this.editing)return;const t=this.column.getColDef(),i=null!=e&&!!e.newData,s=null!=e&&!!e.suppressFlash||!!t.suppressCellFlash,o=null==t.field&&null==t.valueGetter&&null==t.showRowGroup,n=e&&e.forceRefresh||o||i,r=!!this.cellComp,l=this.updateAndFormatValue(r);if(r){if(n||l){this.showValue(i);const e=this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering();!s&&!e&&(this.beans.gos.get("enableCellChangeFlash")||t.enableCellChangeFlash)&&this.flashCell(),this.cellCustomStyleFeature?.applyUserStyles(),this.cellCustomStyleFeature?.applyClassesFromColDef()}this.tooltipFeature?.refreshToolTip(),this.cellCustomStyleFeature?.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.beans.editService?.stopEditingAndFocus(this,e,t)}flashCell(e){const t=e?.flashDuration??e?.flashDelay,i=e?.fadeDuration??e?.fadeDelay;this.animateCell("data-changed",t,i)}animateCell(e,t,i){if(!this.cellComp)return;const s=`ag-cell-${e}`,o=`ag-cell-${e}-animation`,{gos:n}=this.beans;t||(t=n.get("cellFlashDuration")),k(i)||(i=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(s,!0),this.cellComp.addOrRemoveCssClass(o,!1),this.beans.frameworkOverrides.wrapIncoming((()=>{window.setTimeout((()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(s,!1),this.cellComp.addOrRemoveCssClass(o,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout((()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.eGui.style.transition="")}),i))}),t)}))}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){return this.callValueFormatter(e)??e}callValueFormatter(e){return this.beans.valueService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),!e||(!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i)}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc((()=>this.beans.gos.setDomData(t,e.DOM_DATA_KEY_CELL_CTRL,null)))}createEvent(e,t){return this.beans.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){this.cellKeyboardListenerFeature?.processCharacter(e)}onKeyDown(e){this.cellKeyboardListenerFeature?.onKeyDown(e)}onMouseEvent(e,t){this.cellMouseListenerFeature?.onMouseEvent(e,t)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){this.cellComp&&this.cellPositionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:i}=this;on(e,t,i.visibleColsService)}refreshAriaColIndex(){const e=this.beans.visibleColsService.getAriaColIndex(this.column);Bt(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){return this.cellPositionFeature?.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){this.cellComp?"fullRow"===this.beans.gos.get("editType")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t):this.onCellCompAttachedFuncs.push((()=>{this.startRowOrCellEdit(e,t)}))}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return null!=this.cellRangeFeature}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gos.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&e?.forceBrowserFocus&&(this.focusEventToRestore=e));if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus){let t=this.cellComp.getFocusableElement();if(this.editing){const e=this.beans.focusService.findFocusableElements(t,null,!0);e.length&&(t=e[0])}t.focus({preventScroll:!!e.preventScrollOnBrowserFocus})}const i="fullRow"===this.beans.gos.get("editType");t||i||!this.editing||this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:O(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gos.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){if(!this.cellComp)return;this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?this.beans.editService?.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,"cellContextMenu");this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout((()=>{this.beans.frameworkOverrides.wrapOutgoing((()=>{t.onCellContextMenu(i)}))}),0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new Sr;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new yr(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const s=this.createRowDragComp(e,t,i);s&&(this.customRowDragComp=s,this.addDestroyFunc((()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null})))}createRowDragComp(e,t,i){const s=this.beans.gos.get("pagination"),o=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(o){if(!n)return void de("managed row dragging is only allowed in the Client Side Row Model");if(s)return void de("managed row dragging is not possible when doing pagination")}const r=new Zs((()=>this.value),this.rowNode,this.column,e,t,i);return this.beans.context.createBean(r),r}setSuppressRefreshCell(e){this.suppressRefreshCell=e}getEditCompDetails(){return this.editCompDetails}};Ar.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var Ir=Ar,Lr=0,Or=class e extends I{constructor(e,t,i,s,o){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=t,this.gos=t.gos,this.rowNode=e,this.paginationPage=t.paginationService?.getCurrentPage()??0,this.useAnimationFrameForCreate=s,this.printLayout=o,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=e.id+"-"+Lr++,this.rowId=ze(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(i),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=ze(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}updateGui(e,t){"left"===e?this.leftGui=t:"right"===e?this.rightGui=t:"fullWidth"===e?this.fullWidthGui=t:this.centerGui=t}setComp(e,t,i){const s={rowComp:e,element:t,containerType:i};this.allRowGuis.push(s),this.updateGui(i,s),this.initialiseRowComp(s),"FullWidthLoading"===this.rowType||this.rowNode.rowPinned||this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){this.allRowGuis=this.allRowGuis.filter((t=>t.containerType!==e)),this.updateGui(e,void 0)}isCacheable(){return"FullWidthDetail"===this.rowType&&this.gos.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach((e=>e.element.style.display=t))}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach((e=>s.addOrRemoveCssClass(e,!0))),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&It(t.element,1==this.rowNode.expanded),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc((()=>i.setDomData(t.element,e.DOM_DATA_KEY_ROW_CTRL,null))),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask((()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)})),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=ze(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(Ce((()=>{this.onTopChanged()})),this.slideInAnimation[t]=!1);this.fadeInAnimation[t]&&(Ce((()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)})),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gos.get("enableRangeSelection"))return void de("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");const t=this.beans.localeService.getLocaleTextFunc(),i=new Zs((()=>`1 ${t("rowDragRow","row")}`),this.rowNode,void 0,e.element,void 0,!0),s=this.createBean(i,this.beans.context);this.rowDragComps.push(s)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType);if("FullWidthDetail"==this.rowType&&!Zi.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const i=this.createFullWidthCompDetails(e.element,t);e.rowComp.showFullWidth(i)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map((e=>e?.rowComp?.getFullWidthCellRenderer())):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gos.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.visibleColsService.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.visibleColsService.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),t=this.rowNode.isFullWidthCell(),i=this.gos.get("masterDetail")&&this.rowNode.detail,s=this.beans.columnModel.isPivotMode(),o=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(s);this.rowType=e?"FullWidthLoading":i?"FullWidthDetail":t?"FullWidth":o?"FullWidthGroup":"Normal"}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;e||this.gos.get("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask((()=>{this.active&&this.updateColumnListsImpl(!0)}),this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(e,t,i=null){const s={list:[],map:{}},o=(e,t)=>{s.list.push(t),s.map[e]=t};return t.forEach((t=>{const i=t.getInstanceId();let s=e.map[i];s||(s=new Ir(t,this.rowNode,this.beans,this)),o(i,s)})),e.list.forEach((e=>{if(null!=s.map[e.getColumn().getInstanceId()])return;this.isCellEligibleToBeRemoved(e,i)?e.destroy():o(e.getColumn().getInstanceId(),e)})),s}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach((t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,e)}))}getCellCtrlsForContainer(e){switch(e){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const e=this.beans.columnViewportService,t=this.beans.visibleColsService;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t.getAllCols()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const i=e.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i);const s=t.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,s,"left");const o=t.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,o,"right")}}isCellEligibleToBeRemoved(e,t){const i=!0;if(e.getColumn().getPinned()!=t)return i;const s=e.isEditing(),o=this.beans.focusService.isCellFocused(e.getCellPosition());if(s||o){const t=e.getColumn();return!(this.beans.visibleColsService.getAllCols().indexOf(t)>=0)&&i}return i}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=k(this.rowNode.oldRowTop),i=this.beans.visibleColsService.isPinningLeft(),s=this.beans.visibleColsService.isPinningRight();if(t){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=s}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=s}}isEditing(){return this.editingRow}isFullWidth(){return"Normal"!==this.rowType}refreshFullWidth(){const e=(e,t)=>!e||e.rowComp.refreshFullWidth((()=>this.createFullWidthCompDetails(e.element,t).params)),t=e(this.fullWidthGui,null),i=e(this.centerGui,null),s=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&i&&s&&o}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),expandedChanged:this.updateExpandedCss.bind(this),hasChildrenChanged:this.updateExpandedCss.bind(this)}),this.rowNode.detail&&this.addManagedListeners(this.rowNode.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(this.rowNode,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this)}),this.addManagedListeners(this.beans.eventService,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),this.addDestroyFunc((()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))})),this.addManagedPropertyListeners(["rowDragEntireRow"],(()=>{this.gos.get("rowDragEntireRow")?this.allRowGuis.forEach((e=>{this.addRowDraggerToRow(e)})):this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)})),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onRowIndexChanged()))},cellChanged:e=>{this.getAllCellCtrls().forEach((t=>t.onCellChanged(e)))}})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell())this.beans.rowRenderer.redrawRow(this.rowNode);else if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode)}else this.getAllCellCtrls().forEach((t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update}))),this.allRowGuis.forEach((e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp)})),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach((t=>{const i=0===e,s=1===e;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",s)}))}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e)))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach((i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),It(i.element,e&&t)}))}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:O(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find((t=>t.element.contains(e.target)));if(!((t?t.element:null)===e.target))return;const i=this.rowNode,s=this.beans.focusService.getFocusedCell(),o={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:s&&s.column};this.beans.navigationService.navigateToNextCell(e,e.key,o,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||M(e))return;const t=this.allRowGuis.find((t=>t.element.contains(e.target))),i=t?t.element:null,s=i===e.target;let o=null;s||(o=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&s||!o)&&this.beans.navigationService.onTabKeyDown(this,e)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){const e=this.allRowGuis.find((e=>bi(e.element)))?.element;return e?e.getBoundingClientRect().top:0}onFullWidthRowFocused(e){const t=this.rowNode,i=!!e&&(this.isFullWidth()&&e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned),s=this.fullWidthGui?this.fullWidthGui.element:this.centerGui?.element;s&&(s.classList.toggle("ag-full-width-focus",i),i&&e?.forceBrowserFocus&&s.focus({preventScroll:!0}))}recreateCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),e.destroy(),this.updateColumnLists()}removeCellCtrl(e,t){const i={list:[],map:{}};return e.list.forEach((e=>{e!==t&&(i.list.push(e),i.map[e.getColumn().getInstanceId()]=e)})),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){return this.gos.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:t})}createRowEventWithSource(e,t){const i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(M(e))return;const t=this.createRowEventWithSource("rowDoubleClicked",e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=hi(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.visibleColsService;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges();const s=this.getFullWidthElement(),o=e.target;let n=!0;s&&s.contains(o)&&ni(o)&&(n=!1),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllCols()[0],rowPinned:t.rowPinned,forceBrowserFocus:n})}onRowClick(e){if(M(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource("rowClicked",e);this.beans.eventService.dispatchEvent(t);const i=e.ctrlKey||e.metaKey,s=e.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const o=this.gos.get("rowMultiSelectWithClick"),n=!this.gos.get("suppressRowDeselection"),r="rowClicked";if(this.rowNode.isSelected())o?this.rowNode.setSelectedParams({newValue:!1,event:e,source:r}):i?n&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:r}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!s,rangeSelect:s,event:e,source:r});else{const t=!o&&!i;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:s,event:e,source:r})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(e){if("FullWidthDetail"!==this.rowType)return;if(!this.gos.get("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),("clientSide"===this.beans.rowModel.getType()||"serverSide"===this.beans.rowModel.getType())&&this.beans.rowModel.onRowHeightChanged()};window.setTimeout(e,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthCompDetails(e,t){const{gos:i,rowNode:s}=this,o=i.addGridCommonParams({fullWidth:!0,data:s.data,node:s,value:s.key,valueFormatted:s.key,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,i,s)=>this.addFullWidthRowDragging(e,t,i,s),setTooltip:(e,t)=>this.refreshRowTooltip(e,t)}),n=this.beans.userComponentFactory;switch(this.rowType){case"FullWidthDetail":return n.getFullWidthDetailCellRendererDetails(o);case"FullWidthGroup":return n.getFullWidthGroupCellRendererDetails(o);case"FullWidthLoading":return n.getFullWidthLoadingCellRendererDetails(o);default:return n.getFullWidthCellRendererDetails(o)}}refreshRowTooltip(e,t){if(!this.fullWidthGui)return;const i={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>e,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:t};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new Hi(i,this.beans))}addFullWidthRowDragging(e,t,i="",s){if(!this.isFullWidth())return;const o=new Zs((()=>i),this.rowNode,void 0,e,t,s);this.createBean(o,this.beans.context),this.addDestroyFunc((()=>{this.destroyBean(o,this.beans.context)}))}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach((e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(i,!1)}))}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e)))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach((e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t))))}stopEditing(e=!1){this.stoppingRowEdit||this.beans.rowEditService?.stopEditing(this,e)}setInlineEditingCss(e){this.allRowGuis.forEach((t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)}))}setEditingRow(e){this.editingRow=e}startRowEditing(e=null,t=null,i=null){this.editingRow||this.beans.rowEditService?.startEditing(this,e,t,i)}getAllCellCtrls(){if(0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length)return this.centerCellCtrls.list;return[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach((e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!0)))}))}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,(e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!0)))}),(e=>{this.allRowGuis.forEach((t=>t.rowComp.addOrRemoveCssClass(e,!1)))}))}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,(e=>e.rowComp.setUserStyles(this.rowStyles)))}getPinnedForContainer(e){return"left"===e||"right"===e?e:null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2==0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gos.get("rowStyle");if(e&&"function"==typeof e)return void de("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gos.getCallback("getRowStyle");let i;if(t){i=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})}return i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,(e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),_t(e.element,t);!e.element.contains(this.gos.getActiveDomElement())||e!==this.centerGui&&e!==this.fullWidthGui||this.announceDescription()}))}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.gos.get("suppressRowDeselection"))return;const t=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(t)}addHoverFunctionality(e){if(!this.active)return;const{rowNode:t,beans:i,gos:s}=this;this.addManagedListeners(e,{mouseenter:()=>t.onMouseEnter(),mouseleave:()=>t.onMouseLeave()}),this.addManagedListeners(t,{mouseEnter:()=>{i.dragService.isDragging()||s.get("suppressRowHoverHighlight")||(e.classList.add("ag-row-hover"),t.setHovered(!0))},mouseLeave:()=>{e.classList.remove("ag-row-hover"),t.setHovered(!1)}})}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,s=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),s)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),s=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,o=s?Math.min(i,s)-2+"px":void 0;this.forEachGui(e,(e=>{e.element.style.height=`${t}px`,o&&e.element.style.setProperty("--ag-line-height",o)}))}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gos.isAnimateRows()&&!this.isSticky()){if(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach((e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0)))}this.rowNode.setHovered(!1);const t=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=e=>(e.list.forEach((e=>e.destroy())),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,(e=>{e.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),e.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)}))}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationService?.getCurrentPage()??0;this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;return e+this.beans.pageBoundsService.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&k(e)){const t=this.applyPaginationOffset(e),i=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(i)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";const t=this.rowNode;let i;if(this.isSticky())i=t.stickyRowTop;else{const s=this.slideInAnimation[e]?this.roundRowTopToBounds(t.oldRowTop):t.rowTop,o=this.applyPaginationOffset(s);i=t.isRowPinned()?o:this.beans.rowContainerHeightService.getRealPixelPosition(o)}return i+"px"}setRowTopStyle(e){this.allRowGuis.forEach((t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`)))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach((i=>{i.getColumn()==e&&(t=i)})),null!=t||this.getAllCellCtrls().forEach((i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)})),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString();if(null===t)return;const i=this.beans.headerNavigationService.getHeaderRowCount()+(this.beans.filterManager?.getHeaderRowCount()??0),s=this.rowNode.rowIndex%2==0,o=i+this.rowNode.rowIndex+1;this.forEachGui(e,(e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",s),e.rowComp.addOrRemoveCssClass("ag-row-odd",!s),Nt(e.element,o)}))}setStoppingRowEdit(e){this.stoppingRowEdit=e}};Or.DOM_DATA_KEY_ROW_CTRL="renderedRow";var kr=Or,Gr=class extends I{wireBeans(e){this.mouseEventService=e.mouseEventService,this.valueService=e.valueService,this.menuService=e.menuService,this.ctrlsService=e.ctrlsService,this.navigationService=e.navigationService,this.focusService=e.focusService,this.undoRedoService=e.undoRedoService,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService,this.clipboardService=e.clipboardService}constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",x("touchstart")?"touchstart":"mousedown"].forEach((e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}))}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||M(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!Jt())return;const e=new $i(this.element);this.addManagedListeners(e,{longTap:e=>{const t=this.getRowForEvent(e.touchEvent),i=this.mouseEventService.getRenderedCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(void 0,e.touchEvent,t,i)}}),this.addDestroyFunc((()=>e.destroy()))}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gos.getDomData(t,kr.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const o=i?i.getRowNode():null,n=s?s.getColumn():null;let r=null;if(n){const i=e||t;s.dispatchCellContextMenuEvent(i??null),r=this.valueService.getValue(n,o)}const l=this.ctrlsService.getGridBodyCtrl(),a=s?s.getGui():l.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:n,value:r,anchorToElement:a})}getControlsForEventTarget(e){return{cellCtrl:T(this.gos,e,Ir.DOM_DATA_KEY_CELL_CTRL),rowCtrl:T(this.gos,e,kr.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),n=e.isEditing();if(!Eo(this.gos,i,s,o,n)&&"keydown"===t){!n&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Po(i)&&e.processCharacter(i)}if("keydown"===t){const t=e.createEvent(i,"cellKeyDown");this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell(),n=o&&o.column;if(!Eo(this.gos,i,s,n,!1)){const s=i.key;if("keydown"===t)switch(s){case is.PAGE_HOME:case is.PAGE_END:case is.PAGE_UP:case is.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case is.UP:case is.DOWN:e.onKeyboardNavigate(i);break;case is.TAB:e.onTabKeyDown(i)}}if("keydown"===t){const t=e.createRowEvent("cellKeyDown",i);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const i=function(e){const{keyCode:t}=e;let i;switch(t){case 65:i=is.A;break;case 67:i=is.C;break;case 86:i=is.V;break;case 68:i=is.D;break;case 90:i=is.Z;break;case 89:i=is.Y;break;default:i=e.code}return i}(e);return i===is.A?this.onCtrlAndA(e):i===is.C?this.onCtrlAndC(e):i===is.D?this.onCtrlAndD(e):i===is.V?this.onCtrlAndV(e):i===is.X?this.onCtrlAndX(e):i===is.Y?this.onCtrlAndY():i===is.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,rowModel:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[e,o]=[t.isEmpty("top"),t.isEmpty("bottom")],n=e?null:"top";let r,l;o?(r=null,l=i.getRowCount()-1):(r="bottom",l=t.getPinnedBottomRowNodes().length-1);const a=this.visibleColsService.getAllCols();if(N(a))return;s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:l,rowEndPinned:r,columnStart:a[0],columnEnd:c(a)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gos.get("undoRedoCellEditing")&&this.undoRedoService&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService?.redo("ui")}},Nr=class extends I{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({leftPinnedWidthChanged:this.onPinnedLeftWidthChanged.bind(this)})}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;ri(this.element,t),Mi(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}},Hr=class extends I{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({rightPinnedWidthChanged:this.onPinnedRightWidthChanged.bind(this)})}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;ri(this.element,t),Mi(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}},Br=e=>e.getTopRowCtrls(),Vr=e=>e.getStickyTopRowCtrls(),Wr=e=>e.getStickyBottomRowCtrls(),zr=e=>e.getBottomRowCtrls(),_r=e=>e.getCentreRowCtrls(),Ur={center:{type:"center",container:"ag-center-cols-container",viewport:"ag-center-cols-viewport",getRowCtrls:_r},left:{type:"left",container:"ag-pinned-left-cols-container",pinnedType:"left",getRowCtrls:_r},right:{type:"right",container:"ag-pinned-right-cols-container",pinnedType:"right",getRowCtrls:_r},fullWidth:{type:"fullWidth",container:"ag-full-width-container",fullWidth:!0,getRowCtrls:_r},topCenter:{type:"center",container:"ag-floating-top-container",viewport:"ag-floating-top-viewport",getRowCtrls:Br},topLeft:{type:"left",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:Br},topRight:{type:"right",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:Br},topFullWidth:{type:"fullWidth",container:"ag-floating-top-full-width-container",fullWidth:!0,getRowCtrls:Br},stickyTopCenter:{type:"center",container:"ag-sticky-top-container",viewport:"ag-sticky-top-viewport",getRowCtrls:Vr},stickyTopLeft:{type:"left",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:Vr},stickyTopRight:{type:"right",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:Vr},stickyTopFullWidth:{type:"fullWidth",container:"ag-sticky-top-full-width-container",fullWidth:!0,getRowCtrls:Vr},stickyBottomCenter:{type:"center",container:"ag-sticky-bottom-container",viewport:"ag-sticky-bottom-viewport",getRowCtrls:Wr},stickyBottomLeft:{type:"left",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:Wr},stickyBottomRight:{type:"right",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:Wr},stickyBottomFullWidth:{type:"fullWidth",container:"ag-sticky-bottom-full-width-container",fullWidth:!0,getRowCtrls:Wr},bottomCenter:{type:"center",container:"ag-floating-bottom-container",viewport:"ag-floating-bottom-viewport",getRowCtrls:zr},bottomLeft:{type:"left",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:zr},bottomRight:{type:"right",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:zr},bottomFullWidth:{type:"fullWidth",container:"ag-floating-bottom-full-width-container",fullWidth:!0,getRowCtrls:zr}};function Kr(e){return Ur[e]}var $r=["center","left","right","fullWidth"],jr=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],qr=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],Yr=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],Qr=["stickyTopCenter","stickyTopLeft","stickyTopRight"],Xr=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],Jr=[...Qr,"stickyTopFullWidth",...Xr,"stickyBottomFullWidth"],Zr=["topCenter","topLeft","topRight","bottomCenter","bottomLeft","bottomRight","center","left","right",...Qr,...Xr],el=class extends I{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.options=Kr(e)}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService,this.columnViewportService=e.columnViewportService,this.resizeObserverService=e.resizeObserverService,this.rowRenderer=e.rowRenderer}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],(()=>{this.viewportSizeFeature=this.createManagedBean(new vr(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})}))}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.ctrlsService.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new Gr(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows(),this.forContainers(qr,(()=>{this.pinnedWidthFeature=this.createManagedBean(new Nr(this.eContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:()=>this.onPinnedWidthChanged()})})),this.forContainers(Yr,(()=>{this.pinnedWidthFeature=this.createManagedBean(new Hr(this.eContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:()=>this.onPinnedWidthChanged()})})),this.forContainers($r,(()=>this.createManagedBean(new dr(this.eContainer,"center"===this.name?i:void 0)))),this.forContainers(Zr,(()=>this.createManagedBean(new wr(this.eContainer)))),this.forContainers(jr,(()=>this.createManagedBean(new Nn((e=>this.comp.setContainerWidth(`${e}px`)))))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(Jr.indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gos.get("ensureDomOrder"),t=this.gos.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],(()=>{this.addManagedElementListeners(this.eViewport,{scroll:()=>this.eViewport.scrollLeft=0})}))}onDisplayedColumnsChanged(){this.forContainers(["center"],(()=>this.onHorizontalViewportChanged()))}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],(()=>this.onHorizontalViewportChanged()))}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc((()=>this.eContainer.removeEventListener("touchmove",e)))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnViewportService.setScrollPosition(t,i,e)}getCenterWidth(){return ui(this.eViewport)}getCenterViewportScrollLeft(){return fi(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc((()=>t()))}isViewportInTheDOMTree(){return yi(this.eViewport)}getViewportScrollLeft(){return fi(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||(e=this.eViewport).clientWidth<e.scrollWidth;var e}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){vi(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(null!=this.options.pinnedType)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.rowRenderer);if(!this.visible||0===t.length)return void this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});const i=this.gos.isDomLayout("print"),s=this.gos.get("embedFullWidthRows")||i,o=t.filter((e=>{const t=e.isFullWidth();return this.options.fullWidth?!s&&t:s||!t}));this.comp.setRowCtrls({rowCtrls:o,useFlushSync:e})}};var tl=class extends Wi{constructor(){super(),this.eViewport=Vi,this.eContainer=Vi,this.rowComps={},this.name=Wi.elementGettingCreated.getAttribute("name"),this.options=Kr(this.name),this.setTemplate(function(e){let t;return t="center"===e.type?`<div class="${e.viewport}" data-ref="eViewport" role="presentation">\n <div class="${e.container}" data-ref="eContainer"></div>\n </div>`:`<div class="${e.container}" data-ref="eContainer"></div>`,t}(this.options))}wireBeans(e){this.beans=e}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:({rowCtrls:e})=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e,setOffsetTop:e=>this.eContainer.style.transform=`translateY(${e})`};this.createManagedBean(new el(this.name)).setComp(e,this.eContainer,this.eViewport)}destroy(){this.setRowCtrls([]),super.destroy()}setRowCtrls(e){const t={...this.rowComps};this.rowComps={},this.lastPlacedElement=null;e.forEach((e=>{const i=e.getInstanceId(),s=t[i];if(s)this.rowComps[i]=s,delete t[i],this.ensureDomOrder(s.getGui());else{if(!e.getRowNode().displayed)return;const t=new fr(e,this.beans,this.options.type);this.rowComps[i]=t,this.appendRow(t.getGui())}})),Y(t).forEach((e=>{this.eContainer.removeChild(e.getGui()),e.destroy()})),bt(this.eContainer,"rowgroup")}appendRow(e){var t,i,s;this.domOrder?(t=this.eContainer,i=e,(s=this.lastPlacedElement)?s.insertAdjacentElement("afterend",i):t.firstChild?t.insertAdjacentElement("afterbegin",i):t.appendChild(i)):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(Fi(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}},il={selector:"AG-ROW-CONTAINER",component:tl};function sl(e){return e.map((e=>`<ag-row-container name="${e}"></ag-row-container>`)).join("")}var ol=`<div class="ag-root ag-unselectable" role="treegrid">\n <ag-header-root></ag-header-root>\n <div class="ag-floating-top" data-ref="eTop" role="presentation">\n ${sl(["topLeft","topCenter","topRight","topFullWidth"])}\n </div>\n <div class="ag-body" data-ref="eBody" role="presentation">\n <div class="ag-body-viewport" data-ref="eBodyViewport" role="presentation">\n ${sl(["left","center","right","fullWidth"])}\n </div>\n <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n </div>\n <div class="ag-sticky-top" data-ref="eStickyTop" role="presentation">\n ${sl(["stickyTopLeft","stickyTopCenter","stickyTopRight","stickyTopFullWidth"])}\n </div>\n <div class="ag-sticky-bottom" data-ref="eStickyBottom" role="presentation">\n ${sl(["stickyBottomLeft","stickyBottomCenter","stickyBottomRight","stickyBottomFullWidth"])}\n </div>\n <div class="ag-floating-bottom" data-ref="eBottom" role="presentation">\n ${sl(["bottomLeft","bottomCenter","bottomRight","bottomFullWidth"])}\n </div>\n <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n <ag-overlay-wrapper></ag-overlay-wrapper>\n </div>`,nl=class extends Wi{constructor(){super(ol,[rr,hr,ur,ir,il]),this.eBodyViewport=Vi,this.eStickyTop=Vi,this.eStickyBottom=Vi,this.eTop=Vi,this.eBottom=Vi,this.eBody=Vi}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.rangeService=e.rangeService}postConstruct(){const e=(e,t)=>{const i=`${e}px`;t.style.minHeight=i,t.style.height=i},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>Ht(this.getGui(),e),setRowCount:e=>Gt(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setStickyBottomHeight:e=>this.eStickyBottom.style.height=e,setStickyBottomBottom:e=>this.eStickyBottom.style.bottom=e,setStickyBottomWidth:e=>this.eStickyBottom.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach((e=>{e.toggle("ag-layout-auto-height",t.autoHeight),e.toggle("ag-layout-normal",t.normal),e.toggle("ag-layout-print",t.print)})),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle(pr,t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc((()=>t()))},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach((i=>i.classList.toggle(e,t)))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new mr),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||"multiple"===this.gos.get("rowSelection"))&&wt(this.getGui(),"multiselectable",!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}},rl={selector:"AG-GRID-BODY",component:nl},ll=class extends I{constructor(){super(...arguments),this.beanName="scrollVisibleService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnAnimationService=e.columnAnimationService}postConstruct(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)})}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn((()=>{this.columnAnimationService.executeLaterVMTurn((()=>this.updateImpl()))})):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:"scrollVisibilityChanged"};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}},al="__ag_grid_instance",hl=class e extends I{constructor(){super(...arguments),this.beanName="mouseEventService",this.gridInstanceId=e.gridInstanceSequence.next()}wireBeans(e){this.ctrlsService=e.ctrlsService}stampTopLevelGridCompWithGridInstance(e){e[al]=this.gridInstanceId}getRenderedCellForEvent(e){return T(this.gos,e.target,Ir.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const e=t[al];if(k(e)){return e===this.gridInstanceId}t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gos.isDomLayout("normal"),i=e;let s,o;if(null!=i.clientX||null!=i.clientY?(s=i.clientX,o=i.clientY):(s=i.x,o=i.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();s+=e.getScrollFeature().getHScrollPosition().left,o+=t.top}return{x:s,y:o}}};hl.gridInstanceSequence=new ki;var dl=hl,cl=class extends I{constructor(){super(),this.beanName="navigationService",this.onPageDown=ve(this.onPageDown,100),this.onPageUp=ve(this.onPageUp,100)}wireBeans(e){this.mouseEventService=e.mouseEventService,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.rowRenderer=e.rowRenderer,this.headerNavigationService=e.headerNavigationService,this.rowPositionUtils=e.rowPositionUtils,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCon=e.gridBodyCtrl}))}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,n=!!this.rangeService&&e.shiftKey,r=this.mouseEventService.getCellPositionForEvent(e);let l=!1;switch(i){case is.PAGE_HOME:case is.PAGE_END:o||s||(this.onHomeOrEndKey(i),l=!0);break;case is.LEFT:case is.RIGHT:case is.UP:case is.DOWN:if(!r)return!1;!o||s||n||(this.onCtrlUpDownLeftRight(i,r),l=!0);break;case is.PAGE_DOWN:case is.PAGE_UP:o||s||(l=this.handlePageUpDown(i,r,t))}return l&&e.preventDefault(),l}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===is.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:o,focusColumn:n}=e;k(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),k(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:n,rowPinned:null,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:o,rowPinned:null,column:n})}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),s=this.pageBoundsService.getPixelOffset(),o=t.top+i,n=this.rowModel.getRowIndexAtPixel(o+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.pageBoundsService.getPixelOffset(),s=t.top,o=this.rowModel.getRowIndexAtPixel(s+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,o,!0):this.navigateToNextPage(e,o,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.pageBoundsService.getFirstRow(),n=this.pageBoundsService.getLastRow(),r=this.pageBoundsService.getPixelOffset(),l=this.rowModel.getRow(e.rowIndex),a=i?l?.rowHeight-s-r:s-r,h=l?.rowTop+a;let d,c=this.rowModel.getRowIndexAtPixel(h+r);if(c===e.rowIndex){const s=i?-1:1;t=c=e.rowIndex+s}i?(d="bottom",c<o&&(c=o),t<o&&(t=o)):(d="top",c>n&&(c=n),t>n&&(t=n)),this.isRowTallerThanView(c)&&(t=c,d="top"),this.navigateTo({scrollIndex:t,scrollType:d,scrollColumn:null,focusIndex:c,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout((()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})}),50)}getNextFocusIndexForAutoHeight(e,t=!1){const i=t?-1:1,s=this.getViewportHeight(),o=this.pageBoundsService.getLastRow();let n=0,r=e.rowIndex;for(;r>=0&&r<=o;){const e=this.rowModel.getRow(r);if(e){const t=e.rowHeight??0;if(n+t>s)break;n+=t}r+=i}return Math.max(0,Math.min(r,o))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),s=this.gos.getScrollbarWidth();let o=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(o-=s),o}isRowTallerThanView(e){const t=this.rowModel.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s}=i,o=i.column;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===is.PAGE_HOME,i=this.visibleColsService.getAllCols(),s=t?i[0]:c(i),o=t?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(!1===s)if(i){const{rowIndex:i,rowPinned:s}=e.getRowPosition();(s?0===i:i===this.pageBoundsService.getFirstRow())&&(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof Ir&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault();else s&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!!(s||(s=this.rowRenderer.getRowByPosition(i),s&&s.isFullWidth()))&&!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s,o=e.isEditing();if(!o&&e instanceof Ir){const t=e.getRowCtrl();t&&(o=t.isEditing())}return s=o?"fullRow"===this.gos.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNextCellNotEditing(e,t),null===s?s:s||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(s,t,!0);return!1===o?null:null!=o&&(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),o=this.findNextCellToFocusOn(s,t,!0);if(!1===o)return null;if(null==o)return!1;const n=o.getCellPosition(),r=this.isCellEditable(s),l=this.isCellEditable(n),a=n&&s.rowIndex===n.rowIndex&&s.rowPinned===n.rowPinned;if(r&&e.setFocusOutOnEditor(),!a){e.getRowCtrl().stopEditing();o.getRowCtrl().startRowEditing(void 0,void 0,i)}return l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.visibleColsService.getAllCols();let s;s=e instanceof kr?{...e.getRowPosition(),column:t?i[0]:c(i)}:e.getCellPosition();const o=this.findNextCellToFocusOn(s,t,!1);if(!1===o)return null;if(o instanceof Ir)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return k(o)}findNextCellToFocusOn(e,t,i){let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const o=this.gos.getCallback("tabToNextCell");if(k(o)){const n=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(!0===n||null===n)null===n&&de("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(!1===n)return!1;s={rowIndex:n.rowIndex,column:n.column,rowPinned:n.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+s.rowIndex,column:s.column},fromCell:!0}),null}const n="fullRow"===this.gos.get("editType");if(i&&!n){if(!this.isCellEditable(s))continue}this.ensureCellVisible(s);const r=this.getCellByPosition(s);if(!r){const e=this.rowRenderer.getRowByPosition(s);if(!e||!e.isFullWidth()||i)continue;return e}if(!r.isSuppressNavigable())return this.rangeService?.setRangeToCell(s),r}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.rowModel.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let o=i,n=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gos.get("enableRtl")?t===is.LEFT&&(o=this.getLastCellOfColSpan(o)):t===is.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),n=G(o);if(n&&e&&e.key===is.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),s){const s=this.gos.getCallback("navigateToNextCell");if(k(s)){const n=s({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});o=k(n)?{rowPinned:n.rowPinned,rowIndex:n.rowIndex,column:n.column}:null}}if(!o)return;if(o.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+o.rowIndex,column:i.column},event:e||void 0,fromCell:!0})}const r=this.getNormalisedPosition(o);r?this.focusPosition(r):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.visibleColsService.getAllCols(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),n={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?c(i):i[0])};this.focusPosition(n);const r=null!=o&&this.rowPositionUtils.before(n,o),l={type:"fullWidthRowFocused",rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column,isFullWidthCell:!0,fromBelow:r};return this.eventService.dispatchEvent(l),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:c(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&i?.sticky)&&G(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}},ul=class extends I{constructor(){super(...arguments),this.beanName="horizontalResizeService"}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};this.dragService.addDragSource(t);return()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},gl=class extends I{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.menuService=e.menuService}hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,(s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})}),i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,o="left";const n=this.menuService.isLegacyMenuEnabled();!n&&this.gos.get("enableRtl")&&(s=1,o="right");const r=n?void 0:4*s,l=n?void 0:4;this.showPopup(e,(s=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:s,nudgeX:r,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",column:e})}),i,t,n)}showPopup(e,t,i,s,o){const n=e?this.createBean(new ro(e,"COLUMN_MENU")):void 0;if(this.activeMenu=n,!n?.hasFilter()||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const r=document.createElement("div");let l;bt(r,"presentation"),r.classList.add("ag-menu"),o||r.classList.add("ag-filter-menu"),[this.tabListener]=this.addManagedElementListeners(r,{keydown:e=>this.trapFocusWithin(e,r)}),r.appendChild(n?.getGui());const a=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,h=this.localeService.getLocaleTextFunc(),d=o&&"columnFilter"!==i?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),c=this.popupService.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const o=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),o&&s&&bi(s)){const e=this.focusService.findTabbableParent(s);e&&e.focus()}n?.afterGuiDetached(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},positionCallback:()=>t(r),anchorToElement:a,ariaLabel:d});c&&(this.hidePopup=l=c.hideFunc),n.afterInit().then((()=>{t(r),n.afterGuiAttached({container:i,hidePopup:l})})),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==is.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const s={type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:i??null};this.eventService.dispatchEvent(s)}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},pl=class extends I{constructor(){super(...arguments),this.beanName="resizeObserverService",this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),s=()=>{let i=e?.clientWidth??0,s=e?.clientHeight??0,o=!0;const n=()=>{if(o){const o=e?.clientWidth??0,r=e?.clientHeight??0;(o!==i||r!==s)&&(i=o,s=r,t()),this.doNextPolyfillTurn(n)}};return n(),()=>o=!1},o=this.gos.get("suppressBrowserResizeObserver");return!!i.ResizeObserver&&!o?(()=>{const s=new i.ResizeObserver(t);return s.observe(e),()=>s.disconnect()})():this.getFrameworkOverrides().wrapIncoming((()=>s()),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;this.polyfillScheduled=!0,window.setTimeout((()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach((e=>e()))}),50)}},ml=class extends I{constructor(){super(...arguments),this.beanName="animationFrameService",this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationService?.getCurrentPage()??0;e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&de(`AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort(((e,i)=>e.index!==i.index?t*(i.index-e.index):i.createOrder-e.createOrder)),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,o=s.list,n=this.destroyTasks,r=(new Date).getTime();let l=(new Date).getTime()-r;const a=e<=0,h=this.ctrlsService.getGridBodyCtrl();for(;a||l<e;){if(!h.getScrollFeature().scrollGridIfNeeded()){let e;if(i.length)this.sortTaskList(t),e=i.pop().task;else if(o.length)this.sortTaskList(s),e=o.pop().task;else{if(!n.length){this.cancelledTasks.clear();break}e=n.pop()}this.cancelledTasks.has(e)||e()}l=(new Date).getTime()-r}i.length||o.length||n.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask((()=>{t=!1,e()}))):window.setTimeout(e,0)}}},Cl=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(Cl||{}),fl=class extends I{constructor(){super(...arguments),this.beanName="expansionService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType()}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode((e=>{e.id&&t.has(e.id)&&(e.expanded=!0)})),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode((({expanded:t,id:i})=>{t&&i&&e.push(i)})),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}},vl=class extends I{constructor(){super(...arguments),this.beanName="menuService"}wireBeans(e){this.filterMenuFactory=e.filterMenuFactory,this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.filterManager=e.filterManager,this.rowRenderer=e.rowRenderer,this.columnChooserFactory=e.columnChooserFactory,this.contextMenuFactory=e.contextMenuFactory,this.enterpriseMenuFactory=e.enterpriseMenuFactory}postConstruct(){this.activeMenuFactory=this.enterpriseMenuFactory??this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const o=s.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(e){const{rowNode:t}=e,i=e.column;let{anchorToElement:s,value:o}=e;t&&i&&null==o&&(o=t.getValueFromValueService(i)),null==s&&(s=this.getContextMenuAnchorElement(t,i)),this.contextMenuFactory?.onContextMenu(e.mouseEvent??null,e.touchEvent??null,t??null,i??null,o,s)}showColumnChooser(e){this.columnChooserFactory?.showColumnChooser(e)}hidePopupMenu(){this.contextMenuFactory?.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){this.columnChooserFactory?.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!e?.getColDef().suppressHeaderContextMenu&&"new"===this.getColumnMenuType()}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(Jt()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!(!this.filterManager?.isFilterAllowed(e)||this.isLegacyMenuEnabled()||this.isFilterMenuInHeaderEnabled(e)||this.isFloatingFilterButtonDisplayed(e))}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return"new"===this.getColumnMenuType()}isLegacyMenuEnabled(){return"legacy"===this.getColumnMenuType()}isFloatingFilterButtonEnabled(e){const t=e.getColDef(),i=t.floatingFilterComponentParams?.suppressFilterButton;return null!=i&&de("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),null==t.suppressFloatingFilterButton?!i:!t.suppressFloatingFilterButton}getColumnMenuType(){return this.gos.get("columnMenu")}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?!!this.gos.exists("suppressMenuHide")&&e:e}showColumnMenuCommon(e,t,i,s){const{positionBy:o}=t,n=t.column;if("button"===o){const{buttonElement:o}=t;e.showMenuAfterButtonClick(n,o,i,s)}else if("mouse"===o){const{mouseEvent:o}=t;e.showMenuAfterMouseEvent(n,o,i,s)}else n&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(n,"auto"),this.animationFrameService.requestAnimationFrame((()=>{const t=this.ctrlsService.getHeaderRowContainerCtrl(n.getPinned()).getHeaderCtrlForColumn(n);e.showMenuAfterButtonClick(n,t.getAnchorElementForMenu(s),i,!0)})))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(null!=t)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){if(!e||!t)return;const i=e.getCellCtrl(t);return i?.getGui()||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;const o=this.getCellGui(s,t);return o||(s.isFullWidth()?s.getFullWidthElement():i)}},wl=class extends ns{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},Sl={selector:"AG-INPUT-TEXT-AREA",component:wl},yl=class extends ps{constructor(){super('<div class="ag-large-text">\n <ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n </div>',[Sl]),this.eTextArea=Vi}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),k(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===is.LEFT||t===is.UP||t===is.RIGHT||t===is.DOWN||e.shiftKey&&t===is.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return k(e)||k(this.params.value)?this.params.parseValue(e):this.params.value}},bl=class extends ps{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedElementListeners(e,{keydown:e=>{Eo(this.gos,e,t.node,t.column,!0)||t.onKeyDown(e)}})}},Rl=class extends ps{constructor(){super('<div class="ag-cell-edit-wrapper">\n <ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select>\n </div>',[yo]),this.eSelect=Vi,this.startedByEnter=!1}wireBeans(e){this.valueService=e.valueService}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueService:i,gos:s}=this,{values:o,value:n,eventKey:r}=e;if(G(o))return void de("no values found for select cellEditor");this.startedByEnter=null!=r&&r===is.ENTER;let l=!1;o.forEach((s=>{const o={value:s},r=i.formatValue(e.column,null,s),a=null!=r;o.text=a?r:s,t.addOption(o),l=l||n===s})),l?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:a,valueListMaxWidth:h,valueListMaxHeight:d}=e;null!=a&&t.setPickerGap(a),null!=d&&t.setPickerMaxHeight(d),null!=h&&t.setPickerMaxWidth(h),"fullRow"!==s.get("editType")&&this.addManagedListeners(this.eSelect,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout((()=>{this.isAlive()&&this.eSelect.showPicker()}))}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}},Fl=class extends ps{constructor(e){super(`\n <div class="ag-cell-edit-wrapper">\n ${e.getTemplate()}\n </div>`,e.getAgComponents()),this.cellEditorInput=e,this.eInput=Vi}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===is.BACKSPACE||e.eventKey===is.DELETE?i="":t&&1===t.length?i=t:(i=this.cellEditorInput.getStartValue(),t!==is.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedElementListeners(t.getGui(),{keydown:e=>{const{key:t}=e;t!==is.PAGE_UP&&t!==is.PAGE_DOWN||e.preventDefault()}})}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc(),t=this.eInput;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;jt()||t.getFocusableElement().focus();const i=t.getInputElement();this.highlightAllOnFocus?i.select():this.cellEditorInput.setCaret?.()}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}},Pl=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>'}getAgComponents(){return[Mo]}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return k(e)||k(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=k(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},El=class extends Fl{constructor(){super(new Pl)}},Dl=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-input-number-field>'}getAgComponents(){return[To]}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){e.key!==is.UP&&e.key!==is.DOWN||e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!k(e)&&!k(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(null==t)return t;if("string"==typeof t){if(""===t)return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},Ml=class extends Fl{constructor(){super(new Dl)}},xl=class extends Do{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=jt();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?Ko(e??null,!1)??void 0:e;return this.min===t||(this.min=t,Ii(this.eInput,"min",t)),this}setMax(e){const t=e instanceof Date?Ko(e??null,!1)??void 0:e;return this.max===t||(this.max=t,Ii(this.eInput,"max",t)),this}setStep(e){return this.step===e||(this.step=e,Ii(this.eInput,"step",e)),this}getDate(){if(this.eInput.validity.valid)return qo(this.getValue())??void 0}setDate(e,t){this.setValue(Ko(e??null,!1),t)}},Tl={selector:"AG-INPUT-DATE-FIELD",component:xl},Al=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[Tl]}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return k(e)||k(this.params.value)?e??null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ko(e,!1)}},Il=class extends Fl{constructor(){super(new Al)}},Ll=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[Tl]}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return k(e)||k(this.params.value)?this.params.parseValue(e??""):this.params.value}getStartValue(){return Ko(this.parseDate(this.params.value??void 0)??null,!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):qo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Ko(e??null,!1)??void 0}},Ol=class extends Fl{wireBeans(e){this.dataTypeService=e.dataTypeService}constructor(){super(new Ll((()=>this.dataTypeService)))}},kl=class extends ps{constructor(){super('\n <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n <ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>\n </div>',[ls]),this.eCheckbox=Vi}init(e){this.params=e;const t=e.value??void 0;this.eCheckbox.setValue(t);this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(this.eCheckbox,{fieldValueChanged:e=>this.setAriaLabel(e.selected)})}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=$t(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}},Gl=class{constructor(e){this.cellValueChanges=e}},Nl=class extends Gl{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},Hl=class{constructor(e){this.actionStack=[],this.maxStackSize=e||10,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}};function Bl(e,t,i="auto"){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,i)),"ensureVisible")}function Vl(e,t,i){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t,i)),"ensureVisible")}var Wl={version:cn,moduleName:"@ag-grid-community/edit-core",beans:[class extends I{constructor(){super(...arguments),this.beanName="editService"}wireBeans(e){this.navigationService=e.navigationService,this.userComponentFactory=e.userComponentFactory,this.valueService=e.valueService}startEditing(e,t=null,i=!1,s=null){const o=this.createCellEditorParams(e,t,i),n=e.getColumn().getColDef(),r=this.userComponentFactory.getCellEditorDetails(n,o),l=null!=r?.popupFromSelector?r.popupFromSelector:!!n.cellEditorPopup,a=null!=r?.popupPositionFromSelector?r.popupPositionFromSelector:n.cellEditorPopupPosition;e.setEditing(!0,r),e.getComp().setEditDetails(r,l,a,this.gos.get("reactiveCustomComponents"));const h=e.createEvent(s,"cellEditingStarted");this.eventService.dispatchEvent(h)}stopEditing(e,t){const i=e.getComp(),{newValue:s,newValueExists:o}=this.takeValueFromCellEditor(t,i),n=e.getRowNode(),r=e.getColumn(),l=n.getValueFromValueService(r);let a=!1;o&&(a=this.saveNewValue(e,l,s,n,r)),e.setEditing(!1,void 0),i.setEditDetails(),e.updateAndFormatValue(!1),e.refreshCell({forceRefresh:!0,suppressFlash:!0});const h={...e.createEvent(null,"cellEditingStopped"),oldValue:l,newValue:s,valueChanged:a};return this.eventService.dispatchEvent(h),a}handleColDefChanged(e){const t=e.getCellEditor();if(t?.refresh){const{eventKey:i,cellStartedEdit:s}=e.getEditCompDetails().params,o=this.createCellEditorParams(e,i,s),n=e.getColumn().getColDef(),r=this.userComponentFactory.getCellEditorDetails(n,o);t.refresh(r.params)}}setFocusOutOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusIn?t.focusIn():e.focusCell(!0)}stopEditingAndFocus(e,t=!1,i=!1){e.stopRowOrCellEdit(),e.focusCell(!0),t||this.navigateAfterEdit(i,e.getCellPosition())}createPopupEditorWrapper(e){return new bl(e)}takeValueFromCellEditor(e,t){const i={newValueExists:!1};if(e)return i;const s=t.getCellEditor();if(!s)return i;if(s.isCancelAfterEnd&&s.isCancelAfterEnd())return i;return{newValue:s.getValue(),newValueExists:!0}}saveNewValue(e,t,i,s,o){if(i===t)return!1;e.setSuppressRefreshCell(!0);const n=s.setDataValue(o,i,"edit");return e.setSuppressRefreshCell(!1),n}createCellEditorParams(e,t,i){const s=e.getColumn(),o=e.getRowNode();return this.gos.addGridCommonParams({value:o.getValueFromValueService(s),eventKey:t,column:s,colDef:s.getColDef(),rowIndex:e.getCellPosition().rowIndex,node:o,data:o.data,cellStartedEdit:i,onKeyDown:e.onKeyDown.bind(e),stopEditing:e.stopEditingAndFocus.bind(e),eGridCell:e.getGui(),parseValue:t=>this.valueService.parseValue(s,o,t,e.getValue()),formatValue:e.formatValue.bind(e)})}navigateAfterEdit(e,t){if(this.gos.get("enterNavigatesVerticallyAfterEdit")){const i=e?is.UP:is.DOWN;this.navigationService.navigateToNextCell(null,i,t,!1)}}}]},zl={version:cn,moduleName:"@ag-grid-community/edit-api",apiFunctions:{undoCellEditing:function(e){e.undoRedoService?.undo("api")},redoCellEditing:function(e){e.undoRedoService?.redo("api")},getCellEditorInstances:function(e,t={}){return e.rowRenderer.getCellEditorInstances(t).map(Ws)},getEditingCells:function(e){return e.rowRenderer.getEditingCells()},stopEditing:function(e,t=!1){e.rowRenderer.stopEditing(t)},startEditingCell:function(e,t){const i=e.columnModel.getCol(t.colKey);if(!i)return void de(`no column found for ${t.colKey}`);const s={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:i};null==t.rowPinned&&Vl(e,t.rowIndex),Bl(e,t.colKey);const o=e.navigationService.getCellByPosition(s);o&&(e.focusService.isCellFocused(s)||e.focusService.setFocusedCell(s),o.startRowOrCellEdit(t.key))},getCurrentUndoSize:function(e){return e.undoRedoService?.getCurrentUndoStackSize()??0},getCurrentRedoSize:function(e){return e.undoRedoService?.getCurrentRedoStackSize()??0}},dependantModules:[Wl]},_l={version:cn,moduleName:"@ag-grid-community/undo-redo-edit",beans:[class extends I{constructor(){super(...arguments),this.beanName="undoRedoService",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:n,column:r,oldValue:l,value:a}=e,h={rowPinned:o,rowIndex:n,columnId:r.getColId(),newValue:a,oldValue:l};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}wireBeans(e){this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.columnModel=e.columnModel,this.rangeService=e.rangeService}postConstruct(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");if(e<=0)return;this.undoStack=new Hl(e),this.redoStack=new Hl(e),this.addListeners();const t=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:e=>{e.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:t,newColumnsLoaded:t,columnGroupOpened:t,columnRowGroupChanged:t,columnMoved:t,columnPinned:t,columnVisible:t,rowDragEnd:t}),this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:"undoStarted",source:e};this.eventService.dispatchEvent(t);const i={type:"undoEnded",source:e,operationPerformed:this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo")};this.eventService.dispatchEvent(i)}redo(e){const t={type:"redoStarted",source:e};this.eventService.dispatchEvent(t);const i={type:"redoEnded",source:e,operationPerformed:this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo")};this.eventService.dispatchEvent(i)}undoRedo(e,t,i,s,o){if(!e)return!1;const n=e.pop();return!(!n||!n.cellValueChanges)&&(this.processAction(n,(e=>e[s]),o),n instanceof Nl?this.processRange(this.rangeService,n.ranges||[n[i]]):this.processCell(n.cellValueChanges),t.push(n),!0)}processAction(e,t,i){e.cellValueChanges.forEach((e=>{const{rowIndex:s,rowPinned:o,columnId:n}=e,r={rowIndex:s,rowPinned:o},l=this.rowPositionUtils.getRowNode(r);l.displayed&&l.setDataValue(n,t(e),i)}))}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach(((s,o)=>{if(!s)return;const n=s.startRow,r=s.endRow;o===t.length-1&&(i={rowPinned:n.rowPinned,rowIndex:n.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const l={rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(l)}))}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,o={rowIndex:i,rowPinned:s},n=this.rowPositionUtils.getRowNode(o),r={rowPinned:t.rowPinned,rowIndex:n.rowIndex,columnId:t.columnId};this.setLastFocusedCell(r,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,n=this.gridBodyCtrl.getScrollFeature(),r=this.columnModel.getCol(s);if(!r)return;n.ensureIndexVisible(i),n.ensureColumnVisible(r);const l={rowIndex:i,column:r,rowPinned:o};this.focusService.setFocusedCell({...l,forceBrowserFocus:!0}),t?.setRangeToCell(l)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Gl(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{this.activeCellEdit=null;if(e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new Gl(this.cellValueChanges);this.pushActionsToUndoStack(e)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Gl(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new Nl(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;e=this.rangeService&&this.gos.get("enableRangeSelection")?new Nl(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new Gl(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}}],dependantModules:[Wl]},Ul={version:cn,moduleName:"@ag-grid-community/full-row-edit",beans:[class extends I{constructor(){super(...arguments),this.beanName="rowEditService"}startEditing(e,t=null,i=null,s=null){e.getAllCellCtrls().reduce(((e,o)=>{const n=o===i;return n?o.startEditing(t,n,s):o.startEditing(null,n,s),!!e||o.isEditing()}),!1)&&this.setEditing(e,!0)}stopEditing(e,t=!1){const i=e.getAllCellCtrls(),s=e.isEditing();e.setStoppingRowEdit(!0);let o=!1;for(const e of i){const i=e.stopEditing(t);s&&!t&&!o&&i&&(o=!0)}if(o){const t=e.createRowEvent("rowValueChanged");this.eventService.dispatchEvent(t)}s&&this.setEditing(e,!1),e.setStoppingRowEdit(!1)}setEditing(e,t){e.setEditingRow(t),e.forEachGui(void 0,(e=>e.rowComp.addOrRemoveCssClass("ag-row-editing",t)));const i=t?e.createRowEvent("rowEditingStarted"):e.createRowEvent("rowEditingStopped");this.eventService.dispatchEvent(i)}}],dependantModules:[Wl]},Kl={version:cn,moduleName:"@ag-grid-community/default-editor",userComponents:[{name:"agCellEditor",classImp:El}],dependantModules:[Wl]},$l={version:cn,moduleName:"@ag-grid-community/editing",dependantModules:[Wl,_l,Ul,{version:cn,moduleName:"@ag-grid-community/all-editors",dependantModules:[Kl,{version:cn,moduleName:"@ag-grid-community/data-type-editors",userComponents:[{name:"agTextCellEditor",classImp:El},{name:"agNumberCellEditor",classImp:Ml},{name:"agDateCellEditor",classImp:Il},{name:"agDateStringCellEditor",classImp:Ol},{name:"agCheckboxCellEditor",classImp:kl}],dependantModules:[Kl]},{version:cn,moduleName:"@ag-grid-community/select-editor",userComponents:[{name:"agSelectCellEditor",classImp:Rl}],dependantModules:[Wl]},{version:cn,moduleName:"@ag-grid-community/large-text-editor",userComponents:[{name:"agLargeTextCellEditor",classImp:yl}],dependantModules:[Wl]}]},zl]},jl=class extends I{constructor(){super(...arguments),this.beanName="autoWidthCalculator"}wireBeans(e){this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>{this.centerRowContainerCtrl=e.center}))}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach((e=>this.cloneItemIntoDummy(e,t))),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);return s+this.getAutoSizePadding()}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach((i=>{const s=i.getHtmlElementForColumnHeader(e);null!=s&&(t=s)})),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),o=s.classList;["ag-header-cell","ag-header-group-cell"].some((e=>i.classList.contains(e)))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some((e=>n.classList.contains(e)))){for(let e=0;e<n.classList.length;e++){const t=n.classList[e];"ag-row-position-absolute"!=t&&o.add(t)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}},ql=class extends I{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0,this.extraTopHeight=0,this.extraBottomHeight=0}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl}))}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}setOffsetTop(e){if(this.extraTopHeight===e)return;this.extraTopHeight=e;const t={type:"stickyTopOffsetChanged",offset:e};this.eventService.dispatchEvent(t)}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getExtraTopHeight(){return this.extraTopHeight}getExtraBottomHeight(){return this.extraBottomHeight}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let t=e.childStore?.getStoreBounds();return e.footer&&(t=e.sibling.childStore?.getStoreBounds()),(t?.heightPx??0)+(t?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){if(e.footer&&0===e.rowIndex)return Number.MAX_SAFE_INTEGER;if(!e.sibling||1===Math.abs(e.sibling.rowIndex-e.rowIndex)){let t=e.footer?e.sibling:e;for(;t.isExpandable()&&t.expanded;)if(t.master)t=t.detailNode;else if(t.childrenAfterSort){if(0===t.childrenAfterSort.length)break;t=c(t.childrenAfterSort)}return t.rowTop+t.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t="top"===e;let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel()-this.extraTopHeight:this.rowRenderer.getLastVisibleVerticalPixel()-this.extraTopHeight,o=new Set,n=e=>{if(o.add(e),t){const t=this.getLastPixelOfGroup(e),o=s+i+e.rowHeight;e.stickyRowTop=t<o?i+(t-o):i}else{const t=this.getFirstPixelOfGroup(e),o=s-(i+e.rowHeight);e.stickyRowTop=t>o?i-(t-o):i}i=0,o.forEach((e=>{const t=e.stickyRowTop+e.rowHeight;i<t&&(i=t)}))},r=this.areFooterRowsStickySuppressed(),l=this.gos.get("suppressGroupRowsSticky"),a=e=>{if(!e.displayed)return!1;if(e.footer){if(!0===r)return!1;if("grand"===r&&-1===e.level)return!1;if("group"===r&&e.level>-1)return!1;return!o.has(e)}if(e.isExpandable()){if(!0===l)return!1;return!o.has(e)&&e.expanded}return!1};for(let e=0;e<100;e++){let e=s+i;t||(e=s-i);const o=this.rowModel.getRowIndexAtPixel(e),r=this.rowModel.getRow(o);if(null==r)break;const l=this.getStickyAncestors(r).find((e=>(t?e.rowIndex<o:e.rowIndex>o)&&a(e)));if(l){n(l);continue}if(!(t?r.rowTop<e:r.rowTop+r.rowHeight>e)||!a(r))break;n(r)}return t||o.forEach((e=>{e.stickyRowTop=i-(e.stickyRowTop+e.rowHeight)})),this.refreshNodesAndContainerHeight(e,o,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(!0===e)return!0;const t=!!this.gos.get("groupIncludeFooter")||"group"===e,i=!!this.gos.get("groupIncludeTotalFooter")||"grand"===e;return!(!t||!i)||(i?"grand":!!t&&"group")}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some((t=>t.getRowNode()===e))){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows()}else{for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}}refreshNodesAndContainerHeight(e,t,i){const s="top"===e,o=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,n={},r=[];for(let e=0;e<o.length;e++){const i=o[e].getRowNode();!t.has(i)?(n[i.id]=o[e],i.sticky=!1):r.push(o[e])}const l=new Set;for(let e=0;e<r.length;e++)l.add(r[e].getRowNode());const a=[];t.forEach((e=>{l.has(e)||(e.sticky=!0,a.push(this.createRowCon(e,!1,!1)))}));let h=!!a.length||r.length!==o.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),h=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),h=!0),this.destroyRowCtrls(n,!1);const d=[...r,...a];d.sort(((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex)),s||d.reverse(),d.forEach((e=>e.setRowTop(e.getRowNode().stickyRowTop)));let c=0;return s?(t.forEach((e=>{e.rowIndex<this.pageBoundsService.getFirstRow()&&(c+=e.rowHeight)})),c>this.topContainerHeight&&(c=this.topContainerHeight),this.setOffsetTop(c)):(t.forEach((e=>{e.rowIndex>this.pageBoundsService.getLastRow()&&(c+=e.rowHeight)})),c>this.bottomContainerHeight&&(c=this.bottomContainerHeight),this.setOffsetBottom(c)),!!h&&(s?this.stickyTopRowCtrls=d:this.stickyBottomRowCtrls=d,!0)}ensureRowHeightsValid(){let e=!1;const t=t=>{const i=t.getRowNode();if(i.rowHeightEstimated){const t=this.gos.getRowHeightForNode(i);i.setRowHeight(t.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},Yl=class extends I{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach((e=>e.onRangeSelectionChanged()))},t=()=>{this.getAllCellCtrls().forEach((e=>e.updateRangeBordersIfRangeCount()))},i=()=>{this.eventService.addEventListener("rangeSelectionChanged",e),this.eventService.addEventListener("columnMoved",t),this.eventService.addEventListener("columnPinned",t),this.eventService.addEventListener("columnVisible",t)},s=()=>{this.eventService.removeEventListener("rangeSelectionChanged",e),this.eventService.removeEventListener("columnMoved",t),this.eventService.removeEventListener("columnPinned",t),this.eventService.removeEventListener("columnVisible",t)};this.addDestroyFunc((()=>s())),this.addManagedPropertyListener("enableRangeSelection",(e=>{e.currentValue?i():s()}));this.gos.get("enableRangeSelection")&&i()}}wireBeans(e){this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusService=e.focusService,this.beans=e,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()}))}initialise(){if(this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this)}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],(()=>this.onDomLayoutChanged())),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],(()=>this.redraw())),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],(()=>this.redrawRows())),this.gos.isGroupRowsSticky()){const e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new ql(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new Ql(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=Y(this.rowCtrlsByRowIndex),t=Y(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach((t=>t.onCellFocused(e))),this.getFullWidthRowCtrls().forEach((t=>t.onFullWidthRowFocused(e)))}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>{this.onCellFocusChanged(e)},cellFocusCleared:()=>this.onCellFocusChanged(),flashCells:e=>{this.getAllCellCtrls().forEach((t=>t.onFlashCells(e)))},columnHoverChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onColumnHover()))},displayedColumnsChanged:()=>{this.getAllCellCtrls().forEach((e=>e.onDisplayedColumnsChanged()))},displayedColumnsWidthChanged:()=>{this.printLayout&&this.getAllCellCtrls().forEach((e=>e.onLeftChanged()))}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach((e=>e())),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();this.columnModel.getCols().forEach((e=>{const t=t=>{this.getAllCellCtrls().forEach((i=>{i.getColumn()===e&&t(i)}))},i=()=>{t((e=>e.onLeftChanged()))},s=()=>{t((e=>e.onWidthChanged()))},o=()=>{t((e=>e.onFirstRightPinnedChanged()))},n=()=>{t((e=>e.onLastLeftPinnedChanged()))},r=()=>{t((e=>e.onColDefChanged()))};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",s),e.addEventListener("firstRightPinnedChanged",o),e.addEventListener("lastLeftPinnedChanged",n),e.addEventListener("colDefChanged",r),this.destroyFuncsForColumnListeners.push((()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",s),e.removeEventListener("firstRightPinnedChanged",o),e.removeEventListener("lastLeftPinnedChanged",n),e.removeEventListener("colDefChanged",r)}))}))}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach((i=>{const s=i.getCellElement(e);s&&t.push(s)})),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowNodes()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowNodes())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){const i=Object.fromEntries(t.map((e=>[e.id,e]))),s=Object.fromEntries(e.map((e=>[e.getRowNode().id,e])));for(let o=0;o<t.length;o++){const n=t[o],r=e[o];r&&void 0===i[r.getRowNode().id]&&(r.destroyFirstPass(),r.destroySecondPass()),n.id in s?(e[o]=s[n.id],delete s[n.id]):e[o]=new kr(n,this.beans,!1,!1,this.printLayout)}e.length=t.length}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{if(this.cachedRowCtrls?.has(e))return void this.cachedRowCtrls.removeRow(e);{const t=t=>{const i=t[e.rowIndex];i&&i.getRowNode()===e&&(i.destroyFirstPass(),i.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);break;case"bottom":t(this.bottomRowCtrls);break;default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return e?.forEach((e=>this.redrawRow(e,!0))),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e?.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const i=this.gos.getActiveDomElement(),s=this.gos.getDomData(i,Ir.DOM_DATA_KEY_CELL_CTRL),o=this.gos.getDomData(i,kr.DOM_DATA_KEY_ROW_CTRL);return s||o?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gos.isAnimateRows(),o=i?this.getRowsToRecycle():null;if(i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature){this.stickyRowFeature.checkStickyRows();const e=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();e&&this.updateContainerHeights(e)}this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&(this.gridBodyCtrl.getScrollFeature().scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let t=this.pageBoundsService.getCurrentPageHeight();0===t&&(t=1),this.rowContainerHeightService.setModelHeight(t+e)}getLockOnRefresh(){if(this.refreshInProgress){const e=this.frameworkOverrides.getLockOnRefreshError?.()??"";throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace."+e)}this.refreshInProgress=!0,this.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&setTimeout((()=>{this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))}))}stopEditing(e=!1){this.getAllRowCtrls().forEach((t=>{t.stopEditing(e)}))}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const i=t[s].getAllCellCtrls(),o=i.length;for(let t=0;t<o;t++)e.push(i[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const e in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[e]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach((t=>t.flashCell(e)))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};for(const i of this.getCellCtrls(e.rowNodes,e.columns))i.refreshOrDestroyCell(t);this.refreshFullWidth(e.rowNodes)}refreshFullWidth(e){if(!e)return;let t=null;this.stickyRowFeature&&Zt()&&(t=this.getCellToRestoreFocusToAfterRefresh()||null);for(const t of this.getRowCtrls(e)){if(!t.isFullWidth())continue;t.refreshFullWidth()||this.redrawRow(t.getRowNode(),!0)}this.dispatchDisplayedRowsChanged(!1),t&&this.restoreFocusedCell(t)}getCellRendererInstances(e){const t=this.getCellCtrls(e.rowNodes,e.columns).map((e=>e.getCellRenderer())).filter((e=>null!=e));if(e.columns?.length)return t;const i=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach((e=>{if(s&&!this.isRowInMap(e.getRowNode(),s))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderers();for(let e=0;e<t.length;e++){const s=t[e];null!=s&&i.push(s)}})),[...i,...t]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach((e=>{const i=e.getCellEditor();i&&t.push(i)})),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach((t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}})),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach((e=>{const i=e.id;switch(e.rowPinned){case"top":t.top[i]=e;break;case"bottom":t.bottom[i]=e;break;default:t.normal[i]=e}})),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return null!=t.top[i];case"bottom":return null!=t.bottom[i];default:return null!=t.normal[i]}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter((e=>{const i=e.getRowNode();return this.isRowInMap(i,t)})):i}getCellCtrls(e,t){let i;k(t)&&(i={},t.forEach((e=>{const t=this.columnModel.getCol(e);k(t)&&(i[t.getId()]=!0)})));const s=[];return this.getRowCtrls(e).forEach((e=>{e.getAllCellCtrls().forEach((e=>{const t=e.getColumn().getId();i&&!i[t]||s.push(e)}))})),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];$(this.rowCtrlsByRowIndex,((t,i)=>{null==i.getRowNode().id&&e.push(t)})),this.removeRowCtrls(e);const t={};return $(this.rowCtrlsByRowIndex,((e,i)=>{const s=i.getRowNode();t[s.id]=i})),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach((e=>{const i=this.rowCtrlsByRowIndex[e];i&&(i.destroyFirstPass(t),i.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]}))}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&Zt()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let n=!1;if(this.stickyRowFeature){n=this.stickyRowFeature.checkStickyRows();const e=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();e&&this.updateContainerHeights(e)}const r=this.firstRenderedRow!==s||this.lastRenderedRow!==o;if((!t||n||r)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!n),null!=i)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach((e=>i[e]=!0));const s=Object.keys(this.rowCtrlsByRowIndex).filter((e=>!i[e]));this.removeRowCtrls(s,t)}calculateIndexesToDraw(e){const t=function(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}(this.firstRenderedRow,this.lastRenderedRow),i=(e,i)=>{const s=i.getRowNode().rowIndex;null!=s&&(s<this.firstRenderedRow||s>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(i)&&t.push(s)};$(this.rowCtrlsByRowIndex,i),$(e,i),t.sort(((e,t)=>e-t));const s=[];for(let e=0;e<t.length;e++){const i=t[e],o=this.rowModel.getRow(i);o&&!o.sticky&&s.push(i)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t);const o=[];if(s.forEach((s=>{const n=this.createOrUpdateRowCtrl(s,e,t,i);k(n)&&o.push(n)})),e){i&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask((()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})):this.destroyRowCtrls(e,t)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:"displayedRowsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.visibleColsService.isPinningLeft(),t=this.visibleColsService.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach((t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())})),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter((e=>{if(!e.isFullWidth())return!1;const i=e.getRowNode();return!(null!=t&&!this.isRowInMap(i,t))}))}createOrUpdateRowCtrl(e,t,i,s){let o,n=this.rowCtrlsByRowIndex[e];n||(o=this.rowModel.getRow(e),k(o)&&k(t)&&t[o.id]&&o.alreadyRendered&&(n=t[o.id],t[o.id]=null));if(!n){if(o||(o=this.rowModel.getRow(e)),!k(o))return;n=this.createRowCon(o,i,s)}return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n,n}destroyRowCtrls(e,t){const i=[];$(e,((e,s)=>{s&&(this.cachedRowCtrls&&s.isCacheable()?this.cachedRowCtrls.addRow(s):(s.destroyFirstPass(!t),t?(this.zombieRowCtrls[s.getInstanceId()]=s,i.push((()=>{s.destroySecondPass(),delete this.zombieRowCtrls[s.getInstanceId()]}))):s.destroySecondPass()))})),t&&(i.push((()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()})),ge(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){return this.getRowBuffer()*this.gos.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.rowModel.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.pageBoundsService.getFirstRow(),t=this.pageBoundsService.getLastRow();else{const i=this.getRowBufferInPixels(),s=this.ctrlsService.getGridBodyCtrl(),o=this.gos.get("suppressRowVirtualisation");let n,r,l=!1;do{const e=this.pageBoundsService.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:a}=this.pageBoundsService.getCurrentPagePixelRange(),h=this.rowContainerHeightService.getDivStretchOffset(),d=s.getScrollFeature().getVScrollPosition(),c=d.top,u=d.bottom;o?(n=t+h,r=a+h):(n=Math.max(c+e-i,t)+h,r=Math.min(u+e+i,a)+h),this.firstVisibleVPixel=Math.max(c+e,t)+h,this.lastVisibleVPixel=Math.min(u+e,a)+h,l=this.ensureAllRowsInRangeHaveHeightsCalculated(n,r)}while(l);let a=this.rowModel.getRowIndexAtPixel(n),h=this.rowModel.getRowIndexAtPixel(r);const d=this.pageBoundsService.getFirstRow(),c=this.pageBoundsService.getLastRow();a<d&&(a=d),h>c&&(h=c),e=a,t=h}else e=0,t=-1;const i=this.gos.isDomLayout("normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o);const n=e!==this.firstRenderedRow,r=t!==this.lastRenderedRow;if(n||r){this.firstRenderedRow=e,this.lastRenderedRow=t;const i={type:"viewportChanged",firstRow:e,lastRow:t};this.eventService.dispatchEvent(i)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame((()=>{this.beans.eventService.dispatchEvent(e)}))}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.pinnedRowModel?.ensureRowHeightsValid(),s=this.stickyRowFeature?.ensureRowHeightsValid(),o=this.rowModel.ensureRowHeightsValid(e,t,this.pageBoundsService.getFirstRow(),this.pageBoundsService.getLastRow());return(o||s)&&this.eventService.dispatchEvent({type:"recalculateRowBounds"}),!!(s||o||i)&&(this.updateContainerHeights(),!0)}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=!1,i=e.getRowNode(),s=this.focusService.isRowNodeFocused(i),o=e.isEditing(),n=i.detail;if(!(s||o||n))return t;return!!this.isRowPresent(i)||t}isRowPresent(e){return!!this.rowModel.isRowPresent(e)&&(!this.paginationService||this.paginationService.isRowPresent(e))}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gos.get("suppressAnimationFrame"),n=i&&!o&&!this.printLayout;return new kr(e,this.beans,t,n,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map((e=>e.getRowNode()))}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find((e=>e.getRowNode().rowIndex===i))||null,t||(t=this.getStickyBottomRowCtrls().find((e=>e.getRowNode().rowIndex===i))||null))}return t}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!i}},Ql=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];if(!t)return null;this.removeFromCache(t),t.setCached(!1);return t.getRowNode()!=e?null:t}has(e){return null!=this.entriesMap[e.id]}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],C(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],C(this.entriesList,e)}getEntries(){return this.entriesList}},Xl=class extends I{constructor(){super(...arguments),this.beanName="pinnedRowModel",this.nextId=0}wireBeans(e){this.beans=e}postConstruct(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",(()=>this.setPinnedTopRowData())),this.addManagedPropertyListener("pinnedBottomRowData",(()=>this.setPinnedBottomRowData())),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanges.bind(this)})}isEmpty(e){return N("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(N(i))return 0;for(let t=0;t<i.length;t++){const s=i[t];if(s.rowTop+s.rowHeight-1>=e)return t}return i.length-1}onGridStylesChanges(e){if(e.rowHeightChanged){const e=e=>{e.setRowHeight(e.rowHeight,!0)};this.pinnedBottomRows.forEach(e),this.pinnedTopRows.forEach(e)}}ensureRowHeightsValid(){let e=!1,t=0;const i=i=>{if(i.rowHeightEstimated){const s=this.gos.getRowHeightForNode(i);i.setRowTop(t),i.setRowHeight(s.height),t+=s.height,e=!0}};this.pinnedBottomRows?.forEach(i),t=0,this.pinnedTopRows?.forEach(i);return this.eventService.dispatchEvent({type:"pinnedHeightChanged"}),e}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);this.eventService.dispatchEvent({type:"pinnedRowDataChanged"})}createNodesFromData(e,t){const i=[];if(e){const s=this.gos.getRowIdCallback(),o=t?oo.ID_PREFIX_TOP_PINNED:oo.ID_PREFIX_BOTTOM_PINNED;let n=0;const r=t?"top":"bottom";e.forEach(((e,t)=>{const l=new oo(this.beans);l.data=e,l.id=s?.({data:e,level:0,rowPinned:r})??o+this.nextId++,l.rowPinned=r,l.setRowTop(n),l.setRowHeight(this.gos.getRowHeightForNode(l).height),l.setRowIndex(t),n+=l.rowHeight,i.push(l)}))}return i}getPinnedTopRowNodes(){return this.pinnedTopRows}getPinnedBottomRowNodes(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){N(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){N(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=c(e);return t.rowTop+t.rowHeight}},Jl=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(Jl||{}),Zl=class extends I{constructor(e){super(),this.state="needsLoading",this.version=0,this.id=e}getId(){return this.id}load(){this.state="loading",this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed",this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted();this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:"loadComplete",success:e,block:this};this.dispatchLocalEvent(t)}},ea=class extends I{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=fe(this.performCheckBlocksToLoad.bind(this),e))}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){C(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchLocalEvent({type:"blockLoaded"}),0==this.activeBlockLoadsCount&&this.dispatchLocalEvent({type:"blockLoaderFinished"})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void(this.gos.get("debug")&&he("RowNodeBlockLoader - checkBlockToLoad: max loads exceeded"));const e=this.getAvailableLoadingCount(),t=this.blocks.filter((e=>"needsLoading"===e.getState())).slice(0,e);this.registerLoads(t.length),t.forEach((e=>e.load())),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide")){return this.rowModel.getBlockStates()}const e={};return this.blocks.forEach((t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s})),e}printCacheStatus(){this.gos.get("debug")&&he(`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}},ta={version:cn,moduleName:"@ag-grid-community/row-node-block",beans:[ea]},ia=class{constructor(){this.root=null,this.end=null,this.cachedRange=[]}init(e){this.rowModel=e}reset(){this.root=null,this.end=null,this.cachedRange.length=0}setRoot(e){this.root=e,this.end=null,this.cachedRange.length=0}setEndRange(e){this.end=e,this.cachedRange.length=0}getRange(){if(0===this.cachedRange.length){const e=this.getRoot(),t=this.getEnd();if(null==e||null==t)return this.cachedRange;this.cachedRange=this.rowModel.getNodesInRangeForSelection(e,t)}return this.cachedRange}isInRange(e){return null!==this.root&&this.getRange().some((t=>t.id===e.id))}getRoot(){return this.root&&null===this.root?.key&&(this.root=this.rowModel.getRowNode(this.root.id)??null),this.root}getEnd(){return this.end&&null===this.end?.key&&(this.end=this.rowModel.getRowNode(this.end.id)??null),this.end}truncate(e){const t=this.getRange();if(0===t.length)return{keep:[],discard:[]};const i=t[0].id===this.root.id,s=t.findIndex((t=>t.id===e.id));if(s>-1){const o=t.slice(0,s),n=t.slice(s+1);return this.setEndRange(e),i?{keep:o,discard:n}:{keep:n,discard:o}}return{keep:t,discard:[]}}extend(e,t=!1){const i=this.getRoot();if(null==i){const i=this.getRange().slice();return t&&e.depthFirstSearch((e=>!e.group&&i.push(e))),i.push(e),this.setRoot(e),{keep:i,discard:[]}}if(this.rowModel.getNodesInRangeForSelection(i,e).find((e=>e.id===this.end?.id)))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const t=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:t}}}},sa=class extends I{constructor(){super(...arguments),this.beanName="stylingService"}wireBeans(e){this.expressionService=e.expressionService}processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,o){if(null==t&&null==e)return;const n={},r={},l=(e,t)=>{e.split(" ").forEach((e=>{""!=e.trim()&&t(e)}))};if(t){const e=Object.keys(t);for(let s=0;s<e.length;s++){const o=e[s],a=t[o];let h;"string"==typeof a?h=this.expressionService.evaluate(a,i):"function"==typeof a&&(h=a(i)),l(o,(e=>{h?n[e]=!0:r[e]=!0}))}}e&&o&&Object.keys(e).forEach((e=>l(e,(e=>{n[e]||(r[e]=!0)})))),o&&Object.keys(r).forEach(o),Object.keys(n).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;if("function"==typeof i){s=i(t)}else s=i;return"string"==typeof s&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach((e=>{i(e)}))}},oa=class extends rs{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},na={selector:"AG-TOGGLE-BUTTON",component:oa},ra=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(ra||{}),la=class extends I{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:n,isFocusableContainer:r,focusInnerElement:l,onFocusIn:a,onFocusOut:h,shouldStopEventPropagation:d,onTabKeyDown:c,handleKeyDown:u,eFocusableElement:g}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=l,this.eFocusableElement=g,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!n,this.isFocusableContainer=!!r,this.providedFocusIn=a,this.providedFocusOut=h,this.providedShouldStopEventPropagation=d,this.providedOnTabKeyDown=c,this.providedHandleKeyDown=u}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.createManagedBean(new uo(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach((e=>this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)})))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);if(this.forceFocusOutWhenTabGuardsAreEmpty){if(0===this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length)return void this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard)}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(-1===s)return;let o,n;e?(o=0,n=s):(o=s+1,n=i.length);const r=i.slice(o,n),l=this.gos.get("tabIndex");r.sort(((e,t)=>{const i=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return s===l?1:i===l?-1:0===i?1:0===s?-1:i-s})),r[e?r.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(this.focusTrapActive)return;if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout((()=>this.activateTabGuards()),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout((()=>{this.forcingFocusOut=!1,this.activateTabGuards()}))}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},aa=class extends I{constructor(e){super(),this.comp=e}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:i,eFocusableElement:s}=this,o=[t,i],n={setTabIndex:e=>{o.forEach((t=>null!=e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex")))}};this.addTabGuards(t,i);const{focusTrapActive:r=!1,onFocusIn:l,onFocusOut:a,focusInnerElement:h,handleKeyDown:d,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}=e;this.tabGuardCtrl=this.createManagedBean(new la({comp:n,focusTrapActive:r,eTopGuard:t,eBottomGuard:i,eFocusableElement:s,onFocusIn:l,onFocusOut:a,focusInnerElement:h,handleKeyDown:d,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=this.gos.getDocument().createElement("div"),i="top"===e?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),bt(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];wi(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,i){Ai(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.insertAdjacentElement("beforebegin",t):e(t,i)}},ha=class extends Wi{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new aa(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},da=0,ca=class extends I{constructor(){super(...arguments),this.beanName="popupService",this.popupList=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.resizeObserverService=e.resizeObserverService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady((e=>{this.gridCtrl=e.gridCtrl})),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);if(-1!==s){this.popupList[s].alignedToElement=t}const o=t.getBoundingClientRect(),n=this.getParentRect(),r=this.keepXYWithinBounds(i,o.top-n.top,0),l=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${l}px`;const a=n.right-n.left-l;let h;function d(){return o.right-n.left-2}function c(){return o.left-n.left-l}this.gos.get("enableRtl")?(h=c(),h<0&&(h=d(),this.setAlignedStyles(i,"left")),h>a&&(h=0,this.setAlignedStyles(i,"right"))):(h=d(),h>a&&(h=c(),this.setAlignedStyles(i,"right")),h<0&&(h=0,this.setAlignedStyles(i,"left"))),i.style.left=`${h}px`,i.style.top=`${r}px`}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,eventSource:n,alignSide:r="left",position:l="over",column:a,rowNode:h,type:d}=e,c=n.getBoundingClientRect(),u=this.getParentRect(),g=this.getPopupIndex(t);if(-1!==g){this.popupList[g].alignedToElement=n}this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,updatePosition:()=>{let i,o=c.left-u.left;if("right"===r&&(o-=t.offsetWidth-c.width),"over"===l)i=c.top-u.top,this.setAlignedStyles(t,"over");else{this.setAlignedStyles(t,"under");i="under"===this.shouldRenderUnderOrAbove(t,c,u,e.nudgeY||0)?c.top-u.top+c.height:c.top-t.offsetHeight-2*(s||0)-u.top}return{x:o,y:i}},postProcessCallback:()=>this.callPostProcessPopup(d,t,n,null,a,h)})}shouldRenderUnderOrAbove(e,t,i,s){const o=i.bottom-t.bottom,n=t.top-i.top,r=e.offsetHeight+s;return o>r?"under":n>r||n>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i],{alignedToElement:o}=s;if(!o)return;["right","left","over","above","under"].forEach((t=>{o.classList.remove(`ag-has-popup-positioned-${t}`),e.classList.remove(`ag-popup-positioned-${t}`)})),t&&(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,s,o,n){const r=this.gos.getCallback("postProcessPopup");if(r){r({column:o,rowNode:n,ePopup:t,type:e,eventSource:i,mouseEvent:s})}}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:n,updatePosition:r}=e,l={width:0,height:0},a=(n=!1)=>{let{x:a,y:h}=r();n&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,s&&(a+=s),o&&(h+=o),i&&(a=this.keepXYWithinBounds(t,a,1),h=this.keepXYWithinBounds(t,h,0)),t.style.left=`${a}px`,t.style.top=`${h}px`,e.postProcessCallback&&e.postProcessCallback())};if(a(),!n){const e=this.resizeObserverService.observeResize(t,(()=>a(!0)));setTimeout((()=>e()),200)}}getActivePopups(){return this.popupList.map((e=>e.element))}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),mi(t)}keepXYWithinBounds(e,t,i){const s=0===i,o=s?"clientHeight":"clientWidth",n=s?"top":"left",r=s?"height":"width",l=s?"scrollTop":"scrollLeft",a=this.gos.getDocument(),h=a.documentElement,d=this.getPopupParent(),c=e.getBoundingClientRect(),u=d.getBoundingClientRect(),g=a.documentElement.getBoundingClientRect(),p=d===a.body,m=Math.ceil(c[r]);let C=p?(s?gi:pi)(h)+h[l]:d[o];p&&(C-=Math.abs(g[n]-u[n]));const f=C-m;return Math.min(Math.max(t,0),Math.abs(f))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:n,anchorToElement:r}=e;if(!t)return de("could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(i);if(-1!==l){return{hideFunc:this.popupList[l].hideFunc}}this.initialisePopupPosition(i);const a=this.createPopupWrapper(i,s,!!o),h=this.addEventListenersToPopup({...e,wrapperEl:a});return n&&n(),this.addPopupToPopupList(i,a,h,r),{hideFunc:h}}initialisePopupPosition(e){const t=this.getPopupParent().getBoundingClientRect();k(e.style.top)||(e.style.top=-1*t.top+"px"),k(e.style.left)||(e.style.left=-1*t.left+"px")}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div");return this.environment.applyThemeClasses(o),o.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||bt(e,"dialog"),Ft(e,t),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(e){if(e.themeChanged)for(const e of this.popupList)this.environment.applyThemeClasses(e.wrapper)}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:o,closedCallback:n,afterGuiAttached:r,closeOnEsc:l,modal:a}=e;let h=!1;const d=e=>{if(!s.contains(this.gos.getActiveDomElement()))return;e.key!==is.ESCAPE||M(e)||g({keyboardEvent:e})},c=e=>g({mouseEvent:e}),u=e=>g({touchEvent:e}),g=(e={})=>{const{mouseEvent:r,touchEvent:l,keyboardEvent:a,forceHide:g}=e;(g||!this.isEventFromCurrentPopup({mouseEvent:r,touchEvent:l},o)&&!h)&&(h=!0,i.removeChild(s),t.removeEventListener("keydown",d),t.removeEventListener("mousedown",c),t.removeEventListener("touchstart",u),t.removeEventListener("contextmenu",c),this.eventService.removeEventListener("dragStarted",c),n&&n(r||l||a),this.removePopupFromPopupList(o))};return r&&r({hidePopup:g}),window.setTimeout((()=>{l&&t.addEventListener("keydown",d),a&&(t.addEventListener("mousedown",c),this.eventService.addEventListener("dragStarted",c),t.addEventListener("touchstart",u),t.addEventListener("contextmenu",c))}),0),g}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:da++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex((t=>t.element===e))}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then((e=>e&&e())),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=o,s.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter((t=>t.element!==e))}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,n=s.getBoundingClientRect(),r=i.top-n.top,l=i.left-n.left;let a=r,h=l;const d=o.style.top,c=parseInt(d.substring(0,d.length-1),10),u=o.style.left,g=parseInt(u.substring(0,u.length-1),10),p=this.getFrameworkOverrides();return new ws((i=>{p.wrapIncoming((()=>{p.setInterval((()=>{const i=t.getBoundingClientRect(),n=s.getBoundingClientRect();if(0==n.top&&0==n.left&&0==n.height&&0==n.width)return void e.hidePopup();const d=i.top-n.top;if(d!=a){const e=this.keepXYWithinBounds(o,c+r-d,0);o.style.top=`${e}px`}a=d;const u=i.left-n.left;if(u!=h){const e=this.keepXYWithinBounds(o,g+l-u,1);o.style.left=`${e}px`}h=u}),200).then((e=>{i((()=>{null!=e&&window.clearInterval(e)}))}))}),"popupPositioning")}))}hasAnchoredPopup(){return this.popupList.some((e=>e.isAnchored))}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const n=this.getPopupIndex(t);if(-1===n)return!1;for(let e=n;e<this.popupList.length;e++){if(A(this.popupList[e].element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),n=o.length,r=this.getWrapper(e);if(!r||s<=1||!t.contains(e))return!1;const l=i.indexOf(r),a=r.querySelectorAll("div"),h=[];a.forEach((e=>{0!==e.scrollTop&&h.push([e,e.scrollTop])}));let d=!1;if(n){r.classList.contains("ag-always-on-top")?l!==s-1&&(c(o).insertAdjacentElement("afterend",r),d=!0):l!==s-n-1&&(o[0].insertAdjacentElement("beforebegin",r),d=!0)}else l!==s-1&&(c(i).insertAdjacentElement("afterend",r),d=!0);for(;h.length;){const e=h.pop();e[0].scrollTop=e[1]}return d}},ua=["touchstart","touchend","touchmove","touchcancel"],ga=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=e=>e(),this.wrapOutgoing=e=>e()}setInterval(e,t){return new ws((i=>{i(window.setInterval(e,t))}))}addEventListener(e,t,i,s){const o=S(ua,t);e.addEventListener(t,i,{capture:!!s,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${"solid"===this.frameworkName?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},pa=class extends I{constructor(){super(...arguments),this.beanName="cellNavigationService"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.pinnedRowModel=e.pinnedRowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===is.UP,s=e===is.DOWN,o=e===is.LEFT;let n,r;if(i||s)r=i?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow(),n=t.column;else{const e=this.visibleColsService.getAllCols(),i=this.gos.get("enableRtl");r=t.rowIndex,n=o!==i?e[0]:c(e)}return{rowIndex:r,rowPinned:null,column:n}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case is.UP:i=this.getCellAbove(i);break;case is.DOWN:i=this.getCellBelow(i);break;case is.RIGHT:i=this.gos.get("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case is.LEFT:i=this.gos.get("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,de("unknown key for navigation ",e)}s=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}if(!i)return!1;return!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.visibleColsService.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.visibleColsService.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.pageBoundsService.getFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;let i=[];i=this.rowRenderer.getStickyTopRowCtrls().some((t=>t.getRowNode().rowIndex===e.rowIndex))?[...this.rowRenderer.getStickyTopRowCtrls()].sort(((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex)):[...this.rowRenderer.getStickyBottomRowCtrls()].sort(((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex));const s=t?-1:1,o=i.findIndex((t=>t.getRowNode().rowIndex===e.rowIndex)),n=i[o+s];return n?{rowIndex:n.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;if("top"===t){return this.pinnedRowModel.getPinnedTopRowNodes().length-1<=i}if("bottom"===t){return this.pinnedRowModel.getPinnedBottomRowNodes().length-1<=i}return this.pageBoundsService.getLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.pageBoundsService.getFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s,!0);return o||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.pageBoundsService.getLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowNodes().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColAfter(e.column);if(!o){o=t[0];const n=this.getRowBelow(e);if(G(n))return null;if(!n.rowPinned&&!(this.paginationService?.isRowInPage(n)??1))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColBefore(e.column);if(!o){o=c(t);const n=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(G(n))return null;if(!n.rowPinned&&!(this.paginationService?.isRowInPage(n)??1))return null;i=n?n.rowIndex:null,s=n?n.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}};function ma(e,t){e.eventService.dispatchEvent(t)}var Ca=class extends I{constructor(){super(...arguments),this.beanName="apiFunctionService",this.functions={dispatchEvent:ma},this.isDestroyed=!1}wireBeans(e){this.beans=e}postConstruct(){this.preDestroyLink=this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}callFunction(e,t){const i=this.functions[e];return i?i.apply(i,[this.beans,...t]):this.isDestroyed?this.destroyedHandler(e):void(this.isFrameworkMethod(e)||this.beans.validationService?.warnMissingApiFunction(e))}addFunction(e,t){const{validationService:i}=this.beans;i&&(t=i.validateApiFunction(e,t)),this.functions[e]=t}destroy(){this.functions={},this.isDestroyed=!0,super.destroy()}destroyedHandler(e){if("isDestroyed"===e)return!0;"destroy"!==e&&de(`Grid API function ${e}() cannot be called as the grid has been destroyed.\nEither clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.\nTo run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${this.preDestroyLink}`)}isFrameworkMethod(e){return["preWireBeans","wireBeans","preConstruct","postConstruct"].includes(e)}};function fa(e){const t=e.getBean("apiFunctionService");return new Proxy(t,{get(e,t){if("then"!==t)return(...i)=>e.callFunction(t,i)}})}function va(e){return{beanName:"gridApi",bean:fa(e)}}var wa=class extends I{constructor(){super(...arguments),this.beanName="columnDefFactory"}buildColumnDefs(e,t,i){const s=[],o={};return e.forEach((e=>{let n=!0,r=this.createDefFromColumn(e,t,i),l=e.getOriginalParent(),a=null;for(;l;){let e=null;if(l.isPadding()){l=l.getOriginalParent();continue}const t=o[l.getGroupId()];if(t){t.children.push(r),n=!1;break}if(e=this.createDefFromGroup(l),e&&(e.children=[r],o[e.groupId]=e,r=e,l=l.getOriginalParent()),null!=l&&a===l){n=!1;break}a=l}n&&s.push(r)})),s}createDefFromGroup(e){const t=q(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=q(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=!e.isVisible()||void 0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,s}},Sa=class extends I{constructor(){super(...arguments),this.beanName="columnEventDispatcher"}visibleCols(){this.eventService.dispatchEvent({type:"displayedColumnsChanged"})}gridColumns(){this.eventService.dispatchEvent({type:"gridColumnsChanged"})}headerHeight(e){const t={type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}groupOpened(e){const t={type:"columnGroupOpened",columnGroup:1===e.length?e[0]:void 0,columnGroups:e};this.eventService.dispatchEvent(t)}rowGroupChanged(e,t){const i={type:"columnRowGroupChanged",columns:e,column:1===e.length?e[0]:null,source:t};this.eventService.dispatchEvent(i)}genericColumnEvent(e,t,i){const s={type:e,columns:t,column:1===t.length?t[0]:null,source:i};this.eventService.dispatchEvent(s)}pivotModeChanged(){this.eventService.dispatchEvent({type:"columnPivotModeChanged"})}virtualColumnsChanged(e){const t={type:"virtualColumnsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}newColumnsLoaded(e){const t={type:"newColumnsLoaded",source:e};this.eventService.dispatchEvent(t)}everythingChanged(e){const t={type:"columnEverythingChanged",source:e};this.eventService.dispatchEvent(t)}columnMoved(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e,n={type:"columnMoved",columns:t,column:t&&1===t.length?t[0]:null,toIndex:s,finished:o,source:i};this.eventService.dispatchEvent(n)}columnPinned(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,(e=>e.getPinned())),o={type:"columnPinned",pinned:null!=s?s:null,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}columnVisible(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s={type:"columnVisible",visible:this.getCommonValue(e,(e=>e.isVisible())),columns:e,column:i,source:t};this.eventService.dispatchEvent(s)}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}columnChanged(e,t,i){const s={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i};this.eventService.dispatchEvent(s)}columnResized(e,t,i,s=null){if(e&&e.length){const o={type:"columnResized",columns:e,column:1===e.length?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(o)}}},ya=class extends I{constructor(){super(...arguments),this.beanName="columnGetStateService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService}getColumnState(){if(G(this.columnModel.getColDefCols())||!this.columnModel.isAlive())return[];const e=this.columnModel.getAllCols().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}createStateItemFromColumn(e){const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns(),s=e.isRowGroupActive()?t.indexOf(e):null,o=e.isPivotActive()?i.indexOf(e):null,n=e.isValueActive()?e.getAggFunc():null,r=null!=e.getSort()?e.getSort():null,l=null!=e.getSortIndex()?e.getSortIndex():null,a=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:r,sortIndex:l,aggFunc:n,rowGroup:e.isRowGroupActive(),rowGroupIndex:s,pivot:e.isPivotActive(),pivotIndex:o,flex:a}}orderColumnStateList(e){const t=this.columnModel.getCols(),i=new Map(t.map(((e,t)=>[e.getColId(),t])));e.sort(((e,t)=>(i.has(e.colId)?i.get(e.colId):-1)-(i.has(t.colId)?i.get(t.colId):-1)))}},ba=class extends I{constructor(){super(...arguments),this.beanName="columnGroupStateService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService}getColumnGroupState(){const e=[];return xe(null,this.columnModel.getColTree(),(t=>{oe(t)&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})})),e}resetColumnGroupState(e){const t=this.columnModel.getColDefColTree();if(!t)return;const i=[];xe(null,t,(e=>{if(oe(e)){const t=e.getColGroupDef(),s={groupId:e.getGroupId(),open:t?t.openByDefault:void 0};i.push(s)}})),this.setColumnGroupState(i,e)}setColumnGroupState(e,t){if(!this.columnModel.getColTree())return;this.columnAnimationService.start();const i=[];e.forEach((e=>{const t=e.groupId,s=e.open,o=this.columnModel.getProvidedColGroup(t);o&&o.isExpanded()!==s&&(o.setExpanded(s),i.push(o))})),this.visibleColsService.refresh(t,!0),i.length&&this.eventDispatcher.groupOpened(i),this.columnAnimationService.finish()}},Ra=class extends I{constructor(){super(...arguments),this.beanName="columnViewportService",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={}}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}setScrollPosition(e,t,i=!1){const s=this.visibleColsService.isBodyWidthDirty();if(!(e===this.scrollWidth&&t===this.scrollPosition&&!s)){if(this.scrollWidth=e,this.scrollPosition=t,this.visibleColsService.setBodyWidthDirty(),this.gos.get("enableRtl")){const e=this.visibleColsService.getBodyContainerWidth();this.viewportLeft=e-this.scrollPosition-this.scrollWidth,this.viewportRight=e-this.scrollPosition}else this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition;this.columnModel.isReady()&&this.checkViewportColumns(i)}}getHeadersToRender(e,t){let i;switch(e){case"left":i=this.rowsOfHeadersToRenderLeft[t];break;case"right":i=this.rowsOfHeadersToRenderRight[t];break;default:i=this.rowsOfHeadersToRenderCenter[t]}return i||[]}extractViewportColumns(){const e=this.visibleColsService.getCenterCols();this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||0===this.viewportRight}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200;return!(t<s&&i<s)&&!(t>o&&i>o)}getViewportColumns(){const e=this.visibleColsService.getLeftCols(),t=this.visibleColsService.getRightCols();return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.columnModel.isColSpanActive())return this.colsWithinViewport;const t=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this),i=this.visibleColsService.getColsCenter();return this.visibleColsService.getColsForRow(e,i,t,(e=>{const t=e.getLeft();return k(t)&&t>this.viewportLeft}))}checkViewportColumns(e=!1){this.extractViewport()&&this.eventDispatcher.virtualColumnsChanged(e)}calculateHeaderRows(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={};const e={},t=this.visibleColsService.getLeftCols(),i=this.visibleColsService.getRightCols();this.headerColsWithinViewport.concat(t).concat(i).forEach((t=>e[t.getId()]=!0));const s=(t,i,o)=>{let n=!1;for(let r=0;r<t.length;r++){const l=t[r];let a=!1;if(ie(l))a=!0===e[l.getId()];else{const e=l.getDisplayedChildren();e&&(a=s(e,i,o+1))}a&&(n=!0,i[o]||(i[o]=[]),i[o].push(l))}return n};s(this.visibleColsService.getTreeLeft(),this.rowsOfHeadersToRenderLeft,0),s(this.visibleColsService.getTreeRight(),this.rowsOfHeadersToRenderRight,0),s(this.visibleColsService.getTreeCenter(),this.rowsOfHeadersToRenderCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.getViewportColumns().map((e=>`${e.getId()}-${e.getPinned()||"normal"}`)).join("#"),t=this.colsWithinViewportHash!==e;return t&&(this.colsWithinViewportHash=e,this.calculateHeaderRows()),t}},Fa=class extends I{constructor(){super(...arguments),this.beanName="agComponentUtils"}wireBeans(e){this.componentMetadataProvider=e.componentMetadataProvider}adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(){return!1}getGui(){return this.eGui}init(t){const i=e(t),s=typeof i;this.eGui="string"!==s&&"number"!==s&&"boolean"!==s?null!=i?i:Ri("<span></span>"):Ri("<span>"+i+"</span>")}}}doesImplementIComponent(e){return!!e&&(e.prototype&&"getGui"in e.prototype)}},Pa=class extends I{constructor(){super(...arguments),this.beanName="componentMetadataProvider"}wireBeans(e){this.agComponentUtils=e.agComponentUtils}postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}},Ea=Object.fromEntries(["rowPositionUtils","cellPositionUtils","headerPositionUtils","paginationAutoPageSizeService","apiFunctionService","gridApi","userComponentRegistry","agComponentUtils","componentMetadataProvider","resizeObserverService","userComponentFactory","rowContainerHeightService","horizontalResizeService","localeService","validationService","pinnedRowModel","dragService","visibleColsService","eventService","gos","popupService","selectionService","columnFilterService","quickFilterService","filterManager","columnModel","headerNavigationService","pageBoundsService","paginationService","pageBoundsListener","rowRenderer","expressionService","columnFactory","alignedGridsService","navigationService","valueCache","valueService","loggerFactory","autoWidthCalculator","filterMenuFactory","dragAndDropService","focusService","mouseEventService","environment","cellNavigationService","stylingService","scrollVisibleService","sortController","columnHoverService","columnAnimationService","selectableService","autoColService","changeDetectionService","animationFrameService","undoRedoService","columnDefFactory","rowCssClassCalculator","rowNodeBlockLoader","rowNodeSorter","ctrlsService","pinnedWidthService","rowNodeEventThrottle","ctrlsFactory","dataTypeService","syncService","overlayService","stateService","expansionService","apiEventService","ariaAnnouncementService","menuService","columnApplyStateService","columnEventDispatcher","columnMoveService","columnAutosizeService","columnGetStateService","columnGroupStateService","columnSizeService","funcColsService","columnNameService","columnViewportService","pivotResultColsService","showRowGroupColsService"].map(((e,t)=>[e,t])));function Da(e,t){return((e.beanName?Ea[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER)-((t.beanName?Ea[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER)}function Ma(e,t){return"gridDestroyService"===e?.beanName?-1:0}var xa=class extends I{constructor(){super(...arguments),this.beanName="ctrlsFactory",this.registry={}}register(e){this.registry[e.name]=e.classImp}getInstance(e,...t){const i=this.registry[e];if(null!=i)return new i(...t)}},Ta=class extends I{constructor(){super(...arguments),this.beanName="ctrlsService",this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=null!=e.gridCtrl&&null!=e.gridBodyCtrl&&null!=e.center&&null!=e.left&&null!=e.right&&null!=e.bottomCenter&&null!=e.bottomLeft&&null!=e.bottomRight&&null!=e.topCenter&&null!=e.topLeft&&null!=e.topRight&&null!=e.stickyTopCenter&&null!=e.stickyTopLeft&&null!=e.stickyTopRight&&null!=e.stickyBottomCenter&&null!=e.stickyBottomLeft&&null!=e.stickyBottomRight&&null!=e.centerHeader&&null!=e.leftHeader&&null!=e.rightHeader&&null!=e.fakeHScrollComp&&null!=e.fakeVScrollComp&&null!=e.gridHeaderCtrl,this.ready&&(this.readyCallbacks.forEach((t=>t(e))),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){const i=this.params;switch(t){case"left":i.leftHeader=e;break;case"right":i.rightHeader=e;break;default:i.centerHeader=e}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:i}=this.params;return[e,i,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}},Aa=class extends I{constructor(){super(...arguments),this.beanName="cellPositionUtils"}createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${null==i?"null":i}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return i&&s&&o}},Ia=class extends I{constructor(){super(...arguments),this.beanName="rowNodeEventThrottle",this.events=[]}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowModel=e.rowModel}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach((e=>this.eventService.dispatchEvent(e))),this.events=[]};t?i():(null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}},La=class extends I{constructor(){super(...arguments),this.beanName="rowPositionUtils"}wireBeans(e){this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.pageBoundsService=e.pageBoundsService}getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.pageBoundsService.getFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getLastRow()):s&&(t="top",e=s-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowNodes()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowNodes()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&(e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned)}before(e,t){switch(e.rowPinned){case"top":if("top"!==t.rowPinned)return!0;break;case"bottom":if("bottom"!==t.rowPinned)return!1;break;default:if(k(t.rowPinned))return"top"!==t.rowPinned}return e.rowIndex<t.rowIndex}},Oa={cssName:"--ag-row-height",changeKey:"rowHeightChanged",defaultValue:42},ka={cssName:"--ag-header-height",changeKey:"headerHeightChanged",defaultValue:48},Ga={cssName:"--ag-list-item-height",changeKey:"listItemHeightChanged",defaultValue:24},Na=class extends I{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.themeClasses=[],this.eThemeAncestor=null,this.eMeasurementContainer=null,this.sizesMeasured=!1}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.eGridDiv=e.eGridDiv}postConstruct(){this.addManagedPropertyListener("rowHeight",(()=>this.refreshRowHeightVariable())),this.themeClasses=this.getAncestorThemeClasses(),this.setUpThemeClassObservers(),this.getSizeEl(Oa),this.getSizeEl(ka),this.getSizeEl(Ga)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(Oa)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(ka)}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(Ga)}hasMeasuredSizes(){return this.sizesMeasured}getThemeClasses(){return this.themeClasses}applyThemeClasses(e){for(const t of Array.from(e.classList))t.startsWith("ag-theme-")&&!this.themeClasses.includes(t)&&e.classList.remove(t);for(const t of this.themeClasses)e.classList.contains(t)||e.classList.add(t)}getThemeAncestorElement(){return this.eThemeAncestor}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return null!==e&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(null!=t)return t;const i=this.measureSizeEl(e);return"detached"===i||"no-styles"===i?e.defaultValue:(this.lastKnownValues.set(e,i),i)}measureSizeEl(e){const t=this.getSizeEl(e);if(null==t.offsetParent)return"detached";const i=t.offsetWidth;return i===Ba?"no-styles":(this.sizesMeasured=!0,i)}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let i=this.eMeasurementContainer;i||(i=this.eMeasurementContainer=document.createElement("div"),i.className="ag-measurement-container",this.eGridDiv.appendChild(i)),t=document.createElement("div"),t.style.width=`var(${e.cssName}, ${Ba}px)`,i.appendChild(t),this.sizeEls.set(e,t);let s=this.measureSizeEl(e);"no-styles"===s&&de(`no value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`);const o=this.resizeObserverService.observeResize(t,(()=>{const t=this.measureSizeEl(e);"detached"!==t&&"no-styles"!==t&&(this.lastKnownValues.set(e,t),t!==s&&(s=t,this.fireGridStylesChangedEvent(e.changeKey)))}));return this.addDestroyFunc((()=>o())),t}fireGridStylesChangedEvent(e){const t={type:"gridStylesChanged",[e]:!0};this.eventService.dispatchEvent(t)}setUpThemeClassObservers(){const e=new MutationObserver((()=>{const e=this.getAncestorThemeClasses();Ha(e,this.themeClasses)||(this.themeClasses=e,this.fireGridStylesChangedEvent("themeChanged"))}));let t=this.eGridDiv;for(;t;)e.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement}getAncestorThemeClasses(){let e=this.eGridDiv;const t=[];for(this.eThemeAncestor=null;e;){const i=Array.from(e.classList).filter((e=>e.startsWith("ag-theme-")));for(const s of i)this.eThemeAncestor=e,t.includes(s)||t.unshift(s);e=e.parentElement}return Object.freeze(t)}},Ha=(e,t)=>e.length===t.length&&-1===e.findIndex(((i,s)=>e[s]!==t[s])),Ba=15538,Va=class extends I{constructor(){super(...arguments),this.beanName="eventService",this.globalEventService=new h}wireBeans(e){this.globalEventListener=e.globalEventListener,this.globalSyncEventListener=e.globalSyncEventListener}postConstruct(){if(this.globalEventListener){const e=this.gos.useAsyncEvents();this.addGlobalListener(this.globalEventListener,e)}this.globalSyncEventListener&&this.addGlobalListener(this.globalSyncEventListener,!1)}addEventListener(e,t,i){this.globalEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.globalEventService.removeEventListener(e,t,i)}addGlobalListener(e,t=!1){this.globalEventService.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalEventService.removeGlobalListener(e,t)}dispatchLocalEvent(){}dispatchEvent(e){this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e))}dispatchEventOnce(e){this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e))}},Wa=class e extends I{constructor(){super(...arguments),this.beanName="focusService"}wireBeans(e){this.eGridDiv=e.eGridDiv,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.headerNavigationService=e.headerNavigationService,this.headerPositionUtils=e.headerPositionUtils,this.rowRenderer=e.rowRenderer,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.navigationService=e.navigationService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.rangeService=e.rangeService,this.advancedFilterService=e.advancedFilterService}static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",e.toggleKeyboardMode),t.addEventListener("mousedown",e.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",e.toggleKeyboardMode),t.addEventListener("mousedown",e.toggleKeyboardMode))}static toggleKeyboardMode(t){const i=e.keyboardModeActive,s="keydown"===t.type;s&&(t.ctrlKey||t.metaKey||t.altKey)||i!==s&&(e.keyboardModeActive=s)}static unregisterGridCompController(t){e.removeKeyboardModeEvents(t)}postConstruct(){const e=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:e,columnRowGroupChanged:e}),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady((e=>{this.gridCtrl=e.gridCtrl}))}registerKeyboardFocusEvents(){const t=this.gos.getDocument();e.addKeyboardModeEvents(t),e.instanceCount++,this.addDestroyFunc((()=>{e.instanceCount--,e.unregisterGridCompController(t)}))}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getCol(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return e.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),kr.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),an.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gos.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout((()=>{this.restoredFocusedCellPosition=null}),0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,s={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return o&&(s.isFullWidthCell=o.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e={type:"cellFocusCleared",...this.getFocusEventParams()};this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:s,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:n=!1}=e,r=this.columnModel.getCol(t);if(!r)return void(this.focusedCellPosition=null);this.focusedCellPosition=r?{rowIndex:i,rowPinned:O(s),column:r}:null;const l={type:"cellFocused",...this.getFocusEventParams(),forceBrowserFocus:o,preventScrollOnBrowserFocus:n};this.eventService.dispatchEvent(l)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),s=e.getPinned(),{column:o,headerRowIndex:n}=this.focusedHeaderPosition;return t===o&&i===n&&s==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:s,event:o,fromCell:n,rowWithoutSpanValue:r}=e;let{headerPosition:l}=e;if(n&&this.filterManager?.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(l);if(s){const e=this.getFocusedHeader(),s=this.headerNavigationService.getHeaderRowCount();if(i){const i=this.gos.getCallback("tabToNextHeader");i&&(l=this.getHeaderPositionFromUserFunc({userFunc:i,direction:t,currentPosition:e,headerPosition:l,headerRowCount:s}))}else{const t=this.gos.getCallback("navigateToNextHeader");if(t&&o){l=t({key:o.key,previousHeaderPosition:e,nextHeaderPosition:l,headerRowCount:s,event:o})}}}return!!l&&this.focusProvidedHeaderPosition({headerPosition:l,direction:t,event:o,fromCell:n,rowWithoutSpanValue:r})}focusHeaderPositionFromUserFunc(e){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:t,headerPosition:i,direction:s,event:o}=e,n=this.getFocusedHeader(),r=this.headerNavigationService.getHeaderRowCount(),l=this.getHeaderPositionFromUserFunc({userFunc:t,direction:s,currentPosition:n,headerPosition:i,headerRowCount:r});return!!l&&this.focusProvidedHeaderPosition({headerPosition:l,direction:s,event:o})}getHeaderPositionFromUserFunc(e){const{userFunc:t,direction:i,currentPosition:s,headerPosition:o,headerRowCount:n}=e,r=t({backwards:"Before"===i,previousHeaderPosition:s,nextHeaderPosition:o,headerRowCount:n});return!0===r||null===r?(null===r&&de("Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),s):!1===r?null:r}focusProvidedHeaderPosition(e){const{headerPosition:t,direction:i,fromCell:s,rowWithoutSpanValue:o,event:n}=e,{column:r,headerRowIndex:l}=t;if(-1===l)return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(t):this.focusGridView(r);this.headerNavigationService.scrollToColumn(r,i);const a=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()).focusHeader(t.headerRowIndex,r,n);return a&&(null!=o||s)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(o??-1),a}focusFirstHeader(){let e=this.visibleColsService.getAllCols()[0];if(!e)return!1;e.getParent()&&(e=this.visibleColsService.getColGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=c(this.visibleColsService.getAllCols());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return null!=this.focusedCellPosition&&(this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===O(t))}findFocusableElements(e,t,i=!1){let s=oi;t&&(s+=", "+t),i&&(s+=', [tabindex="-1"]');const o=Array.prototype.slice.apply(e.querySelectorAll("[tabindex], input, select, button, textarea, [href]")).filter((e=>bi(e))),n=Array.prototype.slice.apply(e.querySelectorAll(s));if(!n.length)return o;return r=n,o.filter((e=>-1===r.indexOf(e)));var r}focusInto(e,t=!1,i=!1){const s=this.findFocusableElements(e,null,i),o=t?c(s):s[0];return!!o&&(o.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),s=i.indexOf(t);if(-1===s)return null;let o=-1;for(let e=s-1;e>=0;e--)if(i[e].classList.contains("ag-tab-guard-top")){o=e;break}return o<=0?null:i[o-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const s=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),o=this.gos.getActiveDomElement();let n;n=t?s.findIndex((e=>e.contains(o))):s.indexOf(o);const r=n+(i?-1:1);return r<0||r>=s.length?null:s[r]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${uo.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let e=0;e<i.length;e++)if(i[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===ei(e)&&++i<=t;)e=e.parentElement;return null===ei(e)?null:e}focusGridView(e,t){if(this.gos.get("suppressCellFocus"))return t?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const i=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!i)return!1;const{rowIndex:s,rowPinned:o}=i,n=this.getFocusedHeader();return!e&&n&&(e=n.column),!(null==s||!e)&&(this.navigationService.ensureCellVisible({rowIndex:s,column:e,rowPinned:o}),this.setFocusedCell({rowIndex:s,column:e,rowPinned:O(o),forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:s,rowPinned:o,column:e}),!0)}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){return this.advancedFilterFocusColumn=e?.column,this.advancedFilterService?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(e,t){const i=(t?void 0:this.advancedFilterFocusColumn)??this.visibleColsService.getAllCols()?.[0];return e?this.focusHeaderPosition({headerPosition:{column:i,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(i)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}addFocusableContainer(e){this.gridCtrl.addFocusableContainer(e)}removeFocusableContainer(e){this.gridCtrl.removeFocusableContainer(e)}focusGridInnerElement(e){return this.gridCtrl.focusInnerElement(e)}};Wa.keyboardModeActive=!1,Wa.instanceCount=0;var za=Wa,_a=class extends I{constructor(){super(...arguments),this.beanName="pinnedWidthService"}wireBeans(e){this.visibleColsService=e.visibleColsService}postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.visibleColsService.getColsLeftWidth(),i=e?0:this.visibleColsService.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:"leftPinnedWidthChanged"})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:"rightPinnedWidthChanged"}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}},Ua=class extends I{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}wireBeans(e){this.beans=e,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.gridId);const{dragAndDropService:s,mouseEventService:o,ctrlsService:n,resizeObserverService:r}=this.beans;s.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>1===e||0===e,getIconName:()=>"notAllowed"}),o.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new or(this.view)),this.addRtlSupport();const l=r.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc((()=>l())),n.register("gridCtrl",this)}isDetailGrid(){const e=this.focusService.findTabbableParent(this.getGui());return e?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.paginationService?.getPaginationSelector(),gridHeaderDropZonesSelector:e.columnDropZonesService?.getDropZoneSelector(),sideBarSelector:e.sideBarService?.getSideBarSelector(),statusBarSelector:e.statusBarService?.getStatusPanelSelector(),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){const e={type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),i=this.gos.getActiveDomElement(),s=t.findIndex((e=>e.getGui().contains(i))),o=s+(e?-1:1);if(o<0||o>=t.length)return!1;if(0===o){if(s>0){const e=c(this.visibleColsService.getAllCols());if(this.focusService.focusGridView(e,!0))return!0}return!1}return this.focusContainer(t[o],e)}focusInnerElement(e){const t=this.getFocusableContainers(),i=this.visibleColsService.getAllCols(),s=this.gos.getCallback("focusGridInnerElement");if(s&&s({fromBottom:!!e}))return!0;if(e){if(t.length>1)return this.focusContainer(c(t),!0);const e=c(i);if(this.focusService.focusGridView(e,!0))return!0}if(0===this.gos.get("headerHeight")||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let e=1;e<t.length;e++)if(this.focusService.focusInto(t[e].getGui()))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}focusContainer(e,t){e?.setAllowFocus?.(!0);const i=this.focusService.focusInto(e.getGui(),t);return e?.setAllowFocus?.(!1),i}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers.values()]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},Ka=class extends ha{constructor(e){super(),this.gridBody=Vi,this.sideBar=Vi,this.pagination=Vi,this.rootWrapperBody=Vi,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}},t=this.createManagedBean(new Ua),i=t.getOptionalSelectors(),s=this.createTemplate(i),o=[rl,...Object.values(i).filter((e=>!!e))];this.setTemplate(s,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>t.focusInnerElement(e),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc((()=>{this.eGridDiv.removeChild(e),this.gos.get("debug")&&he("Grid removed from DOM")}))}updateLayoutClasses(e,t){const i=this.rootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",i=e.sideBarSelector?'<ag-side-bar data-ref="sideBar"></ag-side-bar>':"",s=e.statusBarSelector?"<ag-status-bar></ag-status-bar>":"",o=e.watermarkSelector?"<ag-watermark></ag-watermark>":"";return`<div class="ag-root-wrapper" role="presentation">\n ${t}\n <div class="ag-root-wrapper-body" data-ref="rootWrapperBody" role="presentation">\n <ag-grid-body data-ref="gridBody"></ag-grid-body>\n ${i}\n </div>\n ${s}\n ${e.paginationSelector?'<ag-pagination data-ref="pagination"></ag-pagination>':""}\n ${o}\n </div>`}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){e||!this.pagination?.isDisplayed()?super.forceFocusOutOfContainer(e):this.pagination.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[this.gridBody];return[this.sideBar,this.pagination].forEach((t=>{t&&e.push(t)})),e.filter((e=>bi(e.getGui())))}},$a={version:cn,moduleName:"@ag-grid-community/aligned-grid",beans:[class extends I{constructor(){super(...arguments),this.beanName="alignedGridsService",this.consuming=!1}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.ctrlsService=e.ctrlsService,this.columnApplyStateService=e.columnApplyStateService}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t="function"==typeof e;"function"==typeof e&&(e=e());const i=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map((e=>{if(!e)return ce("alignedGrids contains an undefined option."),t||ce('You may want to configure via a callback to avoid setup race conditions:\n "alignedGrids: () => [linkedGrid]"'),void ce(i());if(this.isGridApi(e))return e;const s=e;return"current"in s?s.current?.api:(s.api||ce(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),s.api)})).filter((e=>!!e&&!e.isDestroyed()))}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:e})=>this.onColumnEvent(e),alignedGridScroll:({event:e})=>this.onScrollEvent(e)})}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach((t=>{t.isDestroyed()||t.dispatchEvent(e)}))}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){const t={type:"alignedGridColumn",event:e};this.fireEvent(t)}fireScrollEvent(e){if("horizontal"!==e.direction)return;const t={type:"alignedGridScroll",event:e};this.fireEvent(t)}onScrollEvent(e){this.onEvent((()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)}))}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach((e=>{t.push(e)})):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach((e=>{t.push(e.getColId())})):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent((()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{const t=e;this.processColumnEvent(t);break}case"columnGroupOpened":{const t=e;this.processGroupOpenedEvent(t);break}case"columnPivotChanged":de("pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}}))}processGroupOpenedEvent(e){e.columnGroups.forEach((e=>{let t=null;if(e){const i=e.getGroupId();t=this.columnModel.getProvidedColGroup(i)}e&&!t||this.columnModel.setColumnGroupOpened(t,e.isExpanded(),"alignedGridChanged")}))}processColumnEvent(e){const t=e.column;let i=null;if(t&&(i=this.columnModel.getColDefCol(t.getColId())),t&&!i)return;const s=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const t=e.api.getColumnState().map((e=>({colId:e.colId})));this.columnApplyStateService.applyColumnState({state:t,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const t=e.api.getColumnState().map((e=>({colId:e.colId,hide:e.hide})));this.columnApplyStateService.applyColumnState({state:t},"alignedGridChanged")}break;case"columnPinned":{const t=e.api.getColumnState().map((e=>({colId:e.colId,pinned:e.pinned})));this.columnApplyStateService.applyColumnState({state:t},"alignedGridChanged")}break;case"columnResized":{const t=e,i={};s.forEach((e=>{i[e.getId()]={key:e.getColId(),newWidth:e.getActualWidth()}})),t.flexColumns?.forEach((e=>{i[e.getId()]&&delete i[e.getId()]})),this.columnSizeService.setColumnWidths(Object.values(i),!1,t.finished,"alignedGridChanged");break}}const o=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach((e=>{e.setGridOption("alwaysShowVerticalScroll",o)}))}}]};var ja={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},qa=["january","february","march","april","may","june","july","august","september","october","november","december"],Ya=class extends I{constructor(){super(...arguments),this.beanName="dataTypeService",this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}wireBeans(e){this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.columnApplyStateService=e.columnApplyStateService}postConstruct(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",(()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")})),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",(e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(Ae(e.source))}))}processDataTypeDefinitions(){const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},this.formatValueFuncs={};const t=e=>t=>{const{column:i,node:s,value:o}=t;let n=i.getColDef().valueFormatter;return n===e.groupSafeValueFormatter&&(n=e.valueFormatter),this.valueService.formatValue(i,s,o,n)};Object.entries(e).forEach((([e,i])=>{const s={...i,groupSafeValueFormatter:this.createGroupSafeValueFormatter(i)};this.dataTypeDefinitions[e]=s,this.formatValueFuncs[e]=t(s)}));const i=this.gos.get("dataTypeDefinitions")??{};this.dataTypeMatchers={},Object.entries(i).forEach((([s,o])=>{const n=this.processDataTypeDefinition(o,i,[s],e);n&&(this.dataTypeDefinitions[s]=n,o.dataTypeMatcher&&(this.dataTypeMatchers[s]=o.dataTypeMatcher),this.formatValueFuncs[s]=t(n))})),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach((t=>{const i=this.dataTypeMatchers[t];i&&delete this.dataTypeMatchers[t],this.dataTypeMatchers[t]=i??e[t].dataTypeMatcher}))}mergeDataTypeDefinitions(e,t){const i={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...De(e.columnTypes),...De(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const n=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let i=s[n];const r=t[n];if(i&&r&&(i=r),!this.validateDataTypeDefinition(e,i,n))return;o=this.mergeDataTypeDefinitions(i,e)}else{if(i.includes(n))return void de('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');const r=t[n];if(!this.validateDataTypeDefinition(e,r,n))return;const l=this.processDataTypeDefinition(r,t,[...i,n],s);if(!l)return;o=this.mergeDataTypeDefinitions(l,e)}return{...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)}}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(de('The "baseDataType" property of a data type definition must match that of its parent.'),!1):(de(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{if(t.node?.group){const i=t.column.getAggFunc();if(i){if("first"===i||"last"===i)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==i){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter({...t,value:t.value.toNumber()});if("value"in t.value)return e.valueFormatter({...t,value:t.value.value})}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if("string"!=typeof t.value||e.dataTypeMatcher?.(t.value))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetColumnType(e,t,i){let{cellDataType:s}=t;const{field:o}=t;if(void 0===s&&(s=e.cellDataType),null!=s&&!0!==s||(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(o,i)),!s)return void(e.cellDataType=!1);const n=this.dataTypeDefinitions[s];if(n)return e.cellDataType=s,n.groupSafeValueFormatter&&(e.valueFormatter=n.groupSafeValueFormatter),n.valueParser&&(e.valueParser=n.valueParser),n.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,n,i),n.columnTypes;de(`Missing data type definition - "${s}"`)}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=e=>{t.add(e.key)};e.addEventListener("columnStateUpdated",i),this.columnStateUpdateListenerDestroyFuncs.push((()=>e.removeEventListener("columnStateUpdated",i)))}canInferCellDataType(e,t){if("clientSide"!==this.rowModel.getType())return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,i))return!1;const s=null===t.type?e.type:t.type;if(s){const e=this.gos.get("columnTypes")??{};if(De(s).some((t=>{const s=e[t.trim()];return s&&this.doColDefPropsPreventInference(s,i)})))return!1}return!this.doColDefPropsPreventInference(e,i)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some((([i,s])=>this.doesColDefPropPreventInference(e,t,i,s)))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return null===o?(t[i]=!1,!1):void 0===s?!!o:o===s}inferCellDataType(e,t){if(!e)return;let i;const s=this.getInitialData();if(s){const t=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");i=X(s,e,t)}else this.initWaitForRowData(t);if(null==i)return;const[o]=Object.entries(this.dataTypeMatchers).find((([e,t])=>t(i)))??["object"];return o}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(e?.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const[i]=this.addManagedEventListeners({rowDataUpdateStarted:e=>{const{firstRowData:s}=e;if(!s)return;i?.(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(s,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();this.eventService.dispatchEvent({type:"dataTypesInferred"})}})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.destroyColumnStateUpdateListeners();const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach((([e,n])=>{const r=this.columnModel.getCol(e);if(!r)return;const l=r.getColDef();if(!this.columnModel.resetColDefIntoCol(r,"cellDataTypeInferred"))return;const a=r.getColDef();if(t&&a.type&&a.type!==l.type){const t=this.getUpdatedColumnState(r,n);t.rowGroup&&null==t.rowGroupIndex&&(s[e]=t),t.pivot&&null==t.pivotIndex&&(o[e]=t),i.push(t)}})),t&&i.push(...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnApplyStateService.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnApplyStateService.getColumnStateFromColDef(e);return t.forEach((e=>{delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex})),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}getDateStringTypeDefinition(e){return e?this.getDataTypeDefinition(e)??this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(null==t)return!0;const i=this.getDataTypeDefinition(e)?.dataTypeMatcher;return!i||i(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||de('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&de('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}getFormatValue(e){return this.formatValueFuncs[e]}setColDefPropertiesForBaseDataType(e,t,i,s){const o=this.formatValueFuncs[t],n=Zi.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId),r=this.localeService.getLocaleTextFunc(),l=t=>{const{filterParams:i}=e;e.filterParams="object"==typeof i?{...i,...t}:t};switch(i.baseDataType){case"number":e.cellEditor="agNumberCellEditor",n&&l({comparator:(e,t)=>{const i=null==e?0:parseInt(e),s=null==t?0:parseInt(t);return i===s?0:i>s?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===is.SPACE,l(n?{valueFormatter:e=>k(e.value)?r(String(e.value),e.value?"True":"False"):r("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=o,n&&l({valueFormatter:e=>{const t=o(e);return k(t)?t:r("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=qa[Number(e)-1];return r(t,ja[t])}return e??r("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=o;const t=i.dateParser;l(n?{valueFormatter:e=>{const t=o(e);return k(t)?t:r("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const i=t(e??void 0);return i?[String(i.getFullYear()),String(i.getMonth()+1),String(i.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=qa[Number(e)-1];return r(t,ja[t])}return e??r("blanks","(Blanks)")}}:{comparator:(e,i)=>{const s=t(i);return null==i||s<e?-1:s>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const i=this.columnModel.getColDefCol(s),n=i?.getColDef();if(!i||!n)return 0;const r=null==e?"":o({column:i,node:null,value:e}),l=null==t?"":o({column:i,node:null,value:t});return r===l?0:r>l?1:-1},e.keyCreator=o,n?l({valueFormatter:e=>{const t=o(e);return k(t)?t:r("blanks","(Blanks)")}}):e.filterValueGetter=e=>o({column:e.column,node:e.node,value:this.valueService.getValue(e.column,e.node)})}}getDefaultDataTypes(){const e=e=>!!e.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>""===e.newValue?.trim?.()?null:Number(e.newValue),valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:H(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>null==e.newValue?e.newValue:""===e.newValue?.trim?.()?null:"true"===String(e.newValue).toLowerCase(),valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>qo(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?Ko(e.value,!1)??"":t("invalidDate","Invalid Date"),dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>qo(e)??void 0,dateFormatter:e=>Ko(e??null,!1)??void 0,valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>H(e.value)??""}}}destroyColumnStateUpdateListeners(){this.columnStateUpdateListenerDestroyFuncs.forEach((e=>e())),this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}},Qa={version:cn,moduleName:"@ag-grid-community/data-type",beans:[Ya]};function Xa(e,t){const{colKey:i,rowNode:s,useFormatter:o}=t,n=e.columnModel.getColDefCol(i)??e.columnModel.getCol(i);if(G(n))return null;const r=e.valueService.getValue(n,s);if(o){return e.valueService.formatValue(n,s,r)??ze(r,!0)}return r}function Ja(e,t){e.gos.updateGridOptions({options:t})}function Za(e){return e.rowRenderer.getFirstVirtualRenderedRow()}function eh(e){return e.rowRenderer.getLastVirtualRenderedRow()}var th={version:cn,moduleName:"@ag-grid-community/menu-api",apiFunctions:{showColumnMenuAfterButtonClick:function(e,t,i){const s=e.columnModel.getCol(t);e.menuService.showColumnMenu({column:s,buttonElement:i,positionBy:"button"})},showColumnMenuAfterMouseClick:function(e,t,i){let s=e.columnModel.getCol(t);s||(s=e.columnModel.getColDefCol(t)),s?e.menuService.showColumnMenu({column:s,mouseEvent:i,positionBy:"mouse"}):ce(`column '${t}' not found`)},showColumnMenu:function(e,t){const i=e.columnModel.getCol(t);i?e.menuService.showColumnMenu({column:i,positionBy:"auto"}):ce(`column '${t}' not found`)},hidePopupMenu:function(e){e.menuService.hidePopupMenu()}}},ih={version:cn,moduleName:"@ag-grid-community/api",dependantModules:[{version:cn,moduleName:"@ag-grid-community/core-api",apiFunctions:{getGridId:function(e){return e.context.getGridId()},destroy:function(e){e.gridDestroyService.destroy()},isDestroyed:function(e){return e.gridDestroyService.isDestroyCalled()},getGridOption:function(e,t){return e.gos.get(t)},setGridOption:function(e,t,i){Ja(e,{[t]:i})},updateGridOptions:Ja}},{version:cn,moduleName:"@ag-grid-community/pinned-row-api",apiFunctions:{getPinnedTopRowCount:function(e){return e.pinnedRowModel.getPinnedTopRowCount()},getPinnedBottomRowCount:function(e){return e.pinnedRowModel.getPinnedBottomRowCount()},getPinnedTopRow:function(e,t){return e.pinnedRowModel.getPinnedTopRow(t)},getPinnedBottomRow:function(e,t){return e.pinnedRowModel.getPinnedBottomRow(t)}}},{version:cn,moduleName:"@ag-grid-community/row-selection-api",apiFunctions:{setNodesSelected:function(e,t){if(!t.nodes.every((e=>e.rowPinned?(de("cannot select pinned rows"),!1):void 0!==e.id||(de("cannot select node until id for node is known"),!1))))return;const{nodes:i,source:s,newValue:o}=t,n=i;e.selectionService.setNodesSelected({nodes:n,source:s??"api",newValue:o})},selectAll:function(e,t="apiSelectAll"){e.selectionService.selectAllRowNodes({source:t})},deselectAll:function(e,t="apiSelectAll"){e.selectionService.deselectAllRowNodes({source:t})},selectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionService.selectAllRowNodes({source:t,justFiltered:!0})},deselectAllFiltered:function(e,t="apiSelectAllFiltered"){e.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})},selectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})},deselectAllOnCurrentPage:function(e,t="apiSelectAllCurrentPage"){e.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})},getSelectedNodes:function(e){return e.selectionService.getSelectedNodes()},getSelectedRows:function(e){return e.selectionService.getSelectedRows()}}},{version:cn,moduleName:"@ag-grid-community/column-api",apiFunctions:{getColumnDef:function(e,t){const i=e.columnModel.getColDefCol(t);return i?i.getColDef():null},getColumnDefs:function(e){return e.columnModel.getColumnDefs()},sizeColumnsToFit:function(e,t){"number"==typeof t?e.columnSizeService.sizeColumnsToFit(t,"api"):e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t)},setColumnGroupOpened:function(e,t,i){e.columnModel.setColumnGroupOpened(t,i,"api")},getColumnGroup:function(e,t,i){return e.visibleColsService.getColumnGroup(t,i)},getProvidedColumnGroup:function(e,t){return e.columnModel.getProvidedColGroup(t)},getDisplayNameForColumn:function(e,t,i){return e.columnNameService.getDisplayNameForColumn(t,i)||""},getDisplayNameForColumnGroup:function(e,t,i){return e.columnNameService.getDisplayNameForColumnGroup(t,i)||""},getColumn:function(e,t){return e.columnModel.getColDefCol(t)},getColumns:function(e){return e.columnModel.getColDefCols()},applyColumnState:function(e,t){return e.columnApplyStateService.applyColumnState(t,"api")},getColumnState:function(e){return e.columnGetStateService.getColumnState()},resetColumnState:function(e){e.columnApplyStateService.resetColumnState("api")},getColumnGroupState:function(e){return e.columnGroupStateService.getColumnGroupState()},setColumnGroupState:function(e,t){e.columnGroupStateService.setColumnGroupState(t,"api")},resetColumnGroupState:function(e){e.columnGroupStateService.resetColumnGroupState("api")},isPinning:function(e){return e.visibleColsService.isPinningLeft()||e.visibleColsService.isPinningRight()},isPinningLeft:function(e){return e.visibleColsService.isPinningLeft()},isPinningRight:function(e){return e.visibleColsService.isPinningRight()},getDisplayedColAfter:function(e,t){return e.visibleColsService.getColAfter(t)},getDisplayedColBefore:function(e,t){return e.visibleColsService.getColBefore(t)},setColumnVisible:function(e,t,i){e.columnModel.setColsVisible([t],i,"api")},setColumnsVisible:function(e,t,i){e.columnModel.setColsVisible(t,i,"api")},setColumnPinned:function(e,t,i){e.columnModel.setColsPinned([t],i,"api")},setColumnsPinned:function(e,t,i){e.columnModel.setColsPinned(t,i,"api")},getAllGridColumns:function(e){return e.columnModel.getCols()},getDisplayedLeftColumns:function(e){return e.visibleColsService.getLeftCols()},getDisplayedCenterColumns:function(e){return e.visibleColsService.getCenterCols()},getDisplayedRightColumns:function(e){return e.visibleColsService.getRightCols()},getAllDisplayedColumns:function(e){return e.visibleColsService.getAllCols()},getAllDisplayedVirtualColumns:function(e){return e.columnViewportService.getViewportColumns()},moveColumn:function(e,t,i){e.columnMoveService.moveColumns([t],i,"api")},moveColumnByIndex:function(e,t,i){e.columnMoveService.moveColumnByIndex(t,i,"api")},moveColumns:function(e,t,i){e.columnMoveService.moveColumns(t,i,"api")},setColumnWidth:function(e,t,i,s=!0,o="api"){e.columnSizeService.setColumnWidths([{key:t,newWidth:i}],!1,s,o)},setColumnWidths:function(e,t,i=!0,s="api"){e.columnSizeService.setColumnWidths(t,!1,i,s)},getLeftDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeLeft()},getCenterDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeCenter()},getRightDisplayedColumnGroups:function(e){return e.visibleColsService.getTreeRight()},getAllDisplayedColumnGroups:function(e){return e.visibleColsService.getAllTrees()},autoSizeColumn:function(e,t,i){return e.columnAutosizeService.autoSizeCols({colKeys:[t],skipHeader:i,source:"api"})},autoSizeColumns:function(e,t,i){e.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"api"})},autoSizeAllColumns:function(e,t){e.columnAutosizeService.autoSizeAllColumns("api",t)}}},{version:cn,moduleName:"@ag-grid-community/row-api",apiFunctions:{redrawRows:function(e,t={}){const i=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.redrawRows(i)))},setRowNodeExpanded:function(e,t,i,s,o){e.expansionService.setRowNodeExpanded(t,i,s,o)},getRowNode:function(e,t){return e.rowModel.getRowNode(t)},addRenderedRowListener:function(e,t,i,s){e.rowRenderer.addRenderedRowListener(t,i,s)},getRenderedNodes:function(e){return e.rowRenderer.getRenderedNodes()},forEachNode:function(e,t,i){e.rowModel.forEachNode(t,i)},getFirstDisplayedRow:function(e){return Za(e)},getFirstDisplayedRowIndex:Za,getLastDisplayedRow:function(e){return eh(e)},getLastDisplayedRowIndex:eh,getDisplayedRowAtIndex:function(e,t){return e.rowModel.getRow(t)},getDisplayedRowCount:function(e){return e.rowModel.getRowCount()},getModel:function(e){return e.rowModel}}},{version:cn,moduleName:"@ag-grid-community/drag-api",apiFunctions:{addRowDropZone:function(e,t){e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t)},removeRowDropZone:function(e,t){const i=e.dragAndDropService.findExternalZone(t);i&&e.dragAndDropService.removeDropTarget(i)},getRowDropZoneParams:function(e,t){return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t)}}},{version:cn,moduleName:"@ag-grid-community/scroll-api",apiFunctions:{getVerticalPixelRange:function(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition()},getHorizontalPixelRange:function(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition()},ensureColumnVisible:Bl,ensureIndexVisible:Vl,ensureNodeVisible:function(e,t,i=null){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t,i)),"ensureVisible")}}},{version:cn,moduleName:"@ag-grid-community/overlay-api",apiFunctions:{showLoadingOverlay:function(e){e.overlayService.showLoadingOverlay()},showNoRowsOverlay:function(e){e.overlayService.showNoRowsOverlay()},hideOverlay:function(e){e.overlayService.hideOverlay()}}},{version:cn,moduleName:"@ag-grid-community/keyboard-navigation-api",apiFunctions:{getFocusedCell:function(e){return e.focusService.getFocusedCell()},clearFocusedCell:function(e){return e.focusService.clearFocusedCell()},setFocusedCell:function(e,t,i,s){e.focusService.setFocusedCell({rowIndex:t,column:i,rowPinned:s,forceBrowserFocus:!0})},setFocusedHeader:function(e,t,i=!1){const s=e.headerNavigationService.getHeaderPositionForColumn(t,i);s&&e.focusService.focusHeaderPosition({headerPosition:s})},tabToNextCell:function(e,t){return e.navigationService.tabToNextCell(!1,t)},tabToPreviousCell:function(e,t){return e.navigationService.tabToNextCell(!0,t)}}},{version:cn,moduleName:"@ag-grid-community/event-api",apiFunctions:{addEventListener:function(e,t,i){e.apiEventService.addEventListener(t,i)},addGlobalListener:function(e,t){e.apiEventService.addGlobalListener(t)},removeEventListener:function(e,t,i){e.apiEventService.removeEventListener(t,i)},removeGlobalListener:function(e,t){e.apiEventService.removeGlobalListener(t)}}},{version:cn,moduleName:"@ag-grid-community/render-api",apiFunctions:{setGridAriaProperty:function(e,t,i){if(!t)return;const s=e.ctrlsService.getGridBodyCtrl().getGui(),o=`aria-${t}`;null===i?s.removeAttribute(o):s.setAttribute(o,i)},refreshCells:function(e,t={}){e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.refreshCells(t)))},flashCells:function(e,t={}){const i=e=>de(`Since v31.1 api.flashCells parameter '${e}Delay' is deprecated. Please use '${e}Duration' instead.`);k(t.fadeDelay)&&i("fade"),k(t.flashDelay)&&i("flash"),e.frameworkOverrides.wrapIncoming((()=>e.rowRenderer.flashCells(t)))},refreshHeader:function(e){e.frameworkOverrides.wrapIncoming((()=>e.ctrlsService.getHeaderRowContainerCtrls().forEach((e=>e.refresh()))))},isAnimationFrameQueueEmpty:function(e){return e.animationFrameService.isQueueEmpty()},flushAllAnimationFrames:function(e){e.animationFrameService.flushAllFrames()},getSizesForCurrentTheme:function(e){return{rowHeight:e.gos.getRowHeightAsNumber(),headerHeight:e.columnModel.getHeaderHeight()}},getCellRendererInstances:function(e,t={}){return e.rowRenderer.getCellRendererInstances(t).map(Ws)}}},{version:cn,moduleName:"@ag-grid-community/cell-api",apiFunctions:{expireValueCache:function(e){e.valueCache.expire()},getValue:function(e,t,i){return Xa(e,{colKey:t,rowNode:i})},getCellValue:Xa}},th,{version:cn,moduleName:"@ag-grid-community/sort-api",apiFunctions:{onSortChanged:function(e){e.sortController.onSortChanged("api")}}}]};var sh={version:cn,moduleName:"@ag-grid-community/state-core",beans:[class extends I{constructor(){super(...arguments),this.beanName="stateService",this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=fe((()=>this.dispatchQueuedStateUpdateEvents()),0),this.onRowGroupOpenedDebounced=fe((()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),0),this.onRowSelectedDebounced=fe((()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())}),0),this.staleStateKeys=new Set}wireBeans(e){this.filterManager=e.filterManager,this.ctrlsService=e.ctrlsService,this.pivotResultColsService=e.pivotResultColsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnGroupStateService=e.columnGroupStateService,this.columnGetStateService=e.columnGetStateService,this.paginationService=e.paginationService,this.rowModel=e.rowModel,this.selectionService=e.selectionService,this.expansionService=e.expansionService,this.columnAnimationService=e.columnAnimationService,this.columnApplyStateService=e.columnApplyStateService,this.sideBarService=e.sideBarService,this.rangeService=e.rangeService}postConstruct(){this.isClientSideRowModel="clientSide"===this.rowModel.getType(),this.cachedState=this.gos.get("initialState")??{},this.ctrlsService.whenReady((()=>this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnGridReady()))));const[e,t,i]=this.addManagedEventListeners({newColumnsLoaded:({source:t})=>{"gridInitializing"===t&&(e(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnColumnsInitialised())))},rowCountReady:()=>{t?.(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnRowCountReady()))},firstDataRendered:()=>{i?.(),this.suppressEventsAndDispatchInitEvent((()=>this.setupStateOnFirstDataRendered()))}})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState());const e=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:e,sideBarUpdated:e})}setupStateOnColumnsInitialised(){const e=this.gos.get("initialState")??{};this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedEventListeners({columnValueChanged:()=>this.updateColumnState(["aggregation"]),columnMoved:()=>this.updateColumnState(["columnOrder"]),columnPinned:()=>this.updateColumnState(["columnPinning"]),columnResized:()=>this.updateColumnState(["columnSizing"]),columnVisible:()=>this.updateColumnState(["columnVisibility"]),columnPivotChanged:()=>this.updateColumnState(["pivot"]),columnPivotModeChanged:()=>this.updateColumnState(["pivot"]),columnRowGroupChanged:()=>this.updateColumnState(["rowGroup"]),sortChanged:()=>this.updateColumnState(["sort"]),newColumnsLoaded:()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setupStateOnRowCountReady(){const{filter:e,rowGroupExpansion:t,rowSelection:i,pagination:s}=this.gos.get("initialState")??{},o=this.gos.get("advancedFilterModel");(e||o)&&this.setFilterState(e,o),t&&this.setRowGroupExpansionState(t),i&&this.setRowSelectionState(i),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedEventListeners({filterChanged:()=>this.updateCachedState("filter",this.getFilterState()),rowGroupOpened:()=>this.onRowGroupOpenedDebounced(),expandOrCollapseAll:()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:e=>{(e.newPage||e.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}})}setupStateOnFirstDataRendered(){const{scroll:e,rangeSelection:t,focusedCell:i,columnOrder:s}=this.gos.get("initialState")??{};i&&this.setFocusedCellState(i),t&&this.setRangeSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!s?.orderedColIds),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedEventListeners({cellFocused:()=>this.updateCachedState("focusedCell",this.getFocusedCellState()),rangeSelectionChanged:e=>{e.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())},bodyScrollEnd:()=>this.updateCachedState("scroll",this.getScrollState())})}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],o=[],n=[],r=[],l=[],a=[],h=[],d=this.columnGetStateService.getColumnState();for(let e=0;e<d.length;e++){const{colId:c,sort:u,sortIndex:g,rowGroup:p,rowGroupIndex:m,aggFunc:C,pivot:f,pivotIndex:v,pinned:w,hide:S,width:y,flex:b}=d[e];h.push(c),u&&(t[g??0]={colId:c,sort:u}),p&&(i[m??0]=c),"string"==typeof C&&s.push({colId:c,aggFunc:C}),f&&(o[v??0]=c),w&&("right"===w?r:n).push(c),S&&l.push(c),(b||y)&&a.push({colId:c,flex:b??void 0,width:y})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:void 0,columnPinning:n.length||r.length?{leftColIds:n,rightColIds:r}:void 0,columnVisibility:l.length?{hiddenColIds:l}:void 0,columnSizing:a.length?{columnSizingModel:a}:void 0,columnOrder:h.length?{orderedColIds:h}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:o,columnPinning:n,columnVisibility:r,columnSizing:l,columnOrder:a}=e,h={},d=e=>{let t=h[e];return t||(t={colId:e},h[e]=t,t)};t&&t.sortModel.forEach((({colId:e,sort:t},i)=>{const s=d(e);s.sort=t,s.sortIndex=i})),i&&i.groupColIds.forEach(((e,t)=>{const i=d(e);i.rowGroup=!0,i.rowGroupIndex=t})),s&&s.aggregationModel.forEach((({colId:e,aggFunc:t})=>{d(e).aggFunc=t})),o&&(o.pivotColIds.forEach(((e,t)=>{const i=d(e);i.pivot=!0,i.pivotIndex=t})),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),n&&(n.leftColIds.forEach((e=>{d(e).pinned="left"})),n.rightColIds.forEach((e=>{d(e).pinned="right"}))),r&&r.hiddenColIds.forEach((e=>{d(e).hide=!0})),l&&l.columnSizingModel.forEach((({colId:e,flex:t,width:i})=>{const s=d(e);s.flex=t??null,s.width=i}));const c=a?.orderedColIds,u=!!c?.length,g=u?c.map((e=>d(e))):Object.values(h);if(g.length){this.columnStates=g;const e={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnApplyStateService.applyColumnState({state:g,applyOrder:u,defaultState:e},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,this.pivotResultColsService.isPivotResultColsPresent()){if(t){const i=[];for(const e of t)this.pivotResultColsService.getPivotResultCol(e.colId)&&i.push(e);this.columnApplyStateService.applyColumnState({state:i,applyOrder:e},"gridInitializing")}i&&this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnGroupStateService.getColumnGroupState(),t=[];return e.forEach((({groupId:e,open:i})=>{i&&t.push(e)})),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){if(!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const t=new Set(e.columnGroup?.openColumnGroupIds),i=this.columnGroupStateService.getColumnGroupState().map((({groupId:e})=>{const i=t.has(e);return i&&t.delete(e),{groupId:e,open:i}}));t.forEach((e=>{i.push({groupId:e,open:!0})})),i.length&&(this.columnGroupStates=i),this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}getFilterState(){let e=this.filterManager?.getFilterModel();e&&0===Object.keys(e).length&&(e=void 0);const t=this.filterManager?.getAdvancedFilterModel()??void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:s}=e??{advancedFilterModel:t};i&&this.filterManager?.setFilterModel(i,"columnFilter"),s&&this.filterManager?.setAdvancedFilterModel(s)}getRangeSelectionState(){const e=this.rangeService?.getCellRanges().map((e=>{const{id:t,type:i,startRow:s,endRow:o,columns:n,startColumn:r}=e;return{id:t,type:i,startRow:s,endRow:o,colIds:n.map((e=>e.getColId())),startColId:r.getColId()}}));return e?.length?{cellRanges:e}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach((e=>{const i=[];if(e.colIds.forEach((e=>{const t=this.columnModel.getCol(e);t&&i.push(t)})),!i.length)return;let s=this.columnModel.getCol(e.startColId);if(!s){const e=this.visibleColsService.getAllCols(),t=new Set(i);s=e.find((e=>t.has(e)))}t.push({...e,columns:i,startColumn:s})})),this.rangeService.setCellRanges(t)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.ctrlsService.getGridBodyCtrl()?.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:i}=e?.getVScrollPosition()??{top:0};return i||t?{top:i,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:i}=e;this.ctrlsService.getGridBodyCtrl()?.getScrollFeature().setScrollPosition(t,i)}getSideBarState(){return this.sideBarService?.getSideBarComp()?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getCol(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){if(!this.paginationService)return;const e=this.paginationService.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationService.getPageSize();return e||t?{page:e,pageSize:t}:void 0}setPaginationState(e){this.paginationService&&(e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationService.setPageSize(e.pageSize,"initialState"),"number"==typeof e.page&&this.paginationService.setPage(e.page))}getRowSelectionState(){const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(!1===e.selectAll||!1===e.selectAllChildren)&&!e?.toggledNodes?.length?void 0:e}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach((([e,t])=>{z(t,this.cachedState[e])||(i=!0)})),this.cachedState={...this.cachedState,...t},i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),z(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){this.staleStateKeys.forEach((e=>{if("rowSelection"===e)this.setCachedStateValue(e,this.getRowSelectionState())})),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach((e=>this.queuedUpdateSources.add(e))),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:"stateUpdated",sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout((()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))}))}}]},oh={version:cn,moduleName:"@ag-grid-community/state",dependantModules:[sh,{version:cn,moduleName:"@ag-grid-community/state-api",apiFunctions:{getState:function(e){return e.stateService?.getState()??{}}},dependantModules:[sh]}]};function nh(e,t,i){e.addManagedElementListeners(t,{keydown:e=>{if(!e.defaultPrevented&&e.key===is.TAB){const s=e.shiftKey;i.findNextFocusableElement(t,!1,s)||i.focusNextGridCoreContainer(s)&&e.preventDefault()}}})}var rh={selector:"AG-PAGE-SIZE-SELECTOR",component:class extends Wi{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationService.getPageSize()||(this.paginationService.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.paginationService=e.paginationService}postConstruct(){this.addManagedPropertyListener("paginationPageSizeSelector",(()=>{this.onPageSizeSelectorValuesChange()})),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.paginationService.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){wi(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&!1!==this.gos.get("paginationPageSizeSelector")}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationService.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),de("The paginationPageSize grid option is set to a value that is not in the list of page size options.\n Please make sure that the paginationPageSize grid option is set to one of the values in the \n paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.")),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp));const s=this.localeService.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),n=e.map((e=>({value:String(e),text:String(e)}))),r=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new So).addOptions(n).setValue(String(i?"":t)).setAriaLabel(r).setLabel(o).onValueChange((()=>this.handlePageSizeItemSelected())),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get("paginationPageSizeSelector");return Array.isArray(t)&&this.validateValues(t)?[...t].sort(((e,t)=>e-t)):e}validateValues(e){if(!e.length)return de("The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.\n If you want to hide the page size selector, please set the paginationPageSizeSelector to false."),!1;for(let t=0;t<e.length;t++){const i=e[t],s=i>0;if(!("number"==typeof i))return de("The paginationPageSizeSelector grid option contains a non-numeric value.\n Please make sure that all values in the paginationPageSizeSelector array are numbers."),!1;if(!s)return de("The paginationPageSizeSelector grid option contains a negative number or zero.\n Please make sure that all values in the paginationPageSizeSelector array are positive."),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}}},lh={selector:"AG-PAGINATION",component:class extends ha{constructor(){super(),this.btFirst=Vi,this.btPrevious=Vi,this.btNext=Vi,this.btLast=Vi,this.lbRecordCount=Vi,this.lbFirstRowOnPage=Vi,this.lbLastRowOnPage=Vi,this.lbCurrent=Vi,this.lbTotal=Vi,this.pageSizeComp=Vi,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1}wireBeans(e){this.rowNodeBlockLoader=e.rowNodeBlockLoader,this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.focusService=e.focusService}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[rh]);const{btFirst:t,btPrevious:i,btNext:s,btLast:o}=this;this.activateTabIndex([t,i,s,o]),t.insertAdjacentElement("afterbegin",Ui(e?"last":"first",this.gos)),i.insertAdjacentElement("afterbegin",Ui(e?"next":"previous",this.gos)),s.insertAdjacentElement("afterbegin",Ui(e?"previous":"next",this.gos)),o.insertAdjacentElement("afterbegin",Ui(e?"first":"last",this.gos)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],(()=>this.onPageSizeRelatedOptionsChange())),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>{this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(e):this.focusService.focusGridInnerElement(e)},forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const e=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(e),e&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)}),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach((e=>{const{el:t,fn:i}=e;this.addManagedListeners(t,{click:i,keydown:e=>{e.key!==is.ENTER&&e.key!==is.SPACE||(e.preventDefault(),i())}})})),nh(this,this.getGui(),this.focusService),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationService.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationService.getTotalPages()>0,t=this.paginationService.getCurrentPage(),i=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(i)}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");if(t){return t({value:e})}const i=this.localeService.getLocaleTextFunc();return Uo(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),o=e("firstPage","First Page"),n=e("previousPage","Previous Page"),r=e("nextPage","Next Page"),l=e("lastPage","Last Page"),a=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${a}">\n <ag-page-size-selector data-ref="pageSizeComp"></ag-page-size-selector>\n <span class="ag-paging-row-summary-panel" role="status">\n <span id="ag-${a}-first-row" data-ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-${a}-to">${i}</span>\n <span id="ag-${a}-last-row" data-ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n <span id="ag-${a}-of">${s}</span>\n <span id="ag-${a}-row-count" data-ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n </span>\n <span class="ag-paging-page-summary-panel" role="presentation">\n <div data-ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n <div data-ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>\n <span class="ag-paging-description" role="status">\n <span id="ag-${a}-start-page">${t}</span>\n <span id="ag-${a}-start-page-number" data-ref="lbCurrent" class="ag-paging-number"></span>\n <span id="ag-${a}-of-page">${s}</span>\n <span id="ag-${a}-of-page-number" data-ref="lbTotal" class="ag-paging-number"></span>\n </span>\n <div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n <div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${l}"></div>\n </span>\n </div>`}onBtNext(){this.nextButtonDisabled||this.paginationService.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationService.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationService.goToLastPage()}enableOrDisableButtons(){const e=this.paginationService.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),i=this.paginationService.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===i-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){xt(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationService.getCurrentPage(),t=this.paginationService.getPageSize(),i=this.rowModel.isLastRowIndexKnown(),s=this.rowModel.isLastRowIndexKnown()?this.paginationService.getMasterRowCount():null;let o,n;if(this.isZeroPagesToDisplay()?o=n=0:(o=t*e+1,n=o+t-1,i&&n>s&&(n=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader?.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(n)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages(),i=e?this.paginationService.getMasterRowCount():null;if(1===i){const e=this.rowModel.getRow(0);if(e&&e.group&&!(e.groupData||e.aggData))return void this.setTotalLabelsToZero()}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}}},ah={version:cn,moduleName:"@ag-grid-community/pagination-core",beans:[class extends I{constructor(){super(...arguments),this.beanName="paginationService",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return lh}isPaginateChildRows(){return!(!this.gos.get("groupRemoveSingleChildren")&&!this.gos.get("groupRemoveLowestSingleChildren"))||this.gos.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){this.active&&this.currentPage!==e&&"number"==typeof this.currentPage&&(this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0}))}isRowPresent(e){return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){if(!this.active)return!0;return this.getPageForIndex(e.rowIndex)===this.currentPage}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return k(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:k(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:k(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:k(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(void 0===this.pageSizeAutoCalculated)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,0!==this.currentPage&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,0!==this.currentPage&&this.goToFirstPage()}i!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:i=!1,newPageSize:s=!1}=e,o={type:"paginationChanged",animate:!1,newData:!1,newPage:i,newPageSize:s,keepRenderedRows:t};this.eventService.dispatchEvent(o)}},class extends I{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}postConstruct(){this.ctrlsService.whenReady((e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()}))}notActive(){return!this.gos.get("paginationAutoPageSize")||null==this.centerRowsCtrl}onPaginationAutoSizeChanged(){this.notActive()?this.paginationService.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=Math.max(this.gos.getRowHeightAsNumber(),1),i=Math.floor(e/t);this.paginationService.setPageSize(i,"autoCalculated")};this.isBodyRendered?fe((()=>t()),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}}]},hh={version:cn,moduleName:"@ag-grid-community/pagination",dependantModules:[ah,{version:cn,moduleName:"@ag-grid-community/pagination-api",dependantModules:[ah],apiFunctions:{paginationIsLastPageFound:function(e){return e.rowModel.isLastRowIndexKnown()},paginationGetPageSize:function(e){return e.paginationService?.getPageSize()??100},paginationGetCurrentPage:function(e){return e.paginationService?.getCurrentPage()??0},paginationGetTotalPages:function(e){return e.paginationService?.getTotalPages()??1},paginationGetRowCount:function(e){return e.paginationService?e.paginationService.getMasterRowCount():e.rowModel.getRowCount()},paginationGoToNextPage:function(e){e.paginationService?.goToNextPage()},paginationGoToPreviousPage:function(e){e.paginationService?.goToPreviousPage()},paginationGoToFirstPage:function(e){e.paginationService?.goToFirstPage()},paginationGoToLastPage:function(e){e.paginationService?.goToLastPage()},paginationGoToPage:function(e,t){e.paginationService?.goToPage(t)}}}]},dh="@ag-grid-community/core",ch="@ag-grid-community/client-side-row-model",uh="@ag-grid-community/csv-export",gh="@ag-grid-community/infinite-row-model",ph="@ag-grid-enterprise/advanced-filter",mh="@ag-grid-enterprise/charts",Ch="@ag-grid-enterprise/clipboard",fh="@ag-grid-enterprise/excel-export",vh="@ag-grid-enterprise/master-detail",wh="@ag-grid-enterprise/menu",Sh="@ag-grid-enterprise/range-selection",yh="@ag-grid-enterprise/row-grouping",bh="@ag-grid-enterprise/server-side-row-model",Rh="@ag-grid-enterprise/side-bar",Fh={dispatchEvent:dh,getState:dh,getGridId:dh,destroy:dh,isDestroyed:dh,getGridOption:dh,setGridOption:dh,updateGridOptions:dh,setNodesSelected:dh,selectAll:dh,deselectAll:dh,selectAllFiltered:dh,deselectAllFiltered:dh,selectAllOnCurrentPage:dh,deselectAllOnCurrentPage:dh,getSelectedNodes:dh,getSelectedRows:dh,redrawRows:dh,setRowNodeExpanded:dh,getRowNode:dh,addRenderedRowListener:dh,getRenderedNodes:dh,forEachNode:dh,getFirstDisplayedRow:dh,getFirstDisplayedRowIndex:dh,getLastDisplayedRow:dh,getLastDisplayedRowIndex:dh,getDisplayedRowAtIndex:dh,getDisplayedRowCount:dh,getModel:dh,getVerticalPixelRange:dh,getHorizontalPixelRange:dh,ensureColumnVisible:dh,ensureIndexVisible:dh,ensureNodeVisible:dh,getFocusedCell:dh,clearFocusedCell:dh,setFocusedCell:dh,tabToNextCell:dh,tabToPreviousCell:dh,setFocusedHeader:dh,addEventListener:dh,addGlobalListener:dh,removeEventListener:dh,removeGlobalListener:dh,expireValueCache:dh,getValue:dh,getCellValue:dh,showColumnMenuAfterButtonClick:dh,showColumnMenuAfterMouseClick:dh,showColumnMenu:dh,hidePopupMenu:dh,onSortChanged:dh,getPinnedTopRowCount:dh,getPinnedBottomRowCount:dh,getPinnedTopRow:dh,getPinnedBottomRow:dh,showLoadingOverlay:dh,showNoRowsOverlay:dh,hideOverlay:dh,setGridAriaProperty:dh,refreshCells:dh,flashCells:dh,refreshHeader:dh,isAnimationFrameQueueEmpty:dh,flushAllAnimationFrames:dh,getSizesForCurrentTheme:dh,getCellRendererInstances:dh,addRowDropZone:dh,removeRowDropZone:dh,getRowDropZoneParams:dh,getColumnDef:dh,getColumnDefs:dh,sizeColumnsToFit:dh,setColumnGroupOpened:dh,getColumnGroup:dh,getProvidedColumnGroup:dh,getDisplayNameForColumn:dh,getDisplayNameForColumnGroup:dh,getColumn:dh,getColumns:dh,applyColumnState:dh,getColumnState:dh,resetColumnState:dh,getColumnGroupState:dh,setColumnGroupState:dh,resetColumnGroupState:dh,isPinning:dh,isPinningLeft:dh,isPinningRight:dh,getDisplayedColAfter:dh,getDisplayedColBefore:dh,setColumnVisible:dh,setColumnsVisible:dh,setColumnPinned:dh,setColumnsPinned:dh,getAllGridColumns:dh,getDisplayedLeftColumns:dh,getDisplayedCenterColumns:dh,getDisplayedRightColumns:dh,getAllDisplayedColumns:dh,getAllDisplayedVirtualColumns:dh,moveColumn:dh,moveColumnByIndex:dh,moveColumns:dh,setColumnWidth:dh,setColumnWidths:dh,getLeftDisplayedColumnGroups:dh,getCenterDisplayedColumnGroups:dh,getRightDisplayedColumnGroups:dh,getAllDisplayedColumnGroups:dh,autoSizeColumn:dh,autoSizeColumns:dh,autoSizeAllColumns:dh,undoCellEditing:dh,redoCellEditing:dh,getCellEditorInstances:dh,getEditingCells:dh,stopEditing:dh,startEditingCell:dh,getCurrentUndoSize:dh,getCurrentRedoSize:dh,isAnyFilterPresent:dh,onFilterChanged:dh,isColumnFilterPresent:dh,getFilterInstance:dh,getColumnFilterInstance:dh,destroyFilter:dh,setFilterModel:dh,getFilterModel:dh,getColumnFilterModel:dh,setColumnFilterModel:dh,showColumnFilter:dh,isQuickFilterPresent:dh,getQuickFilter:dh,resetQuickFilter:dh,paginationIsLastPageFound:dh,paginationGetPageSize:dh,paginationGetCurrentPage:dh,paginationGetTotalPages:dh,paginationGetRowCount:dh,paginationGoToNextPage:dh,paginationGoToPreviousPage:dh,paginationGoToFirstPage:dh,paginationGoToLastPage:dh,paginationGoToPage:dh,expandAll:dh,collapseAll:dh,onRowHeightChanged:dh,setRowCount:dh,getCacheBlockState:dh,onGroupExpandedOrCollapsed:ch,refreshClientSideRowModel:ch,forEachLeafNode:ch,forEachNodeAfterFilter:ch,forEachNodeAfterFilterAndSort:ch,resetRowHeights:ch,applyTransaction:ch,applyTransactionAsync:ch,flushAsyncTransactions:ch,getBestCostNodeSelection:ch,getDataAsCsv:uh,exportDataAsCsv:uh,refreshInfiniteCache:gh,purgeInfiniteCache:gh,getInfiniteRowCount:gh,isLastRowIndexKnown:gh,getAdvancedFilterModel:ph,setAdvancedFilterModel:ph,showAdvancedFilterBuilder:ph,hideAdvancedFilterBuilder:ph,getChartModels:mh,getChartRef:mh,getChartImageDataURL:mh,downloadChart:mh,openChartToolPanel:mh,closeChartToolPanel:mh,createRangeChart:mh,createPivotChart:mh,createCrossFilterChart:mh,updateChart:mh,restoreChart:mh,copyToClipboard:Ch,cutToClipboard:Ch,copySelectedRowsToClipboard:Ch,copySelectedRangeToClipboard:Ch,copySelectedRangeDown:Ch,pasteFromClipboard:Ch,getDataAsExcel:fh,exportDataAsExcel:fh,getSheetDataForExcel:fh,getMultipleSheetsAsExcel:fh,exportMultipleSheetsAsExcel:fh,addDetailGridInfo:vh,removeDetailGridInfo:vh,getDetailGridInfo:vh,forEachDetailGridInfo:vh,showContextMenu:wh,showColumnChooser:wh,hideColumnChooser:wh,getCellRanges:Sh,addCellRange:Sh,clearRangeSelection:Sh,addAggFunc:yh,addAggFuncs:yh,clearAggFuncs:yh,setColumnAggFunc:yh,isPivotMode:yh,getPivotResultColumn:yh,setValueColumns:yh,getValueColumns:yh,removeValueColumn:yh,removeValueColumns:yh,addValueColumn:yh,addValueColumns:yh,setRowGroupColumns:yh,removeRowGroupColumn:yh,removeRowGroupColumns:yh,addRowGroupColumn:yh,addRowGroupColumns:yh,getRowGroupColumns:yh,moveRowGroupColumn:yh,setPivotColumns:yh,removePivotColumn:yh,removePivotColumns:yh,addPivotColumn:yh,addPivotColumns:yh,getPivotColumns:yh,setPivotResultColumns:yh,getPivotResultColumns:yh,getServerSideSelectionState:bh,setServerSideSelectionState:bh,applyServerSideTransaction:bh,applyServerSideTransactionAsync:bh,applyServerSideRowData:bh,retryServerSideLoads:bh,flushServerSideAsyncTransactions:bh,refreshServerSide:bh,getServerSideGroupLevelState:bh,isSideBarVisible:Rh,setSideBarVisible:Rh,setSideBarPosition:Rh,openToolPanel:Rh,closeToolPanel:Rh,getOpenedToolPanel:Rh,refreshToolPanel:Rh,isToolPanelShowing:Rh,getToolPanelInstance:Rh,getSideBar:Rh,getStatusPanel:"@ag-grid-enterprise/status-bar"},Ph="clientSide",Eh="serverSide",Dh="infinite",Mh={onGroupExpandedOrCollapsed:[Ph],refreshClientSideRowModel:[Ph],forEachLeafNode:[Ph],forEachNodeAfterFilter:[Ph],forEachNodeAfterFilterAndSort:[Ph],resetRowHeights:[Ph],applyTransaction:[Ph],applyTransactionAsync:[Ph],flushAsyncTransactions:[Ph],getBestCostNodeSelection:[Ph],getServerSideSelectionState:[Eh],setServerSideSelectionState:[Eh],applyServerSideTransaction:[Eh],applyServerSideTransactionAsync:[Eh],applyServerSideRowData:[Eh],retryServerSideLoads:[Eh],flushServerSideAsyncTransactions:[Eh],refreshServerSide:[Eh],getServerSideGroupLevelState:[Eh],refreshInfiniteCache:[Dh],purgeInfiniteCache:[Dh],getInfiniteRowCount:[Dh],isLastRowIndexKnown:[Dh],expandAll:[Ph,Eh],collapseAll:[Ph,Eh],onRowHeightChanged:[Ph,Eh],setRowCount:[Dh,Eh],getCacheBlockState:[Dh,Eh]},xh={getValue:{version:"v31.3",new:"getCellValue"},getFirstDisplayedRow:{version:"v31.1",new:"getFirstDisplayedRowIndex"},getLastDisplayedRow:{version:"v31.1",new:"getLastDisplayedRowIndex"},getModel:{version:"v31.1",message:"Please use the appropriate grid API methods instead."},setColumnVisible:{version:"v31.1",old:"setColumnVisible(key,visible)",new:"setColumnsVisible([key],visible)"},setColumnPinned:{version:"v31.1",old:"setColumnPinned(key,pinned)",new:"setColumnsPinned([key],pinned)"},moveColumn:{version:"v31.1",old:"moveColumn(key, toIndex)",new:"moveColumns([key], toIndex)"},setColumnWidth:{version:"v31.1",old:"setColumnWidth(col, width)",new:"setColumnWidths([{key: col, newWidth: width}])"},autoSizeColumn:{version:"v31.1",old:"autoSizeColumn(key, skipHeader)",new:"autoSizeColumns([key], skipHeader)"},addAggFunc:{version:"v31.1",old:"addAggFunc(key, func)",new:"addAggFuncs({ key: func })"},removeValueColumn:{version:"v31.1",old:"removeValueColumn(colKey)",new:"removeValueColumns([colKey])"},addValueColumn:{version:"v31.1",old:"addValueColumn(colKey)",new:"addValueColumns([colKey])"},removeRowGroupColumn:{version:"v31.1",old:"removeRowGroupColumn(colKey)",new:"removeRowGroupColumns([colKey])"},addRowGroupColumn:{version:"v31.1",old:"addRowGroupColumn(colKey)",new:"addRowGroupColumns([colKey])"},removePivotColumn:{version:"v31.1",old:"removePivotColumn(colKey)",new:"removePivotColumns([colKey])"},addPivotColumn:{version:"v31.1",old:"addPivotColumn(colKey)",new:"addPivotColumns([colKey])"},showColumnMenuAfterButtonClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere."},showColumnMenuAfterMouseClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere."},getFilterInstance:{version:"v31.1",message:"'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."},showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'}};var Th=(e,t)=>"clientSide"===(t.rowModelType??"clientSide")?{module:"@ag-grid-enterprise/row-grouping"}:null,Ah={enableRowGroup:Th,rowGroup:Th,rowGroupIndex:Th,enablePivot:Th,enableValue:Th,pivot:Th,pivotIndex:Th,aggFunc:Th,cellEditor:e=>"agRichSelect"===e.cellEditor||"agRichSelectCellEditor"===e.cellEditor?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some((e=>t.includes(e)))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>"multiple"===t?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>Ih},Ih={objectName:"colDef",allProperties:Object.keys({headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0}),docsUrl:"column-properties/",deprecations:{columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"}},validations:Ah},Lh={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:"\t",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0},Oh={version:cn,moduleName:"@ag-grid-community/core"},kh={version:cn,moduleName:"@ag-grid-community/core-validations",beans:[class extends I{constructor(){super(...arguments),this.beanName="validationService"}wireBeans(e){this.beans=e,this.gridOptions=e.gridOptions}postConstruct(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,{objectName:"gridOptions",allProperties:[...st.ALL_PROPERTIES,...nt.EVENT_CALLBACKS],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:{advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."},suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."}},validations:{sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const i=`treeData requires 'getDataPath' in the ${t} row model.`;return e.getDataPath?null:i}case"serverSide":{const i=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:i}}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{switch(e.rowModelType??"clientSide"){case"clientSide":return null;case"serverSide":{const t="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return e.suppressServerSideInfiniteScroll?t:null}}return null}},groupHideOpenParents:{supportedRowModels:["clientSide"],dependencies:{groupTotalRow:[void 0,"bottom"]}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>Ih,defaultColDef:()=>Ih,defaultColGroupDef:()=>Ih,autoGroupColumnDef:()=>Ih}})}processColumnDefs(e){this.processOptions(e,Ih)}warnMissingApiFunction(e){!function(e,t){const i=Fh[e];i?Zi.__assertRegistered(i,`api.${e}`,t)&&de(`API function '${e}' not registered to module '${i}'`):ce(`Unknown API function: '${e}' on GridApi.`)}(e,this.gridId)}validateApiFunction(e,t){return function(e,t,i){const s=xh[e];if(s){const{version:i,new:o,old:n,message:r}=s,l=n??e;return(...e)=>(de(`Since ${i} api.${l} is deprecated. ${o?`Please use ${o} instead. `:""}${r??""}`),t.apply(t,e))}const o=Mh[e];return o?(...s)=>{const n=i.rowModel.getType();if(o.includes(n))return t.apply(t,s);ce(`api.${e} can only be called when gridOptions.rowModelType is ${o.join(" or ")}`)}:t}(e,t,this.beans)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:o,propertyExceptions:n,objectName:r,docsUrl:l}=t;o&&!0!==this.gridOptions.suppressPropertyNamesCheck&&this.checkProperties(e,[...n??[],...Object.keys(s)],o,r,l);const a=new Set;Object.keys(e).forEach((t=>{const o=s[t];if(o)if("renamed"in o){const{renamed:i,version:s}=o;a.add(`As of v${s}, ${String(t)} is deprecated. Please use ${String(i)} instead.`),e[i]=e[t]}else{const{message:e,version:i}=o;a.add(`As of v${i}, ${String(t)} is deprecated. ${e??""}`)}const n=e[t];if(null==n||!1===n)return;const r=i[t];let l;if(!r)return;if("function"==typeof r){const i=r(e,this.gridOptions);if(!i)return;if("objectName"in i){const s=e[t];return Array.isArray(s)?void s.forEach((e=>{this.processOptions(e,i)})):void this.processOptions(e[t],i)}l=i}else l=r;const{module:h,dependencies:d,supportedRowModels:c}=l;if(c){const e=this.gridOptions.rowModelType??"clientSide";if(!c.includes(e))return void a.add(`${String(t)} is not supported with the '${e}' row model.`)}if(h){const e=Array.isArray(h)?h:[h];let i=!0;if(e.forEach((e=>{Zi.__assertRegistered(e,String(t),this.gridId)||(i=!1,a.add(`${String(t)} is only available when ${e} is loaded.`))})),!i)return}if(d){const i=this.checkForWarning(t,d,e);if(i)return void a.add(i)}})),a.size>0&&a.forEach((e=>{de(e)}))}checkForWarning(e,t,i){if("function"==typeof t)return t(i,this.gridOptions);const s=Object.entries(t).find((([e,t])=>{const s=i[e];return!t.includes(s)}));if(!s)return null;const[o,n]=s;return n.length>1?`'${String(e)}' requires '${o}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${o}' to be ${n[0]}.`}checkProperties(e,t,i,s,o){const n=function(e,t,i){const s={},o=e.filter((e=>!t.some((t=>t===e))));return o.length>0&&o.forEach((e=>s[e]=Cs(e,i).values)),s}(Object.getOwnPropertyNames(e),["__ob__","__v_skip","__metadata__",...t,...i],i);if($(n,((e,t)=>{let o=`invalid ${s} property '${e}' did you mean any of these: ${t.slice(0,8).join(", ")}.`;i.includes("context")&&(o+=`\nIf you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),de(o)})),Object.keys(n).length>0&&o){const e=this.getFrameworkOverrides().getDocLink(o);de(`to see all the valid ${s} properties please check: ${e}`)}}}]},Gh={version:cn,moduleName:"@ag-grid-community/core-community-features",dependantModules:[Oh,kh,$l,Dn,oh,Qa,$a,hh,ih]},Nh=class extends I{constructor(){super(...arguments),this.beanName="gridDestroyService",this.destroyCalled=!1}wireBeans(e){this.beans=e}destroy(){if(this.destroyCalled)return;const e={type:"gridPreDestroyed",state:this.beans.stateService?.getState()??{}};this.eventService.dispatchEvent(e),this.destroyCalled=!0,this.beans.ctrlsService.get("gridCtrl")?.destroyGridUi(),this.beans.context.destroy(),super.destroy()}isDestroyCalled(){return this.destroyCalled}},Hh=new Set(["gridPreDestroyed","fillStart","pasteStart"]),Bh=e=>"checkboxSelected"===e||"rowClicked"===e||"spaceKey"===e||"uiSelectAll"===e||"uiSelectAllCurrentPage"===e||"uiSelectAllFiltered"===e,Vh=new Map([...st.BOOLEAN_PROPERTIES.map((e=>[e,W])),...st.NUMBER_PROPERTIES.map((e=>[e,Vo])),["groupAggFiltering",e=>"function"==typeof e?e:W(e)],["pageSize",Wo(1)],["autoSizePadding",Wo(0)],["keepDetailRowsCount",Wo(1)],["rowBuffer",Wo(0)],["infiniteInitialRowCount",Wo(1)],["cacheOverflowSize",Wo(1)],["cacheBlockSize",Wo(1)],["serverSideInitialRowCount",Wo(1)],["viewportRowModelPageSize",Wo(1)],["viewportRowModelBufferSize",Wo(0)]]);function Wh(e,t){const i=Vh.get(e);return i?i(t):t}var zh=class e extends I{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new h,this.globalEventHandlerFactory=e=>(t,i)=>{if(!this.isAlive())return;const s=Hh.has(t);if(s&&!e||!s&&e)return;const o=nt.getCallbackForEvent(t),n=this.gridOptions[o];"function"==typeof n&&this.frameworkOverrides.wrapOutgoing((()=>{n(i)}))}}wireBeans(e){this.gridOptions=e.gridOptions,this.eGridDiv=e.eGridDiv,this.validationService=e.validationService,this.environment=e.environment,this.api=e.gridApi}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth(),this.addManagedEventListeners({gridOptionsChanged:({options:e})=>{this.updateGridOptions({options:e,force:!0,source:"gridOptionsUpdated"})}})}get(e){return this.gridOptions[e]??Lh[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return k(this.gridOptions[e])}mergeGridCommonParams(e){if(e){return t=>{const i=t;return i.api=this.api,i.context=this.gridOptionsContext,e(i)}}return e}updateGridOptions({options:t,force:i,source:s="api"}){const o={id:e.changeSetId++,properties:[]},n=[];Object.entries(t).forEach((([e,t])=>{"api"===s&&tt[e]&&de(`${e} is an initial property and cannot be updated.`);const r=Wh(e,t),l=i||"object"==typeof r&&"api"===s,a=this.gridOptions[e];if(l||a!==r){this.gridOptions[e]=r;const t={type:e,currentValue:r,previousValue:a,changeSet:o,source:s};n.push(t)}})),this.validationService?.processGridOptions(this.gridOptions),o.properties=n.map((e=>e.type)),n.forEach((e=>{this.gridOptions.debug&&he(`Updated property ${e.type} from`,e.previousValue," to ",e.currentValue),this.propertyEventService.dispatchEvent(e)}))}addPropertyEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removePropertyEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:(null==mt&&ti(),mt);null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&G(this.gridOptions.rowModelType)}isDomLayout(e){return(this.gridOptions.domLayout??"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const s={node:e,data:e.data},o=this.getCallback("getRowHeight")(s);if(this.isNumeric(o))return 0===o&&de("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,o),estimated:!1}}if(e.detail&&this.get("masterDetail"))return this.getMasterDetailRowHeight();return{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||G(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(de("row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const s=this.getDomDataKey();let o=e[s];G(o)&&(o={},e[s]=o),o[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&k(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&k(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return k(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.get("ensureDomOrder")&&this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!e?.comparator&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):!0===e?()=>!0:void 0}getGrandTotalRow(){const e=this.gridOptions.grandTotalRow;if(e)return e;return this.gridOptions.groupIncludeTotalFooter?"bottom":void 0}getGroupTotalRowCallback(){const e=this.get("groupTotalRow");if("function"==typeof e)return this.getCallback("groupTotalRow");if(e)return()=>e;const t=this.get("groupIncludeFooter");if("function"==typeof t){const e=this.getCallback("groupIncludeFooter");return t=>e(t)?"bottom":void 0}return()=>t?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?"multipleColumns"===this.gridOptions.groupDisplayType:this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&"groupRows"===this.gridOptions.groupDisplayType}getGridCommonParams(){return{api:this.api,context:this.gridOptionsContext}}addGridCommonParams(e){const t=e;return t.api=this.api,t.context=this.gridOptionsContext,t}getRowIdCallback(){const e=this.getCallback("getRowId");return void 0===e?e:t=>{let i=e(t);return"string"!=typeof i&&(de("The getRowId callback must return a string. The ID ",i," is being cast to a string."),i=String(i)),i}}};zh.changeSetId=0;var _h=zh,Uh=class extends I{constructor(){super(...arguments),this.beanName="headerPositionUtils"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}findHeader(e,t){let i,s;if(je(e.column)?i=this.visibleColsService.getGroupAtDirection(e.column,t):(s=`getCol${t}`,i=this.visibleColsService[s](e.column)),!i)return;const{headerRowIndex:o}=e;if("filter"!==this.getHeaderRowType(o)){const e=[i];for(;i.getParent();)i=i.getParent(),e.push(i);i=e[e.length-1-o]}const{column:n,headerRowIndex:r}=this.getHeaderIndexToFocus(i,o);return{column:n,headerRowIndex:r}}getHeaderIndexToFocus(e,t){let i;if(je(e)&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let o=i;for(;o!==s;)t++,o=o.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some((e=>e.isSpanHeaderHeight()))}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s="column"===i;let o="filter"===i?e:e.getParent(),n=t-1,r=n;if(s&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;o&&o.isPadding();)o=o.getParent(),n--;r=n,n<0&&(o=e,n=t,r=void 0)}return{column:o,headerRowIndex:n,headerRowIndexWithoutSpan:r}}getColumnVisibleChild(e,t,i="After"){let s=e,o=t+1;const n=o;if("group"===this.getHeaderRowType(t)){const t=e.getDisplayedLeafColumns(),n="After"===i?t[0]:c(t),r=[];let l=n;for(;l.getParent()!==e;)l=l.getParent(),r.push(l);if(s=n,n.isSpanHeaderHeight())for(let e=r.length-1;e>=0;e--){const t=r[e];if(!t.isPadding()){s=t;break}o++}else s=c(r),s||(s=n)}return{column:s,headerRowIndex:o,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.visibleColsService.getAllCols(),s=i["start"===t?0:i.length-1];if(!s)return;const o=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);if("group"==o){return{headerRowIndex:e,column:this.visibleColsService.getColGroupAtLevel(s,e)}}return{headerRowIndex:null==o?-1:e,column:s}}},Kh=class extends I{constructor(){super(...arguments),this.beanName="localeService"}getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(t,i,s)=>e({key:t,defaultValue:i,variableValues:s});const t=this.gos.get("localeText");return(e,i,s)=>{let o=t&&t[e];if(o&&s&&s.length){let e=0;for(;!(e>=s.length);){if(-1===o.indexOf("${variable}"))break;o=o.replace("${variable}",s[e++])}}return o??i}}},$h=class extends I{constructor(){super(...arguments),this.beanName="apiEventService",this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new L(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=this.gos.useAsyncEvents()&&!Hh.has(e),o=s?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){const i=this.frameworkEventWrappingService.unwrap(t),s=this.asyncEventListeners.get(e),o=!!s?.delete(i);o||this.syncEventListeners.get(e)?.delete(i),this.eventService.removeEventListener(e,i,o)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const i=(e,i)=>{Hh.has(e)&&t(e,i)},s=(e,i)=>{Hh.has(e)||t(e,i)};this.globalEventListenerPairs.set(e,{syncListener:i,asyncListener:s}),this.eventService.addGlobalListener(i,!1),this.eventService.addGlobalListener(s,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:i,asyncListener:s}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(i,!1),this.eventService.removeGlobalListener(s,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach(((e,i)=>{e.forEach((e=>this.eventService.removeEventListener(i,e,t))),e.clear()})),e.clear()}destroyGlobalListeners(e,t){e.forEach((e=>this.eventService.removeGlobalListener(e,t))),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach((({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)})),this.globalEventListenerPairs.clear()}},jh=class extends I{constructor(){super(...arguments),this.beanName="pageBoundsListener"}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages();const t={type:"paginationChanged",animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,newPageSize:!!e&&e.newPageSize,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}calculatePages(){this.paginationService?this.paginationService.calculatePages():this.pageBoundsService.calculateBounds(0,this.rowModel.getRowCount()-1)}},qh=class extends I{constructor(){super(...arguments),this.beanName="pageBoundsService",this.pixelOffset=0}wireBeans(e){this.rowModel=e.rowModel}getFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getCurrentPageHeight(){return G(this.topRowBounds)||G(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}calculateBounds(e,t){this.topRowBounds=this.rowModel.getRowBounds(e),this.topRowBounds&&(this.topRowBounds.rowIndex=e),this.bottomRowBounds=this.rowModel.getRowBounds(t),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=t),this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=k(this.topRowBounds)?this.topRowBounds.rowTop:0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},Yh=class extends I{constructor(){super(),this.beanName="ariaAnnouncementService",this.descriptionContainer=null,this.announceValue=fe(this.announceValue.bind(this),200)}wireBeans(e){this.eGridDiv=e.eGridDiv}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),Dt(t,"polite"),vt(t,"relevant","additions text"),function(e,t){vt(e,"atomic",t)}(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout((()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)}),50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(wi(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}},Qh=class extends I{constructor(){super(...arguments),this.beanName="columnAnimationService",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady((e=>this.gridBodyCtrl=e.gridBodyCtrl))}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush((()=>{this.active=!1}))}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push((()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)}))}flush(e){if(0===this.executeNextFuncs.length&&0===this.executeLaterFuncs.length)return void e();const t=e=>{for(;e.length;){const t=e.pop();t&&t()}};this.getFrameworkOverrides().wrapIncoming((()=>{window.setTimeout((()=>t(this.executeNextFuncs)),0),window.setTimeout((()=>{e(),t(this.executeLaterFuncs)}),200)}))}},Xh=class extends I{constructor(){super(...arguments),this.beanName="columnHoverService"}setMouseOver(e){this.selectedColumns=e;this.eventService.dispatchEvent({type:"columnHoverChanged"})}clearMouseOver(){this.selectedColumns=null;this.eventService.dispatchEvent({type:"columnHoverChanged"})}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}},Jh=class extends I{constructor(){super(...arguments),this.beanName="overlayService",this.state=0,this.showInitialOverlay=!0}wireBeans(e){this.userComponentFactory=e.userComponentFactory,this.rowModel=e.rowModel,this.columnModel=e.columnModel}postConstruct(){const e=()=>this.updateOverlayVisibility();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e}),this.addManagedPropertyListener("loading",e)}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,this.updateOverlayVisibility()}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos.get("loading");(e||void 0===e&&!this.gos.get("suppressLoadingOverlay"))&&this.doShowLoadingOverlay()}showNoRowsOverlay(){this.showInitialOverlay=!1,this.gos.get("loading")||this.gos.get("suppressNoRowsOverlay")||this.doShowNoRowsOverlay()}hideOverlay(){this.showInitialOverlay=!1,this.gos.get("loading")||this.doHideOverlay()}updateOverlayVisibility(){let e=this.gos.get("loading");this.showInitialOverlay&&void 0===e&&!this.gos.get("suppressLoadingOverlay")&&(e=!this.gos.get("columnDefs")||!this.columnModel.isReady()||!this.gos.get("rowData")&&this.gos.isRowModelType("clientSide")),e?1!==this.state&&this.doShowLoadingOverlay():(this.showInitialOverlay=!1,this.rowModel.isEmpty()&&!this.gos.get("suppressNoRowsOverlay")&&this.gos.isRowModelType("clientSide")?2!==this.state&&this.doShowNoRowsOverlay():0!==this.state&&this.doHideOverlay())}doShowLoadingOverlay(){this.state=1,this.showOverlay(this.userComponentFactory.getLoadingOverlayCompDetails({}),"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}doShowNoRowsOverlay(){this.state=2,this.showOverlay(this.userComponentFactory.getNoRowsOverlayCompDetails({}),"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}doHideOverlay(){this.state=0,this.overlayWrapperComp.hideOverlay()}showOverlay(e,t,i){const s=e.newAgStackInstance();this.overlayWrapperComp.showOverlay(s,t,i)}},Zh=class extends I{constructor(){super(...arguments),this.beanName="rowCssClassCalculator"}wireBeans(e){this.stylingService=e.stylingService}getInitialRowClasses(e){const t=[];return k(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),b(t,this.processClassesFromGridOptions(e.rowNode)),b(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&t.push("ag-cell-last-left-pinned"),"right"===e.pinned&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach((e=>t.push(e)))},s=this.gos.get("rowClass");if(s){if("function"==typeof s)return de("rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gos.getCallback("getRowClass");if(o){i(o({data:e.data,node:e,rowIndex:e.rowIndex}))}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,(e=>{t.push(e)}),(()=>{})),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}},ed=class extends I{constructor(){super(...arguments),this.beanName="rowContainerHeightService",this.scrollY=0,this.uiBodyHeight=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=function(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=2*e;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}(),this.gos.get("debug")&&he("RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.gos.get("debug")&&he(`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}},td=class extends I{constructor(){super(...arguments),this.beanName="rowNodeSorter"}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.showRowGroupColsService=e.showRowGroupColsService}postConstruct(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",(e=>this.isAccentedSort=e.currentValue)),this.addManagedPropertyListener("autoGroupColumnDef",(()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup()))}doFullSort(e,t){const i=e.map(((e,t)=>({currentPos:t,rowNode:e})));return i.sort(this.compareRowNodes.bind(this,t)),i.map((e=>e.rowNode))}compareRowNodes(e,t,i){const s=t.rowNode,o=i.rowNode;for(let t=0,i=e.length;t<i;t++){const i=e[t],n="desc"===i.sort,r=this.getValue(s,i.column),l=this.getValue(o,i.column);let a;const h=this.getComparator(i,s);a=h?h(r,l,s,o,n):_(r,l,this.isAccentedSort);if(!isNaN(a)&&0!==a)return"asc"===i.sort?a:-1*a}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(null!=s)return s;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const n=this.columnModel.getColDefCol(o);return n?n.getColDef().comparator:void 0}getValue(e,t){if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const i=e.allLeafChildren?.[0];return i?this.valueService.getValue(t,i,!1,!1):void 0}const i=this.showRowGroupColsService?.getShowRowGroupCol(t.getId());if(!i)return;return e.groupData?.[i.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}},id=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const o=e.childrenAfterGroup[s];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach((e=>this.nodeIdsToColumns[i.id][e.getId()]=!0)),i=i.parent}linkPathItems(e,t){let i=e;for(let e=0;e<t;e++){const e=this.mapToItems[i.id],t=this.mapToItems[i.parent.id];t.children||(t.children=[]),t.children.push(e),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter((e=>i[e.getId()]))}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter((e=>!i[e.getId()]))}},sd=class extends I{constructor(){super(...arguments),this.beanName="selectionService",this.selectedNodes=new Map,this.selectionCtx=new ia}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.selectionCtx.init(this.rowModel),this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],(()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})})),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes(),this.selectionCtx.reset()}isMultiselect(){return"multiple"===this.rowSelection}overrideSelectionValue(e,t){if(!Bh(t))return e;const i=this.selectionCtx.getRoot();return!i||(i.isSelected()??!1)}setNodesSelected(e){const{newValue:t,clearSelection:i,suppressFinishActions:s,rangeSelect:o,nodes:n,event:r,source:l}=e;if(0===n.length)return 0;if(n.length>1&&!this.isMultiselect())return de("cannot multi select while rowSelection='single'"),0;const a=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,h=n.map((e=>e.footer?e.sibling:e));if(o){if(h.length>1)return de("cannot range select while selecting multiple rows"),0;const e=h[0],i=this.overrideSelectionValue(t,l);if(this.isMultiselect()){if(this.selectionCtx.isInRange(e)){const t=this.selectionCtx.truncate(e);return i&&this.selectRange(t.discard,!1,l),this.selectRange(t.keep,i,l)}if(this.selectionCtx.getRoot()!==e){const t=this.selectionCtx.extend(e,this.groupSelectsChildren);return i&&this.selectRange(t.discard,!1,l),this.selectRange(t.keep,i,l)}}else;}s||this.selectionCtx.setRoot(h[0]);let d=0;for(let e=0;e<h.length;e++){const i=h[e];if(!(a&&i.group)){i.selectThisNode(t,r,l)&&d++}this.groupSelectsChildren&&i.childrenAfterGroup?.length&&(d+=this.selectChildren(i,t,a,l))}if(!s){t&&(i||!this.isMultiselect())&&(d+=this.clearOtherNodes(h[0],l)),d>0&&(this.updateGroupsFromChildrenSelections(l),this.dispatchSelectionChanged(l))}return d}selectRange(e,t,i){let s=0;return e.forEach((e=>{if(e.group&&this.groupSelectsChildren)return;e.selectThisNode(t,void 0,i)&&s++})),s>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i)),s}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return G(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}getSelectedNodes(){const e=[];return this.selectedNodes.forEach((t=>{t&&e.push(t)})),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach((t=>{t&&t.data&&e.push(t.data)})),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach(((i,s)=>{i&&e(i)&&t.set(s,i)})),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const i=this.rowModel.getRootNode();t||(t=new id(!0,i)).setInactive();let s=!1;return t.forEachChangedNodeDepthFirst((t=>{if(t!==i){const i=t.calculateSelectedFromChildren();s=t.selectThisNode(null!==i&&i,void 0,e)||s}})),s}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach((o=>{if(o&&o.id!==e.id){const e=this.selectedNodes.get(o.id);s+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&i.set(o.parent.id,o.parent)}})),i.forEach((e=>{const i=e.calculateSelectedFromChildren();e.selectThisNode(null!==i&&i,void 0,t)})),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(k(t)&&e.id!==t.id&&t){const i=t.id;this.selectedNodes.get(i)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes?.clear()}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(i){for(let s=0,o=i.length;s<o;s++){const o=i[s];if(o.isSelected())t.push(o);else{const t=o;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return this.selectedNodes.forEach((t=>{t&&e++})),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,s),i="clientSide"===this.rowModel.getType(),{source:s,justFiltered:o,justCurrentPage:n}=e;if(n||o){if(!i)return void ce("selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(o,n).forEach(t)}else this.selectedNodes.forEach((e=>{e&&t(e)})),this.reset(s);this.selectionCtx.reset(),i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)}getSelectedCounts(e,t){let i=0,s=0;return this.getNodesToSelect(e,t).forEach((e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?i++:e.selectable&&s++)})),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return(0!==i||0!==s)&&(i>0&&s>0?null:i>0)}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter((e=>e.selectable)).length>0}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.forEachNodeOnPage((e=>{if(e.group)if(e.expanded)this.groupSelectsChildren||i.push(e);else{const t=e=>{i.push(e),e.childrenAfterFilter?.length&&e.childrenAfterFilter.forEach(t)};t(e)}else i.push(e)})),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter((e=>{i.push(e)})),i):(s.forEachNode((e=>{i.push(e)})),i)}forEachNodeOnPage(e){const t=this.pageBoundsService.getFirstRow(),i=this.pageBoundsService.getLastRow();for(let s=t;s<=i;s++){const t=this.rowModel.getRow(s);t&&e(t)}}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e,o=this.getNodesToSelect(i,s);o.forEach((e=>e.selectThisNode(!0,void 0,t))),this.selectionCtx.setRoot(o[0]??null),this.selectionCtx.setEndRange(c(o)??null),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.dispatchSelectionChanged(t)}getSelectionState(){const e=[];return this.selectedNodes.forEach((t=>{t?.id&&e.push(t.id)})),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),s=[];this.rowModel.forEachNode((e=>{i.has(e.id)&&s.push(e)})),this.setNodesSelected({newValue:!0,nodes:s,source:t})}dispatchSelectionChanged(e){const t={type:"selectionChanged",source:e};this.eventService.dispatchEvent(t)}},od=class extends I{constructor(){super(...arguments),this.beanName="selectableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.addManagedPropertyListener("isRowSelectable",(()=>this.updateSelectable()))}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const s=this.gos.get("groupSelectsChildren"),o="clientSide"===this.rowModel.getType()&&s,n=[],r=t=>{if(e&&!t.group)return;if(o&&t.group){const e=t.childrenAfterGroup.some((e=>!0===e.selectable));return void t.setRowSelectable(e,!0)}const s=!i||i(t);t.setRowSelectable(s,!0),!s&&t.isSelected()&&n.push(t)};if(o){const e=this.rowModel;new id(!1,e.getRootNode()).forEachChangedNodeDepthFirst(r,!0,!0)}else this.rowModel.forEachNode(r);n.length&&this.selectionService.setNodesSelected({nodes:n,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof sd&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}},nd=["asc","desc",null],rd=class extends I{constructor(){super(...arguments),this.beanName="sortController"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.showRowGroupColsService=e.showRowGroupColsService}progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){"asc"!==t&&"desc"!==t&&(t=null);let o=[e];if(this.gos.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.funcColsService.getSourceColumnsForGroupColumn(e),i=t?.filter((e=>e.isSortable()));i&&(o=[e,...i])}o.forEach((e=>e.setSort(t,s)));const n=[];if(!((i||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"))){const e=this.clearSortBarTheseColumns(o,s);n.push(...e)}this.updateSortIndex(e),n.push(...o),this.dispatchSortChangedEvents(s,n)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.showRowGroupColsService?.getShowRowGroupCol(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getAllCols().forEach((e=>e.setSortIndex(null)));const n=o.filter((e=>(!t||!e.getColDef().showRowGroup)&&e!==s));(s.getSort()?[...n,s]:n).forEach(((e,t)=>{e.setSortIndex(t)}))}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const e=this.columnModel.getAllCols().filter((e=>!!e.getSort()));return e&&e.length>0}dispatchSortChangedEvents(e,t){const i={type:"sortChanged",source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getAllCols().forEach((s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))})),i}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gos.get("sortingOrder")?this.gos.get("sortingOrder"):nd,!Array.isArray(t)||t.length<=0)return de(`sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,o=i==t.length-1;let n;return n=s||o?t[0]:t[i+1],nd.indexOf(n)<0?(de("invalid sort type ",n),null):n}getIndexedSortMap(){let e=this.columnModel.getAllCols().filter((e=>!!e.getSort()));if(this.columnModel.isPivotMode()){const t=this.gos.isColumnsSortingCoupledToGroup();e=e.filter((e=>{const i=!!e.getAggFunc(),s=!e.isPrimary(),o=t?this.showRowGroupColsService?.getShowRowGroupCol(e.getId()):e.getColDef().showRowGroup;return i||s||o}))}const t=this.funcColsService.getRowGroupColumns().filter((e=>!!e.getSort())),i={};e.forEach(((e,t)=>i[e.getId()]=t)),e.sort(((e,t)=>{const s=e.getSortIndex(),o=t.getSortIndex();if(null!=s&&null!=o)return s-o;if(null==s&&null==o){return i[e.getId()]>i[t.getId()]?1:-1}return null==o?-1:1}));const s=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;s&&(e=[...new Set(e.map((e=>this.showRowGroupColsService?.getShowRowGroupCol(e.getId())??e)))]);const o=new Map;return e.forEach(((e,t)=>o.set(e,t))),s&&t.forEach((e=>{const t=this.showRowGroupColsService.getShowRowGroupCol(e.getId());o.set(e,o.get(t))})),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort((([e,t],[i,s])=>t-s)).map((([e])=>e))}getSortModel(){return this.getColumnsWithSortingOrdered().filter((e=>e.getSort())).map((e=>({sort:e.getSort(),colId:e.getId()})))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter((e=>e.getSort())).map((e=>({sort:e.getSort(),column:e})))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.funcColsService.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSort();const i=null!=e.getColDef().field||!!e.getColDef().valueGetter?[e,...t]:t,s=i[0].getSort();return i.every((e=>e.getSort()==s))?s:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}},ld=class extends I{constructor(){super(...arguments),this.beanName="syncService",this.waitingForColumns=!1}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.rowModel=e.rowModel}postConstruct(){this.addManagedPropertyListener("columnDefs",(e=>this.setColumnDefs(e)))}start(){this.ctrlsService.whenReady((()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()}))}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=Zi.__isRegistered("@ag-grid-enterprise/core",this.gridId);this.gos.get("debug")&&he(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){this.eventService.dispatchEvent({type:"gridReady"})}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t)return this.waitingForColumns?(this.waitingForColumns=!1,void this.setColumnsAndData(t)):void this.columnModel.setColumnDefs(t,Ae(e.source))}},ad=class extends I{constructor(){super(...arguments),this.beanName="changeDetectionService"}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer}postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),o=new id(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst((e=>{i.push(e)}))}this.rowRenderer.refreshCells({rowNodes:i})}},hd=class extends I{constructor(){super(...arguments),this.beanName="expressionService",this.expressionToFunctionCache={}}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);ce("value should be either a string or a function",e)}evaluateExpression(e,t){try{const i=this.createExpressionFunction(e);return i(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(i){return he("Processing of the expression failed"),he("Expression = ",e),he("Params = ",t),he("Exception = ",i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}},dd=class extends I{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}},cd=class extends I{constructor(){super(...arguments),this.beanName="valueService",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionService=e.expressionService,this.columnModel=e.columnModel,this.valueCache=e.valueCache,this.dataTypeService=e.dataTypeService}postConstruct(){this.initialised||this.init()}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=e=>this.callColumnCellValueChangedHandler(e),t=this.gos.useAsyncEvents();this.eventService.addEventListener("cellValueChanged",e,t),this.addDestroyFunc((()=>this.eventService.removeEventListener("cellValueChanged",e,t))),this.addManagedPropertyListener("treeData",(e=>this.isTreeData=e.currentValue))}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),n=o.field,r=e.getColId(),l=t.data;let a;const h=t.groupData&&void 0!==t.groupData[r],d=!s&&t.aggData&&void 0!==t.aggData[r],c=this.isSsrm&&s&&!!e.getColDef().aggFunc,u=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?a=this.executeFilterValueGetter(o.filterValueGetter,l,e,t):this.isTreeData&&d?a=t.aggData[r]:this.isTreeData&&o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):this.isTreeData&&n&&l?a=X(l,n,e.isFieldContainsDots()):h?a=t.groupData[r]:d?a=t.aggData[r]:o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):u?a=X(l,t.field,e.isFieldContainsDots()):n&&l&&!c&&(a=X(l,n,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof a&&0===a.indexOf("=")){const i=a.substring(1);a=this.executeValueGetter(i,l,e,t)}if(null==a){const i=this.getOpenedGroup(t,e);if(null!=i)return i}return a}parseValue(e,t,i,s){const o=e.getColDef(),n=this.gos.addGridCommonParams({node:t,data:t?.data,oldValue:s,newValue:i,colDef:o,column:e}),r=o.valueParser;return k(r)?"function"==typeof r?r(n):this.expressionService.evaluate(r,n):i}formatValue(e,t,i,s,o=!0){let n,r=null;const l=e.getColDef();if(s?n=s:o&&(n=l.valueFormatter),n){const s=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:l,column:e});r="function"==typeof n?n(s):this.expressionService.evaluate(n,s)}else if(l.refData)return l.refData[i]||"";return null==r&&Array.isArray(i)&&(r=i.join(", ")),r}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const i=t.getColDef().showRowGroup;let s=e.parent;for(;null!=s;){if(s.rowGroupColumn&&(!0===i||i===s.rowGroupColumn.getColId()))return s.key;s=s.parent}}setValue(e,t,i,s){const o=this.columnModel.getColDefCol(t);if(!e||!o)return!1;G(e.data)&&(e.data={});const{field:n,valueSetter:r}=o.getColDef();if(G(n)&&G(r))return de("you need either field or valueSetter set on colDef for editing to work"),!1;if(this.dataTypeService&&!this.dataTypeService.checkType(o,i))return de("Data type of the new value does not match the cell data type of the column"),!1;const l=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o});let a;if(l.newValue=i,a=k(r)?"function"==typeof r?r(l):this.expressionService.evaluate(r,l):this.setValueUsingField(e.data,n,i,o.isFieldContainsDots()),void 0===a&&(a=!0),!a)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),l.newValue=this.getValue(o,e);const h={type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:l.column,api:l.api,colDef:l.colDef,context:l.context,data:e.data,node:e,oldValue:l.oldValue,newValue:l.newValue,value:l.newValue,source:s};return this.eventService.dispatchEvent(h),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&this.getFrameworkOverrides().wrapOutgoing((()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,context:e.context})}))}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(s){const s=t.split(".");let n=e;for(;s.length>0&&n;){const e=s.shift();0===s.length?(o=n[e]===i,o||(n[e]=i)):n=n[e]}}else o=e[t]===i,o||(e[t]=i);return!o}executeFilterValueGetter(e,t,i,s){const o=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return"function"==typeof e?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,s){const o=i.getColId(),n=this.valueCache.getValue(s,o);if(void 0!==n)return n;const r=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let l;return l="function"==typeof e?e(r):this.expressionService.evaluate(e,r),this.valueCache.setValue(s,o,l),l}getValueCallback(e,t){const i=this.columnModel.getColDefCol(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;if(s){o=s(this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data}))}return"string"==typeof o||null==o||(o=String(o),"[object Object]"===o&&de("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}},ud=class{};function gd(e){ud.gridOptions=e}function pd(e,t,i){if(!t)return ce("No gridOptions provided to createGrid"),{};const s=(new fd).create(e,t,(t=>{const i=new Ka(e);t.createBean(i)}),void 0,i);if(!Object.isFrozen(t)&&!i?.frameworkOverrides){const e="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{ce(`gridOptions.api is no longer supported. See ${e}.`)},configurable:!0})}return s}ud.gridOptions=void 0;var md=class{constructor(e,t,i){if(de("Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions."),!t)return void ce("No gridOptions provided to the grid");this.gridOptions=t;const s=(new fd).create(e,t,(t=>{const i=new Ka(e);t.createBean(i).addDestroyFunc((()=>{this.destroy()}))}),void 0,i);this.gridOptions.api=s}destroy(){this.gridOptions&&(this.gridOptions.api?.destroy(),delete this.gridOptions.api)}},Cd=1,fd=class{create(e,t,i,s,o){let n={};ud.gridOptions?(Q(n,ud.gridOptions,!0,!0),n={...n,...t}):n=t;const r=function(e){const t={};return Object.entries(e).forEach((([e,i])=>{const s=Wh(e,i);t[e]=s})),t}(n),l=r.gridId??String(Cd++),a=this.getRegisteredModules(o,l),h=this.createBeansList(r.rowModelType,a,l),d=this.createProvidedBeans(e,r,o);if(!h)return void ce("Failed to create grid.");const c=new _s({providedBeanInstances:d,beanClasses:h,gridId:l,beanInitComparator:Da,beanDestroyComparator:Ma,derivedBeans:[va]});return this.registerModuleUserComponents(c,a),this.registerControllers(c,a),this.registerModuleApiFunctions(c,a),i(c),c.getBean("syncService").start(),s&&s(c),c.getBean("gridApi")}registerControllers(e,t){const i=e.getBean("ctrlsFactory");t.forEach((e=>{e.controllers&&e.controllers.forEach((e=>i.register(e)))}))}getRegisteredModules(e,t){const i=e?e.modules:null,s=Zi.__getRegisteredModules(t),o=[],n={},r=(e,t,i)=>{var s;n[(s=t).moduleName]||(n[s.moduleName]=!0,o.push(s),Zi.__register(s,e,i)),t.dependantModules&&t.dependantModules.forEach((t=>r(e,t,i)))};return r(!!i?.length||!Zi.__isPackageBased(),Gh,void 0),i&&i.forEach((e=>r(!0,e,t))),s&&s.forEach((e=>r(!Zi.__isPackageBased(),e,void 0))),o}registerModuleUserComponents(e,t){const i=this.extractModuleEntity(t,(e=>e.userComponents?e.userComponents:[])),s=e.getBean("userComponentRegistry");i.forEach((e=>{s.registerDefaultComponent(e.name,e.classImp)}))}registerModuleApiFunctions(e,t){const i=e.getBean("apiFunctionService");t.forEach((e=>{const t=e.apiFunctions??{};Object.keys(t).forEach((e=>{i?.addFunction(e,t[e])}))}))}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;G(s)&&(s=new ga);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createBeansList(e="clientSide",t,i){const s=t.filter((t=>!t.rowModel||t.rowModel===e)),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[e])return void ce("Could not find row model for rowModelType = ",e);if(!Zi.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const n=[La,Aa,Uh,Nh,Ca,vs,Fa,Pa,pl,Vs,ed,ul,Kh,Xl,Js,Qe,Va,_h,ca,sd,Te,kn,qh,jh,Yl,hd,Me,cl,dd,cd,jl,gl,qs,za,dl,Na,pa,sa,ll,rd,Xh,Qh,od,ad,ml,wa,Zh,td,Ta,_a,Ia,xa,ld,Jh,fl,$h,Yh,vl,ke,Sa,Ne,Le,ya,ba,Ke,Oe,_e,Ra,Ue],r=this.extractModuleEntity(s,(e=>e.beans?e.beans:[]));n.push(...r);const l=[];return n.forEach((e=>{l.indexOf(e)<0&&l.push(e)})),l}extractModuleEntity(e,t){return[].concat(...e.map(t))}},vd=class extends I{constructor(){super(...arguments),this.beanName="rowModelHelperService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){const e=this.rowModel;switch(e.getType()){case"clientSide":this.clientSideRowModel=e;break;case"infinite":this.infiniteRowModel=e;break;case"serverSide":this.serverSideRowModel=e}}getClientSideRowModel(){return this.clientSideRowModel}getInfiniteRowModel(){return this.infiniteRowModel}getServerSideRowModel(){return this.serverSideRowModel}};var wd={version:cn,moduleName:"@ag-grid-community/csrm-ssrm-shared-api",apiFunctions:{expandAll:function(e){e.expansionService.expandAll(!0)},collapseAll:function(e){e.expansionService.expandAll(!1)},onRowHeightChanged:function(e){const t=e.rowModelHelperService?.getClientSideRowModel(),i=e.rowModelHelperService?.getServerSideRowModel();t?t.onRowHeightChanged():i&&i.onRowHeightChanged()}}},Sd={version:cn,moduleName:"@ag-grid-community/ssrm-infinite-shared-api",apiFunctions:{setRowCount:function(e,t,i){const s=e.rowModelHelperService?.getServerSideRowModel();if(s)return e.funcColsService.isRowGroupEmpty()?void s.setRowCount(t,i):void ce("setRowCount cannot be used while using row grouping.");const o=e.rowModelHelperService?.getInfiniteRowModel();o&&o.setRowCount(t,i)},getCacheBlockState:function(e){return e.rowNodeBlockLoader?.getBlockState()??{}}}},yd=class{wrap(e,t,i=[],s){const o=this.createWrapper(e,s);return t.forEach((e=>{this.createMethod(o,e,!0)})),i.forEach((e=>{this.createMethod(o,e,!1)})),o}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&de("Framework component is missing the method "+t+"()"),null)}}};function bd(e,t){if(!e)return!1;const i=(e,i)=>{const s=t[e.id],o=t[i.id],n=void 0!==s,r=void 0!==o;return n&&r?s-o:!n&&!r?e.__objectId-i.__objectId:n?1:-1};let s,o,n=!1;for(let t=0;t<e.length-1;t++)if(s=e[t],o=e[t+1],i(s,o)>0){n=!0;break}return!!n&&(e.sort(i),!0)}var Rd=class{};Rd.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},Rd.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],Rd.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var Fd=(e=>(e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd",e))(Fd||{}),Pd=void 0===i.g?{}:i.g;Pd.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,Pd.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,Pd.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,Pd.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,Pd.Node="undefined"==typeof Node?{}:Node,Pd.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent},209:function(e,t,i){var s,o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(a,{BaseCreator:()=>d,BaseGridSerializingSession:()=>c,CsvCreator:()=>f,CsvExportModule:()=>P,Downloader:()=>p,GridSerializer:()=>y,RowType:()=>S,XmlFactory:()=>M,ZipContainer:()=>B,_CsvExportCoreModule:()=>R}),e.exports=(s=a,((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of r(t))l.call(e,a)||a===i||o(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s));var h=i(423),d=class extends h.BeanStub{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},c=class{constructor(e){this.groupColumns=[];const{columnModel:t,funcColsService:i,columnNameService:s,valueService:o,gos:n,processCellCallback:r,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:h}=e;this.columnModel=t,this.funcColsService=i,this.columnNameService=s,this.valueService=o,this.gos=n,this.processCellCallback=r,this.processHeaderCallback=l,this.processGroupHeaderCallback=a,this.processRowGroupCallback=h}prepare(e){this.groupColumns=e.filter((e=>!!e.getColDef().showRowGroup))}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,i,s,o){const n=this.gos.get("groupHideOpenParents")&&!o.footer||!this.shouldRenderGroupSummaryCell(o,e,t)?this.valueService.getValue(e,o):this.createValueForGroupNode(e,o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){if(!(e&&e.group))return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=e.groupData?.[t.getId()])return!0;if(this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.funcColsService.getRowGroupColumns()[0].getId()}}const s=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&s}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnNameService.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),o=t=>{if(i||s)return t.key;const o=t.groupData?.[e.getId()];return o&&t.rowGroupColumn&&!1!==t.rowGroupColumn.getColDef().useValueFormatterForExport?this.valueService.formatValue(t.rowGroupColumn,t,o)??o:o},n=t.footer,r=[o(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,r.push(o(t));const l=r.reverse().join(" -> ");return n?`Total ${l}`:l}processCell(e){const{accumulatedRowIndex:t,rowNode:i,column:s,value:o,processCellCallback:n,type:r}=e;return n?{value:n(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:s,node:i,value:o,type:r,parseValue:e=>this.valueService.parseValue(s,i,e,this.valueService.getValue(s,i)),formatValue:e=>this.valueService.formatValue(s,i,e)??e}))??""}:!1!==s.getColDef().useValueFormatterForExport?{value:o??"",valueFormatted:this.valueService.formatValue(s,i,o)}:{value:o??""}}},u=i(423),g=i(423),p=class{static download(e,t){const i=document.defaultView||window;if(!i)return void(0,g._warnOnce)("There is no `window` associated with the current `document`");const s=document.createElement("a"),o=i.URL.createObjectURL(t);s.setAttribute("href",o),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout((()=>{i.URL.revokeObjectURL(o)}),0)}},m=i(423),C=class extends c{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach((e=>{this.beginNewLine(),e.forEach(((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)}))})))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){0!=t&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():((0,m._warnOnce)("unknown value type during csv conversion"),t="");return'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}},f=class extends d{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.gridSerializer=e.gridSerializer}postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return void(0,u._warnOnce)("Export cancelled. Export is not allowed as per your configuration.");const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\ufeff",i],{type:"text/plain"}),o="function"==typeof t.fileName?t.fileName(this.gos.getGridCommonParams()):t.fileName;p.download(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:n}=this,{processCellCallback:r,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:h,suppressQuotes:d,columnSeparator:c}=e;return new C({columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:n,processCellCallback:r||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:h||void 0,suppressQuotes:d||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}},v=i(423);var w=i(423),S=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(S||{}),y=class extends w.BeanStub{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.selectionService=e.selectionService,this.rowNodeSorter=e.rowNodeSorter,this.sortController=e.sortController}serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:o}=t,n=this.getColumnsToExport(i,o,s);return(0,w._compose)(this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const o=t.shouldRowBeSkipped||(()=>!1),n=this.gos.get("groupRemoveSingleChildren"),r=this.gos.get("groupRemoveLowestSingleChildren"),l=null!=t.rowPositions||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!l,h=this.columnModel.isPivotMode()?s.leafGroup:!s.group,d=!!s.footer,c=r&&s.leafGroup,u=1===s.allChildrenCount&&1===s.childrenAfterGroup?.length&&(n||c);if(!h&&!d&&(t.skipRowGroups||u||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned)return;if(-1===s.level&&!h&&!d)return;if(o(this.gos.addGridCommonParams({node:s})))return;const g=e.onNewBodyRow(s);if(i.forEach(((e,t)=>{g.onColumn(e,t,s)})),t.getCustomContentBelowRow){const i=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));i&&e.addCustomContent(i)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new w.GroupInstanceIdCreator,o=this.visibleColsService.createGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0});this.recursivelyAddHeaderGroups(o,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const e=i.onNewHeaderRow();t.forEach(((t,i)=>{e.onColumn(t,i,void 0)}))}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter((e=>"top"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex))).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,o=s.getType(),n="clientSide"===o,r="serverSide"===o,l=!n&&e.onlySelected,a=this.processRow.bind(this,i,e,t),{exportedRows:h="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter((e=>null==e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>s.getRow(e.rowIndex))).forEach(a);else if(this.columnModel.isPivotMode())n?s.forEachPivotNode(a,!0):r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||l){const e=this.selectionService.getSelectedNodes();this.replicateSortedOrder(e),e.forEach(a)}else"all"===h?s.forEachNode(a):n||r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(e,s)=>null!=e.rowIndex&&null!=s.rowIndex?e.rowIndex-s.rowIndex:e.level===s.level?e.parent?.id===s.parent?.id?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:e.rowIndex??-1},{rowNode:s,currentPos:s.rowIndex??-1}):i(e.parent,s.parent):e.level>s.level?i(e.parent,s):i(e,s.parent);e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter((e=>"bottom"===e.rowPinned)).sort(((e,t)=>e.rowIndex-t.rowIndex)).map((e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex))).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getColsForKeys(i);const o=this.gos.get("treeData");let n=[];return n=e&&!s?this.columnModel.getCols():this.visibleColsService.getAllCols(),t&&!o&&(n=n.filter((e=>e.getColId()!==w.GROUP_AUTO_COLUMN_ID))),n}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach((e=>{const t=e;t.getChildren&&t.getChildren().forEach((e=>s.push(e)))})),e.length>0&&(0,w.isColumnGroup)(e[0])&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let o=0;t.forEach((e=>{const t=e;let n;n=i?i(this.gos.addGridCommonParams({columnGroup:t})):this.columnNameService.getDisplayNameForColumnGroup(t,"header");const r=t.getLeafColumns().reduce(((e,t,i,s)=>{let o=(0,w._last)(e);return"open"===t.getColumnGroupShow()?o&&null==o[1]||(o=[i],e.push(o)):o&&null==o[1]&&(o[1]=i-1),i===s.length-1&&o&&null==o[1]&&(o[1]=i),e}),[]);s.onColumn(t,n||"",o++,t.getLeafColumns().length-1,r)}))}},b="32.0.2",R={version:b,moduleName:`${v.ModuleNames.CsvExportModule}-core`,beans:[f,y]},F={version:b,moduleName:`${v.ModuleNames.CsvExportModule}-api`,apiFunctions:{getDataAsCsv:function(e,t){return e.csvCreator?.getDataAsCsv(t)},exportDataAsCsv:function(e,t){e.csvCreator?.exportDataAsCsv(t)}},dependantModules:[R]},P={version:b,moduleName:v.ModuleNames.CsvExportModule,dependantModules:[R,F]},E="\r\n";function D(e,t,i){if(!t&&""!==t&&0!==t)return"";let s=t;return"boolean"==typeof t&&i&&(s=i(t)),` ${e}="${s}"`}var M=class{static createHeader(e={}){const t=["version"];e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone");return`<?xml ${t.map((t=>`${t}="${e[t]}"`)).join(" ")} ?>`}static createXml(e,t){let i="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach((e=>{Object.keys(e.map).forEach((s=>{i+=D(e.prefix+s,e.map[s],t)}))})),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach((s=>{i+=D(s,e.properties.rawMap[s],t)})));let s="<"+e.name+i;return e.children||null!=e.textNode?null!=e.textNode?s+">"+e.textNode+"</"+e.name+">"+E:(s+=">\r\n",e.children&&e.children.forEach((e=>{s+=this.createXml(e,t)})),s+"</"+e.name+">"+E):s+"/>"+E}},x=i(423),T=async e=>{const t=new Blob([e]),{size:i,content:s}=await(async e=>{let t=0;const i=[],s=new WritableStream({write:e=>{i.push(e),t+=e.length}}),o=new ReadableStream({start:t=>{const i=new FileReader;i.onload=e=>{e.target?.result&&t.enqueue(e.target.result),t.close()},i.readAsArrayBuffer(e)}}),n=new window.CompressionStream("deflate-raw");return await o.pipeThrough(n).pipeTo(s),{size:t,content:new Blob(i)}})(t);return{size:i,content:new Uint8Array(await s.arrayBuffer())}};function A(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i}var I=e=>{if(!e.length)return 0;let t=~0,i=0,s=0,o=0;for(let n=0;n<e.length;n++)i=e[n],s=255&(t^i),o=O[s],t=t>>>8^o;return~t},L=e=>e.length?I("string"==typeof e?(new TextEncoder).encode(e):e):0,O=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),k=(e,t,i,s,o,n)=>{const{content:r,path:l,created:a}=e,h=(e=>{let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t})(a),d=(e=>{let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t})(a),c=L(o),u=void 0!==n?n:s,g=(0,x._utf8_encode)(l),p=g!==l;let m="";if(p){const e=A(1,1)+A(L(g),4)+g;m="up"+A(e.length,2)+e}const C="\0"+(p?"\0\b":"\0\0")+A(t?8:0,2)+A(h,2)+A(d,2)+A(u?c:0,4)+A(n??s,4)+A(s,4)+A(g.length,2)+A(m.length,2),f="PK"+C+g+m,v="PK\0"+C+"\0\0\0\0\0\0"+(r?"\0\0\0\0":"\0\0\0")+A(i,4)+g+m;return{localFileHeader:Uint8Array.from(f,(e=>e.charCodeAt(0))),centralDirectoryHeader:Uint8Array.from(v,(e=>e.charCodeAt(0)))}},G=e=>{let t;if("string"==typeof e){const i=atob(e.split(";base64,")[1]);t=Uint8Array.from(i,(e=>e.charCodeAt(0)))}else t=e;return{size:t.length,content:t}},N=async(e,t)=>{const{content:i}=e,{size:s,content:o}=i?G(i):{size:0,content:Uint8Array.from([])};let n,r,l=!1;if("file"===e.type&&o&&s>0){const e=await T(o);n=e.content,r=e.size,l=!0}return{...k(e,l,t,s,o,r),content:n||o,isCompressed:l}},H=(e,t)=>{const{content:i}=e,{content:s}=i?G(i):{content:Uint8Array.from([])};return{...k(e,!1,t,s.length,s,void 0),content:s,isCompressed:!1}},B=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:(new TextEncoder).encode(t),isBase64:i,type:"file"})}static async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=0,i=0;for(const s of e){const{localFileHeader:e,centralDirectoryHeader:o,content:n}=s;t+=e.length+n.length,i+=o.length}const s=new Uint8Array(t),o=new Uint8Array(i);let n=0,r=0;for(const t of e){const{localFileHeader:e,centralDirectoryHeader:i,content:l}=t;s.set(e,n),n+=e.length,s.set(l,n),n+=l.length,o.set(i,r),r+=i.length}const l=((e,t,i)=>{const s="PK\0\0\0\0"+A(e,2)+A(e,2)+A(t,4)+A(i,4)+"\0\0";return Uint8Array.from(s,(e=>e.charCodeAt(0)))})(e.length,i,t),a=new Uint8Array(s.length+o.length+l.length);return a.set(s),a.set(o,s.length),a.set(l,s.length+o.length),a}static async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=await N(s,i),{localFileHeader:o,content:n}=e;t.push(e),i+=o.length+n.length}return this.packageFiles(t)}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const e=H(s,i),{localFileHeader:o,content:n}=e;t.push(e),i+=o.length+n.length}return this.packageFiles(t)}};B.folders=[],B.files=[]},773:function(e,t,i){var s,o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,a={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(a,{InfiniteRowModelModule:()=>w}),e.exports=(s=a,((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of r(t))l.call(e,a)||a===i||o(e,a,{get:()=>t[a],enumerable:!(s=n(t,a))||s.enumerable});return e})(o({},"__esModule",{value:!0}),s));var h=i(423),d=i(423),c=i(423),u=i(423),g=class extends u.RowNodeBlock{wireBeans(e){this.beans=e}constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){(0,u._exists)(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();(0,u._missing)(this.params.datasource.getRows)?(0,u._warnOnce)("datasource is missing getRows method"):window.setTimeout((()=>{this.params.datasource.getRows(e)}),0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach(((s,o)=>{this.startRow+o<i&&e(s,t.next())}))}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new u.RowNode(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach(((t,i)=>{const s=e.rowData?e.rowData[i]:void 0;!t.id&&t.alreadyRendered&&s&&(this.rowNodes[i]=new u.RowNode(this.beans),this.rowNodes[i].setRowIndex(t.rowIndex),this.rowNodes[i].setRowTop(t.rowTop),this.rowNodes[i].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],s,this.startRow+i)}));const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroy(){this.rowNodes.forEach((e=>{e.clearRowTopAndRowIndex()})),super.destroy()}},p=class extends c.BeanStub{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}wireBeans(e){this.rowRenderer=e.rowRenderer,this.focusService=e.focusService}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new g(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach((e=>e.setStateWaitingToLoad())),this.params.rowNodeBlockLoader.checkBlockToLoad())}destroy(){this.getBlocksInOrder().forEach((e=>this.destroyBlock(e))),super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.gos.get("debug")&&(0,c._log)(`InfiniteCache - onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter((t=>t!=e));t.sort(((e,t)=>t.getLastAccessed()-e.getLastAccessed()));const i=this.params.maxBlocksInCache>0,s=i?this.params.maxBlocksInCache-1:null;t.forEach(((e,t)=>{if("needsLoading"===e.getState()&&t>=1||!!i&&t>=s){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}}))}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,(0,c._exists)(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize==0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new c.NumberSequence;this.getBlocksInOrder().forEach((i=>i.forEachNode(e,t,this.rowCount)))}getBlocksInOrder(){return(0,c._getAllValuesInObject)(this.blocks).sort(((e,t)=>e.getId()-t.getId()))}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:"storeUpdated"};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach((t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)})),e.length>0&&e.forEach((e=>this.destroyBlock(e)))}purgeCache(){this.getBlocksInOrder().forEach((e=>this.removeBlockFromCache(e))),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,o=!1;const n=new c.NumberSequence;let r=!1;this.getBlocksInOrder().forEach((l=>{r||(o&&s+1!==l.getId()?r=!0:(s=l.getId(),l.forEachNode((s=>{const n=s===e||s===t;(o||n)&&i.push(s),n&&(o=!o)}),n,this.rowCount)))}));return r||o?[]:i}},m=class extends d.BeanStub{constructor(){super(...arguments),this.beanName="rowModel"}wireBeans(e){this.filterManager=e.filterManager,this.sortController=e.sortController,this.selectionService=e.selectionService,this.rowRenderer=e.rowRenderer,this.rowNodeBlockLoader=e.rowNodeBlockLoader}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc((()=>this.destroyCache())),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&(0,d._warnOnce)("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onCacheUpdated.bind(this)}),this.addManagedPropertyListener("datasource",(()=>this.setDatasource(this.gos.get("datasource")))),this.addManagedPropertyListener("cacheBlockSize",(()=>this.resetCache())),this.addManagedPropertyListener("rowHeight",(()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()}))}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!(0,d._jsonEquals)(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;null!=this.gos.getRowIdCallback()||this.selectionService.reset("rowDataChanged"),this.resetCache()}createModelUpdatedEvent(){return{type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager?.getFilterModel()??{},sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new d.NumberSequence},this.infiniteCache=this.createBean(new p(this.cacheParams)),this.eventService.dispatchEventOnce({type:"rowCountReady"});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode((e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}));const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode((i=>{i.id===e&&(t=i)})),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};var C="32.0.2",f={version:C,moduleName:`${h.ModuleNames.InfiniteRowModelModule}-core`,rowModel:"infinite",beans:[m],dependantModules:[h._RowNodeBlockModule]},v={version:C,moduleName:`${h.ModuleNames.InfiniteRowModelModule}-api`,beans:[h.RowModelHelperService],apiFunctions:{refreshInfiniteCache:function(e){e.rowModelHelperService?.getInfiniteRowModel()?.refreshCache()},purgeInfiniteCache:function(e){e.rowModelHelperService?.getInfiniteRowModel()?.purgeCache()},getInfiniteRowCount:function(e){return e.rowModelHelperService?.getInfiniteRowModel()?.getRowCount()},isLastRowIndexKnown:function(e){return e.rowModelHelperService?.getInfiniteRowModel()?.isLastRowIndexKnown()}},dependantModules:[f,h._SsrmInfiniteSharedApiModule]},w={version:C,moduleName:h.ModuleNames.InfiniteRowModelModule,dependantModules:[f,v]}},12:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const s=i(608),o=i(886),n=i(423),r=i(209),l=i(773);n.ModuleRegistry.__registerModules([n.CommunityFeaturesModule,o.ClientSideRowModelModule,l.InfiniteRowModelModule,r.CsvExportModule],!1,void 0),s.__exportStar(i(423),t),s.__exportStar(i(886),t),s.__exportStar(i(209),t),s.__exportStar(i(773),t)},608:function(e,t,i){"use strict";i.r(t),i.d(t,{__addDisposableResource:function(){return O},__assign:function(){return n},__asyncDelegator:function(){return P},__asyncGenerator:function(){return F},__asyncValues:function(){return E},__await:function(){return R},__awaiter:function(){return p},__classPrivateFieldGet:function(){return A},__classPrivateFieldIn:function(){return L},__classPrivateFieldSet:function(){return I},__createBinding:function(){return C},__decorate:function(){return l},__disposeResources:function(){return G},__esDecorate:function(){return h},__exportStar:function(){return f},__extends:function(){return o},__generator:function(){return m},__importDefault:function(){return T},__importStar:function(){return x},__makeTemplateObject:function(){return D},__metadata:function(){return g},__param:function(){return a},__propKey:function(){return c},__read:function(){return w},__rest:function(){return r},__runInitializers:function(){return d},__setFunctionName:function(){return u},__spread:function(){return S},__spreadArray:function(){return b},__spreadArrays:function(){return y},__values:function(){return v}});var s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},s(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var n=function(){return n=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function r(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(i[s[o]]=e[s[o]])}return i}function l(e,t,i,s){var o,n=arguments.length,r=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r}function a(e,t){return function(i,s){t(i,s,e)}}function h(e,t,i,s,o,n){function r(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var l,a=s.kind,h="getter"===a?"get":"setter"===a?"set":"value",d=!t&&e?s.static?e:e.prototype:null,c=t||(d?Object.getOwnPropertyDescriptor(d,s.name):{}),u=!1,g=i.length-1;g>=0;g--){var p={};for(var m in s)p[m]="access"===m?{}:s[m];for(var m in s.access)p.access[m]=s.access[m];p.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(r(e||null))};var C=(0,i[g])("accessor"===a?{get:c.get,set:c.set}:c[h],p);if("accessor"===a){if(void 0===C)continue;if(null===C||"object"!=typeof C)throw new TypeError("Object expected");(l=r(C.get))&&(c.get=l),(l=r(C.set))&&(c.set=l),(l=r(C.init))&&o.unshift(l)}else(l=r(C))&&("field"===a?o.unshift(l):c[h]=l)}d&&Object.defineProperty(d,s.name,c),u=!0}function d(e,t,i){for(var s=arguments.length>2,o=0;o<t.length;o++)i=s?t[o].call(e,i):t[o].call(e);return s?i:void 0}function c(e){return"symbol"==typeof e?e:"".concat(e)}function u(e,t,i){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:i?"".concat(i," ",t):t})}function g(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,i,s){return new(i||(i=Promise))((function(o,n){function r(e){try{a(s.next(e))}catch(e){n(e)}}function l(e){try{a(s.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,l)}a((s=s.apply(e,t||[])).next())}))}function m(e,t){var i,s,o,n,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function l(l){return function(a){return function(l){if(i)throw new TypeError("Generator is already executing.");for(;n&&(n=0,l[0]&&(r=0)),r;)try{if(i=1,s&&(o=2&l[0]?s.return:l[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,l[1])).done)return o;switch(s=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,s=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(6===l[0]&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(e){l=[6,e],s=0}finally{i=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}}var C=Object.create?function(e,t,i,s){void 0===s&&(s=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,o)}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]};function f(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||C(t,e,i)}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],s=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var s,o,n=i.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(s=n.next()).done;)r.push(s.value)}catch(e){o={error:e}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(o)throw o.error}}return r}function S(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}function y(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var s=Array(e),o=0;for(t=0;t<i;t++)for(var n=arguments[t],r=0,l=n.length;r<l;r++,o++)s[o]=n[r];return s}function b(e,t,i){if(i||2===arguments.length)for(var s,o=0,n=t.length;o<n;o++)!s&&o in t||(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}function R(e){return this instanceof R?(this.v=e,this):new R(e)}function F(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,o=i.apply(e,t||[]),n=[];return s={},r("next"),r("throw"),r("return"),s[Symbol.asyncIterator]=function(){return this},s;function r(e){o[e]&&(s[e]=function(t){return new Promise((function(i,s){n.push([e,t,i,s])>1||l(e,t)}))})}function l(e,t){try{(i=o[e](t)).value instanceof R?Promise.resolve(i.value.v).then(a,h):d(n[0][2],i)}catch(e){d(n[0][3],e)}var i}function a(e){l("next",e)}function h(e){l("throw",e)}function d(e,t){e(t),n.shift(),n.length&&l(n[0][0],n[0][1])}}function P(e){var t,i;return t={},s("next"),s("throw",(function(e){throw e})),s("return"),t[Symbol.iterator]=function(){return this},t;function s(s,o){t[s]=e[s]?function(t){return(i=!i)?{value:R(e[s](t)),done:!1}:o?o(t):t}:o}}function E(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=v(e),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(i){t[i]=e[i]&&function(t){return new Promise((function(s,o){(function(e,t,i,s){Promise.resolve(s).then((function(t){e({value:t,done:i})}),t)})(s,o,(t=e[i](t)).done,t.value)}))}}}function D(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var M=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&C(t,e,i);return M(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function A(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)}function I(e,t,i,s,o){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?o.call(e,i):o?o.value=i:t.set(e,i),i}function L(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function O(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var s;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=t[Symbol.asyncDispose]}if(void 0===s){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=t[Symbol.dispose]}if("function"!=typeof s)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:s,async:i})}else i&&e.stack.push({async:!0});return t}var k="function"==typeof SuppressedError?SuppressedError:function(e,t,i){var s=new Error(i);return s.name="SuppressedError",s.error=e,s.suppressed=t,s};function G(e){function t(t){e.error=e.hasError?new k(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function i(){for(;e.stack.length;){var s=e.stack.pop();try{var o=s.dispose&&s.dispose.call(s.value);if(s.async)return Promise.resolve(o).then(i,(function(e){return t(e),i()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:o,__assign:n,__rest:r,__decorate:l,__param:a,__metadata:g,__awaiter:p,__generator:m,__createBinding:C,__exportStar:f,__values:v,__read:w,__spread:S,__spreadArrays:y,__spreadArray:b,__await:R,__asyncGenerator:F,__asyncDelegator:P,__asyncValues:E,__makeTemplateObject:D,__importStar:x,__importDefault:T,__classPrivateFieldGet:A,__classPrivateFieldSet:I,__classPrivateFieldIn:L,__addDisposableResource:O,__disposeResources:G}}},t={};function i(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,i),n.exports}return i.d=function(e,t){for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(12)}()}));