UNPKG

@ag-grid-community/core

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

1 lines 824 kB
var We=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 this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),s.size===0&&(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 l=e.event;l instanceof Event&&(e.eventPath=l.composedPath())}const s=(l,a)=>l.forEach(d=>{if(!a.has(d))return;const c=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>d(e)):()=>d(e);t?this.dispatchAsync(c):c()}),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(l=>{const a=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>l(i,e)):()=>l(i,e);t?this.dispatchAsync(a):a()})}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}},Ni=(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))(Ni||{}),so={};function Yt(e,t){so[t]||(e(),so[t]=!0)}function se(e,...t){console.log("AG Grid: "+e,...t)}function w(e,...t){Yt(()=>console.warn("AG Grid: "+e,...t),e+t?.join(""))}function k(e,...t){Yt(()=>console.error("AG Grid: "+e,...t),e+t?.join(""))}function Wi(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Va(e){Ba(e,400)}var zi=[],_i=!1;function oo(e){zi.push(e),!_i&&(_i=!0,window.setTimeout(()=>{const t=zi.slice();zi.length=0,_i=!1,t.forEach(i=>i())},0))}function Ba(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function q(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(o,s)},t)}}function no(e,t){let i=0;return function(...s){const o=this,n=new Date().getTime();n-i<t||(i=n,e.apply(o,s))}}function ro(e,t,i=100,s){const o=new Date().getTime();let n=null,r=!1;const l=()=>{const a=new Date().getTime()-o>i;(e()||a)&&(t(),r=!0,n!=null&&(window.clearInterval(n),n=null),a&&s&&w(s))};l(),r||(n=window.setInterval(l,10))}function Na(...e){return t=>e.reduce((i,s)=>s(i),t)}function fe(e){return e==null||e===""?null:e}function F(e,t=!1){return e!=null&&(e!==""||t)}function L(e){return!F(e)}function ye(e){return e==null||e.length===0}function Qt(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function ze(e){if(e===void 0)return;if(e===null||e==="")return null;if(typeof e=="number")return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function Ui(e){if(e!==void 0)return e===null||e===""?!1:Ki(e)}function Ki(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}function vt(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function lo(e,t,i=!1){const s=e==null,o=t==null;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(r,l){return r>l?1:r<l?-1:0}if(typeof e!="string"||!i)return n(e,t);try{return e.localeCompare(t)}catch{return n(e,t)}}function St(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(i=>t.push(i)),t}return Object.values(e)}function ao(e,t){return e.get("rowModelType")===t}function N(e){return ao(e,"clientSide")}function Me(e){return ao(e,"serverSide")}function z(e,t){return e.get("domLayout")===t}function wt(e){return Pt(e)!==void 0}function Xt(e){return!e.get("suppressAsyncEvents")}function $i(e){return typeof e.get("getRowHeight")=="function"}function Wa(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function _e(e,t,i=!1,s){if(s==null&&(s=e.environment.getDefaultRowHeight()),$i(e)){if(i)return{height:s,estimated:!0};const r={node:t,data:t.data},l=e.getCallback("getRowHeight")(r);if(qi(l))return l===0&&w("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,l),estimated:!1}}if(t.detail&&e.get("masterDetail"))return za(e);const o=e.get("rowHeight");return{height:o&&qi(o)?o:s,estimated:!1}}function za(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return qi(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function yt(e){const{environment:t}=e,i=e.get("rowHeight");if(!i||L(i))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(w("row height must be a number if not using standard row model"),t.getDefaultRowHeight())}function qi(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function Rt(e,t,i){const s=t[e.getDomDataKey()];return s?s[i]:void 0}function Ue(e,t,i,s){const o=e.getDomDataKey();let n=t[o];L(n)&&(n={},t[o]=n),n[i]=s}function B(e){let t=null;const i=e.get("getDocument");return i&&F(i)?t=i():e.eGridDiv&&(t=e.eGridDiv.ownerDocument),t&&F(t)?t:document}function co(e){return B(e).defaultView||window}function Ft(e){return e.eGridDiv.getRootNode()}function H(e){return Ft(e).activeElement}function ji(e){const t=B(e),i=H(e);return i===null||i===t.body}function Jt(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function Zt(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||z(e,"print"))}function me(e){return!e.get("autoGroupColumnDef")?.comparator&&!e.get("treeData")}function ei(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function _a(e){const t=e.get("grandTotalRow");if(t)return t;if(e.get("groupIncludeTotalFooter"))return"bottom"}function Ua(e){const t=e.get("groupTotalRow");if(typeof t=="function")return e.getCallback("groupTotalRow");if(t)return()=>t;const i=e.get("groupIncludeFooter");if(typeof i=="function"){const s=e.getCallback("groupIncludeFooter");return o=>s(o)?"bottom":void 0}return()=>i?"bottom":void 0}function Ka(e){return e.exists("groupDisplayType")?e.get("groupDisplayType")==="multipleColumns":e.get("groupHideOpenParents")}function ti(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function ii(e){const t=e.getCallback("getRowId");return t===void 0?t:i=>{let s=t(i);return typeof s!="string"&&(w("The getRowId callback must return a string. The ID ",s," is being cast to a string."),s=String(s)),s}}function st(e){return e?.checkboxes??!0}function bt(e){return e?.mode==="multiRow"&&(e.headerCheckbox??!0)}function $a(e){return e?.hideDisabledCheckboxes??!1}function uo(e){return typeof e.get("rowSelection")!="string"}function ho(e){return e.get("cellSelection")!==void 0}function go(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t?.suppressMultiRanges??!1:!1:e.get("suppressMultiRangeSelection")}function he(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function qa(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t.handle?.mode==="range":!1:e.get("enableRangeHandle")}function po(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?t.handle?.mode==="fill":!1:e.get("enableFillHandle")}function ja(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"&&t.handle?.mode==="fill"?t.handle:void 0:{mode:"fill",setFillValue:e.get("fillOperation"),direction:e.get("fillHandleDirection"),suppressClearOnFillReduction:e.get("suppressClearOnFillReduction")}}function fo(e){const t=e.get("rowSelection")??"single";if(typeof t=="string"){const i=e.get("suppressRowClickSelection"),s=e.get("suppressRowDeselection");return i&&s?!1:i?"enableDeselection":s?"enableSelection":!0}return t.mode==="singleRow"||t.mode==="multiRow"?t.enableClickSelection??!1:!1}function Ya(e){const t=fo(e);return t===!0||t==="enableSelection"}function mo(e){const t=fo(e);return t===!0||t==="enableDeselection"}function si(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t?.isRowSelectable}function Pt(e){const t=e.get("rowSelection");if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}return t?.mode}function oi(e){return Pt(e)==="multiRow"}function Qa(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):t?.enableSelectionWithoutKeys??!1}function ni(e){const t=e.get("rowSelection");if(typeof t=="string"){const i=e.get("groupSelectsChildren"),s=e.get("groupSelectsFiltered");return i&&s?"filteredDescendants":i?"descendants":"self"}return t?.mode==="multiRow"?t.groupSelects:void 0}function ot(e){const t=ni(e);return t==="descendants"||t==="filteredDescendants"}function Yi(e){return e.isModuleRegistered("@ag-grid-enterprise/set-filter")&&!e.get("suppressSetFilterByDefault")}function Xa(e){return e!=null&&e.length>0}function I(e){if(!(!e||!e.length))return e[e.length-1]}function Ce(e,t,i){return e==null&&t==null?!0:e!=null&&t!=null&&e.length===t.length&&e.every((s,o)=>i?i(s,t[o]):t[o]===s)}function Ja(e,t){return Ce(e,t)}function Za(e){return e.sort((t,i)=>t-i)}function ed(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 Co(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function j(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function td(e,t){for(let i=0;i<t.length;i++)Co(e,t[i])}function id(e,t){for(let i=0;i<t.length;i++)j(e,t[i])}function Et(e,t,i){e.splice(i,0,t)}function sd(e,t,i){if(!(e==null||t==null))for(let s=t.length-1;s>=0;s--){const o=t[s];Et(e,o,i)}}function vo(e,t,i){id(e,t),t.slice().reverse().forEach(s=>Et(e,s,i))}function Ae(e,t){return e.indexOf(t)>-1}function So(e){return e?.flatMap(t=>t)??[]}function wo(e,t){t==null||e==null||t.forEach(i=>e.push(i))}function od(e,t){if(e!=null)for(let i=e.length-1;i>=0;i--)t(e[i],i)}var yo="__ag_Grid_Stop_Propagation",nd=["touchstart","touchend","touchmove","touchcancel","scroll"],Qi={};function Ke(e){e[yo]=!0}function ve(e){return e[yo]===!0}var Ro=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof Qi[i]=="boolean")return Qi[i];const s=document.createElement(e[i]||"div");return i="on"+i,Qi[i]=i in s}})();function ri(e,t,i){let s=t;for(;s;){const o=Rt(e,s,i);if(o)return o;s=s.parentElement}return null}function Fo(e,t){return!t||!e?!1:ld(t).indexOf(e)>=0}function rd(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function ld(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():rd(t)}function ad(e,t,i,s){const n=Ae(nd,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,n)}var v=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){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,i){this.localEventService||(this.localEventService=new We),this.localEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.localEventService&&this.localEventService.removeEventListener(e,t,i)}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?ad(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(o=>o!==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(s=>s!==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=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=o.changeSet.id}const n={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(n)};e.forEach(o=>this.setupGridOptionListener(o,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)}};function U(e){return e instanceof Dt}var Dt=class extends v{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=Eo(),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()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1: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=>{Fe(t)?e.push(t):U(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 n=0,r=s.length;n<r;n++){const l=s[n];if(!l.isVisible())continue;const a=l.getColumnGroupShow();a==="open"?(e=!0,i=!0):a==="closed"?(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(s=>{U(s)&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},bo="ag-Grid-ControlsColumn",dd=class extends v{constructor(){super(...arguments),this.beanName="controlsColService"}isControlsColEnabled(){const{gos:e}=this,t=e.get("rowSelection");if(!t||typeof t!="object")return!1;const i=st(t),s=bt(t);return!!(i||s)}createControlsCols(){if(!this.isControlsColEnabled())return[];const{gos:e}=this,t=e.get("selectionColumnDef"),s={maxWidth:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:e.get("enableRtl")?"right":"left",comparator(n,r,l,a){const d=l.isSelected(),c=a.isSelected();return d&&c?0:d?1:-1},editable:!1,suppressFillHandle:!0,...t,colId:`${bo}`},o=new di(s,null,s.colId,!1);return this.createBean(o),[o]}},xt="ag-Grid-AutoColumn";function Xi(e){const t=[],i=s=>{for(let o=0;o<s.length;o++){const n=s[o];Fe(n)?t.push(n):U(n)&&i(n.getChildren())}};return i(e),t}function Re(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}function Te(e,t,i){const s={};if(!t)return;be(null,t,n=>{s[n.getInstanceId()]=n}),i&&be(null,i,n=>{s[n.getInstanceId()]=null});const o=Object.values(s).filter(n=>n!=null);e.destroyBeans(o)}function Ji(e){return e.getId().startsWith(xt)}function nt(e){return e.getColId().startsWith(bo)}function li(e){let t=[];return e instanceof Array?e.some(s=>typeof s!="string")?w("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):w("colDef.type should be of type 'string' | 'string[]'"),t}var Zi=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e,t){const{frameworkOverrides:i,wrappedListeners:s}=this;let o=t;if(i.shouldWrapOutgoing){o=r=>{i.wrapOutgoing(()=>t(r))};let n=s.get(e);n||(n=new Map,s.set(e,n)),n.set(t,o)}return o}wrapGlobal(e){const{frameworkOverrides:t,wrappedGlobalListeners:i}=this;let s=e;return t.shouldWrapOutgoing&&(s=(o,n)=>{t.wrapOutgoing(()=>e(o,n))},i.set(e,s)),s}unwrap(e,t){const{wrappedListeners:i}=this,s=i.get(e);if(s){const o=s.get(t);if(o)return s.delete(t),s.size===0&&i.delete(e),o}return t}unwrapGlobal(e){const{wrappedGlobalListeners:t}=this,i=t.get(e);return i?(t.delete(e),i):e}},ai=new Set(["__proto__","constructor","prototype"]);function oe(e,t){if(e!=null){if(Array.isArray(e)){for(let i=0;i<e.length;i++)t(i.toString(),e[i]);return}for(const[i,s]of Object.entries(e))ai.has(i)||t(i,s)}}function Po(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(ai.has(i[s]))continue;const o=i[s],n=e[o];t[o]=n}return t}function es(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(o=>{if(t&&t.indexOf(o)>=0||ai.has(o))return;const n=i[o];ts(n)&&n.constructor===Object?s[o]=es(n):s[o]=n}),s}function $e(e){if(!e)return[];const t=Object;if(typeof t.values=="function")return t.values(e);const i=[];for(const s in e)e.hasOwnProperty(s)&&e.propertyIsEnumerable(s)&&i.push(e[s]);return i}function K(e,t,i=!0,s=!1){F(t)&&oe(t,(o,n)=>{if(ai.has(o))return;let r=e[o];r!==n&&(s&&r==null&&n!=null&&typeof n=="object"&&n.constructor===Object&&(r={},e[o]=r),ts(n)&&ts(r)&&!Array.isArray(r)?K(r,n,i,s):(i||n!==void 0)&&(e[o]=n))})}function Mt(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let n=0;n<s.length;n++){if(o==null)return;o=o[s[n]]}return o}function ts(e){return typeof e=="object"&&e!==null}var cd={resizable:!0,sortable:!0},ud=0;function Eo(){return ud++}function Fe(e){return e instanceof di}var di=class extends v{constructor(e,t,i,s){super(),this.isColumn=!0,this.instanceId=Eo(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new We,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){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;t!==void 0?t!==null&&(this.sortIndex=t):i!==null&&(this.sortIndex=i);const s=e.hide,o=e.initialHide;s!==void 0?this.visible=!s:this.visible=!o,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const n=e.flex,r=e.initialFlex;n!==void 0?this.flex=n:r!==void 0&&(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=F(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=F(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??this.gos.environment.getDefaultColumnMinWidth(),this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=F(this.colDef.tooltipField)||F(this.colDef.tooltipValueGetter)||F(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=ze(e.width),s=ze(e.initialWidth);return i!=null?t=i:s!=null?t=s:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(L(this.colDef)||L(this.colDef.showRowGroup))return!1;const t=this.colDef.showRowGroup===!0,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}getHighlighted(){return this.highlighted}addEventListener(e,t){this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new Zi(this.frameworkOverrides));const i=this.frameworkEventListenerService?.wrap(e,t)??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){const i=this.frameworkEventListenerService?.unwrap(e,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(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const t=this.createColumnFunctionCallbackParams(e),i=this.colDef.suppressNavigable;return i(t)}return!1}isCellEditable(e){if(e.group){if(this.gos.get("treeData")){if(!e.data&&!this.gos.get("enableGroupEdit"))return!1}else if(!this.gos.get("enableGroupEdit"))return!1}return 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){const t=this.gos.get("rowSelection");if(t&&typeof t!="string"){const i=nt(this)&&st(t);return this.isColumnFunc(e,i)}else 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]??cd[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}setHighlighted(e){this.highlighted!==e&&(this.highlighted=e,this.columnEventService.dispatchEvent(this.createColumnEvent("headerHighlightChanged","uiColumnMoved")))}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 this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return L(this.sort)}isSorting(){return F(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&&K(s,i),this.columnEventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=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 this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const i=e===!0;this.visible!==i&&(this.visible=i,this.columnEventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){return!this.getColDef().suppressSpanHeaderHeight}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(L(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(L(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&&t!=="flex"&&t!=="gridInitializing"&&(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 this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}},hd={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},Do=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=Qt(e);let i=0;for(;;){let s;if(e?(s=e,i!==0&&(s+="_"+i)):t?(s=t,i!==0&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},xo=class extends v{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,i,s){const o=new Do,{existingCols:n,existingGroups:r,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(e,0,t,n,o,r,s),d=this.findMaxDept(a,0),c=this.balanceColumnTree(a,0,d,o);return be(null,c,(h,g)=>{U(h)&&h.setupExpandable(),h.setOriginalParent(g)}),{columnTree:c,treeDept:d}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&be(null,e,o=>{if(U(o)){const n=o;i.push(n)}else{const n=o;s.push(n.getId()),t.push(n)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}balanceTreeForAutoCols(e,t){const i=[],s=this.findDepth(t);return e.forEach(o=>{let n=o;for(let r=s-1;r>=0;r--){const l=new Dt(null,`FAKE_PATH_${o.getId()}}_${r}`,!0,r);this.createBean(l),l.setChildren([n]),n.setOriginalParent(l),n=l}s===0&&o.setOriginalParent(null),i.push(n)}),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&U(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(U(r)){const l=r,a=this.balanceColumnTree(l.getChildren(),t+1,i,s);l.setChildren(a),o.push(l)}else{let l,a;for(let d=i-1;d>=t;d--){const c=s.getUniqueKey(null,null),u=this.createMergedColGroupDef(null),h=new Dt(u,c,!0,t);this.createBean(h),a&&a.setChildren([h]),a=h,l||(l=a)}if(l&&a)if(o.push(l),e.some(c=>U(c))){a.setChildren([r]);continue}else{a.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(U(o)){const n=o,r=this.findMaxDept(n.getChildren(),t+1);i<r&&(i=r)}}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 d=e[a];this.isColumnGroup(d)?l[a]=this.createColumnGroup(i,d,t,s,o,n,r):l[a]=this.createColumn(i,d,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),d=new Dt(l,a,!1,i);this.createBean(d);const c=this.findExistingGroup(t,n);c&&n.splice(c.idx,1);const u=c?.group;u&&d.setExpanded(u.isExpanded());const h=this.recursivelyCreateColumns(l.children,i+1,e,s,o,n,r);return d.setChildren(h),d}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 l=this.addColumnDefaultAndTypes(t,r.getColId());r.setColDef(l,t,o),this.applyColumnState(r,l,o)}else{const l=s.getUniqueKey(t.colId,t.field),a=this.addColumnDefaultAndTypes(t,l);r=new di(a,t,l,e),this.createBean(r)}return this.dataTypeService?.addColumnListeners(r),r}applyColumnState(e,t,i){const s=ze(t.flex);if(s!==void 0&&e.setFlex(s),e.getFlex()<=0){const l=ze(t.width);if(l!=null)e.setActualWidth(l,i);else{const a=e.getActualWidth();e.setActualWidth(a,i)}}t.sort!==void 0&&(t.sort=="asc"||t.sort=="desc"?e.setSort(t.sort,i):e.setSort(void 0,i));const n=ze(t.sortIndex);n!==void 0&&e.setSortIndex(n);const r=Ui(t.hide);r!==void 0&&e.setVisible(!r,i),t.pinned!==void 0&&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(e.colId!=null){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(e.field!=null){if(s.field===e.field)return{idx:i,column:t[i]};continue}if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(e.groupId!=null)for(let s=0;s<t.length;s++){const o=t[s];if(o.getColGroupDef()&&o.getId()===e.groupId)return{idx:s,group:o}}}addColumnDefaultAndTypes(e,t){const i={},s=this.gos.get("defaultColDef");K(i,s,!1,!0);const o=this.updateColDefAndGetColumnType(i,e,t);o&&this.assignColumnTypes(o,i),K(i,e,!1,!0);const n=this.gos.get("autoGroupColumnDef"),r=me(this.gos);return e.rowGroup&&n&&r&&K(i,{sort:n.sort,initialSort:n.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?li(o):void 0}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},hd),s=this.gos.get("columnTypes")||{};oe(s,(o,n)=>{o in i?w(`the column type '${o}' is a default column type and cannot be overridden.`):(n.type&&w("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[o]=n)}),e.forEach(o=>{const n=i[o.trim()];n?K(t,n,!1,!0):w("colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};function be(e,t,i){if(t)for(let s=0;s<t.length;s++){const o=t[s];U(o)&&be(o,o.getChildren(),i),i(o,e)}}var Mo=class extends v{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.ctrlsService=e.ctrlsService,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.controlsColService=e.controlsColService,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"],t=>this.refreshAll(qe(t.source))),this.addManagedPropertyListener("rowSelection",t=>{this.onSelectionOptionsChanged(t.currentValue,t.previousValue,qe(t.source))}),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(qe(t.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],t=>this.recreateColumnDefs(qe(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gos.get("pivotMode"),qe(t.source))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e){const t=this.colDefs?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(e):void 0;this.valueCache.expire();const i=this.colDefCols?.list,s=this.colDefCols?.tree,o=this.columnFactory.createColumnTree(this.colDefs,!0,s,e);Te(this.context,this.colDefCols?.tree,o.columnTree);const n=o.columnTree,r=o.treeDept,l=Xi(n),a={};l.forEach(d=>a[d.getId()]=d),this.colDefCols={tree:n,treeDepth:r,list:l,map:a},this.funcColsService.extractCols(e,i),this.ready=!0,this.refreshCols(!0),this.visibleColsService.refresh(e),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(e),t&&(this.changeEventsDispatching=!0,t(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(e),e==="gridInitializing"&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(e){if(!this.colDefCols)return;const t=this.cols?.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.createControlsCols(),this.addControlsCols();const i=Wa(this.gos,this.showingPivotResult);(!e||i)&&this.restoreColOrder(),this.positionLockedCols(),this.showRowGroupColsService?.refresh(),this.quickFilterService?.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear(),!Ce(t,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=e!=null,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(r=>this.cols?.map[r.getColId()]!==void 0)||(this.lastPivotOrder=null)}else{const{map:t,list:i,tree:s,treeDepth:o}=this.colDefCols;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns(),i=this.controlsColService?.isControlsColEnabled();return this.cols.list.filter(o=>{const n=Ji(o);if(e){const r=t&&Ae(t,o);return n||r||i&&nt(o)}else return n||o.isVisible()})}addAutoCols(){this.autoCols!=null&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),Ao(this.cols))}createAutoCols(){const e=ti(this.gos,this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),i=this.funcColsService.getRowGroupColumns(),o=!(i.length>0||this.gos.get("treeData"))||t||e,n=()=>{this.autoCols&&(Te(this.context,this.autoCols.tree),this.autoCols=null)};if(o||!this.autoColService){n();return}const r=this.autoColService.createAutoCols(i)??[],l=Io(r,this.autoCols?.list||null),a=this.cols.treeDepth,c=(this.autoCols?this.autoCols.treeDepth:-1)==a;if(l&&c)return;n();const[u,h]=this.columnFactory.balanceTreeForAutoCols(r,this.cols.tree);this.autoCols={list:r,tree:u,treeDepth:h,map:{}};const g=p=>{if(!p)return null;const m=p.filter(f=>!Ji(f));return[...r,...m]};this.lastOrder=g(this.lastOrder),this.lastPivotOrder=g(this.lastPivotOrder)}createControlsCols(){const e=()=>{Te(this.context,this.controlsCols?.tree),this.controlsCols=null};this.controlsColService||e();const t=this.cols.treeDepth,s=(this.controlsCols?.treeDepth??-1)==t,o=this.controlsColService?.createControlsCols()??[];if(Io(o,this.controlsCols?.list??[])&&s)return;e();const[r,l]=this.columnFactory.balanceTreeForAutoCols(o,this.cols.tree);this.controlsCols={list:o,tree:r,treeDepth:l,map:{}};const a=d=>{if(!d)return null;const c=d.filter(u=>!nt(u));return[...o,...c]};this.lastOrder=a(this.lastOrder),this.lastPivotOrder=a(this.lastPivotOrder)}addControlsCols(){this.controlsCols!=null&&(this.cols.list=this.controlsCols.list.concat(this.cols.list),this.cols.tree=this.controlsCols.tree.concat(this.cols.tree),Ao(this.cols))}refreshAll(e){this.isReady()&&(this.refreshCols(!1),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,i){this.columnApplyStateService.applyColumnState({state:e.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!t}))},i)}setColsPinned(e,t,i){if(!this.cols||ye(e))return;if(z(this.gos,"print")){w("Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let s;t===!0||t==="left"?s="left":t==="right"?s="right":s=null;const o=[];e.forEach(n=>{if(!n)return;const r=this.getCol(n);r&&r.getPinned()!==s&&(r.setPinned(s),o.push(r))}),o.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(o,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;U(e)?s=e.getId():s=e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){let t=null;return be(null,this.cols?.tree,i=>{U(i)&&i.getId()===e&&(t=i)}),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||t===0)return!1;if(t===-1)return!0;const s=this.funcColsService.getRowGroupColumns().findIndex(o=>o.getColId()===e.getColId());return t>s}isSuppressAutoCol(){return this.gos.get("groupDisplayType")==="custom"?!0:this.gos.get("treeDataDisplayType")==="custom"}setAutoHeightActive(){this.autoHeightActive=this.cols.list.some(e=>e.isVisible()&&e.isAutoHeight()),this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,N(this.gos)||Me(this.gos)||w("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((a,d)=>[a,d]));if(!this.cols.list.some(a=>t.has(a)))return;const s=new Map(this.cols.list.map(a=>[a,!0])),o=e.filter(a=>s.has(a)),n=new Map(o.map(a=>[a,!0])),r=this.cols.list.filter(a=>!n.has(a)),l=o.slice();r.forEach(a=>{let d=a.getOriginalParent();if(!d){l.push(a);return}const c=[];for(;!c.length&&d;)d.getLeafColumns().forEach(p=>{const m=l.indexOf(p)>=0,f=c.indexOf(p)<0;m&&f&&c.push(p)}),d=d.getOriginalParent();if(!c.length){l.push(a);return}const u=c.map(g=>l.indexOf(g)),h=Math.max(...u);Et(l,a,h+1)}),this.cols.list=l}sortColsLikeKeys(e){if(this.cols==null)return;let t=[];const i={};e.forEach(o=>{if(i[o])return;const n=this.cols.map[o];n&&(t.push(n),i[o]=!0)});let s=0;if(this.cols.list.forEach(o=>{const n=o.getColId();if(i[n]!=null)return;n.startsWith(xt)?Et(t,o,s++):t.push(o)}),t=this.columnMoveService.placeLockedColumns(t),!this.columnMoveService.doesMovePassMarryChildren(t)){w("Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.cols.list=t}sortColsLikeCols(e){!e||e.length<=1||e.filter(i=>this.cols.list.indexOf(i)<0).length>0||e.sort((i,s)=>{const o=this.cols.list.indexOf(i),n=this.cols.list.indexOf(s);return o-n})}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){vo(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((s,o)=>this.lastOrder.indexOf(s)-this.lastOrder.indexOf(o)):this.lastOrder&&e.sort((s,o)=>this.cols.list.indexOf(s)-this.cols.list.indexOf(o));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=>e.getColDef().colSpan!=null)}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(!1),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return e&&this.gos.get("treeData")?(w("Pivot mode not available with treeData."),!1):!0}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!ye(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(e))}setColumnDefs(e,t){this.colDefs=e,this.createColsFromColDefs(t)}destroy(){Te(this.context,this.colDefCols?.tree),Te(this.context,this.autoCols?.tree),Te(this.context,this.controlsCols?.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 t=this.pivotResultColsService.getPivotResultCols()?.list;return[this.colDefCols?.list??[],this.autoCols?.list??[],this.controlsCols?.list??[],t??[]].flat()}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(t==null)return null;const{map:i,list:s}=t;if(typeof e=="string"&&i[e])return i[e];for(let o=0;o<s.length;o++)if(To(s[o],e))return s[o];return this.getAutoCol(e)}getAutoCol(e){return this.autoCols?.list.find(t=>To(t,e))??null}getAutoCols(){return this.autoCols?.list??null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&(e.isColumn?this.eventDispatcher.headerHeight(e):this.eventDispatcher.groupHeaderHeight(e))}getGroupRowsHeight(){const e=[],t=this.ctrlsService.getHeaderRowContainerCtrls();for(const i of t){if(!i)continue;const s=i.getGroupRowCount()||0;for(let o=0;o<s;o++){const n=i.getGroupRowCtrlAtIndex(o),r=e[o];if(n){const l=this.getColumnGroupHeaderRowHeight(n);(r==null||l>r)&&(e[o]=l)}}}return e}getColumnGroupHeaderRowHeight(e){const t=this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight();let i=0;const s=e.getHeaderCtrls();for(const o of s){const n=o.getColumn();if(n.isAutoHeaderHeight()){const r=n.getAutoHeaderHeight();r!=null&&r>i&&(i=r)}}return Math.max(t,i)}getColumnHeaderRowHeight(){const