UNPKG

ag-grid-community

Version:

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

18 lines (11 loc) 1.01 MB
var _r=Object.defineProperty,wu=Object.defineProperties,Eu=Object.getOwnPropertyDescriptor,yu=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertySymbols,Gl=Object.prototype.hasOwnProperty,xl=Object.prototype.propertyIsEnumerable,_l=(e,t,i)=>t in e?_r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,I=(e,t)=>{for(var i in t||(t={}))Gl.call(t,i)&&_l(e,i,t[i]);if(Fo)for(var i of Fo(t))xl.call(t,i)&&_l(e,i,t[i]);return e},Z=(e,t)=>wu(e,yu(t)),Ru=(e,t)=>{var i={};for(var s in e)Gl.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&Fo)for(var s of Fo(e))t.indexOf(s)<0&&xl.call(e,s)&&(i[s]=e[s]);return i},ge=(e,t)=>{for(var i in t)_r(e,i,{get:t[i],enumerable:!0})},d=(e,t,i,s)=>{for(var o=s>1?void 0:s?Eu(t,i):t,r=e.length-1,n;r>=0;r--)(n=e[r])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&_r(t,i,o),o},Je=(e,t)=>(i,s)=>t(i,s,e),Vl={};ge(Vl,{attrToBoolean:()=>Po,attrToNumber:()=>Gt,attrToString:()=>Du,defaultComparator:()=>Tu,exists:()=>y,jsonEquals:()=>Vr,makeNull:()=>pt,missing:()=>G,missingOrEmpty:()=>_e,toStringOrNull:()=>ys,values:()=>ii});function pt(e){return e==null||e===""?null:e}function y(e,t=!1){return e!=null&&(e!==""||t)}function G(e){return!y(e)}function _e(e){return e==null||e.length===0}function ys(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Gt(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 Po(e){if(e!==void 0)return e===null||e===""?!1:typeof e=="boolean"?e:/true/i.test(e)}function Du(e){if(!(e==null||e===""))return e}function Vr(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function Tu(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 r(n,l){return n>l?1:n<l?-1:0}if(typeof e!="string"||!i)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}function ii(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(i=>t.push(i)),t}return Object.values(e)}var Hl=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=ys(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++}}},kl={};ge(kl,{cloneObject:()=>Hr,deepCloneDefinition:()=>Lo,getAllValuesInObject:()=>xt,getValueUsingField:()=>ki,isNonNullObject:()=>Oo,iterateObject:()=>me,mergeDeep:()=>Ve,removeAllReferences:()=>Bl});function me(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))t(i,s)}}function Hr(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){const o=i[s],r=e[o];t[o]=r}return t}function Lo(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(o=>{if(t&&t.indexOf(o)>=0)return;const r=i[o];Oo(r)&&r.constructor===Object?s[o]=Lo(r):s[o]=r}),s}function xt(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 Ve(e,t,i=!0,s=!1){y(t)&&me(t,(o,r)=>{let n=e[o];n!==r&&(s&&n==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(n={},e[o]=n),Oo(r)&&Oo(n)&&!Array.isArray(n)?Ve(n,r,i,s):(i||r!==void 0)&&(e[o]=r))})}function ki(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let r=0;r<s.length;r++){if(o==null)return;o=o[s[r]]}return o}function Bl(e,t=[],i){Object.keys(e).forEach(n=>{typeof e[n]=="object"&&!t.includes(n)&&(e[n]=void 0)});const s=Object.getPrototypeOf(e),o={},r=n=>`AG Grid: Grid API function ${n}() cannot be called as the grid has been destroyed. It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid. To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${i}`;Object.getOwnPropertyNames(s).forEach(n=>{if(typeof s[n]=="function"&&!t.includes(n)){const a=()=>{console.warn(r(n))};o[n]={value:a,writable:!0}}}),Object.defineProperties(e,o)}function Oo(e){return typeof e=="object"&&e!==null}var Wl={};ge(Wl,{compose:()=>bu,debounce:()=>De,doOnce:()=>si,errorOnce:()=>et,executeAfter:()=>Kl,executeInAWhile:()=>zl,executeNextVMTurn:()=>Wr,getFunctionName:()=>Io,isFunction:()=>Mo,noop:()=>Au,throttle:()=>Ur,waitUntil:()=>zr,warnOnce:()=>N});var Ul={};function si(e,t){Ul[t]||(e(),Ul[t]=!0)}function N(e){si(()=>console.warn("AG Grid: "+e),e)}function et(e){si(()=>console.error("AG Grid: "+e),e)}function Io(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&t.length===2?t[1].trim():null}function Mo(e){return!!(e&&e.constructor&&e.call&&e.apply)}function zl(e){Kl(e,400)}var kr=[],Br=!1;function Wr(e){kr.push(e),!Br&&(Br=!0,window.setTimeout(()=>{const t=kr.slice();kr.length=0,Br=!1,t.forEach(i=>i())},0))}function Kl(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function De(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(o,s)},t)}}function Ur(e,t){let i=0;return function(...s){const o=this,r=new Date().getTime();r-i<t||(i=r,e.apply(o,s))}}function zr(e,t,i=100,s){const o=new Date().getTime();let r=null,n=!1;const l=()=>{const a=new Date().getTime()-o>i;(e()||a)&&(t(),n=!0,r!=null&&(window.clearInterval(r),r=null),a&&s&&console.warn(s))};l(),n||(r=window.setInterval(l,10))}function bu(...e){return t=>e.reduce((i,s)=>s(i),t)}var Au=()=>{},Kr=(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))(Kr||{}),No=class Q{static register(t){Q.__register(t,!0,void 0)}static registerModules(t){Q.__registerModules(t,!0,void 0)}static __register(t,i,s){Q.runVersionChecks(t),s!==void 0?(Q.areGridScopedModules=!0,Q.gridModulesMap[s]===void 0&&(Q.gridModulesMap[s]={}),Q.gridModulesMap[s][t.moduleName]=t):Q.globalModulesMap[t.moduleName]=t,Q.setModuleBased(i)}static __unRegisterGridModules(t){delete Q.gridModulesMap[t]}static __registerModules(t,i,s){Q.setModuleBased(i),t&&t.forEach(o=>Q.__register(o,i,s))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[o,r]=Q.currentModuleVersion.split(".")||[];return i===o&&s===r}static runVersionChecks(t){if(Q.currentModuleVersion||(Q.currentModuleVersion=t.version),t.version?Q.isValidModuleVersion(t)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is version ${t.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${t.moduleName}' is incompatible. Please update all modules to the same version.`),t.validate){const i=t.validate();i.isValid||console.error(`AG Grid: ${i.message}`)}}static setModuleBased(t){Q.moduleBased===void 0?Q.moduleBased=t:Q.moduleBased!==t&&si(()=>{console.warn("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."),console.warn("Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){Q.isBundled=!0}static __assertRegistered(t,i,s){var o;if(this.__isRegistered(t,s))return!0;const r=i+t;let n;if(Q.isBundled)n=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle: <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script> For more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(Q.moduleBased||Q.moduleBased===void 0){let l=(o=Object.entries(Kr).find(([a,h])=>h===t))==null?void 0:o[0];n=`AG Grid: unable to use ${i} as the ${l} is not registered${Q.areGridScopedModules?` for gridId: ${s}`:""}. Check if you have registered the module: import { ModuleRegistry } from '@ag-grid-community/core'; import { ${l} } from '${t}'; ModuleRegistry.registerModules([ ${l} ]); For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else n=`AG Grid: unable to use ${i} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package: import 'ag-grid-enterprise'; For more info see: https://www.ag-grid.com/javascript-grid/packages/`;return si(()=>{console.warn(n)},r),!1}static __warnEnterpriseChartDisabled(t){const s="ag-charts-enterprise"+":"+t,r=`AG Grid: the '${t}' chart type is not supported in AG Charts Community as 'ag-grid-charts-enterprise' or '@ag-grid-enterprise/charts-enterprise' hasn't been loaded. See https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/ for more details.`;si(()=>{console.warn(r)},s)}static __isRegistered(t,i){var s;return!!Q.globalModulesMap[t]||!!((s=Q.gridModulesMap[i])!=null&&s[t])}static __getRegisteredModules(t){return[...ii(Q.globalModulesMap),...ii(Q.gridModulesMap[t]||{})]}static __getGridRegisteredModules(t){var i;return ii((i=Q.gridModulesMap[t])!=null?i:{})||[]}static __isPackageBased(){return!Q.moduleBased}};No.globalModulesMap={},No.gridModulesMap={},No.areGridScopedModules=!1;var $=No,$l=class{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return ii(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),y(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),me(this.beanWrappers,(t,i)=>{let s;i.bean.__agBeanMetaData&&i.bean.__agBeanMetaData.autowireMethods&&i.bean.__agBeanMetaData.autowireMethods.agConstructor&&(s=i.bean.__agBeanMetaData.autowireMethods.agConstructor);const o=this.getBeansForParameters(s,i.bean.name),r=new(i.bean.bind.apply(i.bean,[null,...o]));i.beanInstance=r});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let s;e.prototype.constructor?s=Io(e.prototype.constructor):s=""+e,console.error(`Context item ${s} is not a bean`);return}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach(t=>{this.forEachMetaDataInHierarchy(t,(i,s)=>{const o=i.agClassAttributes;o&&o.forEach(r=>{const n=this.lookupBeanInstance(s,r.beanName,r.optional);t[r.attributeName]=n})})})}methodWireBeans(e){e.forEach(t=>{this.forEachMetaDataInHierarchy(t,(i,s)=>{me(i.autowireMethods,(o,r)=>{if(o==="agConstructor")return;const n=this.getBeansForParameters(r,s);t[o].apply(t,n)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;i!=null;){const s=i.constructor;if(s.hasOwnProperty("__agBeanMetaData")){const o=s.__agBeanMetaData,r=this.getBeanName(s);t(o,r)}i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&me(e,(s,o)=>{const r=this.lookupBeanInstance(t,o);i[Number(s)]=r}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if(t==="context")return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const s=this.beanWrappers[t];return s?s.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(i=>this.callLifeCycleMethodsOnBean(i,t))}callLifeCycleMethodsOnBean(e,t,i){const s={};this.forEachMetaDataInHierarchy(e,r=>{const n=r[t];n&&n.forEach(l=>{l!=i&&(s[l]=!0)})}),Object.keys(s).forEach(r=>e[r]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,$.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(t=>{this.callLifeCycleMethodsOnBean(t,"preDestroyMethods","destroy");const i=t;typeof i.destroy=="function"&&i.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}};function $r(e,t,i){const s=oi(e.constructor);s.preConstructMethods||(s.preConstructMethods=[]),s.preConstructMethods.push(t)}function T(e,t,i){const s=oi(e.constructor);s.postConstructMethods||(s.postConstructMethods=[]),s.postConstructMethods.push(t)}function ve(e,t,i){const s=oi(e.constructor);s.preDestroyMethods||(s.preDestroyMethods=[]),s.preDestroyMethods.push(t)}function P(e){return t=>{const i=oi(t);i.beanName=e}}function g(e){return(t,i,s)=>{Yl(t,e,!1,t,i,null)}}function U(e){return(t,i,s)=>{Yl(t,e,!0,t,i,null)}}function Yl(e,t,i,s,o,r){if(t===null){console.error("AG Grid: Autowired name should not be null");return}if(typeof r=="number"){console.error("AG Grid: Autowired should be on an attribute");return}const n=oi(e.constructor);n.agClassAttributes||(n.agClassAttributes=[]),n.agClassAttributes.push({attributeName:o,beanName:t,optional:i})}function He(e){return(t,i,s)=>{const o=typeof t=="function"?t:t.constructor;let r;if(typeof s=="number"){let n;i?(r=oi(o),n=i):(r=oi(o),n="agConstructor"),r.autowireMethods||(r.autowireMethods={}),r.autowireMethods[n]||(r.autowireMethods[n]={}),r.autowireMethods[n][s]=e}}}function oi(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var Ke=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={}}setBeans(e,t,i=null,s=null){if(this.frameworkOverrides=t,this.gridOptionsService=e,i){const o=e.useAsyncEvents();this.addGlobalListener(i,o)}s&&this.addGlobalListener(s,!1)}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){let t=e;this.gridOptionsService&&this.gridOptionsService.addGridCommonParams(t),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){var i;const s=e.type;if(t&&"event"in e){const a=e.event;a instanceof Event&&(e.eventPath=a.composedPath())}const o=(a,h)=>a.forEach(c=>{if(!h.has(c))return;const p=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>c(e)):()=>c(e);t?this.dispatchAsync(p):p()}),r=(i=this.getListeners(s,t,!1))!=null?i:new Set,n=new Set(r);n.size>0&&o(n,r),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(a=>{const h=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>a(s,e)):()=>a(s,e);t?this.dispatchAsync(h):h()})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}};d([Je(0,He("gridOptionsService")),Je(1,He("frameworkOverrides")),Je(2,He("globalEventListener")),Je(3,He("globalSyncEventListener"))],Ke.prototype,"setBeans",1),Ke=d([P("eventService")],Ke);var Yr=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=i=>{this.frameworkOverrides.wrapOutgoing(()=>e(i))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(i,s)=>{this.frameworkOverrides.wrapOutgoing(()=>e(i,s))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){var t;return(t=this.wrappedListeners.get(e))!=null?t:e}unwrapGlobal(e){var t;return(t=this.wrappedGlobalListeners.get(e))!=null?t:e}},Fu={resizable:!0,sortable:!0},Pu=0;function jl(){return Pu++}var ne=class Wh{constructor(t,i,s,o){this.instanceId=jl(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new Ke,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=t,this.userProvidedColDef=i,this.colId=s,this.primary=o,this.setState(t)}getInstanceId(){return this.instanceId}setState(t){t.sort!==void 0?(t.sort==="asc"||t.sort==="desc")&&(this.sort=t.sort):(t.initialSort==="asc"||t.initialSort==="desc")&&(this.sort=t.initialSort);const i=t.sortIndex,s=t.initialSortIndex;i!==void 0?i!==null&&(this.sortIndex=i):s!==null&&(this.sortIndex=s);const o=t.hide,r=t.initialHide;o!==void 0?this.visible=!o:this.visible=!r,t.pinned!==void 0?this.setPinned(t.pinned):this.setPinned(t.initialPinned);const n=t.flex,l=t.initialFlex;n!==void 0?this.flex=n:l!==void 0&&(this.flex=l)}setColDef(t,i,s){this.colDef=t,this.userProvidedColDef=i,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",s))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(t){this.parent=t}getParent(){return this.parent}setOriginalParent(t){this.originalParent=t}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const t=this.gridOptionsService.get("suppressFieldDotNotation");this.fieldContainsDots=y(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!t,this.tooltipFieldContainsDots=y(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!t}initMinAndMaxWidths(){const t=this.colDef;this.minWidth=this.columnUtils.calculateColMinWidth(t),this.maxWidth=this.columnUtils.calculateColMaxWidth(t)}initTooltip(){this.tooltipEnabled=y(this.colDef.tooltipField)||y(this.colDef.tooltipValueGetter)||y(this.colDef.tooltipComponent)}resetActualWidth(t){const i=this.columnUtils.calculateColInitialWidth(this.colDef);this.setActualWidth(i,t,!0)}isEmptyGroup(){return!1}isRowGroupDisplayed(t){if(G(this.colDef)||G(this.colDef.showRowGroup))return!1;const i=this.colDef.showRowGroup===!0,s=this.colDef.showRowGroup===t;return i||s}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(t,i){var s,o;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new Yr(this.frameworkOverrides));const r=(o=(s=this.frameworkEventListenerService)==null?void 0:s.wrap(i))!=null?o:i;this.eventService.addEventListener(t,r)}removeEventListener(t,i){var s,o;const r=(o=(s=this.frameworkEventListenerService)==null?void 0:s.unwrap(i))!=null?o:i;this.eventService.removeEventListener(t,r)}createColumnFunctionCallbackParams(t){return this.gridOptionsService.addGridCommonParams({node:t,data:t.data,column:this,colDef:this.colDef})}isSuppressNavigable(t){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const i=this.createColumnFunctionCallbackParams(t),s=this.colDef.suppressNavigable;return s(i)}return!1}isCellEditable(t){return t.group&&!this.gridOptionsService.get("enableGroupEdit")?!1:this.isColumnFunc(t,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(t){return this.isColumnFunc(t,this.colDef.rowDrag)}isDndSource(t){return this.isColumnFunc(t,this.colDef.dndSource)}isCellCheckboxSelection(t){return this.isColumnFunc(t,this.colDef.checkboxSelection)}isSuppressPaste(t){return this.isColumnFunc(t,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(t){var i;return(i=this.colDef[t])!=null?i:Fu[t]}isColumnFunc(t,i){if(typeof i=="boolean")return i;if(typeof i=="function"){const s=this.createColumnFunctionCallbackParams(t);return i(s)}return!1}setMoving(t,i){this.moving=t,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",i))}createColumnEvent(t,i){return this.gridOptionsService.addGridCommonParams({type:t,column:this,columns:[this],source:i})}isMoving(){return this.moving}getSort(){return this.sort}setSort(t,i){this.sort!==t&&(this.sort=t,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",i))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(t,i){this.menuVisible!==t&&(this.menuVisible=t,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",i)))}isMenuVisible(){return this.menuVisible}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return G(this.sort)}isSorting(){return y(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(t){this.sortIndex=t,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(t){this.aggFunc=t,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(t,i){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",i)))}isFilterActive(){return this.filterActive}setFilterActive(t,i,s){this.filterActive!==t&&(this.filterActive=t,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",i)));const o=this.createColumnEvent("filterChanged",i);s&&Ve(o,s),this.eventService.dispatchEvent(o)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(t){t===!0||t==="left"?this.pinned="left":t==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(t,i){this.firstRightPinned!==t&&(this.firstRightPinned=t,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",i)))}setLastLeftPinned(t,i){this.lastLeftPinned!==t&&(this.lastLeftPinned=t,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",i)))}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(t,i){const s=t===!0;this.visible!==s&&(this.visible=s,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",i))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const t=this.getColDef();return!t.suppressSpanHeaderHeight&&!t.autoHeaderHeight}getColumnGroupPaddingInfo(){let t=this.getParent();if(!t||!t.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const i=t.getPaddingLevel()+1;let s=!0;for(;t;){if(!t.isPadding()){s=!1;break}t=t.getParent()}return{numberOfParents:i,isSpanningTotal:s}}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(t){const i=t!==this.autoHeaderHeight;return this.autoHeaderHeight=t,i}createBaseColDefParams(t){return this.gridOptionsService.addGridCommonParams({node:t,data:t.data,colDef:this.colDef,column:this})}getColSpan(t){if(G(this.colDef.colSpan))return 1;const i=this.createBaseColDefParams(t),s=this.colDef.colSpan(i);return Math.max(s,1)}getRowSpan(t){if(G(this.colDef.rowSpan))return 1;const i=this.createBaseColDefParams(t),s=this.colDef.rowSpan(i);return Math.max(s,1)}setActualWidth(t,i,s=!1){this.minWidth!=null&&(t=Math.max(t,this.minWidth)),this.maxWidth!=null&&(t=Math.min(t,this.maxWidth)),this.actualWidth!==t&&(this.actualWidth=t,this.flex&&i!=="flex"&&i!=="gridInitializing"&&(this.flex=null),s||this.fireColumnWidthChangedEvent(i)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(t){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",t))}isGreaterThanMax(t){return this.maxWidth!=null?t>this.maxWidth:!1}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(t){this.flex!==t&&(this.flex=t),this.dispatchStateUpdatedEvent("flex")}setMinimum(t){y(this.minWidth)&&this.setActualWidth(this.minWidth,t)}setRowGroupActive(t,i){this.rowGroupActive!==t&&(this.rowGroupActive=t,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",i))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(t,i){this.pivotActive!==t&&(this.pivotActive=t,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",i))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(t,i){this.aggregationActive!==t&&(this.aggregationActive=t,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",i)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}getMenuTabs(t){N("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let i=this.getColDef().menuTabs;return i==null&&(i=t),i}dispatchStateUpdatedEvent(t){this.eventService.dispatchEvent({type:Wh.EVENT_STATE_UPDATED,key:t})}};ne.EVENT_MOVING_CHANGED="movingChanged",ne.EVENT_LEFT_CHANGED="leftChanged",ne.EVENT_WIDTH_CHANGED="widthChanged",ne.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",ne.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",ne.EVENT_VISIBLE_CHANGED="visibleChanged",ne.EVENT_FILTER_CHANGED="filterChanged",ne.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",ne.EVENT_SORT_CHANGED="sortChanged",ne.EVENT_COL_DEF_CHANGED="colDefChanged",ne.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",ne.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",ne.EVENT_PIVOT_CHANGED="columnPivotChanged",ne.EVENT_VALUE_CHANGED="columnValueChanged",ne.EVENT_STATE_UPDATED="columnStateUpdated",d([g("gridOptionsService")],ne.prototype,"gridOptionsService",2),d([g("columnUtils")],ne.prototype,"columnUtils",2),d([g("columnHoverService")],ne.prototype,"columnHoverService",2),d([g("frameworkOverrides")],ne.prototype,"frameworkOverrides",2),d([T],ne.prototype,"initialise",1);var j=ne,Go=class Ro{constructor(t,i,s,o){this.localEventService=new Ke,this.expandable=!1,this.instanceId=jl(),this.expandableListenerRemoveCallback=null,this.colGroupDef=t,this.groupId=i,this.expanded=!!t&&!!t.openByDefault,this.padding=s,this.level=o}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(t,i){this.colGroupDef=t,this.level=i,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(t){this.originalParent=t}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(t=>t.isVisible()):!1}isPadding(){return this.padding}setExpanded(t){this.expanded=t===void 0?!1:t;const i={type:Ro.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(i)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(t){this.children=t}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const t=[];return this.addLeafColumns(t),t}addLeafColumns(t){this.children&&this.children.forEach(i=>{i instanceof j?t.push(i):i instanceof Ro&&i.addLeafColumns(t)})}getColumnGroupShow(){const t=this.colGroupDef;if(t)return t.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const t=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(i=>i.addEventListener("visibleChanged",t)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(i=>i.removeEventListener("visibleChanged",t)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let t=!1,i=!1,s=!1;const o=this.findChildrenRemovingPadding();for(let n=0,l=o.length;n<l;n++){const a=o[n];if(!a.isVisible())continue;const h=a.getColumnGroupShow();h==="open"?(t=!0,s=!0):h==="closed"?(i=!0,s=!0):(t=!0,i=!0)}const r=t&&i&&s;if(this.expandable!==r){this.expandable=r;const n={type:Ro.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(n)}}findChildrenRemovingPadding(){const t=[],i=s=>{s.forEach(o=>{o instanceof Ro&&o.isPadding()?i(o.children):t.push(o)})};return i(this.children),t}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(t,i){this.localEventService.addEventListener(t,i)}removeEventListener(t,i){this.localEventService.removeEventListener(t,i)}};Go.EVENT_EXPANDED_CHANGED="expandedChanged",Go.EVENT_EXPANDABLE_CHANGED="expandableChanged",d([ve],Go.prototype,"destroy",1);var se=Go,Lu={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},ql={};ge(ql,{addSafePassiveEventListener:()=>ra,createEventPath:()=>sa,getCtrlForEventTarget:()=>xo,getEventPath:()=>oa,isElementInEventPath:()=>_o,isEventSupported:()=>Jr,isStopPropagationForAgGrid:()=>it,stopPropagationForAgGrid:()=>tt});var Ql={};ge(Ql,{areEqual:()=>gt,existsAndNotEmpty:()=>Xl,flatten:()=>ta,forEachReverse:()=>Nu,includes:()=>ke,insertArrayIntoArray:()=>qr,insertIntoArray:()=>Rs,last:()=>z,moveInArray:()=>Qr,pushAll:()=>Xr,removeAllFromArray:()=>ea,removeAllFromUnorderedArray:()=>Jl,removeFromArray:()=>Pe,removeFromUnorderedArray:()=>jr,removeRepeatsFromArray:()=>Iu,shallowCompare:()=>Ou,sortNumerically:()=>Zl,toStrings:()=>Mu});function Xl(e){return e!=null&&e.length>0}function z(e){if(!(!e||!e.length))return e[e.length-1]}function gt(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 Ou(e,t){return gt(e,t)}function Zl(e){return e.sort((t,i)=>t-i)}function Iu(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 jr(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function Pe(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function Jl(e,t){for(let i=0;i<t.length;i++)jr(e,t[i])}function ea(e,t){for(let i=0;i<t.length;i++)Pe(e,t[i])}function Rs(e,t,i){e.splice(i,0,t)}function qr(e,t,i){if(!(e==null||t==null))for(let s=t.length-1;s>=0;s--){const o=t[s];Rs(e,o,i)}}function Qr(e,t,i){ea(e,t),t.slice().reverse().forEach(s=>Rs(e,s,i))}function ke(e,t){return e.indexOf(t)>-1}function ta(e){return[].concat.apply([],e)}function Xr(e,t){t==null||e==null||t.forEach(i=>e.push(i))}function Mu(e){return e.map(ys)}function Nu(e,t){if(e!=null)for(let i=e.length-1;i>=0;i--)t(e[i],i)}var ia="__ag_Grid_Stop_Propagation",Gu=["touchstart","touchend","touchmove","touchcancel","scroll"],Zr={};function tt(e){e[ia]=!0}function it(e){return e[ia]===!0}var Jr=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof Zr[i]=="boolean")return Zr[i];const s=document.createElement(e[i]||"div");return i="on"+i,Zr[i]=i in s}})();function xo(e,t,i){let s=t;for(;s;){const o=e.getDomData(s,i);if(o)return o;s=s.parentElement}return null}function _o(e,t){return!t||!e?!1:oa(t).indexOf(e)>=0}function sa(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function oa(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():sa(t)}function ra(e,t,i,s){const r=ke(Gu,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,r)}var Dt=class Uh{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.lastChangeSetIdLookup={},this.propertyListenerId=0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){this.destroyFunctions.forEach(t=>t()),this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:Uh.EVENT_DESTROYED})}addEventListener(t,i){this.localEventService||(this.localEventService=new Ke),this.localEventService.addEventListener(t,i)}removeEventListener(t,i){this.localEventService&&this.localEventService.removeEventListener(t,i)}dispatchEvent(t){this.localEventService&&this.localEventService.dispatchEvent(t)}addManagedListener(t,i,s){if(this.destroyed)return;t instanceof HTMLElement?ra(this.getFrameworkOverrides(),t,i,s):t.addEventListener(i,s);const o=()=>(t.removeEventListener(i,s),this.destroyFunctions=this.destroyFunctions.filter(r=>r!==o),null);return this.destroyFunctions.push(o),o}setupGridOptionListener(t,i){this.gridOptionsService.addEventListener(t,i);const s=()=>(this.gridOptionsService.removeEventListener(t,i),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null);return this.destroyFunctions.push(s),s}addManagedPropertyListener(t,i){return this.destroyed?()=>null:this.setupGridOptionListener(t,i)}addManagedPropertyListeners(t,i){if(this.destroyed)return;const s=t.join("-")+this.propertyListenerId++,o=r=>{if(r.changeSet){if(r.changeSet&&r.changeSet.id===this.lastChangeSetIdLookup[s])return;this.lastChangeSetIdLookup[s]=r.changeSet.id}const n={type:"gridPropertyChanged",changeSet:r.changeSet,source:r.source};i(n)};t.forEach(r=>this.setupGridOptionListener(r,o))}addDestroyFunc(t){this.isAlive()?this.destroyFunctions.push(t):t()}createManagedBean(t,i){const s=this.createBean(t,i);return this.addDestroyFunc(this.destroyBean.bind(this,t,i)),s}createBean(t,i,s){return(i||this.getContext()).createBean(t,s)}destroyBean(t,i){return(i||this.getContext()).destroyBean(t)}destroyBeans(t,i){return t&&t.forEach(s=>this.destroyBean(s,i)),[]}};Dt.EVENT_DESTROYED="destroyed",d([g("frameworkOverrides")],Dt.prototype,"frameworkOverrides",2),d([g("context")],Dt.prototype,"context",2),d([g("eventService")],Dt.prototype,"eventService",2),d([g("gridOptionsService")],Dt.prototype,"gridOptionsService",2),d([g("localeService")],Dt.prototype,"localeService",2),d([g("environment")],Dt.prototype,"environment",2),d([ve],Dt.prototype,"destroy",1);var D=Dt,ri=class extends D{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i,s){const o=new Hl,{existingCols:r,existingGroups:n,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(e,0,t,r,o,n,s),h=this.findMaxDept(a,0);this.logger.log("Number of levels for grouped columns is "+h);const c=this.balanceColumnTree(a,0,h,o),p=(f,C)=>{f instanceof se&&f.setupExpandable(),f.setOriginalParent(C)};return this.columnUtils.depthFirstOriginalTreeSearch(null,c,p),{columnTree:c,treeDept:h}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&this.columnUtils.depthFirstOriginalTreeSearch(null,e,o=>{if(o instanceof se){const r=o;i.push(r)}else{const r=o;s.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){return e.map(i=>this.createAutoGroupTreeItem(t,i))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let s=t;for(let o=i-1;o>=0;o--){const r=new se(null,`FAKE_PATH_${t.getId()}}_${o}`,!0,o);this.createBean(r),r.setChildren([s]),s.setOriginalParent(r),s=r}return i===0&&t.setOriginalParent(null),s}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof se;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let r=0;r<e.length;r++){const n=e[r];if(n instanceof se){const l=n,a=this.balanceColumnTree(l.getChildren(),t+1,i,s);l.setChildren(a),o.push(l)}else{let l,a;for(let h=i-1;h>=t;h--){const c=s.getUniqueKey(null,null),p=this.createMergedColGroupDef(null),f=new se(p,c,!0,t);this.createBean(f),a&&a.setChildren([f]),a=f,l||(l=a)}if(l&&a)if(o.push(l),e.some(c=>c instanceof se)){a.setChildren([n]);continue}else{a.setChildren(e);break}o.push(n)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(o instanceof se){const r=o,n=this.findMaxDept(r.getChildren(),t+1);i<n&&(i=n)}}return i}recursivelyCreateColumns(e,t,i,s,o,r,n){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,r,n):l[a]=this.createColumn(i,h,s,o,n)}return l}createColumnGroup(e,t,i,s,o,r,n){const l=this.createMergedColGroupDef(t),a=o.getUniqueKey(l.groupId||null,null),h=new se(l,a,!1,i);this.createBean(h);const c=this.findExistingGroup(t,r);c&&r.splice(c.idx,1);let p=c?.group;p&&h.setExpanded(p.isExpanded());const f=this.recursivelyCreateColumns(l.children,i+1,e,s,o,r,n);return h.setChildren(f),h}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gridOptionsService.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,o){const r=this.findExistingColumn(t,i);r&&i?.splice(r.idx,1);let n=r?.column;if(n){const l=this.addColumnDefaultAndTypes(t,n.getColId());n.setColDef(l,t,o),this.applyColumnState(n,l,o)}else{const l=s.getUniqueKey(t.colId,t.field),a=this.addColumnDefaultAndTypes(t,l);n=new j(a,t,l,e),this.context.createBean(n)}return this.dataTypeService.addColumnListeners(n),n}applyColumnState(e,t,i){const s=Gt(t.flex);if(s!==void 0&&e.setFlex(s),e.getFlex()<=0){const l=Gt(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 r=Gt(t.sortIndex);r!==void 0&&e.setSortIndex(r);const n=Po(t.hide);n!==void 0&&e.setVisible(!n,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.gridOptionsService.get("defaultColDef");Ve(i,s,!1,!0);const o=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);o&&this.assignColumnTypes(o,i),Ve(i,e,!1,!0);const r=this.gridOptionsService.get("autoGroupColumnDef"),n=this.gridOptionsService.isColumnsSortingCoupledToGroup();return e.rowGroup&&r&&n&&Ve(i,{sort:r.sort,initialSort:r.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},Lu),s=this.gridOptionsService.get("columnTypes")||{};me(s,(o,r)=>{o in i?console.warn(`AG Grid: the column type '${o}' is a default column type and cannot be overridden.`):(r.type&&N("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]=r)}),e.forEach(o=>{const r=i[o.trim()];r?Ve(t,r,!1,!0):console.warn("AG Grid: colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};d([g("columnUtils")],ri.prototype,"columnUtils",2),d([g("dataTypeService")],ri.prototype,"dataTypeService",2),d([Je(0,He("loggerFactory"))],ri.prototype,"setBeans",1),ri=d([P("columnFactory")],ri);var Vo=class yt{constructor(t,i,s,o){this.displayedChildren=[],this.localEventService=new Ke,this.groupId=i,this.partId=s,this.providedColumnGroup=t,this.pinned=o}static createUniqueId(t,i){return t+"_"+i}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(t){this.parent=t}getUniqueId(){return yt.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const t=this.getProvidedColumnGroup().getLeafColumns();return!t||t.length===0?!1:t.every(i=>i.isMoving())}checkLeft(){if(this.displayedChildren.forEach(t=>{t instanceof yt&&t.checkLeft()}),this.displayedChildren.length>0)if(this.gridOptionsService.get("enableRtl")){const i=z(this.displayedChildren).getLeft();this.setLeft(i)}else{const t=this.displayedChildren[0].getLeft();this.setLeft(t)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(t){this.oldLeft=this.left,this.left!==t&&(this.left=t,this.localEventService.dispatchEvent(this.createAgEvent(yt.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(t){return{type:t}}addEventListener(t,i){this.localEventService.addEventListener(t,i)}removeEventListener(t,i){this.localEventService.removeEventListener(t,i)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(t){let i=!1;return this.children.forEach(s=>{t===s&&(i=!0),s instanceof yt&&s.isChildInThisGroupDeepSearch(t)&&(i=!0)}),i}getActualWidth(){let t=0;return this.displayedChildren&&this.displayedChildren.forEach(i=>{t+=i.getActualWidth()}),t}isResizable(){if(!this.displayedChildren)return!1;let t=!1;return this.displayedChildren.forEach(i=>{i.isResizable()&&(t=!0)}),t}getMinWidth(){let t=0;return this.displayedChildren.forEach(i=>{t+=i.getMinWidth()||0}),t}addChild(t){this.children||(this.children=[]),this.children.push(t)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const t=[];return this.addLeafColumns(t),t}getDisplayedLeafColumns(){const t=[];return this.addDisplayedLeafColumns(t),t}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(t){this.providedColumnGroup.setExpanded(t)}addDisplayedLeafColumns(t){this.displayedChildren.forEach(i=>{i instanceof j?t.push(i):i instanceof yt&&i.addDisplayedLeafColumns(t)})}addLeafColumns(t){this.children.forEach(i=>{i instanceof j?t.push(i):i instanceof yt&&i.addLeafColumns(t)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const t=this.getParent();return!this.isPadding()||!t||!t.isPadding()?0:1+t.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let t=this;for(;t!=null&&t.isPadding();)t=t.getParent();if(!(t?t.providedColumnGroup.isExpandable():!1)){this.displayedChildren=this.children,this.localEventService.dispatchEvent(this.createAgEvent(yt.EVENT_DISPLAYED_CHILDREN_CHANGED));return}this.children.forEach(s=>{if(s instanceof yt&&(!s.displayedChildren||!s.displayedChildren.length))return;switch(s.getColumnGroupShow()){case"open":t.providedColumnGroup.isExpanded()&&this.displayedChildren.push(s);break;case"closed":t.providedColumnGroup.isExpanded()||this.displayedChildren.push(s);break;default:this.displayedChildren.push(s);break}}),this.localEventService.dispatchEvent(this.createAgEvent(yt.EVENT_DISPLAYED_CHILDREN_CHANGED))}};Vo.EVENT_LEFT_CHANGED="leftChanged",Vo.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",d([g("gridOptionsService")],Vo.prototype,"gridOptionsService",2);var le=Vo,u=class{};u.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",u.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",u.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",u.EVENT_PIVOT_MAX_COLUMNS_EXCEEDED="pivotMaxColumnsExceeded",u.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",u.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",u.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",u.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",u.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",u.EVENT_COLUMN_MOVED="columnMoved",u.EVENT_COLUMN_VISIBLE="columnVisible",u.EVENT_COLUMN_PINNED="columnPinned",u.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",u.EVENT_COLUMN_RESIZED="columnResized",u.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",u.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns",u.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide",u.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation",u.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",u.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver",u.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave",u.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked",u.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu",u.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",u.EVENT_ROW_GROUP_OPENED="rowGroupOpened",u.EVENT_ROW_DATA_UPDATED="rowDataUpdated",u.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",u.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",u.EVENT_CHART_CREATED="chartCreated",u.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",u.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",u.EVENT_CHART_DESTROYED="chartDestroyed",u.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",u.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",u.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",u.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",u.EVENT_MODEL_UPDATED="modelUpdated",u.EVENT_CUT_START="cutStart",u.EVENT_CUT_END="cutEnd",u.EVENT_PASTE_START="pasteStart",u.EVENT_PASTE_END="pasteEnd",u.EVENT_FILL_START="fillStart",u.EVENT_FILL_END="fillEnd",u.EVENT_RANGE_DELETE_START="rangeDeleteStart",u.EVENT_RANGE_DELETE_END="rangeDeleteEnd",u.EVENT_UNDO_STARTED="undoStarted",u.EVENT_UNDO_ENDED="undoEnded",u.EVENT_REDO_STARTED="redoStarted",u.EVENT_REDO_ENDED="redoEnded",u.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",u.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",u.EVENT_CELL_CLICKED="cellClicked",u.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",u.EVENT_CELL_MOUSE_DOWN="cellMouseDown",u.EVENT_CELL_CONTEXT_MENU="cellContextMenu",u.EVENT_CELL_VALUE_CHANGED="cellValueChanged",u.EVENT_CELL_EDIT_REQUEST="cellEditRequest",u.EVENT_ROW_VALUE_CHANGED="rowValueChanged",u.EVENT_CELL_FOCUSED="cellFocused",