import{Q as bo,T as xn,aj as Po,a2 as An,O as Tn,e as In,ak as Ks}from"./index.0409e1b2.js";var ct=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 h=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>d(e)):()=>d(e);t?this.dispatchAsync(h):h()}),o=this.getListeners(i,t,!1)??new Set,r=new Set(o);r.size>0&&s(r,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())}},Do=(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))(Do||{}),$s={};function ls(e,t){$s[t]||(e(),$s[t]=!0)}function ne(e,...t){console.log("AG Grid: "+e,...t)}function S(e,...t){ls(()=>console.warn("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function O(e,...t){ls(()=>console.error("AG Grid: "+e,...t),e+(t==null?void 0:t.join("")))}function as(e){return!!(e&&e.constructor&&e.call&&e.apply)}function Ln(e){On(e,400)}var wi=[],Si=!1;function js(e){wi.push(e),!Si&&(Si=!0,window.setTimeout(()=>{const t=wi.slice();wi.length=0,Si=!1,t.forEach(i=>i())},0))}function On(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function Y(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(o,s)},t)}}function qs(e,t){let i=0;return function(...s){const o=this,r=new Date().getTime();r-i{const a=new Date().getTime()-o>i;(e()||a)&&(t(),n=!0,r!=null&&(window.clearInterval(r),r=null),a&&s&&S(s))};l(),n||(r=window.setInterval(l,10))}function kn(...e){return t=>e.reduce((i,s)=>s(i),t)}function Re(e){return e==null||e===""?null:e}function F(e,t=!1){return e!=null&&(e!==""||t)}function A(e){return!F(e)}function se(e){return e==null||e.length===0}function Hi(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function Ue(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 Vi(e){if(e!==void 0)return e===null||e===""?!1:Ni(e)}function Ni(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}function Mt(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function Hn(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:nt.push(i)),t}return Object.values(e)}function Eo(e,t){return e.get("rowModelType")===t}function N(e){return Eo(e,"clientSide")}function De(e){return Eo(e,"serverSide")}function z(e,t){return e.get("domLayout")===t}function Xt(e){return ei(e)!==void 0}function Jt(e){return!e.get("suppressAsyncEvents")}function Mo(e){return typeof e.get("getRowHeight")=="function"}function Vn(e,t){return t?!e.get("enableStrictPivotColumnOrder"):e.get("maintainColumnOrder")}function Le(e,t,i=!1,s){if(s==null&&(s=e.environment.getDefaultRowHeight()),Mo(e)){if(i)return{height:s,estimated:!0};const n={node:t,data:t.data},l=e.getCallback("getRowHeight")(n);if(Bi(l))return l===0&&S("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 Nn(e);const o=e.get("rowHeight");return{height:o&&Bi(o)?o:s,estimated:!1}}function Nn(e){if(e.get("detailRowAutoHeight"))return{height:1,estimated:!1};const t=e.get("detailRowHeight");return Bi(t)?{height:t,estimated:!1}:{height:300,estimated:!1}}function Ke(e){const{environment:t}=e,i=e.get("rowHeight");if(!i||A(i))return t.getDefaultRowHeight();const s=t.refreshRowHeightVariable();return s!==-1?s:(S("row height must be a number if not using standard row model"),t.getDefaultRowHeight())}function Bi(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}function xt(e,t,i){const s=t[e.getDomDataKey()];return s?s[i]:void 0}function Ye(e,t,i,s){const o=e.getDomDataKey();let r=t[o];A(r)&&(r={},t[o]=r),r[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 xo(e){return B(e).defaultView||window}function At(e){return e.eGridDiv.getRootNode()}function V(e){return At(e).activeElement}function Ao(e){const t=B(e),i=V(e);return i===null||i===t.body}function ot(e){return e.get("ensureDomOrder")?!1:e.get("animateRows")}function ci(e){return!(e.get("paginateChildRows")||e.get("groupHideOpenParents")||z(e,"print"))}function fe(e){const t=e.get("autoGroupColumnDef");return!(t!=null&&t.comparator)&&!e.get("treeData")}function Wi(e){const t=e.get("groupAggFiltering");if(typeof t=="function")return e.getCallback("groupAggFiltering");if(t===!0)return()=>!0}function To(e){const t=e.get("grandTotalRow");if(t)return t;if(e.get("groupIncludeTotalFooter"))return"bottom"}function Io(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 Lo(e){return e.exists("groupDisplayType")?e.get("groupDisplayType")==="multipleColumns":e.get("groupHideOpenParents")}function ui(e,t){return t?!1:e.get("groupDisplayType")==="groupRows"}function ut(e){const t=e.getCallback("getRowId");return t===void 0?t:i=>{let s=t(i);return typeof s!="string"&&(S("The getRowId callback must return a string. The ID ",s," is being cast to a string."),s=String(s)),s}}function lt(e){return(e==null?void 0:e.checkboxes)??!0}function Zt(e){return(e==null?void 0:e.mode)==="multiRow"&&(e.headerCheckbox??!0)}function Bn(e){return(e==null?void 0:e.hideDisabledCheckboxes)??!1}function Wn(e){return typeof e.get("rowSelection")!="string"}function zn(e){return e.get("cellSelection")!==void 0}function _n(e){const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?(t==null?void 0:t.suppressMultiRanges)??!1:!1:e.get("suppressMultiRangeSelection")}function ve(e){const t=e.get("cellSelection");return t!==void 0?!!t:e.get("enableRangeSelection")}function Un(e){var s;const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?((s=t.handle)==null?void 0:s.mode)==="range":!1:e.get("enableRangeHandle")}function Ys(e){var s;const t=e.get("cellSelection");return t!==void 0?typeof t!="boolean"?((s=t.handle)==null?void 0:s.mode)==="fill":!1:e.get("enableFillHandle")}function Oo(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 Kn(e){const t=Oo(e);return t===!0||t==="enableSelection"}function Qs(e){const t=Oo(e);return t===!0||t==="enableDeselection"}function ds(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("isRowSelectable"):t==null?void 0:t.isRowSelectable}function ei(e){const t=e.get("rowSelection");if(typeof t=="string")switch(t){case"multiple":return"multiRow";case"single":return"singleRow";default:return}return t==null?void 0:t.mode}function hs(e){return ei(e)==="multiRow"}function $n(e){const t=e.get("rowSelection");return typeof t=="string"?e.get("rowMultiSelectWithClick"):(t==null?void 0:t.enableSelectionWithoutKeys)??!1}function cs(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==null?void 0:t.mode)==="multiRow"?t.groupSelects:void 0}function Qe(e){const t=cs(e);return t==="descendants"||t==="filteredDescendants"}function yi(e){return e.isModuleRegistered("@ag-grid-enterprise/set-filter")&&!e.get("suppressSetFilterByDefault")}function I(e){if(!(!e||!e.length))return e[e.length-1]}function ke(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 jn(e){return e.sort((t,i)=>t-i)}function Go(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function Q(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function qn(e,t){for(let i=0;iti(e,s,i))}function $e(e,t){return e.indexOf(t)>-1}function Qn(e){return(e==null?void 0:e.flatMap(t=>t))??[]}function Xs(e,t){t==null||e==null||t.forEach(i=>e.push(i))}var Ho="__ag_Grid_Stop_Propagation",Xn=["touchstart","touchend","touchmove","touchcancel","scroll"],Ri={};function at(e){e[Ho]=!0}function Fe(e){return e[Ho]===!0}var Vo=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof Ri[i]=="boolean")return Ri[i];const s=document.createElement(e[i]||"div");return i="on"+i,Ri[i]=i in s}})();function zi(e,t,i){let s=t;for(;s;){const o=xt(e,s,i);if(o)return o;s=s.parentElement}return null}function Jn(e,t){return!t||!e?!1:el(t).indexOf(e)>=0}function Zn(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function el(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Zn(t)}function tl(e,t,i,s){const r=$e(Xn,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,r)}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;enull;e instanceof HTMLElement?tl(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 r={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(r)};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 j(e){return e instanceof qt}var qt=class extends v{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=Wo(),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=>{Ge(t)?e.push(t):j(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 r=0,n=s.length;r{i.forEach(s=>{j(s)&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},No="ag-Grid-ControlsColumn",il=class extends v{constructor(){super(...arguments),this.beanName="controlsColService"}createControlsCols(){const{gos:e}=this,t=e.get("rowSelection");if(!t||typeof t!="object")return[];const i=lt(t),s=Zt(t);if(i||s){const o=e.get("selectionColumnDef"),n={maxWidth:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:e.get("enableRtl")?"right":"left",comparator(a,d,h,c){const u=h.isSelected(),g=c.isSelected();return u&&g?0:u?1:-1},editable:!1,suppressFillHandle:!0,...o,colId:`${No}`},l=new fs(n,null,n.colId,!1);return this.createBean(l),[l]}return[]}},gi="ag-Grid-AutoColumn";function us(e){const t=[],i=s=>{for(let o=0;ot+i.getActualWidth(),0)}function Te(e,t,i){const s={};if(!t)return;Pe(null,t,r=>{s[r.getInstanceId()]=r}),i&&Pe(null,i,r=>{s[r.getInstanceId()]=null});const o=Object.values(s).filter(r=>r!=null);e.destroyBeans(o)}function _i(e){return e.getId().startsWith(gi)}function Gt(e){return e.getColId().startsWith(No)}function Yt(e){let t=[];return e instanceof Array?e.some(s=>typeof s!="string")?S("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):S("colDef.type should be of type 'string' | 'string[]'"),t}var gs=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){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}},ps=new Set(["__proto__","constructor","prototype"]);function re(e,t){if(e!=null){if(Array.isArray(e)){for(let i=0;i{if(t&&t.indexOf(o)>=0||ps.has(o))return;const r=i[o];Ki(r)&&r.constructor===Object?s[o]=Ui(r):s[o]=r}),s}function Oe(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 q(e,t,i=!0,s=!1){F(t)&&re(t,(o,r)=>{if(ps.has(o))return;let n=e[o];n!==r&&(s&&n==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(n={},e[o]=n),Ki(r)&&Ki(n)&&!Array.isArray(n)?q(n,r,i,s):(i||r!==void 0)&&(e[o]=r))})}function Rt(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let r=0;r=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=Ue(e.width),s=Ue(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(A(this.colDef)||A(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){var s;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new gs(this.frameworkOverrides));const i=((s=this.frameworkEventListenerService)==null?void 0:s.wrap(t))??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){var s;const i=((s=this.frameworkEventListenerService)==null?void 0:s.unwrap(t))??t;this.columnEventService.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(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=Gt(this)&<(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]??sl[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 A(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&&q(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(A(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(A(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})}},rl={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},nl=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t{j(u)&&u.setupExpandable(),u.setOriginalParent(g)}),{columnTree:h,treeDept:d}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&Pe(null,e,o=>{if(j(o)){const r=o;i.push(r)}else{const r=o;s.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}balanceTreeForAutoCols(e,t){const i=[],s=this.findDepth(t);return e.forEach(o=>{let r=o;for(let n=s-1;n>=0;n--){const l=new qt(null,`FAKE_PATH_${o.getId()}}_${n}`,!0,n);this.createBean(l),l.setChildren([r]),r.setOriginalParent(l),r=l}s===0&&o.setOriginalParent(null),i.push(r)}),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&j(i[0]);)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let r=0;r=t;d--){const h=s.getUniqueKey(null,null),c=this.createMergedColGroupDef(null),u=new qt(c,h,!0,t);this.createBean(u),a&&a.setChildren([u]),a=u,l||(l=a)}if(l&&a)if(o.push(l),e.some(h=>j(h))){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{o in i?S(`the column type '${o}' is a default column type and cannot be overridden.`):(r.type&&S("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?q(t,r,!1,!0):S("colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};function Pe(e,t,i){if(t)for(let s=0;sthis.refreshAll(We(t.source))),this.addManagedPropertyListener("rowSelection",t=>{this.onSelectionOptionsChanged(t.currentValue,t.previousValue,We(t.source))}),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(We(t.source))),this.addManagedPropertyListeners(["defaultColDef","defaultColGroupDef","columnTypes","suppressFieldDotNotation"],t=>this.recreateColumnDefs(We(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gos.get("pivotMode"),We(t.source))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e){var d,h,c;const t=this.colDefs?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(e):void 0;this.valueCache.expire();const i=(d=this.colDefCols)==null?void 0:d.list,s=(h=this.colDefCols)==null?void 0:h.tree,o=this.columnFactory.createColumnTree(this.colDefs,!0,s,e);Te(this.context,(c=this.colDefCols)==null?void 0:c.tree,o.columnTree);const r=o.columnTree,n=o.treeDept,l=us(r),a={};l.forEach(u=>a[u.getId()]=u),this.colDefCols={tree:r,treeDepth:n,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){var o,r,n;if(!this.colDefCols)return;const t=(o=this.cols)==null?void 0:o.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.createControlsCols(),this.addControlsCols();const i=Vn(this.gos,this.showingPivotResult);(!e||i)&&this.restoreColOrder(),this.positionLockedCols(),(r=this.showRowGroupColsService)==null||r.refresh(),(n=this.quickFilterService)==null||n.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear(),!ke(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(n=>{var l;return((l=this.cols)==null?void 0:l.map[n.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();return this.cols.list.filter(s=>{const o=_i(s);if(e){const r=t&&$e(t,s);return o||r}else return o||s.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),Js(this.cols))}createAutoCols(){var p;const e=ui(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,r=()=>{this.autoCols&&(Te(this.context,this.autoCols.tree),this.autoCols=null)};if(o||!this.autoColService){r();return}const n=this.autoColService.createAutoCols(i)??[],l=eo(n,((p=this.autoCols)==null?void 0:p.list)||null),a=this.cols.treeDepth,h=(this.autoCols?this.autoCols.treeDepth:-1)==a;if(l&&h)return;r();const[c,u]=this.columnFactory.balanceTreeForAutoCols(n,this.cols.tree);this.autoCols={list:n,tree:c,treeDepth:u,map:{}};const g=C=>{if(!C)return null;const f=C.filter(w=>!_i(w));return[...n,...f]};this.lastOrder=g(this.lastOrder),this.lastPivotOrder=g(this.lastPivotOrder)}createControlsCols(){var d,h,c;const e=()=>{var u;Te(this.context,(u=this.controlsCols)==null?void 0:u.tree),this.controlsCols=null};this.controlsColService||e();const t=this.cols.treeDepth,s=(((d=this.controlsCols)==null?void 0:d.treeDepth)??-1)==t,o=((h=this.controlsColService)==null?void 0:h.createControlsCols())??[];if(eo(o,((c=this.controlsCols)==null?void 0:c.list)??[])&&s)return;e();const[n,l]=this.columnFactory.balanceTreeForAutoCols(o,this.cols.tree);this.controlsCols={list:o,tree:n,treeDepth:l,map:{}};const a=u=>{if(!u)return null;const g=u.filter(p=>!Gt(p));return[...o,...g]};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),Js(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||se(e))return;if(z(this.gos,"print")){S("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(r=>{if(!r)return;const n=this.getCol(r);n&&n.getPinned()!==s&&(n.setPinned(s),o.push(n))}),o.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(o,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;j(e)?s=e.getId():s=e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){var i;let t=null;return Pe(null,(i=this.cols)==null?void 0:i.tree,s=>{j(s)&&s.getId()===e&&(t=s)}),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)||De(this.gos)||S("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)),r=new Map(o.map(a=>[a,!0])),n=this.cols.list.filter(a=>!r.has(a)),l=o.slice();n.forEach(a=>{let d=a.getOriginalParent();if(!d){l.push(a);return}const h=[];for(;!h.length&&d;)d.getLeafColumns().forEach(p=>{const C=l.indexOf(p)>=0,f=h.indexOf(p)<0;C&&f&&h.push(p)}),d=d.getOriginalParent();if(!h.length){l.push(a);return}const c=h.map(g=>l.indexOf(g)),u=Math.max(...c);ti(l,a,u+1)}),this.cols.list=l}sortColsLikeKeys(e){if(this.cols==null)return;let t=[];const i={};e.forEach(o=>{if(i[o])return;const r=this.cols.map[o];r&&(t.push(r),i[o]=!0)});let s=0;if(this.cols.list.forEach(o=>{const r=o.getColId();if(i[r]!=null)return;r.startsWith(gi)?ti(t,o,s++):t.push(o)}),t=this.columnMoveService.placeLockedColumns(t),!this.columnMoveService.doesMovePassMarryChildren(t)){S("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),r=this.cols.list.indexOf(s);return o-r})}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){var s;ko((s=this.cols)==null?void 0:s.list,e,t),this.visibleColsService.refresh(i)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){var e,t;this.showingPivotResult?this.lastPivotOrder=(e=this.cols)==null?void 0:e.list:this.lastOrder=(t=this.cols)==null?void 0:t.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(){var e;return((e=this.colDefCols)==null?void 0:e.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")?(S("Pivot mode not available with treeData."),!1):!0}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!se(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(){var e,t,i;Te(this.context,(e=this.colDefCols)==null?void 0:e.tree),Te(this.context,(t=this.autoCols)==null?void 0:t.tree),Te(this.context,(i=this.controlsCols)==null?void 0:i.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){var e;return(e=this.colDefCols)!=null&&e.list?this.colDefCols.list:null}getCols(){var e;return((e=this.cols)==null?void 0:e.list)??[]}getAllCols(){var i,s,o;const e=this.pivotResultColsService.getPivotResultCols(),t=e==null?void 0:e.list;return[((i=this.colDefCols)==null?void 0:i.list)??[],((s=this.autoCols)==null?void 0:s.list)??[],((o=this.controlsCols)==null?void 0:o.list)??[],t??[]].flat()}getColsForKeys(e){return e?e.map(t=>this.getCol(t)).filter(t=>t!=null):[]}getColDefCol(e){var t;return(t=this.colDefCols)!=null&&t.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;oZs(i,e)))??null}getAutoCols(){var e;return((e=this.autoCols)==null?void 0:e.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;on)&&(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 r=o.getColumn();if(r.isAutoHeaderHeight()){const n=r.getAutoHeaderHeight();n!=null&&n>i&&(i=n)}}return Math.max(t,i)}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),i=this.visibleColsService.getAllCols().filter(s=>s.isAutoHeaderHeight()).map(s=>s.getAutoHeaderHeight()||0);return Math.max(e,...i)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if((e==null?void 0:e.type)!=="fitCellContents")return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",i)})}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}onSelectionOptionsChanged(e,t,i){const s=t&&typeof t!="string"?lt(t):void 0,o=e&&typeof e!="string"?lt(e):void 0,r=s!==o,n=t&&typeof t!="string"?Zt(t):void 0,l=e&&typeof e!="string"?Zt(e):void 0;(r||n!==l)&&this.refreshAll(i)}};function We(e){return e==="gridOptionsUpdated"?"gridOptionsChanged":e}function Js(e){e.map={},e.list.forEach(t=>e.map[t.getId()]=t)}function Zs(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}function eo(e,t){return ke(e,t,(i,s)=>i.getColId()===s.getColId())}var dl=class extends v{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,this.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeCols(e));return}const{colKeys:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:r="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered()){this.timesDelayed++,setTimeout(()=>this.autoSizeCols(e));return}this.timesDelayed=0;const n=[];let l=-1;const a=i??this.gos.get("skipHeaderOnAutoSize"),d=s??a;for(;l!==0;){l=0;const h=[];t.forEach(c=>{if(!c)return;const u=this.columnModel.getCol(c);if(!u||n.indexOf(u)>=0)return;const g=this.autoWidthCalculator.getPreferredWidthForColumn(u,a);if(g>0){const p=this.normaliseColumnWidth(u,g);u.setActualWidth(p,r),n.push(u),l++}h.push(u)}),h.length&&this.visibleColsService.refresh(r)}d||this.autoSizeColumnGroupsByColumns(t,r,o),this.eventDispatcher.columnResized(n,!0,"autosizeColumns")}autoSizeColumn(e,t,i){e&&this.autoSizeCols({colKeys:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;this.columnModel.getColsForKeys(e).forEach(l=>{let a=l.getParent();for(;a&&a!=i;)a.isPadding()||s.add(a),a=a.getParent()});let r;const n=[];for(const l of s){for(const a of this.ctrlsService.getHeaderRowContainerCtrls())if(r=a.getHeaderCtrlForColumn(l),r)break;r&&r.resizeLeafColumnsToFit(t)}return n}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeAllColumns(e,t));return}const i=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:i,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const i=e.getMinWidth();tthis.rowGroupCols.push(e),removeGroupCol:e=>Q(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>Q(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>Q(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(t===!0)return this.rowGroupCols.slice(0);const i=this.columnModel.getColDefCol(t);return i?[i]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return se(this.rowGroupCols)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.columnModel.getColDefCol(e);s&&(s.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[s],i))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,(i,s)=>this.setRowGroupActive(i,s,t),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,i),!e&&!this.gos.get("suppressMakeColumnVisibleAfterUnGroup")&&this.columnModel.setColsVisible([t],!0,i))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,i=>this.setRowGroupActive(!0,i,t),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,i=>this.setRowGroupActive(!1,i,t),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,i=>i.setPivotActive(!0,t),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"columnPivotChanged",!0,!1,(i,s)=>{s.setPivotActive(i,t)},t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,i=>i.setPivotActive(!1,t),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,(i,s)=>this.setValueActive(i,s,t),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const s=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(s)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,i=>this.setValueActive(!0,i,t),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,i=>this.setValueActive(!1,i,t),"columnValueChanged",t)}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupCols[e],o=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,s),this.eventDispatcher.rowGroupChanged(o,i)}setColList(e,t,i,s,o,r,n){if(!this.columnModel.getCols())return;const l=new Map;t.forEach((d,h)=>l.set(d,h)),t.length=0,F(e)&&e.forEach(d=>{const h=this.columnModel.getColDefCol(d);h&&t.push(h)}),t.forEach((d,h)=>{const c=l.get(d);if(c===void 0){l.set(d,0);return}s&&c!==h||l.delete(d)}),(this.columnModel.getColDefCols()||[]).forEach(d=>{const h=t.indexOf(d)>=0;r(h,d)}),o&&this.columnModel.refreshCols(!1),this.visibleColsService.refresh(n),this.eventDispatcher.columnChanged(i,[...l.keys()],n)}updateColList(e,t,i,s,o,r,n){if(!e||se(e))return;let l=!1;const a=new Set;e.forEach(d=>{if(!d)return;const h=this.columnModel.getColDefCol(d);if(h){if(a.add(h),i){if(t.indexOf(h)>=0)return;t.push(h)}else{const c=t.indexOf(h);if(c<0)return;for(let u=c+1;ui.setValueActive(s,e),()=>{},()=>{},i=>{const s=i.aggFunc;if(s===null||s==="")return null;if(s!==void 0)return!!s},i=>i.initialAggFunc!=null&&i.initialAggFunc!=""),this.valueCols.forEach(i=>{const s=i.getColDef();s.aggFunc!=null&&s.aggFunc!=""?i.setAggFunc(s.aggFunc):i.getAggFunc()||i.setAggFunc(s.initialAggFunc)})}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,(i,s)=>i.setRowGroupActive(s,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,(i,s)=>i.setPivotActive(s,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}extractColsCommon(e=[],t=[],i,s,o,r,n){const l=[],a=[];(this.columnModel.getColDefCols()||[]).forEach(u=>{const g=e.indexOf(u)<0,p=u.getColDef(),C=Vi(r(p)),f=Vi(n(p)),w=Ue(s(p)),y=Ue(o(p));let R;C!==void 0?R=C:w!==void 0?w===null?R=!1:R=w>=0:g?f!==void 0?R=f:y!==void 0?R=y!=null&&y>=0:R=!1:R=t.indexOf(u)>=0,R&&((g?w!=null||y!=null:w!=null)?l.push(u):a.push(u))});const h=u=>{const g=s(u.getColDef()),p=o(u.getColDef());return g??p};l.sort((u,g)=>{const p=h(u),C=h(g);return p===C?0:p{a.indexOf(u)>=0&&c.push(u)}),a.forEach(u=>{c.indexOf(u)<0&&c.push(u)}),t.forEach(u=>{c.indexOf(u)<0&&i(u,!1)}),c.forEach(u=>{t.indexOf(u)<0&&i(u,!0)}),c}generateColumnStateForRowGroupAndPivotIndexes(e,t){const i={},s=(o,r,n,l,a,d)=>{const h=this.columnModel.getColDefCols();if(!r.length||!h)return[];const c=Object.keys(o),u=new Set(c),g=new Set(c),p=new Set(r.map(D=>{const E=D.getColId();return g.delete(E),E}).concat(c)),C=[],f={};let w=0;for(let D=0;D{const E=f[D];for(let T=P;T{const E=D.getColId();if(u.has(E))M(E),o[E][a]=y++;else{const T=D.getColDef();(T[a]===null||T[a]===void 0&&T[d]==null)&&(R||(T[n]||T[n]===void 0&&T[l]?M(E):(g.forEach(Ve=>{o[Ve][a]=y+f[Ve]}),y+=C.length,R=!0)),i[E]||(i[E]={colId:E}),i[E][a]=y++)}})};return s(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}},cl=class extends v{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const i=this.columnModel.getColDefCols()||[];if(se(i))return!1;if(e&&e.state&&!e.state.forEach)return S("applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const s=this.funcColsService.getModifyColumnsNoEventsCallbacks(),o=(l,a,d)=>{const h=this.compareColumnStatesAndDispatchEvents(t),c=a.slice(),u={},g={},p=[],C=[];let f=0;const w=this.funcColsService.getRowGroupColumns().slice(),y=this.funcColsService.getPivotColumns().slice();l.forEach(D=>{const E=D.colId||"";if(E.startsWith(gi)){p.push(D),C.push(D);return}const L=d(E);L?(this.syncColumnWithStateItem(L,D,e.defaultState,u,g,!1,t,s),Q(c,L)):(C.push(D),f+=1)});const R=D=>this.syncColumnWithStateItem(D,null,e.defaultState,u,g,!1,t,s);c.forEach(R),this.funcColsService.sortRowGroupColumns(to.bind(this,u,w)),this.funcColsService.sortPivotColumns(to.bind(this,g,y)),this.columnModel.refreshCols(!1);const M=(this.columnModel.getAutoCols()||[]).slice();return p.forEach(D=>{const E=this.columnModel.getAutoCol(D.colId);Q(M,E),this.syncColumnWithStateItem(E,D,e.defaultState,null,null,!0,t,s)}),M.forEach(R),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),h(),{unmatchedAndAutoStates:C,unmatchedCount:f}};this.columnAnimationService.start();let{unmatchedAndAutoStates:r,unmatchedCount:n}=o(e.state||[],i,l=>this.columnModel.getColDefCol(l));if(r.length>0||F(e.defaultState)){const l=this.pivotResultColsService.getPivotResultCols(),a=l==null?void 0:l.list;n=o(r,a||[],d=>this.pivotResultColsService.getPivotResultCol(d)).unmatchedCount}return this.columnAnimationService.finish(),n===0}resetColumnState(e){const t=this.columnModel.getColDefCols();if(se(t))return;const i=this.columnModel.getColDefColTree(),s=us(i),o=[];let r=1e3,n=1e3,l=[];const a=this.columnModel.getAutoCols();a&&(l=l.concat(a)),s&&(l=l.concat(s)),l.forEach(d=>{const h=this.getColumnStateFromColDef(d);A(h.rowGroupIndex)&&h.rowGroup&&(h.rowGroupIndex=r++),A(h.pivotIndex)&&h.pivot&&(h.pivotIndex=n++),o.push(h)}),this.applyColumnState({state:o,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(p,C)=>p??C??null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),n=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),a=t(i.flex,i.initialFlex);let d=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);d==null&&(h==null||h==!1)&&(d=null,h=null);let c=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);c==null&&(u==null||u==!1)&&(c=null,u=null);const g=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:r,pinned:n,width:l,flex:a,rowGroup:h,rowGroupIndex:d,pivot:u,pivotIndex:c,aggFunc:g}}syncColumnWithStateItem(e,t,i,s,o,r,n,l){if(!e)return;const a=(P,M)=>{const D={value1:void 0,value2:void 0};let E=!1;return t&&(t[P]!==void 0&&(D.value1=t[P],E=!0),F(M)&&t[M]!==void 0&&(D.value2=t[M],E=!0)),!E&&i&&(i[P]!==void 0&&(D.value1=i[P]),F(M)&&i[M]!==void 0&&(D.value2=i[M])),D},d=a("hide").value1;d!==void 0&&e.setVisible(!d,n);const h=a("pinned").value1;h!==void 0&&e.setPinned(h);const c=e.getColDef().minWidth??this.gos.environment.getDefaultColumnMinWidth(),u=a("flex").value1;if(u!==void 0&&e.setFlex(u),u==null){const P=a("width").value1;P!=null&&c!=null&&P>=c&&e.setActualWidth(P,n)}const g=a("sort").value1;g!==void 0&&(g==="desc"||g==="asc"?e.setSort(g,n):e.setSort(void 0,n));const p=a("sortIndex").value1;if(p!==void 0&&e.setSortIndex(p),r||!e.isPrimary())return;const C=a("aggFunc").value1;C!==void 0&&(typeof C=="string"?(e.setAggFunc(C),e.isValueActive()||(e.setValueActive(!0,n),l.addValueCol(e))):(F(C)&&S("stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,n),l.removeValueCol(e))));const{value1:f,value2:w}=a("rowGroup","rowGroupIndex");(f!==void 0||w!==void 0)&&(typeof w=="number"||f?(e.isRowGroupActive()||(e.setRowGroupActive(!0,n),l.addGroupCol(e)),s&&typeof w=="number"&&(s[e.getId()]=w)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,n),l.removeGroupCol(e)));const{value1:y,value2:R}=a("pivot","pivotIndex");(y!==void 0||R!==void 0)&&(typeof R=="number"||y?(e.isPivotActive()||(e.setPivotActive(!0,n),l.addPivotCol(e)),o&&typeof R=="number"&&(o[e.getId()]=R)):e.isPivotActive()&&(e.setPivotActive(!1,n),l.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach(i=>{i.colId!=null&&t.push(i.colId)}),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},i=this.columnGetStateService.getColumnState(),s={};return i.forEach(o=>{s[o.colId]=o}),()=>{const o=this.columnModel.getAllCols(),r=(C,f,w,y)=>{const R=f.map(y),P=w.map(y);if(ke(R,P))return;const D=new Set(f);w.forEach(T=>{D.delete(T)||D.add(T)});const E=[...D];this.eventService.dispatchEvent({type:C,columns:E,column:E.length===1?E[0]:null,source:e})},n=C=>{const f=[];return o.forEach(w=>{const y=s[w.getColId()];y&&C(y,w)&&f.push(w)}),f},l=C=>C.getColId();r("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),l),r("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),l);const d=n((C,f)=>{const w=C.aggFunc!=null,y=w!=f.isValueActive(),R=w&&C.aggFunc!=f.getAggFunc();return y||R});d.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",d,e);const h=(C,f)=>C.width!=f.getActualWidth();this.eventDispatcher.columnResized(n(h),!0,e);const c=(C,f)=>C.pinned!=f.getPinned();this.eventDispatcher.columnPinned(n(c),e);const u=(C,f)=>C.hide==f.isVisible();this.eventDispatcher.columnVisible(n(u),e);const p=n((C,f)=>C.sort!=f.getSort()||C.sortIndex!=f.getSortIndex());p.length>0&&this.sortController.dispatchSortChangedEvents(e,p),this.normaliseColumnMovedEventForColumnState(i,e)}}normaliseColumnMovedEventForColumnState(e,t){const i=this.columnGetStateService.getColumnState(),s={};i.forEach(a=>s[a.colId]=a);const o={};e.forEach(a=>{s[a.colId]&&(o[a.colId]=!0)});const r=e.filter(a=>o[a.colId]),n=i.filter(a=>o[a.colId]),l=[];n.forEach((a,d)=>{const h=r&&r[d];if(h&&h.colId!==a.colId){const c=this.columnModel.getCol(h.colId);c&&l.push(c)}}),l.length&&this.eventDispatcher.columnMoved({movedColumns:l,source:t,finished:!0})}},to=(e,t,i,s)=>{const o=e[i.getId()],r=e[s.getId()],n=o!=null,l=r!=null;if(n&&l)return o-r;if(n)return-1;if(l)return 1;const a=t.indexOf(i),d=t.indexOf(s),h=a>=0,c=d>=0;return h&&c?a-d:h?-1:1},ul=class extends v{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,i){const s=this.columnModel.getCols();if(!s)return;const o=s[e];this.moveColumns([o],t,i)}moveColumns(e,t,i,s=!0){const o=this.columnModel.getCols();if(!o)return;if(t>o.length-e.length){S("tried to insert columns in invalid location, toIndex = ",t),S("remember that you should not count the moving columns when calculating the new index");return}this.columnAnimationService.start();const r=this.columnModel.getColsForKeys(e);this.doesMovePassRules(r,t)&&(this.columnModel.moveInCols(r,t,i),this.eventDispatcher.columnMoved({movedColumns:r,source:i,toIndex:t,finished:s})),this.columnAnimationService.finish()}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const s=this.columnModel.getCols().slice();return ko(s,e,t),s}doesMovePassLockedPositions(e){const t=r=>r?r==="left"||r===!0?-1:1:0,i=this.gos.get("enableRtl");let s=i?1:-1,o=!0;return e.forEach(r=>{const n=t(r.getColDef().lockPosition);i?n>s&&(o=!1):n{if(!j(s))return;const o=s,r=o.getColGroupDef();if(!(r&&r.marryChildren))return;const l=[];o.getLeafColumns().forEach(u=>{const g=e.indexOf(u);l.push(g)});const a=Math.max.apply(Math,l),d=Math.min.apply(Math,l),h=a-d,c=o.getLeafColumns().length-1;h>c&&(t=!1)}),t}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(r=>{const n=r.getColDef().lockPosition;n==="right"?s.push(r):n==="left"||n===!0?t.push(r):i.push(r)}),this.gos.get("enableRtl")?[...s,...i,...t]:[...t,...i,...s]}},gl=/[&<>"']/g,pl={"&":"&","<":"<",">":">",'"':""","'":"'"};function me(e,t){if(e==null)return null;const i=e.toString().toString();return t?i:i.replace(gl,s=>pl[s])}function fl(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,i=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(i,"$1 $2$3").replace(/\./g," ").split(" ").map(o=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" ")}function Cl(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}var ml=class extends v{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const r=e.headerValueGetter;if(r){const n=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o});return typeof r=="function"?r(n):typeof r=="string"?this.expressionService.evaluate(r,n):(S("headerValueGetter must be a function or a string"),"")}else{if(e.headerName!=null)return e.headerName;if(e.field)return fl(e.field)}return""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn,s=F(i);let o=null,r;if(s){const n=this.funcColsService.getValueColumns(),l=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&n.length===1,a=e.getColDef().pivotTotalColumnIds!==void 0;if(l&&!a)return t;o=i?i.getAggFunc():null,r=!0}else{const n=e.isValueActive(),l=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();n&&l?(o=e.getAggFunc(),r=!0):r=!1}if(r){const n=typeof o=="string"?o:"func";return`${this.localeService.getLocaleTextFunc()(n,n)}(${t})`}return t}},vl=class extends v{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){var e;Te(this.context,(e=this.pivotResultCols)==null?void 0:e.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;const i=this.columnModel.getColDefCol(t);let s=null;return this.pivotResultCols.list.forEach(o=>{const r=o.getColDef().pivotKeys,n=o.getColDef().pivotValueColumn;ke(r,e)&&n===i&&(s=o)}),s}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){var i,s;if(this.columnModel.isReady()&&!(e==null&&this.pivotResultCols==null)){if(e){this.processPivotResultColDef(e);const o=this.columnFactory.createColumnTree(e,!1,((i=this.pivotResultCols)==null?void 0:i.tree)||this.previousPivotResultCols||void 0,t);Te(this.context,(s=this.pivotResultCols)==null?void 0:s.tree,o.columnTree);const r=o.columnTree,n=o.treeDept,l=us(r),a={};this.pivotResultCols={tree:r,treeDepth:n,list:l,map:a},this.pivotResultCols.list.forEach(h=>this.pivotResultCols.map[h.getId()]=h);const d=!!this.previousPivotResultCols;this.previousPivotResultCols=null,this.columnModel.refreshCols(!d)}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null,this.columnModel.refreshCols(!1);this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=o=>{o.forEach(r=>{if(F(r.children)){const l=r;i&&i(l),s(l.children)}else t&&t(r)})};e&&s(e)}},wl=class extends v{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,i,s){const o=[];e.forEach(r=>{const n=this.columnModel.getColDefCol(r.key)||this.columnModel.getCol(r.key);if(!n)return;if(o.push({width:r.newWidth,ratios:[1],columns:[n]}),this.gos.get("colResizeDefault")==="shift"&&(t=!t),t){const a=this.visibleColsService.getColAfter(n);if(!a)return;const d=n.getActualWidth()-r.newWidth,h=a.getActualWidth()+d;o.push({width:h,ratios:[1],columns:[a]})}}),o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(!(!t||t.every(h=>this.checkMinAndMaxWidthsForSet(h)))){if(i){const h=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(h,i,s)}return}const r=[],n=[];t.forEach(h=>{const{width:c,columns:u,ratios:g}=h,p={},C={};u.forEach(y=>n.push(y));let f=!0,w=0;for(;f;){if(w++,w>1e3){O("infinite loop in resizeColumnSets");break}f=!1;const y=[];let R=0,P=c;u.forEach((D,E)=>{if(C[D.getId()])P-=p[D.getId()];else{y.push(D);const L=g[E];R+=L}});const M=1/R;y.forEach((D,E)=>{const T=E===y.length-1;let L;T?L=P:(L=Math.round(g[E]*c*M),P-=L);const X=D.getMinWidth(),Ve=D.getMaxWidth();L0&&L>Ve&&(L=Ve,C[D.getId()]=!0,f=!0),p[D.getId()]=L})}u.forEach(y=>{const R=p[y.getId()];y.getActualWidth()!==R&&(y.setActualWidth(R,s),r.push(y))})});const l=r.length>0;let a=[];l&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.visibleColsService.setLeftValues(s),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const d=n.concat(a);(l||i)&&this.eventDispatcher.columnResized(d,i,s,a)}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,r=!0;t.forEach(a=>{const d=a.getMinWidth();s+=d||0;const h=a.getMaxWidth();h>0?o+=h:r=!1});const n=i>=s,l=!r||i<=o;return n&&l}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const i=this.visibleColsService.getCenterCols();let s=-1;if(e.resizingCols){const u=new Set(e.resizingCols);for(let g=i.length-1;g>=0;g--)if(u.has(i[g])){s=g;break}}let o=0,r=[],n=0,l=0;for(let u=0;us?(r.push(i[u]),l+=i[u].getFlex(),n+=i[u].getMinWidth()):o+=i[u].getActualWidth();if(!r.length)return[];let a=[];o+n>this.flexViewportWidth&&(r.forEach(u=>u.setActualWidth(u.getMinWidth(),t)),a=r,r=[]);const d=[];let h;e:for(;;){h=this.flexViewportWidth-o;const u=h/l;for(let g=0;gy&&(f=y),f){p.setActualWidth(f,t),Go(r,p),l-=p.getFlex(),a.push(p),o+=p.getActualWidth();continue e}d[g]=Math.floor(C)}break}let c=h;return r.forEach((u,g)=>{const p=gthis.sizeColumnsToFit(e,t,i,s));return}const o={};s&&((u=s==null?void 0:s.columnLimits)==null||u.forEach(({key:g,...p})=>{o[typeof g=="string"?g:g.getColId()]=p}));const r=this.visibleColsService.getAllCols(),n=e===Se(r);if(e<=0||!r.length||n)return;const l=[],a=[];r.forEach(g=>{g.getColDef().suppressSizeToFit===!0?a.push(g):l.push(g)});const d=l.slice(0);let h=!1;const c=g=>{Q(l,g),a.push(g)};for(l.forEach(g=>{g.resetActualWidth(t);const p=o==null?void 0:o[g.getId()],C=(p==null?void 0:p.minWidth)??(s==null?void 0:s.defaultMinWidth),f=(p==null?void 0:p.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=g.getActualWidth();typeof C=="number"&&wf&&g.setActualWidth(f,t,!0)});!h;){h=!0;const g=e-Se(a);if(g<=0)l.forEach(p=>{var f;const C=((f=o==null?void 0:o[p.getId()])==null?void 0:f.minWidth)??(s==null?void 0:s.defaultMinWidth);if(typeof C=="number"){p.setActualWidth(C,t,!0);return}p.setMinimum(t)});else{const p=g/Se(l);let C=g;for(let f=l.length-1;f>=0;f--){const w=l[f],y=o==null?void 0:o[w.getId()],R=(y==null?void 0:y.minWidth)??(s==null?void 0:s.defaultMinWidth),P=(y==null?void 0:y.maxWidth)??(s==null?void 0:s.defaultMaxWidth),M=w.getMinWidth(),D=w.getMaxWidth(),E=typeof R=="number"&&R>M?R:M,T=typeof P=="number"&&PT?(L=T,c(w),h=!1):f===0&&(L=C),w.setActualWidth(L,t,!0),C-=L}}}d.forEach(g=>{g.fireColumnWidthChangedEvent(t)}),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),!i&&this.eventDispatcher.columnResized(d,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if(t==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:s,defaultMaxWidth:o}=e,r=i==null?void 0:i.map(({colId:n,minWidth:l,maxWidth:a})=>({key:n,minWidth:l,maxWidth:a}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:s,defaultMaxWidth:o,columnLimits:r})}else t==="fitProvidedWidth"&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}};function zo(e,t){return e+"_"+t}function W(e){return e instanceof _o}var _o=class extends v{constructor(e,t,i,s){super(),this.isColumn=!1,this.displayedChildren=[],this.autoHeaderHeight=null,this.parent=null,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return zo(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{W(e)&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=I(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}isAutoHeaderHeight(){var e;return!!((e=this.getColGroupDef())!=null&&e.autoHeaderHeight)}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{Ge(t)?e.push(t):W(t)&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{Ge(t)?e.push(t):W(t)&&t.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}this.children.forEach(i=>{if(W(i)&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},Uo=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return typeof t!="number"?i=0:i=t+1,this.existingIds[e]=i,i}},Sl=class extends v{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=Fi(this.treeLeft),this.columnsCenter=Fi(this.treeCenter),this.columnsRight=Fi(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter(i=>i.isAutoHeight()),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols(e)}updateBodyWidths(){const e=Se(this.columnsCenter),t=Se(this.columnsLeft),i=Se(this.columnsRight);this.bodyWidthDirty=this.bodyWidth!==e,(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i)&&(this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i,this.eventService.dispatchEvent({type:"columnContainerWidthChanged"}),this.eventService.dispatchEvent({type:"displayedColumnsWidthChanged"}))}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,i=this.columnsRight?I(this.columnsRight):null):(t=this.columnsLeft?I(this.columnsLeft):null,i=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter(r=>r.getPinned()=="left"),i=e.filter(r=>r.getPinned()=="right"),s=e.filter(r=>r.getPinned()!="left"&&r.getPinned()!="right"),o=new Uo;this.treeLeft=this.createGroups({columns:t,idCreator:o,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:i,idCreator:o,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:s,idCreator:o,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],i=[],s=[];for(const o of e){const r=o.getPinned();r?r===!0||r==="left"?t.push(o):s.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(s)}getAriaColIndex(e){let t;return W(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach(e=>{e.forEach(t=>{W(t)&&t.checkLeft()})})}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const i=this.columnModel.getCols().slice(0),s=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach(o=>{if(s){let r=Se(o);o.forEach(n=>{r-=n.getActualWidth(),n.setLeft(r,e)})}else{let r=0;o.forEach(n=>{n.setLeft(r,e),r+=n.getActualWidth()})}qn(i,o)}),i.forEach(o=>{o.setLeft(null,e)})}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,i,s){const o=[];let r=null;for(let n=0;n1){const u=d-1;for(let g=1;g<=u;g++)h.push(t[n+g]);n+=u}let c;i?(c=!1,h.forEach(u=>{i(u)&&(c=!0)})):c=!0,c&&(o.length===0&&r&&(s&&s(l))&&o.push(r),o.push(l)),r=l}return o}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),i=t.indexOf(e);return i>0?t[i-1]:null}getGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o=t==="After"?I(s):s[0],r=`getCol${t}`;for(;;){const n=this[r](o);if(!n)return null;const l=this.getColGroupAtLevel(n,i);if(l!==e)return l}}getColGroupAtLevel(e,t){let i=e.getParent(),s,o;for(;s=i.getProvidedColumnGroup().getLevel(),o=i.getPaddingLevel(),!(s+o<=t);)i=i.getParent();return i}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};ze(this.treeCenter,!1,e),ze(this.treeLeft,!1,e),ze(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllTrees();ze(e,!1,t=>{W(t)&&t.calculateDisplayedColumns()})}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let i=0;i{if(W(r)){const n=r;let l;s?l=e===n.getGroupId()&&t===n.getPartId():l=e===n.getGroupId(),l&&(o=n)}}),o}getColAfter(e){const t=this.getAllCols(),i=t.indexOf(e);return i{const g=h;h=u;const p=d[g],f=(W(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(f==null){for(let y=g;y{s.forEach(o=>{if(W(o)){const r=o;t[o.getUniqueId()]=r,i(r.getChildren())}})};return e&&i(e),t}setupParentsIntoCols(e,t){e.forEach(i=>{if(i.setParent(t),W(i)){const s=i;this.setupParentsIntoCols(s.getChildren(),s)}})}};function ze(e,t,i){if(e)for(let s=0;s{Ge(i)&&t.push(i)}),t}var Ko=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","rangeSelectionChanged","cellSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","cellSelectionDeleteStart","cellSelectionDeleteEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterOpened","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","dragCancelled","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd","rowDragCancel"],yl=["scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","scrollGapChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnGroupHeaderHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged","overlayExclusiveChanged"],Rl=[...Ko,...yl],Fl={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,dragAndDropImageComponent:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0,suppressSetFilterByDefault:!0},_=class{};_.STRING_PROPERTIES=["overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"];_.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","dragAndDropImageComponentParams","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","theme","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy","cellSelection","selectionColumnDef"];_.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"];_.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"];_.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMoveWhenColumnDragging","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading","maintainColumnOrder","enableStrictPivotColumnOrder","suppressSetFilterByDefault"];_.OTHER_PROPERTIES=["suppressStickyTotalRow","loadThemeGoogleFonts","rowSelection"];_.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","dragAndDropImageComponent","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"];_.ALL_PROPERTIES=[..._.ARRAY_PROPERTIES,..._.OBJECT_PROPERTIES,..._.STRING_PROPERTIES,..._.NUMBER_PROPERTIES,..._.FUNCTION_PROPERTIES,..._.BOOLEAN_PROPERTIES,..._.OTHER_PROPERTIES];var Tt=_,le=class{static getCallbackForEvent(t){return!t||t.length<2?t:"on"+t[0].toUpperCase()+t.substring(1)}};le.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY";le.PUBLIC_EVENTS=Ko;le.EVENT_CALLBACKS=Rl.map(e=>le.getCallbackForEvent(e));le.BOOLEAN_PROPERTIES=Tt.BOOLEAN_PROPERTIES;le.ALL_PROPERTIES=Tt.ALL_PROPERTIES;le.ALL_PROPERTIES_AND_CALLBACKS=[...le.ALL_PROPERTIES,...le.EVENT_CALLBACKS];le.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(le.ALL_PROPERTIES_AND_CALLBACKS);var he=le;function bl(e,t){typeof e!="object"&&(e={});const i={...e};return he.ALL_PROPERTIES_AND_CALLBACKS.forEach(o=>{const r=t[o];typeof r<"u"&&r!==he.VUE_OMITTED_PROPERTY&&(i[o]=r)}),i}function $i(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).filter(n=>he.ALL_PROPERTIES_AND_CALLBACKS_SET.has(n)).forEach(n=>{i[n]=e[n],s=!0}),!s)return;const o={type:"gridOptionsChanged",options:i};t.dispatchEvent(o);const r={type:"componentStateChanged"};re(i,(n,l)=>{r[n]=l}),t.dispatchEvent(r)}function kt(e,t,i){return i&&e.addDestroyFunc(()=>t.destroyBean(i)),i??e}var Pl=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.addCssClass(s));return}if(this.cssClassStates[e]!==!0&&e.length){const s=this.getGui();s&&s.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.removeCssClass(s));return}if(this.cssClassStates[e]!==!1&&e.length){const s=this.getGui();s&&s.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return t?t.classList.contains(e):!1}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const s=(e||"").split(" ");if(s.length>1){s.forEach(o=>this.addOrRemoveCssClass(o,t));return}}if(this.cssClassStates[e]!==t&&e.length){const s=this.getGui();s&&s.classList.toggle(e,t),this.cssClassStates[e]=t}}};function Ee(e,t,i){i==null||typeof i=="string"&&i==""?$o(e,t):ge(e,t,i)}function ge(e,t,i){e.setAttribute(jo(t),i.toString())}function $o(e,t){e.removeAttribute(jo(t))}function jo(e){return`aria-${e}`}function ee(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Dl(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function El(e){return e.getAttribute("aria-label")}function dt(e,t){Ee(e,"label",t)}function It(e,t){Ee(e,"labelledby",t)}function qo(e,t){Ee(e,"live",t)}function Ml(e,t){Ee(e,"atomic",t)}function xl(e,t){Ee(e,"relevant",t)}function Al(e,t){Ee(e,"disabled",t)}function Yo(e,t){Ee(e,"hidden",t)}function ii(e,t){ge(e,"expanded",t)}function Tl(e,t){ge(e,"setsize",t)}function Il(e,t){ge(e,"posinset",t)}function Ll(e,t){ge(e,"multiselectable",t)}function Ol(e,t){ge(e,"rowcount",t)}function Qo(e,t){ge(e,"rowindex",t)}function Gl(e,t){ge(e,"colcount",t)}function Xo(e,t){ge(e,"colindex",t)}function kl(e,t){ge(e,"colspan",t)}function Hl(e,t){ge(e,"sort",t)}function Vl(e){$o(e,"sort")}function si(e,t){Ee(e,"selected",t)}function Nl(e,t){Ee(e,"controls",t.id),It(t,e.id)}function Cs(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var bi,Nt,Pi,Di,Ei,Mi,ji,qi,xi;function we(){return bi===void 0&&(bi=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),bi}function Jo(){if(Nt===void 0)if(we()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(Nt=e[1]!=null?parseFloat(e[1]):0)}else Nt=0;return Nt}function ms(){if(Pi===void 0){const e=window;Pi=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return Pi}function vs(){return Di===void 0&&(Di=/(firefox)/i.test(navigator.userAgent)),Di}function Zo(){return Ei===void 0&&(Ei=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),Ei}function He(){return Mi===void 0&&(Mi=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),Mi}function Yi(){return!we()||Jo()>=15}function Qi(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return t===-1&&(i===null||i===""&&!vs())?null:t.toString()}function Bl(){if(xi!==void 0)return xi;if(!document.body)return-1;let e=1e6;const t=vs()?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=e*2;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),xi=e,e}function Wl(){var e,t;return((e=document.body)==null?void 0:e.clientWidth)??(window.innerHeight||((t=document.documentElement)==null?void 0:t.clientWidth)||-1)}function zl(){var e,t;return((e=document.body)==null?void 0:e.clientHeight)??(window.innerHeight||((t=document.documentElement)==null?void 0:t.clientHeight)||-1)}function _l(){return qi==null&&er(),qi}function er(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;i===0&&t.clientWidth===0&&(i=null),t.parentNode&&t.parentNode.removeChild(t),i!=null&&(qi=i,ji=i===0)}function tr(){return ji==null&&er(),ji}var Bt,Ul="[tabindex], input, select, button, textarea, [href]",ir="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function ws(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i="input, select, button, textarea",s=t.call(e,i),o=t.call(e,ir),r=ue(e);return s&&!o&&r}function H(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Yo(e,!t)}function Kl(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Yo(e,!t)}function Lt(e,t){const i="disabled",s=t?o=>o.setAttribute(i,""):o=>o.removeAttribute(i);s(e),dr(e.querySelectorAll("input"),o=>s(o))}function rt(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof i=="number"){if(++s>i)break}else if(e===i)break}return!1}function Xe(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:l,paddingRight:a,paddingBottom:d,paddingLeft:h,marginTop:c,marginRight:u,marginBottom:g,marginLeft:p,boxSizing:C}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(n||"0"),paddingTop:parseFloat(l||"0"),paddingRight:parseFloat(a||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(c||"0"),marginRight:parseFloat(u||"0"),marginBottom:parseFloat(g||"0"),marginLeft:parseFloat(p||"0"),boxSizing:C}}function Ss(e){const t=Xe(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom:t.height}function Ht(e){const t=Xe(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight:t.width}function sr(e){const{height:t,marginBottom:i,marginTop:s}=Xe(e);return Math.floor(t+i+s)}function oi(e){const{width:t,marginLeft:i,marginRight:s}=Xe(e);return Math.floor(t+i+s)}function or(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:r}=Xe(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function ri(){if(typeof Bt=="boolean")return Bt;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML=`
`,document.body.appendChild(e),e.scrollLeft=1,Bt=Math.floor(e.scrollLeft)===0,document.body.removeChild(e),Bt}function ni(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),ms()&&!ri()&&(i=e.scrollWidth-e.getBoundingClientRect().width-i)),i}function li(e,t,i){i&&(ri()?t*=-1:(we()||ms())&&(t=e.scrollWidth-e.getBoundingClientRect().width-t)),e.scrollLeft=t}function U(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function Ce(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function rr(e){return!!e.offsetParent}function ue(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!rr(e)||window.getComputedStyle(e).visibility!=="visible")}function Ot(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function nr(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function lr(e,t){for(let i=0;it.push(i)),t}function Ql(e,t){if(e)for(let i=0;i{this.prepareToShowTooltip(t)},io):this.prepareToShowTooltip(t))}onMouseMove(t){this.lastMouseEvent&&(this.lastMouseEvent=t),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(t){var r;const i=t.relatedTarget,s=this.parentComp.getGui(),o=(r=this.tooltipComp)==null?void 0:r.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&(o!=null&&o.contains(i))||this.setToDoNothing()}onKeyDown(){this.isInteractingWithTooltip&&(this.isInteractingWithTooltip=!1),this.setToDoNothing()}prepareToShowTooltip(t){if(this.state!=0||Ne.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){const t=new Date().getTime(),i=Ne.lastTooltipHideTime;return t-ithis.setToDoNothing();[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:l,columnMoved:l})}this.interactionEnabled&&([this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(o,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}),[this.onDocumentKeyDownCallback]=this.addManagedElementListeners(B(this.gos),{keydown:l=>{o.contains(l==null?void 0:l.target)||this.onKeyDown()}}),this.tooltipTrigger===1&&([this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(o,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}))),this.eventService.dispatchEvent({type:"tooltipShow",tooltipGui:o,parentGui:this.parentComp.getGui()}),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,this.lockService())}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}isTooltipFocused(){var s;const t=(s=this.tooltipComp)==null?void 0:s.getGui(),i=V(this.gos);return!!t&&t.contains(i)}onTooltipFocusOut(t){const i=this.parentComp.getGui();this.isTooltipFocused()||(this.isInteractingWithTooltip=!1,i.contains(t.relatedTarget)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const t={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...t,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...t,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const t=this.tooltipPopupDestroyFunc,i=this.tooltipComp,s=this.tooltipTrigger===0?Jl:0;window.setTimeout(()=>{t(),this.destroyBean(i)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(t=>{t&&t()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){Ne.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},io)}unlockService(){Ne.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};hr.isLocked=!1;var Zl=hr,gt=class extends v{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(e!=null&&e!=""?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var t,i,s,o;if(this.tooltipManager!=null)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new Zl(e,(i=(t=this.ctrl).getTooltipShowDelayOverride)==null?void 0:i.call(t),(o=(s=this.ctrl).getTooltipHideDelayOverride)==null?void 0:o.call(s),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){var o,r,n,l,a;const e=this.ctrl,t=(o=e.getColumn)==null?void 0:o.call(e),i=(r=e.getColDef)==null?void 0:r.call(e),s=(n=e.getRowNode)==null?void 0:n.call(e);return{location:e.getLocation(),colDef:i,column:t,rowIndex:(l=e.getRowIndex)==null?void 0:l.call(e),node:s,data:s==null?void 0:s.data,value:this.getTooltipText(),valueFormatted:(a=e.getValueFormatted)==null?void 0:a.call(e),hideTooltipCallback:()=>{var d;return(d=this.tooltipManager)==null?void 0:d.hideTooltip(!0)}}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},ea=new ht,b=null,G=class cr extends v{constructor(t,i){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=ea.next(),this.cssClassManager=new Pl(()=>this.eGui),this.componentSelectors=new Map((i??[]).map(s=>[s.selector,s])),t&&this.setTemplate(t)}preWireBeans(t){super.preWireBeans(t)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(t,i){t&&this.gos&&(this.applyElementsToComponent(t),this.createChildComponentsFromTags(t,i))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(t){const{newTooltipText:i,showDelayOverride:s,hideDelayOverride:o,location:r,shouldDisplayTooltip:n}=t||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==i&&(this.tooltipText=i);const l=()=>this.tooltipText;i!=null&&(this.tooltipFeature=this.createBean(new gt({getTooltipValue:l,getGui:()=>this.getGui(),getLocation:()=>r??"UNKNOWN",getColDef:t==null?void 0:t.getColDef,getColumn:t==null?void 0:t.getColumn,getTooltipShowDelayOverride:s!=null?()=>s:void 0,getTooltipHideDelayOverride:o!=null?()=>o:void 0,shouldDisplayTooltip:n})))}getDataRefAttribute(t){return t.getAttribute?t.getAttribute("data-ref"):null}applyElementsToComponent(t,i,s,o=null){if(i===void 0&&(i=this.getDataRefAttribute(t)),i){const r=this[i];if(r===b)this[i]=o??t;else{const n=s&&s[i];!this.suppressDataRefValidation&&!n&&S(`Issue with data-ref: ${i} on ${this.constructor.name} with ${r}`)}}}createChildComponentsFromTags(t,i){Yl(t.childNodes).forEach(o=>{if(!(o instanceof HTMLElement))return;const r=this.createComponentFromElement(o,n=>{n.getGui()&&this.copyAttributesFromNode(o,n.getGui())},i);if(r){if(r.addItems&&o.children.length){this.createChildComponentsFromTags(o,i);const n=Array.prototype.slice.call(o.children);r.addItems(n)}this.swapComponentForNode(r,t,o)}else o.childNodes&&this.createChildComponentsFromTags(o,i)})}createComponentFromElement(t,i,s){const o=t.nodeName,r=this.getDataRefAttribute(t),n=o.indexOf("AG-")===0,l=n?this.componentSelectors.get(o):null;let a=null;if(l){cr.elementGettingCreated=t;const d=s&&r?s[r]:void 0;a=new l.component(d),a.setParentComponent(this),this.createBean(a,null,i)}else n&&S(`Missing selector: ${o}`);return this.applyElementsToComponent(t,r,s,a),a}copyAttributesFromNode(t,i){Ql(t.attributes,(s,o)=>i.setAttribute(s,o))}swapComponentForNode(t,i,s){const o=t.getGui();i.replaceChild(o,s),i.insertBefore(document.createComment(s.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,t))}activateTabIndex(t){const i=this.gos.get("tabIndex");t||(t=[]),t.length||t.push(this.getGui()),t.forEach(s=>s.setAttribute("tabindex",i.toString()))}setTemplate(t,i,s){const o=Ot(t);this.setTemplateFromElement(o,i,s)}setTemplateFromElement(t,i,s,o=!1){if(this.eGui=t,this.suppressDataRefValidation=o,i)for(let r=0;rthis.eGui.removeEventListener(t,i))}addCssClass(t){this.cssClassManager.addCssClass(t)}removeCssClass(t){this.cssClassManager.removeCssClass(t)}containsCssClass(t){return this.cssClassManager.containsCssClass(t)}addOrRemoveCssClass(t,i){this.cssClassManager.addOrRemoveCssClass(t,i)}},ur={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"},ta=(()=>{const e=new Set(Object.values(ur));return e.add("eye"),e})();function ia(e,t,i){const s=ie(e,t,i);if(s){const{className:r}=s;if(typeof r=="string"&&r.indexOf("ag-icon")>-1||typeof r=="object"&&r["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function ie(e,t,i,s){let o=null;const r=i&&i.getColDef().icons;if(r&&(o=r[e]),t&&!o){const n=t.get("icons");n&&(o=n[e])}if(o){let n;if(typeof o=="function")n=o();else if(typeof o=="string")n=o;else throw new Error("icon from grid options needs to be a string or a function");if(typeof n=="string")return Ot(n);if(Rs(n))return n;S("iconRenderer should return back a string or a dom object")}else{const n=document.createElement("span");let l=ur[e]??(ta.has(e)?e:void 0);return l||(s?l=e:(S(`Did not find icon ${e}`),l="")),n.setAttribute("class",`ag-icon ag-icon-${l}`),n.setAttribute("unselectable","on"),ee(n,"presentation"),n}}var sa=class extends G{constructor(){super(...arguments),this.dragSource=null,this.eIcon=b,this.eLabel=b}postConstruct(){const e=t=>ia(t,this.gos,null);this.dropIconMap={pinned:e("columnMovePin"),hide:e("columnMoveHide"),move:e("columnMoveMove"),left:e("columnMoveLeft"),right:e("columnMoveRight"),group:e("columnMoveGroup"),aggregate:e("columnMoveValue"),pivot:e("columnMovePivot"),notAllowed:e("dropNotAllowed")}}init(e){this.dragSource=e.dragSource,this.setTemplate(`
`)}destroy(){this.dragSource=null,super.destroy()}setIcon(e,t=!1){var s,o;U(this.eIcon);let i=null;e||(e=(s=this.dragSource)!=null&&s.getDefaultIconName?(o=this.dragSource)==null?void 0:o.getDefaultIconName():"notAllowed"),i=this.dropIconMap[e],this.eIcon.classList.toggle("ag-shake-left-to-right",t),!(i===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns"))&&i&&this.eIcon.appendChild(i)}setLabel(e){this.eLabel.textContent=me(e)}};function gr(e,t,i){if(i===0)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}var Ie=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new ct,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const s={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(s)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!gr(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const i={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}};function Ct(e,t){return``}var oa=` ${Ct("Order","order")} ${Ct("Asc","ascending-icon")} ${Ct("Desc","descending-icon")} ${Ct("Mixed","mixed-icon")} ${Ct("None","none-icon")} `,Fs=class extends G{constructor(e){super(),this.eSortOrder=b,this.eSortAsc=b,this.eSortDesc=b,this.eSortMixed=b,this.eSortNone=b,e||this.setTemplate(oa)}wireBeans(e){this.sortController=e.sortController}attachCustomElements(e,t,i,s,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=o}setupSort(e,t=!1){if(this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),!this.column.isSortable()&&!this.column.getColDef().showRowGroup)return;this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e);const i=this.updateIcons.bind(this),s=this.onSortChanged.bind(this);this.addManagedPropertyListener("unSortIcon",i),this.addManagedEventListeners({newColumnsLoaded:i,sortChanged:s,columnRowGroupChanged:s}),this.onSortChanged()}addInIcon(e,t,i){if(t==null)return;const s=ie(e,this.gos,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t=e==="asc";H(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t=e==="desc";H(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gos.get("unSortIcon"),i=e==null;H(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;fe(this.gos)&&e&&(this.addManagedEventListeners({sortChanged:this.updateMultiSortIndicator.bind(this),columnRowGroupChanged:this.updateMultiSortIndicator.bind(this)}),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e=this.sortController.getDisplaySortForColumn(this.column)==="mixed";H(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){if(!this.eSortOrder)return;const e=this.sortController.getColumnsWithSortingOrdered(),t=this.sortController.getDisplaySortIndexForColumn(this.column)??-1,i=e.some(o=>this.sortController.getDisplaySortIndexForColumn(o)??-1>=1),s=t>=0&&i;H(this.eSortOrder,s,{skipAriaHidden:!0}),t>=0?this.eSortOrder.textContent=(t+1).toString():U(this.eSortOrder)}},ra={selector:"AG-SORT-INDICATOR",component:Fs},na=``,Xi=class extends G{constructor(){super(...arguments),this.eFilter=b,this.eFilterButton=b,this.eSortIndicator=b,this.eMenu=b,this.eLabel=b,this.eText=b,this.eSortOrder=b,this.eSortAsc=b,this.eSortDesc=b,this.eSortMixed=b,this.eSortNone=b,this.lastMovingChanged=0}wireBeans(e){this.sortController=e.sortController,this.menuService=e.menuService,this.funcColsService=e.funcColsService}destroy(){super.destroy()}refresh(e){const t=this.params;return this.params=e,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort||this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide||t.enableFilterButton!=e.enableFilterButton||t.enableFilterIcon!=e.enableFilterIcon?!1:(this.setDisplayName(e),!0)}workOutTemplate(){let e=this.params.template??na;return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate,[ra]),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=me(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(t==null)return;const s=ie(e,this.gos,i);s&&t.appendChild(s)}setupTap(){const{gos:e}=this;if(e.get("suppressTouch"))return;const t=new Ie(this.getGui(),!0),i=this.shouldSuppressMenuHide(),s=i&&F(this.eMenu),o=s?new Ie(this.eMenu,!0):t;if(this.params.enableMenu){const r=s?"tap":"longTap",n=l=>this.params.showColumnMenuAfterMouseClick(l.touchStart);this.addManagedListeners(o,{[r]:n})}if(this.params.enableSorting){const r=n=>{var a,d;const l=n.touchStart.target;i&&((a=this.eMenu)!=null&&a.contains(l)||(d=this.eFilterButton)!=null&&d.contains(l))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListeners(t,{tap:r})}if(this.params.enableFilterButton){const r=new Ie(this.eFilterButton,!0);this.addManagedListeners(r,{tap:()=>this.params.showFilter(this.eFilterButton)}),this.addDestroyFunc(()=>r.destroy())}this.addDestroyFunc(()=>t.destroy()),s&&this.addDestroyFunc(()=>o.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){Ce(this.eMenu),this.eMenu=void 0;return}const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedElementListeners(this.eMenu,{click:()=>this.params.showColumnMenu(this.eMenu)}),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){const t=this.params.column,i=this.menuService.isLegacyMenuEnabled();if(e&&!i){if(this.menuService.isFilterMenuInHeaderEnabled(t))return this.params.showFilter(this.eFilterButton??this.eMenu??this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu(this.eMenu??this.eFilterButton??this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.createBean(new Fs(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListeners(this.params.column,{movingChanged:()=>{this.lastMovingChanged=new Date().getTime()}}),this.eLabel&&this.addManagedElementListeners(this.eLabel,{click:t=>{const i=this.params.column.isMoving(),o=new Date().getTime()-this.lastMovingChanged<50;if(!(i||o)){const l=this.gos.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey;this.params.progressSort(l)}}});const e=()=>{const t=this.params.column.getSort();if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",t==="asc"),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",t==="desc"),this.addOrRemoveCssClass("ag-header-cell-sorted-none",!t),this.params.column.getColDef().showRowGroup){const i=this.funcColsService.getSourceColumnsForGroupColumn(this.params.column),o=!(i==null?void 0:i.every(r=>this.params.column.getSort()==r.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",o)}};this.addManagedEventListeners({sortChanged:e,columnRowGroupChanged:e})}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedElementListeners(this.eFilterButton,{click:()=>this.params.showFilter(this.eFilterButton)}):this.eFilterButton=void 0}configureFilter(e,t,i){if(!e)return Ce(t),!1;const s=this.params.column;return this.addInIcon("filter",t,s),this.addManagedListeners(s,{filterChanged:i}),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();H(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){return e?this.eFilterButton??this.eMenu??this.getGui():this.eMenu??this.eFilterButton??this.getGui()}},la=class extends G{constructor(){super(``),this.agOpened=b,this.agClosed=b,this.agLabel=b}wireBeans(e){this.columnModel=e.columnModel}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&S("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened",this.agOpened),this.addInIcon("columnGroupClosed",this.agClosed);const e=o=>{if(Fe(o))return;const r=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),r,"uiColumnExpanded")};this.addTouchAndClickListeners(this.agClosed,e),this.addTouchAndClickListeners(this.agOpened,e);const t=o=>{at(o)};this.addManagedElementListeners(this.agClosed,{dblclick:t}),this.addManagedElementListeners(this.agOpened,{dblclick:t}),this.addManagedElementListeners(this.getGui(),{dblclick:e}),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup(),s=this.updateIconVisibility.bind(this);this.addManagedListeners(i,{expandedChanged:s,expandableChanged:s})}addTouchAndClickListeners(e,t){const i=new Ie(e,!0);this.addManagedListeners(i,{tap:t}),this.addDestroyFunc(()=>i.destroy()),this.addManagedElementListeners(e,{click:t})}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const t=this.params.columnGroup.isExpanded();H(this.agOpened,t),H(this.agClosed,!t)}else H(this.agOpened,!1),H(this.agClosed,!1)}addInIcon(e,t){const i=ie(e,this.gos,null);i&&t.appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable()){H(this.agOpened,!1),H(this.agClosed,!1);return}}setupLabel(){var i;const{displayName:e,columnGroup:t}=this.params;if(F(e)){const s=me(e,!0);this.agLabel.textContent=s}this.addOrRemoveCssClass("ag-sticky-label",!((i=t.getColGroupDef())!=null&&i.suppressStickyLabel))}},aa="↑",da="↓",ha=class extends G{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}wireBeans(e){this.filterManager=e.filterManager}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),s=e.formatValue(i),o=F(s)?s:i,r=t>=0;r?this.eDelta.textContent=aa+o:this.eDelta.textContent=da+o,this.eDelta.classList.toggle("ag-value-change-delta-up",r),this.eDelta.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),U(this.eDelta)}refresh(e,t=!1){var s;const i=e.value;if(i===this.lastValue||(F(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:F(e.value)?this.eValue.textContent=i:U(this.eValue),(s=this.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof i=="number"&&typeof this.lastValue=="number"){const o=i-this.lastValue;this.showDelta(e,o)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}},ca=class extends G{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}wireBeans(e){this.filterManager=e.filterManager}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var s;let i=e.value;return A(i)&&(i=""),i===this.lastValue||(s=this.filterManager)!=null&&s.isSuppressFlashingCellsBecauseFiltering()?!1:(t||this.addSlideAnimation(),this.lastValue=i,F(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:F(e.value)?this.eCurrent.textContent=i:U(this.eCurrent),!0)}},m=class{};m.BACKSPACE="Backspace";m.TAB="Tab";m.ENTER="Enter";m.ESCAPE="Escape";m.SPACE=" ";m.LEFT="ArrowLeft";m.UP="ArrowUp";m.RIGHT="ArrowRight";m.DOWN="ArrowDown";m.DELETE="Delete";m.F2="F2";m.PAGE_UP="PageUp";m.PAGE_DOWN="PageDown";m.PAGE_HOME="Home";m.PAGE_END="End";m.A="KeyA";m.C="KeyC";m.D="KeyD";m.V="KeyV";m.X="KeyX";m.Y="KeyY";m.Z="KeyZ";var ua=class extends G{constructor(e,t,i){super(t,i),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s,disabled:o}=this.config;o!=null&&this.setDisabled(o),e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),i!=null&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){U(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(H(this.eLabel,!1),ee(this.eLabel,"presentation")):(H(this.eLabel,!0),ee(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const i=this.getGui().classList;return i.toggle("ag-label-align-left",e==="left"),i.toggle("ag-label-align-right",e==="right"),i.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(ai(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return Lt(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}},pr=class extends ua{constructor(e,t,i,s){super(e,t,i),this.className=s}postConstruct(){super.postConstruct();const{width:e,value:t,onValueChange:i}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),i!=null&&this.onValueChange(i),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}setLabel(e){return super.setLabel(e),this.refreshAriaLabelledBy(),this}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId(),i=this.getLabel();i==null||i==""||El(e)!==null?It(e,""):It(e,t??"")}setAriaLabel(e){return dt(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListeners(this,{fieldValueChanged:()=>e(this.getValue())}),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return ce(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchLocalEvent({type:"fieldValueChanged"}),this)}},_e=class extends pr{constructor(e,t,i="text",s="input"){super(e,(e==null?void 0:e.template)??`
`,[],t),this.inputType=i,this.displayFieldTag=s,this.eLabel=b,this.eWrapper=b,this.eInput=b}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{inputName:e,inputWidth:t}=this.config;e!=null&&this.setInputName(e),t!=null&&this.setInputWidth(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedElementListeners(this.eInput,{input:e=>this.setValue(e.target.value)})}setInputType(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return ai(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return ae(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return dt(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return Lt(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)ae(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";ae(this.eInput,"autocomplete",t)}return this}},bs=class extends _e{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}postConstruct(){super.postConstruct();const{readOnly:e,passive:t}=this.config;typeof e=="boolean"&&this.setReadOnly(e),typeof t=="boolean"&&this.setPassive(t)}addInputListeners(){this.addManagedElementListeners(this.eInput,{click:this.onCheckboxClick.bind(this)}),this.addManagedElementListeners(this.eLabel,{click:this.toggle.bind(this)})}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchLocalEvent({type:"fieldValueChanged",selected:e,previousValue:t,event:i});const s=this.getInputElement();this.eventService.dispatchEvent({type:"checkboxChanged",id:s.id,name:s.name,selected:e,previousValue:t})}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",e===!0),this.eWrapper.classList.toggle("ag-indeterminate",e==null)}},Ps={selector:"AG-CHECKBOX",component:bs},ga=class extends G{constructor(){super(` `,[Ps]),this.eCheckbox=b}init(e){this.refresh(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),qo(t,"polite"),this.addManagedListeners(t,{click:i=>{if(at(i),this.eCheckbox.isDisabled())return;const s=this.eCheckbox.getValue();this.onCheckboxChanged(s)},dblclick:i=>{at(i)}}),this.addManagedElementListeners(this.params.eGridCell,{keydown:i=>{if(i.key===m.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===V(this.gos)&&this.eCheckbox.toggle();const s=this.eCheckbox.getValue();this.onCheckboxChanged(s),i.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var l;let t,i=!0;if(e.node.group&&e.column)if(typeof e.value=="boolean")t=e.value;else{const a=e.column.getColId();a.startsWith(gi)?t=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[a]!==void 0?t=e.value??void 0:i=!1}else t=e.value??void 0;if(!i){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(t);const s=e.disabled!=null?e.disabled:!((l=e.column)!=null&&l.isCellEditable(e.node));this.eCheckbox.setDisabled(s);const o=this.localeService.getLocaleTextFunc(),r=Cs(o,t),n=s?r:`${o("ariaToggleCellValue","Press SPACE to toggle cell value")} (${r})`;this.eCheckbox.setInputAriaLabel(n)}onCheckboxChanged(e){const{column:t,node:i,value:s}=this.params;this.eventService.dispatchEvent({type:"cellEditingStarted",column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s});const o=this.params.node.setDataValue(this.params.column,e,"edit");this.eventService.dispatchEvent({type:"cellEditingStopped",column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:o}),o||this.updateCheckbox(this.params)}},pa=class extends G{constructor(){super(`
`),this.eLoadingIcon=b,this.eLoadingText=b}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=ie("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},fa=class extends G{constructor(){super('
')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>It(e.eParentOfValue)),It(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");dt(this.getGui(),t)}setupLoading(e){const i=B(this.gos).createElement("div");i.classList.add("ag-skeleton-effect");const s=e.node.rowIndex;if(s!=null){const n=75+25*(s%2===0?Math.sin(s):Math.cos(s));i.style.width=`${n}%`}this.getGui().appendChild(i);const r=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");dt(this.getGui(),r)}refresh(e){return!1}destroy(){super.destroy()}},fr=class extends G{constructor(){super()}destroy(){super.destroy()}},Ca=class extends fr{init(){var t;const e=Re((t=this.gos.get("overlayLoadingTemplate"))==null?void 0:t.trim());if(this.setTemplate(e??''),!e){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("loadingOoo","Loading...")})}}},ma=class extends fr{init(){var t;const e=Re((t=this.gos.get("overlayNoRowsTemplate"))==null?void 0:t.trim());if(this.setTemplate(e??''),!e){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("noRowsToShow","No Rows To Show")})}}},pt=class extends G{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},va=class extends pt{constructor(){super('
')}init(e){const{value:t}=e;this.getGui().textContent=me(t,!0)}};function Cr(e){const{inputValue:t,allSuggestions:i,hideIrrelevant:s,filterByPercentageOfBestMatch:o,addSequentialWeight:r}=e;let n=i.map((d,h)=>({value:d,relevance:Sa(t.toLowerCase(),d.toLocaleLowerCase(),r),idx:h}));if(n.sort((d,h)=>h.relevance-d.relevance),s&&(n=n.filter(d=>d.relevance!==0)),n.length>0&&o&&o>0){const h=n[0].relevance*o;n=n.filter(c=>h-c.relevance<0)}const l=[],a=[];for(const d of n)l.push(d.value),a.push(d.idx);return{values:l,indices:a}}function wa(e){const t=[],i=e.length;for(let s=1;s<=i;s++)for(let o=0;o<=i-s;o++){const r=o+s-1;t.push(e.slice(o,r+1))}return t}function Sa(e,t,i=!1){const s=e.replace(/\s/g,""),o=t.replace(/\s/g,""),r=s.length,n=o.length,l=new Array(r+1).fill(null).map(()=>new Array(n+1).fill(0));for(let c=0;c<=r;c+=1)l[c][0]=c;for(let c=0;c<=n;c+=1)l[0][c]=c;for(let c=1;c<=r;c++)for(let u=1;u<=n;u++)s[c-1]===o[u-1]?l[c][u]=l[c-1][u-1]:l[c][u]=1+Math.min(l[c][u-1],Math.min(l[c-1][u],l[c-1][u-1]));const a=l[r][n];let h=Math.max(r,n)-a;if(i){const c=wa(s);for(let u=0;uthis.registerJsComponent(t,i))}registerDefaultComponent(e,t,i){this.agGridDefaults[e]=t,i&&(this.agGridDefaultParams[e]=i)}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(l,a,d)=>({componentFromFramework:a,component:l,params:d}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(s!=null)return i(s,!0);const o=this.jsComps[t];if(o){const l=this.getFrameworkOverrides().isFrameworkComponent(o);return i(o,l)}const r=this.agGridDefaults[t];if(r)return i(r,!1,this.agGridDefaultParams[t]);const n=this.enterpriseAgDefaultCompsModule[t];return n?this.gos.assertModuleRegistered(n,`AG Grid '${e}' component: ${t}`):ls(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=[...Object.keys(this.agGridDefaults).filter(o=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(o)),...Object.keys(this.jsComps)],s=Cr({inputValue:t,allSuggestions:i,hideIrrelevant:!0,filterByPercentageOfBestMatch:.8}).values;S(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),s.length>0&&S(` Did you mean: [${s.slice(0,3)}]?`),S(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},te=class St{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(i=>this.onDone(i),i=>this.onReject(i))}static all(t){return t.length?new St(i=>{let s=t.length;const o=new Array(s);t.forEach((r,n)=>{r.then(l=>{o[n]=l,s--,s===0&&i(o)})})}):St.resolve()}static resolve(t=null){return new St(i=>i(t))}then(t){return new St(i=>{this.status===1?i(t(this.resolution)):this.waiters.push(s=>i(t(s)))})}onDone(t){this.status=1,this.resolution=t,this.waiters.forEach(i=>i(t))}onReject(t){}},Ra={propertyName:"dateComponent",cellRenderer:!1},Fa={propertyName:"dragAndDropImageComponent",cellRenderer:!1},ba={propertyName:"headerComponent",cellRenderer:!1},Pa={propertyName:"headerGroupComponent",cellRenderer:!1},so={propertyName:"cellRenderer",cellRenderer:!0},Da={propertyName:"cellRenderer",cellRenderer:!1},Ea={propertyName:"loadingCellRenderer",cellRenderer:!0},Ma={propertyName:"cellEditor",cellRenderer:!1},oo={propertyName:"innerRenderer",cellRenderer:!0},xa={propertyName:"loadingOverlayComponent",cellRenderer:!1},Aa={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Ta={propertyName:"tooltipComponent",cellRenderer:!1},Ds={propertyName:"filter",cellRenderer:!1},Ia={propertyName:"floatingFilterComponent",cellRenderer:!1},La={propertyName:"toolPanel",cellRenderer:!1},Oa={propertyName:"statusPanel",cellRenderer:!1},Ga={propertyName:"fullWidthCellRenderer",cellRenderer:!0},ka={propertyName:"loadingCellRenderer",cellRenderer:!0},Ha={propertyName:"groupRowRenderer",cellRenderer:!0},Va={propertyName:"detailCellRenderer",cellRenderer:!0},Na={propertyName:"menuItem",cellRenderer:!1},mr=class vr extends v{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(t){this.agComponentUtils=t.agComponentUtils,this.componentMetadataProvider=t.componentMetadataProvider,this.userComponentRegistry=t.userComponentRegistry,this.frameworkComponentWrapper=t.frameworkComponentWrapper,this.gridOptions=t.gridOptions}getDragAndDropImageCompDetails(t){return this.getCompDetails(this.gridOptions,Fa,"agDragAndDropImage",t,!0)}getHeaderCompDetails(t,i){return this.getCompDetails(t,ba,"agColumnHeader",i)}getHeaderGroupCompDetails(t){const i=t.columnGroup.getColGroupDef();return this.getCompDetails(i,Pa,"agColumnGroupHeader",t)}getFullWidthCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Ga,null,t,!0)}getFullWidthLoadingCellRendererDetails(t){return this.getCompDetails(this.gridOptions,ka,"agLoadingCellRenderer",t,!0)}getFullWidthGroupCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Ha,"agGroupRowRenderer",t,!0)}getFullWidthDetailCellRendererDetails(t){return this.getCompDetails(this.gridOptions,Va,"agDetailCellRenderer",t,!0)}getInnerRendererDetails(t,i){return this.getCompDetails(t,oo,null,i)}getFullWidthGroupRowInnerCellRenderer(t,i){return this.getCompDetails(t,oo,null,i)}getCellRendererDetails(t,i){return this.getCompDetails(t,so,null,i)}getEditorRendererDetails(t,i){return this.getCompDetails(t,Da,null,i)}getLoadingCellRendererDetails(t,i){return this.getCompDetails(t,Ea,"agSkeletonCellRenderer",i,!0)}getCellEditorDetails(t,i){return this.getCompDetails(t,Ma,"agCellEditor",i,!0)}getFilterDetails(t,i,s){return this.getCompDetails(t,Ds,s,i,!0)}getDateCompDetails(t){return this.getCompDetails(this.gridOptions,Ra,"agDateInput",t,!0)}getLoadingOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,xa,"agLoadingOverlay",t,!0)}getNoRowsOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,Aa,"agNoRowsOverlay",t,!0)}getTooltipCompDetails(t){return this.getCompDetails(t.colDef,Ta,"agTooltipComponent",t,!0)}getSetFilterCellRendererDetails(t,i){return this.getCompDetails(t,so,null,i)}getFloatingFilterCompDetails(t,i,s){return this.getCompDetails(t,Ia,s,i)}getToolPanelCompDetails(t,i){return this.getCompDetails(t,La,null,i,!0)}getStatusPanelCompDetails(t,i){return this.getCompDetails(t,Oa,null,i,!0)}getMenuItemCompDetails(t,i){return this.getCompDetails(t,Na,"agMenuItem",i,!0)}getCompDetails(t,i,s,o,r=!1){const{propertyName:n,cellRenderer:l}=i;let{compName:a,jsComp:d,fwComp:h,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:g}=vr.getCompKeys(this.frameworkOverrides,t,i,o),p;const C=R=>{const P=this.userComponentRegistry.retrieve(n,R);P&&(d=P.componentFromFramework?void 0:P.component,h=P.componentFromFramework?P.component:void 0,p=P.params)};if(a!=null&&C(a),d==null&&h==null&&s!=null&&C(s),d&&l&&!this.agComponentUtils.doesImplementIComponent(d)&&(d=this.agComponentUtils.adaptFunction(n,d)),!d&&!h){r&&O(`Could not find component ${a}, did you forget to configure this component?`);return}const f=this.mergeParamsWithApplicationProvidedParams(t,i,o,c,p),w=d==null,y=d||h;return{componentFromFramework:w,componentClass:y,params:f,type:i,popupFromSelector:u,popupPositionFromSelector:g,newAgStackInstance:()=>this.newAgStackInstance(y,w,f,i)}}static getCompKeys(t,i,s,o){const{propertyName:r}=s;let n,l,a,d,h,c;if(i){const u=i,g=u[r+"Selector"],p=g?g(o):null,C=f=>{typeof f=="string"?n=f:f!=null&&f!==!0&&(t.isFrameworkComponent(f)?a=f:l=f)};p?(C(p.component),d=p.params,h=p.popup,c=p.popupPosition):C(u[r])}return{compName:n,jsComp:l,fwComp:a,paramsFromSelector:d,popupFromSelector:h,popupPositionFromSelector:c}}newAgStackInstance(t,i,s,o){const r=o.propertyName,n=!i;let l;if(n)l=new t;else{const d=this.componentMetadataProvider.retrieve(r);l=this.frameworkComponentWrapper.wrap(t,d.mandatoryMethodList,d.optionalMethodList,o)}const a=this.initComponent(l,s);return a==null?te.resolve(l):a.then(()=>l)}mergeParamsWithApplicationProvidedParams(t,i,s,o=null,r){const n=this.gos.getGridCommonParams();q(n,s),r&&q(n,r);const l=t,a=l&&l[i.propertyName+"Params"];if(typeof a=="function"){const d=a(s);q(n,d)}else typeof a=="object"&&q(n,a);return q(n,o),n}initComponent(t,i){if(this.createBean(t),t.init!=null)return t.init(i)}};function bt(e){const t=e;return t!=null&&t.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var pi=class k{static register(t){k.__register(t,!0,void 0)}static registerModules(t){k.__registerModules(t,!0,void 0)}static __register(t,i,s){k.runVersionChecks(t),s!==void 0?(k.areGridScopedModules=!0,k.gridModulesMap[s]===void 0&&(k.gridModulesMap[s]={}),k.gridModulesMap[s][t.moduleName]=t):k.globalModulesMap[t.moduleName]=t,k.setModuleBased(i)}static __unRegisterGridModules(t){delete k.gridModulesMap[t]}static __registerModules(t,i,s){k.setModuleBased(i),t&&t.forEach(o=>k.__register(o,i,s))}static isValidModuleVersion(t){const[i,s]=t.version.split(".")||[],[o,r]=k.currentModuleVersion.split(".")||[];return i===o&&s===r}static runVersionChecks(t){k.currentModuleVersion||(k.currentModuleVersion=t.version);const i=s=>`You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${s} Please update all modules to the same version.`;if(t.version?k.isValidModuleVersion(t)||O(i(`'${t.moduleName}' is version ${t.version} but the other modules are version ${k.currentModuleVersion}.`)):O(i(`'${t.moduleName}' is incompatible.`)),t.validate){const s=t.validate();s.isValid||O(`${s.message}`)}}static setModuleBased(t){k.moduleBased===void 0?k.moduleBased=t:k.moduleBased!==t&&(O("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."),O("Please see https://www.ag-grid.com/javascript-grid/modules/ for more information."))}static __setIsBundled(){k.isBundled=!0}static __assertRegistered(t,i,s){var r;if(this.__isRegistered(t,s))return!0;let o;if(k.isBundled)o=`AG Grid: unable to use ${i} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle: